using System.Collections; using System.Collections.Generic; using UnityEditor; using UnityEngine; public class SceneBrushTree : SceneBrush { public override EBrushType brushType => EBrushType.Tree; public override string RootName => "Trees"; protected override bool PreProcessPrefab(GameObject k_prefab) { base.PreProcessPrefab(k_prefab); if (k_prefab.GetComponent() != null) TreeUtil.PostProcessTree(k_prefab); return true; } public override void OnInspectorGUI() { base.OnInspectorGUI(); if (Valid) { // 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); // } } } }