Example #1
0
 void Update()
 {
     //Switch Character
     if (Input.GetKeyDown(KeyCode.Space))
     {
         CharacterManager.SwitchPlayerCharacter();
     }
     //Open character panel
     if (Input.GetKeyDown(KeyCode.C))
     {
         UIManager.CharacterPanel.SwitchState();
     }
     //Open inventory panel
     if (Input.GetKeyDown(KeyCode.I))
     {
         UIManager.InventoryPanel.SwitchState();
     }
     //Close all panels
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         UIManager.InventoryPanel.Hide();
         UIManager.CharacterPanel.Hide();
         UIManager.ShopPanel.Hide();
     }
     //Heal to full
     if (Input.GetKeyDown(KeyCode.H))
     {
         CharacterManager.GetCharacters().ForEach(x => x.Heal(500));
     }
     //Give all items
     if (Input.GetKeyDown(KeyCode.G))
     {
         Inventory.Currency = 1000;
         Inventory.AddItem(new Script_Axe());
         Inventory.AddItem(new Script_Spear());
         Inventory.AddItem(new Script_Armor("Bronze Chest", Script_Armor.ArmorType.Chest, 4));
         Inventory.AddItem(new Script_Armor("Bronze Helm", Script_Armor.ArmorType.Helm, 2));
         Inventory.AddItem(new Script_Armor("Bronze Legs", Script_Armor.ArmorType.Legs, 3));
         Inventory.AddItem(new Script_Armor("Iron Chest", Script_Armor.ArmorType.Chest, 6));
         Inventory.AddItem(new Script_Armor("Iron Helm", Script_Armor.ArmorType.Helm, 4));
         Inventory.AddItem(new Script_Armor("Iron Legs", Script_Armor.ArmorType.Legs, 5));
         var hp = new Script_HealthPotion();
         hp.Amount = 10;
         Inventory.AddItem(hp);
         UIManager.InventoryPanel.Refresh();
     }
 }
    // Use this for initialization
    void Start()
    {
        ShopEntries = new List <ShopEntry>();
        //Create stock
        ShopEntries.Add(new ShopEntry(new Script_Axe(), 50));
        ShopEntries.Add(new ShopEntry(new Script_Spear(), 70));
        ShopEntries.Add(new ShopEntry(new Script_Armor("Bronze Chest", Script_Armor.ArmorType.Chest, 4), 40));
        ShopEntries.Add(new ShopEntry(new Script_Armor("Bronze Helm", Script_Armor.ArmorType.Helm, 2), 25));
        ShopEntries.Add(new ShopEntry(new Script_Armor("Bronze Legs", Script_Armor.ArmorType.Legs, 3), 30));
        ShopEntries.Add(new ShopEntry(new Script_Armor("Iron Chest", Script_Armor.ArmorType.Chest, 6), 55));
        ShopEntries.Add(new ShopEntry(new Script_Armor("Iron Helm", Script_Armor.ArmorType.Helm, 4), 40));
        ShopEntries.Add(new ShopEntry(new Script_Armor("Iron Legs", Script_Armor.ArmorType.Legs, 5), 45));
        var hp = new Script_HealthPotion();

        hp.Amount = 10;
        ShopEntries.Add(new ShopEntry(hp, 10));
        transform.GetChild(0).gameObject.SetActive(false);
    }