您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
27 行
1023 B
27 行
1023 B
using UnityEngine;
|
|
using UnityEditor;
|
|
|
|
[CustomEditor(typeof(SpawnCompactor))]
|
|
public class SpawnCompactorEditor : Editor
|
|
{
|
|
public override void OnInspectorGUI()
|
|
{
|
|
|
|
using (var ccs = new EditorGUI.ChangeCheckScope())
|
|
{
|
|
DrawDefaultInspector();
|
|
|
|
if (ccs.changed)
|
|
{
|
|
var str = FindObjectOfType<SpawnTexturesRenderer>();
|
|
if(str != null)
|
|
str.RefreshGeneratedData();
|
|
}
|
|
}
|
|
|
|
var compactor = (SpawnCompactor)target;
|
|
EditorGUILayout.HelpBox("Particle count: " + compactor.ParticleCount + "\n\nThis many particles will be spawned. " +
|
|
"UV-space mesh is rendered as a mask into a texture of size as above. UVs of touched pixels are written into a tightly packed texture, and each one will spawn a particle." +
|
|
"The texture and the spawn count are automatically set on the VisualEffect." , MessageType.Info);
|
|
}
|
|
}
|