//Assigns their hotkey to my skill that's being swapped private void AssignDraggedToMine(SkillTreePiece skillTreePieceOfDragged, Skill thisSlotsSkills) { skillTreePieceOfDragged.setSkill(thisSlotsSkills); skillTreePieceOfDragged.getSkill().SlotAssignedTo = (gameObject); skillTreePieceOfDragged.getSkill().Hotkey = new SkillHotkey(DraggableSlot.originalSlot.GetComponent <Slot>().key, thisSlotsSkills); DraggableSlot.originalSlot.GetComponent <Image>().sprite = GetComponent <Image>().sprite; DraggableSlot.originalParent.GetChild(0).GetComponent <Image>().sprite = GetComponent <Image>().sprite; }
//This is called every time player levels up //It shows player all the upgrades/unlocks available public void displayUnlockablesForOneTree(StatsManager sm) { _sm = sm; //try //{ int x = 0; //Debug.Log(transform + " : " + skillsUnlocked); //Skills with the level requirement met by the player will light up and allow player to unlock/upgrade them if player has unlocked all previous skills foreach (SkillTreePiece piece in treePieces) { if (piece.getUnlocked() == false && piece.getSkill().LvlRequirement <= sm.getCurrentLvl() && sm.getUpgradePnts() > 0 && piece.NumberInTree == skillsUnlocked) { toggles[x].interactable = true; } else if (canUpgradeSkill(piece.getSkill()) && piece.getUnlocked()) { toggles[x].interactable = true; toggles[x].isOn = false; } else if (piece.getUnlocked() && !canUpgradeSkill(piece.getSkill())) { toggles[x].isOn = true; toggles[x].interactable = false; } else { toggles[x].interactable = false; } x++; } /*} * * catch(System.NullReferenceException e) * { * Debug.Log ("OH OH: "); * } */ }