Example #1
0
 // Start is called before the first frame updatMOV
 void Start()
 {
     inputRequester          = InputRequester.Instance;
     stats                   = GetComponent <Player>().stats;
     playerBody.inputManager = this;
     player                  = GetComponent <Player>();
 }
Example #2
0
 public void UpdateFullTopBar(Player.PlayerStats playerStats)
 {
     UpdateTopBar(TopBar.UI.HardCurrency, playerStats.hardCurrency);
     UpdateTopBar(TopBar.UI.SoftCurrency, playerStats.softCurrency);
     UpdateTopBar(TopBar.UI.Level, playerStats.level);
     UpdateTopBar(TopBar.UI.SoftKey, playerStats.softKey);
     UpdateTopBar(TopBar.UI.HardKey, playerStats.hardKey);
 }
Example #3
0
 public void UpdateStatButtons(Player.PlayerStats playerStats)
 {
     UpdateStatButton(playerStats.health);
     UpdateStatButton(playerStats.attack);
     UpdateStatButton(playerStats.defence);
     UpdateStatButton(playerStats.energy);
     UpdateStatButton(playerStats.recovery);
 }
Example #4
0
    public void UpdateXPBar(Player.PlayerStats playerStats)
    {
        int xpIntoLevel = playerStats.xp.Amount - GetXPForLevel(playerStats.level.Amount - 1);
        int xpForNext   = GetXPForLevel(playerStats.level.Amount) - GetXPForLevel(playerStats.level.Amount - 1);

        Debug.Log(xpIntoLevel + "/" + xpForNext);
        m_xpBar.ChangeSliderValue(xpIntoLevel, xpForNext);
    }
Example #5
0
    private void SetupUI()
    {
        Player.PlayerStats playerStats = m_player.GetStats();

        UpdateXPBar(playerStats);
        UpdateStatButtons(playerStats);
        UpdateFullTopBar(playerStats);
    }
Example #6
0
    public void TryAttackEnemy(Enemy enemy)
    {
        Player.PlayerStats playerStats = m_player.GetStats();

        if (!playerStats.Dead)
        {
            m_player.AttackTarget(enemy);
        }
    }
Example #7
0
 public SaveData(string scene, Player player)
 {
     this.scene  = scene;
     stats       = player.playerStats;
     position    = new float[3];
     position[0] = player.transform.position.x;
     position[1] = player.transform.position.y;
     position[2] = player.transform.position.z;
 }