Ejemplo n.º 1
0
        public override IEnumerator Load_Resource()
        {
            UI.IDialog.RequestDialogEnter <UI.InventoryDialog>();
            for (int i = 0; i < attributes.Length; i++)
            {
                attributes[i].SetParent(this);
            }

            for (int i = 0; i < equipment.GetSlots.Length; i++)
            {
                equipment.GetSlots[i].OnBeforeUpdate += OnBeforeSlotUpdate;
                equipment.GetSlots[i].OnAfterUpdate  += OnAfterSlotUpdate;
            }

            inventoryConsume   = GameObject.Find("imgPotion").GetComponent <InventoryBase>();
            inventoryInterface = GameObject.Find("ImgBagInventory").GetComponent <InventoryBase>();
            inventoryEquipment = GameObject.Find("ImgCharacterInventory").GetComponent <InventoryBase>();

            inventoryConsume.OnItemDestory   += Inventorye_OnItemDestory;
            inventoryInterface.OnItemDestory += Inventorye_OnItemDestory;;
            inventoryEquipment.OnItemDestory += Inventorye_OnItemDestory;;


            UI.IDialog.RequestDialogExit <UI.InventoryDialog>();

            manager = this.gameObject;
            inventory.Clear();
            equipment.Clear();
            consume.Clear();
            AddMessage();
            yield return(null);
        }
Ejemplo n.º 2
0
 private void OnTriggerExit(Collider other)
 {
     open = false;
     chestUi.slotsOnInterface.Clear();
     chestData.Clear();
     foreach (Transform child in chestUi.transform)
     {
         GameObject.Destroy(child.gameObject);
     }
     chestUi.gameObject.SetActive(false);
 }
Ejemplo n.º 3
0
    void Update()
    {
        currentValueText.text = "" + currentGold;

        movement   = Vector3.zero;
        movement.x = Input.GetAxisRaw("Horizontal");
        movement.y = Input.GetAxisRaw("Vertical");
        SaveAndLoadGame();
        AnimationUpdate();
        if (Input.GetKeyUp(KeyCode.Space))
        {
            if (this.name == "Archer(Clone)")
            {
                if (arrowSpawn)
                {
                    if (canFire)
                    {
                        canFire = false;
                        StartCoroutine(Attacking("Archer(Clone)"));
                    }
                }
            }
            else if (this.name == "Mage(Clone)")
            {
                if (orbSpawn)
                {
                    if (canFire)
                    {
                        canFire = false;
                        StartCoroutine(Attacking("Mage(Clone)"));
                    }
                }
            }
            else if (this.name == "Warrior(Clone)")
            {
                animator.SetBool("attacking", false);
            }
        }
        if (Input.GetKeyDown(KeyCode.Space))
        {
            StartCoroutine(Attacking("Warrior(Clone)"));
        }
        if (playerCurrentHP <= 0)
        {
            gameObject.SetActive(false);
            inventory.Clear();
            equipment.Clear();
            FindObjectOfType <GameManager>().RespawnPlease();
        }
    }
Ejemplo n.º 4
0
    private void MoveCraftingItemsToInventory()
    {
        if (herbItemSlot.item.id >= 0)
        {
            FindObjectOfType <Player>().inventory.AddItem(herbItemSlot?.item, herbItemSlot.amount);
        }

        if (oreItemSlot.item.id >= 0)
        {
            FindObjectOfType <Player>().inventory.AddItem(oreItemSlot?.item, oreItemSlot.amount);
        }

        if (woodItemSlot.item.id >= 0)
        {
            FindObjectOfType <Player>().inventory.AddItem(woodItemSlot?.item, woodItemSlot.amount);
        }

        if (energyShardItemSlot.item.id >= 0)
        {
            FindObjectOfType <Player>().inventory.AddItem(energyShardItemSlot?.item, energyShardItemSlot.amount);
        }

        if (recipeItemSlot.item.id >= 0)
        {
            FindObjectOfType <Player>().inventory.AddItem(recipeItemSlot?.item, recipeItemSlot.amount);
        }

        if (outputSlot.item.id >= 0)
        {
            FindObjectOfType <Player>().inventory.AddItem(outputSlot?.item, outputSlot.amount);
        }
        craftingInventory.Clear();
    }
