您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

34 行
849 B

using System;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
namespace UnityEditor.VFXToolbox.Workbench
{
public class PaintBuffer : ScriptableObject
{
public int Width;
public int Height;
public Color[] data;
public void FromRenderTexture(RenderTexture texture)
{
if(Width != texture.width || Height != texture.height)
{
Width = texture.width;
Height = texture.height;
data = VFXToolboxUtility.ReadBack(texture);
}
else
{
Color[] newdata = VFXToolboxUtility.ReadBack(texture);
for (int i = 0; i < data.Length; i++)
{
data[i] = newdata[i];
}
}
}
}
}