From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Assets/Scripts/XEditor/XCharacterMaterial.cs | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Client/Assets/Scripts/XEditor/XCharacterMaterial.cs (limited to 'Client/Assets/Scripts/XEditor/XCharacterMaterial.cs') diff --git a/Client/Assets/Scripts/XEditor/XCharacterMaterial.cs b/Client/Assets/Scripts/XEditor/XCharacterMaterial.cs new file mode 100644 index 00000000..4e43dda2 --- /dev/null +++ b/Client/Assets/Scripts/XEditor/XCharacterMaterial.cs @@ -0,0 +1,45 @@ +#if UNITY_EDITOR +using UnityEditor; +using UnityEngine; +using XEditor; +using XUtliPoolLib; +using System.Collections.Generic; + +public enum EEquipType +{ + Archer, + Cleric, + Sorcer, + Warrior, + Academic, + Spirit, + Tail, + Wing, + Char, + SelectChar, + Creator +} +public class XCharacterMaterial : MonoBehaviour +{ + //private string characterType = "Archer"; + public Material mat = null; + private SkinnedMeshRenderer skin = null; + public void OnAttached() + { + skin = gameObject.GetComponentInChildren(); + + } + + void Update() + { + if(mat!=null&&mat!= skin.sharedMaterial) + { + + mat.CopyPropertiesFromMaterial(skin.sharedMaterial); + skin.sharedMaterial = mat; + + } + } + +} +#endif \ No newline at end of file -- cgit v1.1-26-g67d0