public void Start() { theCollider = gameObject.GetComponent <Collider2D>(); anim = GameObject.Find("UI").GetComponentInChildren <Animator>(); fade = GameObject.Find("UI").GetComponentInChildren <fadeScript>(); }
IEnumerator secondDelay() { yield return(new WaitForSeconds(waitForDissolve)); fadeScript myFadeScript = canvas.GetComponent <fadeScript>(); myFadeScript.undoFadeMe(); }
IEnumerator myDelay() { yield return(new WaitForSeconds(waitFor)); fadeScript myFadeScript = canvas.GetComponent <fadeScript>(); myFadeScript.FadeMe(); }
// Update is called once per frame void Update() { fadeScript myFadeScript = canvas.GetComponent <fadeScript>(); if (myFadeScript.alpha >= 1) { StopCoroutine("myDelay"); StartCoroutine("secondDelay"); } }
void Start() { instance = this; }