public void HideGlow(bool red)
    {
        UINoticeScript glow = this.GetScript(Notice.Glow, red);

        if (glow != null)
        {
            glow.Hide();
        }
    }
 void Awake()
 {
     AlertRedScript      = AlertRed.GetComponent <UINoticeScript> ();
     CorrectRedScript    = CorrectRed.GetComponent <UINoticeScript> ();
     IncorrectRedScript  = IncorrectRed.GetComponent <UINoticeScript> ();
     AlertBlueScript     = AlertBlue.GetComponent <UINoticeScript> ();
     CorrectBlueScript   = CorrectBlue.GetComponent <UINoticeScript> ();
     IncorrectBlueScript = IncorrectBlue.GetComponent <UINoticeScript> ();
     GlowBlueScript      = GlowBlue.GetComponent <UINoticeScript> ();
     GlowRedScript       = GlowRed.GetComponent <UINoticeScript> ();
 }
    public bool IsVisible(Notice which, bool red)
    {
        UINoticeScript script = this.GetScript(which, red);

        if (script != null)
        {
            return(script.IsVisible());
        }
        else
        {
            return(false);
        }
    }
    // Shows notice until function return false
    public void Show(Notice which, bool red, System.Func <bool> until)
    {
        UINoticeScript script = this.GetScript(which, red);

        if (script != null)
        {
            if (which != Notice.Glow)
            {
                this.HideOthers(which, red);
            }

            script.Show();

            if (until != null)
            {
                StartCoroutine(Hide(script, until));
            }
        }
    }
    // Shows notice and hides all other notices
    // If positive howLong is given hides after that many seconds
    public void Show(Notice which, bool red, int howLong = -1)
    {
        UINoticeScript script = this.GetScript(which, red);

        if (script != null)
        {
            if (which != Notice.Glow)
            {
                this.HideOthers(which, red);
            }

            script.Show();

            if (howLong > 0)
            {
                StartCoroutine(Hide(script, howLong));
            }
        }
    }
    private IEnumerator Hide(UINoticeScript which, System.Func <bool> until)
    {
        yield return(new WaitUntil(until));

        which.Hide();
    }
    private IEnumerator Hide(UINoticeScript which, int time)
    {
        yield return(new WaitForSeconds(time));

        which.Hide();
    }
Пример #8
0
 void Awake()
 {
     this.AlertScript   = Alert.GetComponent <UINoticeScript> ();
     this.CorrectScript = Correct.GetComponent <UINoticeScript> ();
 }