2023-12-07 16:41:41 +08:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using Sirenix.OdinInspector;
|
2023-12-09 22:06:08 +08:00
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
#endif
|
2023-12-07 16:41:41 +08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 存储场景中物件渲染所需的基本数据,每个场景笔刷都会绑定一份该对象,可以用于在场景中标识某个笔刷刷上的游戏物体
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class SceneObjectRenderInfo : ScriptableObject
|
|
|
|
|
{
|
|
|
|
|
[ReadOnly]
|
|
|
|
|
[LabelText("不透明材质")]
|
|
|
|
|
public List<Material> opaqueMaterial = new();
|
|
|
|
|
|
|
|
|
|
[ReadOnly]
|
|
|
|
|
[LabelText("半透明材质")]
|
|
|
|
|
public List<Material> transparentMaterial = new();
|
|
|
|
|
|
|
|
|
|
[ReadOnly]
|
|
|
|
|
[LabelText("网格")]
|
|
|
|
|
public List<Mesh> meshes = new();
|
2023-12-09 22:06:08 +08:00
|
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
|
public void RecordUndo(string undoName)
|
|
|
|
|
{
|
|
|
|
|
foreach (var mat in opaqueMaterial)
|
|
|
|
|
{
|
|
|
|
|
Undo.RecordObject(mat, undoName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var mat in transparentMaterial)
|
|
|
|
|
{
|
|
|
|
|
Undo.RecordObject(mat, undoName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var mesh in meshes)
|
|
|
|
|
{
|
|
|
|
|
Undo.RecordObject(mesh, undoName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2023-12-07 16:41:41 +08:00
|
|
|
}
|