Ejemplo n.º 1
0
    public void OpenChest(Chest myChest)
    {
        brownCoinCount = 0;
        List <GameObject> instancedDrops = new List <GameObject>();

        myChest.gameObject.GetComponent <Animator>().SetBool("isOpen", true); // The animation also changes the BoxCollider2D

        foreach (var o in myChest.ChestLoot)
        {
            instancedDrops.Add(m_LootHandler.DropLoot(o.gameObject.GetComponent <LootTable>().GetItemType(), myChest.transform.position, Quaternion.identity));
        }
        MoveDrops(myChest.ChestLootInitialPositions, instancedDrops);
    }