/// <summary> /// 开启高光,使用指定发光颜色 /// </summary> /// <param name="target">目标物体</param> /// <param name="color">发光颜色</param> public static void OpenHighLight(this GameObject target, Color color) { HighlightableObject ho = target.GetComponent <HighlightableObject>(); if (ho == null) { ho = target.AddComponent <HighlightableObject>(); } ho.ConstantOnImmediate(color); }
/// <summary> /// 开启高光,使用指定发光颜色 /// </summary> /// <param name="target">目标物体</param> /// <param name="color">发光颜色</param> public static void OpenHighLight(this GameObject target, Color color) { HOS.Clear(); target.transform.GetComponentsInChildren(true, HOS); for (int i = 0; i < HOS.Count; i++) { HOS[i].ConstantOff(); HOS[i].Die(); } HighlightableObject ho = target.GetComponent <HighlightableObject>(); if (ho == null) { ho = target.AddComponent <HighlightableObject>(); } ho.ConstantOnImmediate(color); }