Exemple #1
0
    public void Open()
    {
        // Stop WaitAndClose if it is running
        StopAllCoroutines();

        // Play the open door animation
        animator.CrossFade("open", 0.2f);
        open = true;

        // Unblock the door node so that units can traverse it again
        blocker.Unblock();
    }
Exemple #2
0
    public IEnumerator Die()
    {
        if (UnitManager.Instance.CheckUnitType <AIEnemy>(this))
        {
            InventoryManager.Instance.AddEnemyDrops(((EnemyUnitData)unitData).drops);
        }

        animationManager.TriggerAnimation(AnimationManager.deathTrigger);

        yield return(StartCoroutine(CheckIfDeathAnimationCompleted()));

        blocker.Unblock();

        Destroy(gameObject, 3f);
    }