public static void Flash(GameObject go, bool active, bool addIfNull = true) { OutlineObj obj = go.GetComponent <OutlineObj>(); if (obj == null) { if (active == false) { addIfNull = false; } if (addIfNull) { obj = go.AddComponent <OutlineObj>(); obj.enabled = false; } else { return; } } if (active) { obj.enabled = true; obj.FlashingOn(); } else { obj.FlashingOff(); obj.enabled = false; } }
public static void Flash_WithOutEnable(OutlineObj obj, bool active) { if (active) { obj.FlashingOn(); } else { obj.FlashingOff(); } }