Beispiel #1
0
    void Start()
    {
        inventory = Hammers.instance;
        inventory.onItemChanhgedCallback += UpdateUI;

        slots = itemsParent.GetComponentsInChildren <ShopSlot>();
    }
Beispiel #2
0
 static void Main(string[] args)
 {
     HM = new Hammers("Great Hammer", "Iron Hammer", 10);
     SW = new Sword("Sword", "Rusty long sword", 15);
     IS.AddItem(HM, 1);
     IS.AddItem(SW, 1);
     PrintArray();
     Console.ReadKey(true);
 }
 public void Awake()
 {
     if (instance != null)
     {
         Debug.LogWarning("More than one instance of Inventory found!");
         return;
     }
     instance = this;
 }
 public Knight(string name, int level, int healthPoints)
 {
     Name          = name;
     Level         = level;
     HealthPoint   = healthPoints;
     AbilityPoints = ABILITY_POINTS;
     Faction       = FACTION;
     BodyArmor     = BODY_ARMOR;
     Weapon        = WEAPON;
 }
Beispiel #5
0
    // Use this for initialization
    void Start()
    {
        Time.timeScale = 1;

        /*PlayerPrefs.DeleteKey ("IsSold1");
         * PlayerPrefs.DeleteKey ("IsSold2");
         * PlayerPrefs.DeleteKey ("IsSold3");
         * PlayerPrefs.DeleteKey ("IsSold4");
         *
         * PlayerPrefs.DeleteKey ("IsEquipped1");
         * PlayerPrefs.DeleteKey ("IsEquipped2");
         * PlayerPrefs.DeleteKey ("IsEquipped3");
         * PlayerPrefs.DeleteKey ("IsEquipped4");*/

        hammerList = new List <Hammers> ();
        hammerSold = new List <string> ();


        hammer1 = gameObject.AddComponent <Hammers> ();
        hammer2 = gameObject.AddComponent <Hammers> ();
        hammer3 = gameObject.AddComponent <Hammers> ();
        hammer4 = gameObject.AddComponent <Hammers> ();
        hammer5 = gameObject.AddComponent <Hammers> ();
        hammer6 = gameObject.AddComponent <Hammers> ();



        InitializeHammers();


        if (hammer1.isEquipped == 1)
        {
            sellButtonText.text = "Equipped";
        }
        else
        {
            sellButtonText.text = "Equip";
        }
    }