Esempio n. 1
0
    //Called by store when we purchase a creature
    public void AddCreatureToInventory(Creature creature)
    {
        creatureList.AddCreature(creature);
        GameObject newCreaturePanel = CreateCreatureObject(creature);

        newCreaturePanel.transform.SetParent(inventoryList.transform, false);
    }
Esempio n. 2
0
    private void PopulatePlayerInventory(CreatureList list)
    {
        list.AddCreature(CreatureManager.Manager.GetCreatureOfType(CreatureType.Slime));
        list.AddCreature(CreatureManager.Manager.GetCreatureOfType(CreatureType.Slime));

        /*
         * list.AddCreature(CreatureManager.Manager.GetCreatureOfType(CreatureType.Arachnid));
         * list.AddCreature(CreatureManager.Manager.GetCreatureOfType(CreatureType.Avian));
         * list.AddCreature(CreatureManager.Manager.GetCreatureOfType(CreatureType.Canine));
         * list.AddCreature(CreatureManager.Manager.GetCreatureOfType(CreatureType.Demon));
         * list.AddCreature(CreatureManager.Manager.GetCreatureOfType(CreatureType.Dragon));
         * list.AddCreature(CreatureManager.Manager.GetCreatureOfType(CreatureType.Equine));
         */
        foreach (var creature in creatureList.Creatures)
        {
            GameObject newCreaturePanel = CreateCreatureObject(creature);
            newCreaturePanel.transform.SetParent(inventoryList.transform, false);
        }
    }
 void Update()
 {
     while (creatureList.Creatures.Count < creatureCount)
     {
         CreatureData newCreature = CreatureManager.Manager.GetRandomCreature();
         Creature     creature    = new Creature(newCreature);
         creatureList.AddCreature(creature);
         GameObject newCreaturePanel = GetCreaturePanel(creature);
         newCreaturePanel.transform.SetParent(StoreListFrame.transform, false);
     }
 }
    private void PopulateStore(CreatureList list)
    {
        if (list.Creatures.Count < creatureCount)
        {
            //Fill the list with random creatures of the type we want
            for (int i = 0; i < creatureCount; i++)
            {
                list.AddCreature(CreatureManager.Manager.GetRandomCreature());
            }
        }

        foreach (var creature in creatureList.Creatures)
        {
            GameObject newCreaturePanel = GetCreaturePanel(creature);
            newCreaturePanel.transform.SetParent(StoreListFrame.transform, false);
        }
    }