public void Set(PlayerStatInfo other) { if (other != null) { m_ApiVersion = AchievementsInterface.PlayerstatinfoApiLatest; Name = other.Name; CurrentValue = other.CurrentValue; ThresholdValue = other.ThresholdValue; } }
// Start is called before the first frame update /* * NAME: Start * SYNOPSIS: * * * * DESCRIPTION: * This start function is used to load the current UI when the game is started. * This handles if the UI does not currently exist it creates the handler if it does * exist destroy the current gameObject. This is loads player stats that are displayed * on the UI. * * * RETURNS: * * AUTHOR: * Thomas Furletti * DATE: * 07/08/2020 */ void Start() { if (!UIExists) { UIExists = true; // stop player from being destroyed on zone change DontDestroyOnLoad(transform.gameObject); } else { Destroy(gameObject); } playerStats = GetComponent <PlayerStatInfo>(); }
// /* * NAME: Start * SYNOPSIS: * Start is called before the first frame update * * * DESCRIPTION: * Start is called before the first frame update * Gets the players stats from the player object and saves them for use. * * * RETURNS: * * AUTHOR: * Thomas Furletti * DATE: * 07/08/2020 */ void Start() { playerStats = FindObjectOfType <PlayerStatInfo>(); }
// /* * NAME: Start * SYNOPSIS: * Gets the player current hp and stats on start. * * * DESCRIPTION: * This function is used for constant tracking of the player stats and health. This * is needed because if you do not keep track of these stats the player will have no * point in leveling up. This is also for the enemy and how much damage they will take. * * * RETURNS: * * AUTHOR: * Thomas Furletti * DATE: * 07/08/2020 */ void Start() { CurrentHp = MaxHp; playerStats = FindObjectOfType <PlayerStatInfo>(); }