Exemplo n.º 1
0
    IEnumerator BornAlienCoroutine(Clickable clickable)
    {
        while (currentLiveState.Equals(AlienLiveState.Born))
        {
            while (pauseInCupol || pauseInBlackHole)
            {
                yield return(null);
            }

            bornTime += Time.deltaTime;

            float currentScale = bornTime / GameplayConstants.AlienBornTime;

            fChild.transform.localScale = new Vector3(currentScale, currentScale, currentScale);



            if (bornTime > GameplayConstants.AlienBornTime)
            {
                bornTime = GameplayConstants.AlienBornTime;

                fChild.transform.localScale = new Vector3(1, 1, 1);

                currentLiveState = AlienLiveState.Alive;

                clickable.AlienWasBorning();
                break;
            }

            yield return(null);
        }

        //  childAnim.GetComponent<Image>().color = startColor;


        library.aliens.GetComponent <AlienController>().AddAlien(this);

        // SetLastTarget(clickable);
        //  finalTarget = clickable;
    }