NLDClient-yudde/ProjectNLD/Assets/Editor/Scene/SceneBrush/SceneBrushTree.cs

40 lines
1.5 KiB
C#
Raw Normal View History

2023-12-07 16:41:41 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class SceneBrushTree : SceneBrush
{
public override EBrushType brushType => EBrushType.Tree;
2023-12-14 12:21:48 +08:00
public override string RootName => "Trees";
2023-12-07 16:41:41 +08:00
2023-12-14 12:21:48 +08:00
protected override bool PreProcessPrefab(GameObject k_prefab)
2023-12-07 16:41:41 +08:00
{
base.PreProcessPrefab(k_prefab);
2023-12-07 18:40:32 +08:00
if (k_prefab.GetComponent<Tree>() != null)
TreeUtil.PostProcessTree(k_prefab);
2023-12-14 12:21:48 +08:00
return true;
2023-12-07 16:41:41 +08:00
}
public override void OnInspectorGUI()
{
2023-12-09 22:06:08 +08:00
base.OnInspectorGUI();
2023-12-07 16:41:41 +08:00
if (Valid)
{
2023-12-20 12:51:57 +08:00
// var branchMat = renderInfo.opaqueMaterial[0];
// var leafMat = renderInfo.opaqueMaterial[1];
// EditorGUI.BeginChangeCheck();
// var branchColor = EditorGUILayout.ColorField("树枝颜色", branchMat.color);
// var leafColor = EditorGUILayout.ColorField("树叶颜色", leafMat.color);
// var alpha =1f;
// //alpha = EditorGUILayout.Slider("Alpha", renderInfo.transparentMaterial[0].color.a, 0, 1);
// if (EditorGUI.EndChangeCheck())
// {
// branchMat.color = branchColor;
// leafMat.color = leafColor;
// renderInfo.transparentMaterial[0].color = new Color(branchColor.r, branchColor.g, branchColor.b, alpha);
// renderInfo.transparentMaterial[1].color = new Color(leafColor.r, leafColor.g, leafColor.b, alpha);
// }
2023-12-07 16:41:41 +08:00
}
}
2023-12-07 18:40:32 +08:00
}