예제 #1
0
 void addSkillLevelIcon(Rect r, LevelUpSystem.ActiveSpell spell, Texture2D icon)
 {
     GUI.Button(new Rect(r.x+icon.width-3-icon_skill_lvl.width-2,
                         r.y+icon.height-3-icon_skill_lvl.height-1,
                         icon_skill_lvl.width, icon_skill_lvl.height),icon_skill_lvl, spellButtonStyle);
     GUI.Label(new Rect(r.x+10, r.y+11, r.width, r.height),
             string.Format("{0}", spell.level), skilllvlTextStyle);
 }
예제 #2
0
    private void Awake()
    {
        rb            = GetComponent <Rigidbody>();
        anim          = GetComponent <Animator>();
        levelUpSystem = GetComponent <LevelUpSystem>();
        gameManager   = FindObjectOfType <GameManager>();
        gameManager.setCharacterLevel(levelUpSystem.getCurrentLevel());

        //set experience
        levelUpSystem.addEp(gameManager.GetStoredExperience());
        //set level
        gameManager.setCharacterLevel(levelUpSystem.getCurrentLevel());
    }
예제 #3
0
    void Start()
    {
        _health = maxHealth;
        GameObject playerGO = GameObject.FindGameObjectWithTag("Player");

        if (playerGO != null)
        {
            _levelUpSystem = playerGO.GetComponent <LevelUpSystem>();
        }
        else
        {
            Debug.LogError("Player is missing from the scene");
        }
        _audioSource = GetComponent <AudioSource>();
    }
예제 #4
0
    void Start()
    {
        health = maxHealth;
        GameObject playerGO = GameObject.FindGameObjectWithTag("Player");
        if(playerGO != null)
        {
            levelUpSystem = playerGO.GetComponent<LevelUpSystem>();
        }
        else
        {
            Debug.LogError("Player is missing from the scene");
        }
        audioSource = GetComponent<AudioSource>();

    }
예제 #5
0
 void createLvlUpSkillButton(LevelUpSystem.Spell skill, Rect r)
 {
     glow += Time.deltaTime*0.3f;
     GUI.backgroundColor = new Color(GUI.backgroundColor.r, GUI.backgroundColor.g, GUI.backgroundColor.b,
         Mathf.Sin(glow)+1.3f);
     if(lvlSystem.skillPoints > 0)
     {
         if(GUI.Button(r, "",lvlupskillStyle))
             lvlSystem.up_skill(skill);
     }
     else
     {
         glow = 0;
     }
     GUI.backgroundColor = new Color(GUI.backgroundColor.r, GUI.backgroundColor.g, GUI.backgroundColor.b, 1);
 }
예제 #6
0
    void createToolTip(Rect r, LevelUpSystem.PassiveSpell skill)
    {
        if(r.Contains (Event.current.mousePosition))
        {
            GUI.color = Color.yellow;
            GUI.Box (new Rect(156, 120,200,100), "");
            GUI.Box (new Rect(156, 120,200,100), skill.name+" (lvl "+skill.level+")", skillTitleTextStyle);
            GUI.color = Color.white;
            if(skill == lvlSystem.passives[0])
            {
                GUI.Box (new Rect(156, 120,200,100), "\n\nAttack Damage: "+
                    player.GetComponent<PlayerAttributes>().atkDamage, skillDescriptionTextStyle);
            }
            else
            {
                GUI.Box (new Rect(156, 120,200,100), "\n\nMax. HP: "+maxHealth, skillDescriptionTextStyle);
            }
            GUI.Box (new Rect(156, 120,200,100), "\n\n\n\n"+skill.getDescription(), skillDescriptionTextStyle);

        }
    }
예제 #7
0
파일: GainXP.cs 프로젝트: KarateF22/GameX
	void Update(){
		if (kills == null)
			kills = GameObject.FindWithTag("MainCamera").GetComponent<killCounter>();
		if (levelUpScript == null)
			levelUpScript = GameObject.FindWithTag("MainCamera").GetComponent<LevelUpSystem>();
	}
예제 #8
0
파일: GainXP.cs 프로젝트: KarateF22/GameX
	void  Start (){	
		levelUpScript = GameObject.FindWithTag("MainCamera").GetComponent<LevelUpSystem>();
		kills = GameObject.FindWithTag("MainCamera").GetComponent<killCounter>();
	}
예제 #9
0
 void Start()
 {
     player    = GameObject.FindGameObjectWithTag("Player");
     lvlSystem = player.GetComponent <LevelUpSystem>();
 }
예제 #10
0
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     lvlSystem = player.GetComponent<LevelUpSystem>();
 }
예제 #11
0
 void SpellButton(Rect r, LevelUpSystem.ActiveSpell active, Texture2D icon, KeyCode key, GUIStyle style)
 {
     createToolTip(r, active);
     if(!active.isAvailable())
         GUI.color = new Color(0.4f,0.4f,0.4f,1);
     if((Event.current.type == EventType.KeyDown && Event.current.keyCode == key ||
         GUI.Button(r,icon, style)) && active.isAvailable() && player.GetComponent<Controls>().cantMove == 0)
     {
         if(active.manaCost <= mana)
         {
             if(active.Equals(lvlSystem.actives[0]))
             {
                 if(health < maxHealth)
                     lvlSystem.activate_skill(active);
             }
             else if(active.Equals(lvlSystem.actives[1]) || active.Equals(lvlSystem.actives[2]))
             {
                 if(player.GetComponent<Controls>().grounded)
                     lvlSystem.activate_skill(active);
             }
             else
                 lvlSystem.activate_skill(active);
         }
         else
         {
             audio.PlayOneShot(outOfMana);
         }
     }
     if(active.onCoolDown() && active.level > 0){
         GUI.Label(r,string.Format("{0:F1}",active.cooldown -(Time.time-active.lastCastTime)), coolDownTextStyle);
     }
     addSkillLevelIcon(r, active, icon);
     GUI.color = Color.white;
 }
예제 #12
0
 void PassiveSpellButton(Rect r, LevelUpSystem.PassiveSpell passive, Texture2D icon, GUIStyle style)
 {
     createToolTip(r, passive);
     GUI.Button(r,icon, style);
     addSkillLevelIcon(r, passive, icon);
 }
예제 #13
0
    void createToolTip(Rect r, LevelUpSystem.ActiveSpell skill)
    {
        if(r.Contains (Event.current.mousePosition))
        {
            GUI.color = Color.yellow;
            GUI.Box (new Rect(156, 120,200,130), "");
            GUI.Box (new Rect(156, 120,200,130), skill.name+" (lvl "+skill.level+")", skillTitleTextStyle);
            GUI.color = Color.white;
            GUI.Box (new Rect(156, 120,200,130), "\n\n"+skill.getInfo(), skillDescriptionTextStyle);
            GUI.Box (new Rect(156, 120,200,130), "\n\n\n\n\n"+skill.getDescription(), skillDescriptionTextStyle);

        }
    }