Exemplo n.º 1
0
    public void afterOpen()
    {
        switch (chestType)
        {
        case 1:
            //drop item
            It.randomDrop();
            break;

        case 2:
            //enemy spawn
            Et.StartSpawn();
            break;
        }
    }
Exemplo n.º 2
0
    void deathAction(int killerId)
    {
        // print("Call Dead Action from " + gameObject.name);

        myCol.enabled = false;
        // Shadow Character dead
        ShadowCharacterTracking tracking = GetComponent <ShadowCharacterTracking>();

        if (tracking != null)
        {
            tracking.NotifyDead();
        }

        if (playerCon != null && tag != "Enemy")
        {
            playerCon.ReportDeath();
            reviveArea.activeReviveArea();
            if (GameManagerPC.Instance != null && id >= 0)
            {
                // player Lose 10% of holding item
                ItemOnPlayer itemOnPlayer = GetComponent <ItemOnPlayer>();
                if (itemOnPlayer != null)
                {
                    itemOnPlayer.RemoveRandomItemOnPlayer(3);
                }
                GameManagerPC.Instance.OnPlayerDeath(id);
            }

            return;
        }
        EnemyAI enemyAI = gameObject.GetComponent <EnemyAI>();

        if (enemyAI != null)
        {
            enemyAI.ReportDeath(killerId);
        }

        DropControl dropControl = gameObject.GetComponent <DropControl>();

        if (dropControl != null)
        {
            dropControl.randomDrop();
        }
    }