// Update is called once per frame void Update() { if (_isHovering) { //display labels //check for keys //if key is pressed add powerup to correct if (Input.GetKeyDown(KeyCode.E)) { RemoveExistingAbilities(true); //check for pre existing primary abilities AddSkill(_player, true); //add skill to player UISkillPortraitManager.GetInstance().AssignFirstSkillPortrait(_skillImage); //add portrait to UI ItemDescriptionScript.Instance.Activate(_description); Destroy(gameObject); //destroy the power up obj } if (Input.GetKeyDown(KeyCode.R)) { RemoveExistingAbilities(false); //check for pre existing secondary abilities AddSkill(_player, false); //add skill to player UISkillPortraitManager.GetInstance().AssignSecondSkillPortrait(_skillImage); //add portait to UI ItemDescriptionScript.Instance.Activate(_description); Destroy(gameObject); //destroy the power up obj } } }
void Awake() { if (_instance == null) { _instance = this; } }