// Start is called before the first frame updatMOV void Start() { inputRequester = InputRequester.Instance; stats = GetComponent <Player>().stats; playerBody.inputManager = this; player = GetComponent <Player>(); }
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); }
public void UpdateStatButtons(Player.PlayerStats playerStats) { UpdateStatButton(playerStats.health); UpdateStatButton(playerStats.attack); UpdateStatButton(playerStats.defence); UpdateStatButton(playerStats.energy); UpdateStatButton(playerStats.recovery); }
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); }
private void SetupUI() { Player.PlayerStats playerStats = m_player.GetStats(); UpdateXPBar(playerStats); UpdateStatButtons(playerStats); UpdateFullTopBar(playerStats); }
public void TryAttackEnemy(Enemy enemy) { Player.PlayerStats playerStats = m_player.GetStats(); if (!playerStats.Dead) { m_player.AttackTarget(enemy); } }
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; }