コード例 #1
0
    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;
        }
    }
コード例 #2
0
 public static void Flash_WithOutEnable(OutlineObj obj, bool active)
 {
     if (active)
     {
         obj.FlashingOn();
     }
     else
     {
         obj.FlashingOff();
     }
 }