/****************************************************
功能:直接修改模型贴图
原理:在鼠标点击的位置进行碰撞检测,然后读取检测结果的uv值,修改对应贴图。
目标贴图必须打开读写开关
模型需要一个mesh render组件
*****************************************************/
using System;
using System.Collections.Generic;
using UnityEngine;
public class ChangeTexture : MonoBehaviour
{
public Texture2D source_texture;
public Texture2D target_texture;
public Color brush_color = Color.blue;
public int brush_width = 10;
private Transform target_transform;
private Vector2Int last_pos = Vector2Int.zero;
public v
在模型上画画的demo,直接修改贴图
最新推荐文章于 2022-02-22 21:48:14 发布