Ejemplo n.º 1
0
 // Use this for initialization
 protected virtual void Start()
 {
     Inventaire = new Item[2][];
     Inventaire[0] = new equipment[2];
     Inventaire[1] = new Item[20];
     agent = GetComponent<NavMeshAgent>();
     //to delete
     stamina = 100;
     animator = GetComponent<Animator>();
 }
Ejemplo n.º 2
0
 private void readInventaire(Item[][] inv)
 {
     int j = 1;
     for (int i = 0; i < 2; i++)
     {
         j = 1;
         foreach (Item element in inv[i])
         {
             Text obj = GameObject.Find("Text (" + j + ")").GetComponent<Text>();
             if (element != null)
             {
                 if (element.type == 0)
                 {
                     AssemblyCSharp.equipment temp = (AssemblyCSharp.equipment)element;
                     if (temp.typeEquip == 0)
                     {
                         downWeapon.GetComponent<Dropdown>().options.Add(new Dropdown.OptionData(temp.name));
                     }
                     else {
                         downArmor.GetComponent<Dropdown>().options.Add(new Dropdown.OptionData(temp.name));
                     }
                     obj.text = "Equipement : " + temp.name + " Dommage : " + temp.damage + " Portée : " + temp.bonusScope;
                 }
                 else {
                     AssemblyCSharp.Resources temp = (AssemblyCSharp.Resources)element;
                     obj.text = "Ressource : " + temp.name + " Quantité : " + temp.nb;
                 }
                 j += 1;
             }
             else {
                 obj.text = "";
             }
         }
     }
 }