public void ShowHight(bool state) { if (state) { ho.ConstantOnImmediate(color); } else { ho.ConstantOffImmediate(); } }
void AfterUpdate() { int val = (int)counter; //Color col = new Color(GetColorValue(1020, val), GetColorValue(0, val), GetColorValue(510, val), 1f); Color col = new Color(0f, 1f, 0f, 1f); if (Input.GetMouseButtonDown(0) && Start01.part == ho.gameObject) { ho.ConstantOnImmediate(col); } else if (Input.GetMouseButtonUp(0) && Start01.part == ho.gameObject) { ho.ConstantOffImmediate(); Start01.part = null; } counter += Time.deltaTime * speed; counter %= period; }
public void Seclet(bool seclet) { mSelected = seclet; if (mSelected) { // 1.选中 msCurrentWujiang = this; if (mHighlightableObjecto == null) { mHighlightableObjecto = gameObject.AddComponent <HighlightableObject>(); } mHighlightableObjecto.ConstantOnImmediate(Color.red); } else { // 2.不选中 msCurrentWujiang = null; mHighlightableObjecto.Off(); } }
// Use this for initialization void Start() { ho = m_High.GetComponent <HighlightableObject>(); ho.ConstantOnImmediate(col); }