/* Add, remove or swap runes, depends of the current inventory slot and character sheet slot */ private void MoveRune() { Item rune = _myInventory[_currentSelectedSlot].Item; // If _characterSheet has no rune in the selected slot if (!RuneManagement.RuneInCurrentSlot) { if (rune != null && rune.typeOfCollectableItem == Item.TypeOfCollectableItem.Rune) { RuneManagement.AddRune(rune); RemoveItem(_currentSelectedSlot); enabled = false; } } // If _characterSheet has a rune in the selected slot else { if (rune == null) { AddItemAt(RuneManagement.GetRune(), _currentSelectedSlot); RuneManagement.RemoveRune(); enabled = false; } else if (rune != null && rune.typeOfCollectableItem == Item.TypeOfCollectableItem.Rune) { // SWAP Item runeInCharSheet = RuneManagement.SwapRune(rune); _myInventory[_currentSelectedSlot].GetComponent <Image>().sprite = runeInCharSheet.ImageOfTheItem; _myInventory[_currentSelectedSlot].gameObject.GetComponent <Item>().InitValues(runeInCharSheet); Destroy(runeInCharSheet); enabled = false; } } }
public static void InitializeAwakes() { RuneManagement.InitRunes(); ToolManagement.InitTools(); }