예제 #1
0
    // 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
            }
        }
    }
예제 #2
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
 }