using AX.TrackRecord; using System.Collections; using System.Collections.Generic; using UnityEngine; public class JiantouColorChanged : MonoBehaviour { // Use this for initialization void Start() { } // Update is called once per frame void Update() { changeColor(); } private void changeColor() { if (gameObject.name.Contains("jingong")) { if (JiantouColorControl.ToolName.Equals("JinGong") || LoadManager.Instance.IsPlayBacking) { if (JiantouColorControl.highLight ) { gameObject.GetComponent().material.color = new Color(1, 0, 0); } else { gameObject.GetComponent().material.color = new Color(0.15f, 0, 0); } } else { gameObject.GetComponent().material.color = new Color(1, 0, 0); } } if (gameObject.name.Contains("chetui") ) { if (JiantouColorControl.ToolName.Equals("CheTui") || LoadManager.Instance.IsPlayBacking) { if (JiantouColorControl.highLight) { gameObject.GetComponent().material.color = new Color(0, 1, 0); } else { gameObject.GetComponent().material.color = new Color(0, 0.15f, 0); } } else { gameObject.GetComponent().material.color = new Color(0, 1, 0); } } if (gameObject.name.Contains("ssrline")) { if (JiantouColorControl.ToolName.Equals("SSShuiDai") || LoadManager.Instance.IsPlayBacking) { if (JiantouColorControl.highLight) { gameObject.GetComponent().material.color = new Color(1, 0, 0); } else { gameObject.GetComponent().material.color = new Color(0.15f, 0, 0); } } else { gameObject.GetComponent().material.color = new Color(1, 0, 0); } } if (gameObject.name.Contains("fengexian")) { if (JiantouColorControl.ToolName.Equals("FenGeXian")) { if (JiantouColorControl.highLight) { gameObject.GetComponent().material.color = new Color(1, 0, 0); } else { gameObject.GetComponent().material.color = new Color(0.15f, 0, 0); } } else { gameObject.GetComponent().material.color = new Color(1, 0, 0); } } if (gameObject.name.Contains("dujiexian")) { if (JiantouColorControl.ToolName.Equals("DuJieXian")) { if (JiantouColorControl.highLight) { gameObject.GetComponent().material.color = new Color(1, 0, 0); } else { gameObject.GetComponent().material.color = new Color(0.15f, 0, 0); } } else { gameObject.GetComponent().material.color = new Color(1, 0, 0); } } } }