Ejemplo n.º 5
0
 public void PopulateInventory()
 {
     inventoryObject.Clear();
     foreach (var item in itemObjects)
     {
         inventoryObject.AddItem(item.CreateItem(), 1);
     }
 }
Ejemplo n.º 6
0
Archivo: Player.cs Proyecto: Khoryn/IDJ
    private void OnApplicationQuit()
    {
        inventory.Save();
        equipment.Save();

        inventory.Clear();
        equipment.Clear();
    }
Ejemplo n.º 7
0
        CharacterStats baseStats; // stats based on the Selected Character

        private void Awake()
        {
            EquippedGearSlots.Clear();
            SetEquipmentSlots();

            movement = GetComponent <IMove>();

            health    = GetComponent <IHealth>();
            baseStats = GetComponentInChildren <CharacterStats>();
        }
Ejemplo n.º 8
0
 private void OnApplicationQuit()
 {
     inventory.Clear();
     fridge.Clear();
     trash.Clear();
     topOvenRack.Clear();
     bottomOvenRack.Clear();
     topCookieRack.Clear();
     bottomCookieRack.Clear();
 }
 private void OnApplicationQuit()
 {
     inventory.Clear();
     equipment.Clear();
     craftingTable.Clear();
     chest.Clear();
     blacksmithing.Clear();
     herbalisim.Clear();
     quest.Clear();
 }
Ejemplo n.º 10
0
 public void Knockback(float knockbackTime, float damage)
 {
     currentPlayerHealth.runTimeValue -= damage;
     Debug.Log("Current health: " + currentPlayerHealth.runTimeValue);
     playerHealthObserver.Raise();
     if (currentPlayerHealth.runTimeValue > 0)
     {
         StartCoroutine(KnockbackCoroutine(knockbackTime));
     }
     else
     {
         SceneManager.LoadScene("MainMenu");
         inventory.Clear();
     }
 }
Ejemplo n.º 11
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.I))
        {
            inventoryUI.gameObject.SetActive(true);
            inventoryUI.Show();
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            Item item = new Item(groundItem[0].item);
            inventory.AddItem(item, 2);
        }
        if (Input.GetKey(KeyCode.D))
        {
            if (Input.GetKeyDown(KeyCode.A))
            {
                Item item = new Item(groundItem[0].item);
                inventory.AddItem(item, 1);
            }
            if (Input.GetKeyDown(KeyCode.B))
            {
                Item item = new Item(groundItem[1].item);
                inventory.AddItem(item, 1);
            }
            if (Input.GetKeyDown(KeyCode.F))
            {
                Item item = new Item(groundItem[2].item);
                inventory.AddItem(item, 1);
            }
        }

        if (Input.GetKeyDown(KeyCode.S))
        {
            inventory.Save();
        }
        if (Input.GetKeyDown(KeyCode.L))
        {
            inventory.Load();
        }
        if (Input.GetKeyDown(KeyCode.C))
        {
            inventory.Clear();
        }
    }
Ejemplo n.º 12
0
 private void OnApplicationQuit()
 {
     itemsForUse.Clear();
     documents.Clear();
     memories.Clear();
 }
Ejemplo n.º 13
0
 public void OnApplicationQuit()
 {
     inventory.Clear();
     equipment.Clear();
 }
Ejemplo n.º 14
0
 private void OnApplicationQuit()
 {
     inventoryObject.Clear();
 }
Ejemplo n.º 15
0
 private void OnApplicationQuit()
 {
     inventory.Clear();
     equipment.Clear();
     enchant.Clear();
 }
Ejemplo n.º 16
0
 public void ClearInventory()
 {
     equipmentObject?.Clear();
     inventoryObject?.Clear();
 }
Ejemplo n.º 17
0
 private void OnApplicationQuit()
 {
     inventory.Clear();
     playerEquipment.Clear();
 }
Ejemplo n.º 18
0
 private void OnApplicationQuit()
 {
     inventory.Clear();
     inventory.Clear();
 }