Inheritance: MonoBehaviour
Exemple #1
0
    IEnumerator popEffectCoroutine(SavedCell savedCell)
    {
        yield return(new WaitForSeconds(_popEffectTimeS));

        if (null != savedCell)
        {
            savedCell.setCollidable(true);
        }
        else
        {
            Logger.Log("Hero::popEffectCoroutine unexpected null savedCell", Logger.Level.WARN);
        }
    }
Exemple #2
0
    //TODO divide by 2 the chemicals
    void duplicateCell()
    {
        if (null != _lastNewCell)
        {
            Destroy(_lastNewCell);
        }
        else
        {
            ModalManager.setModal("FirstCheckpoint");
        }

        _lastNewCell = (GameObject)Instantiate(this.gameObject);

        SavedCell savedCell = (SavedCell)_lastNewCell.AddComponent <SavedCell>();

        savedCell.initialize(this, _lastCheckpoint.transform.position);

        StartCoroutine(popEffectCoroutine(savedCell));
    }
Exemple #3
0
    void respawnCoroutine(CellControl cc)
    {
        enableEyes(true);

        foreach (GameObject flagellum in _flagella)
        {
            flagellum.SetActive(true);
        }
        _flagella.Clear();

        iTween.ScaleTo(gameObject, _optionsIn);
        safeFadeTo(_optionsInAlpha);

        cc.enabled = true;
        foreach (PushableBox box in FindObjectsOfType(typeof(PushableBox)))
        {
            box.resetPos();
        }

        MineManager.isReseting = true;


        SavedCell savedCell = null;

        if (null != _lastNewCell)
        {
            savedCell = (SavedCell)_lastNewCell.GetComponent <SavedCell>();
            savedCell.resetCollisionState();
            gameObject.transform.position = _lastNewCell.transform.position;
            gameObject.transform.rotation = _lastNewCell.transform.rotation;
        }

        _isAlive = true;
        cc.reset();
        setLife(1f);

        StartCoroutine(popEffectCoroutine(savedCell));
    }
Exemple #4
0
 IEnumerator popEffectCoroutine(SavedCell savedCell)
 {
     yield return new WaitForSeconds(_popEffectTimeS);
     if(null != savedCell) {
         savedCell.setCollidable(true);
     } else {
         Logger.Log("Hero::popEffectCoroutine unexpected null savedCell", Logger.Level.WARN);
     }
 }