// Start is called before the first frame update void Start() { PlayerThirst = GameObject.Find("HUD").GetComponent <HungerThirst>(); playerHealth = GameObject.Find("Player").GetComponent <PlayerHealth>(); InvokeRepeating("DyingofThirst", 1.0f, 1.0f); }
/// <summary> /// Triggered when stop moving /// </summary> private void OnMoveStopped() { HungerThirst hungerThirst = GetComponent <HungerThirst>(); // Remove the extra hunger increase amount hungerThirst.ReduceExtraHungerIncreaseAmount(_extraHungerIncreaseAmount); // Remove the extra thirst increase amount hungerThirst.ReduceExtraThirstIncreaseAmount(_extraThirstIncreaseAmount); }
/// <summary> /// Triggered when start moving /// </summary> private void OnMoveStarted() { HungerThirst hungerThirst = GetComponent <HungerThirst>(); // Add extra hunger increase amount hungerThirst.AddExtraHungerIncreaseAmount(_extraHungerIncreaseAmount); // Add extra thirst increase amount hungerThirst.AddExtraThirstIncreaseAmount(_extraThirstIncreaseAmount); }
/******************* * Methods *******************/ /// <summary> /// Awake is called when the script instance is being loaded. /// </summary> void Awake() { _hungerThirst = GetComponent <HungerThirst>(); _health = _maxHealth; _healthLbl.gameObject.SetActive(_showHUD); //RefreshHUD(); curHealthText.text = ("Health: " + _health); }
/// <summary> /// Reduces thirst when picked up /// </summary> /// <param name="picker">The gameobject that picked up the item.</param> public void Pickup(GameObject picker) { HungerThirst hungerThirst = picker.GetComponent <HungerThirst>(); if (hungerThirst != null && hungerThirst.UseThirst) { hungerThirst.ReduceThirst(_reduceAmount); Destroy(gameObject); } }
private void Awake() { hungerThirst = FindObjectOfType <HungerThirst>(); RefreshPlayerHealth(); RefreshHunger(); RefreshThirst(); //fps animations shit toolBelt = FindObjectOfType <ToolBelt>(); }
// Start is called before the first frame update void Start() { playerManager = FindObjectOfType <PlayerManager>(); hungerThirst = FindObjectOfType <HungerThirst>(); weaponChange = FindObjectOfType <WeaponChange>(); database = FindObjectOfType <ItemDatabase>(); inventory = FindObjectOfType <Inventory>(); usingSounds = FindObjectOfType <UsingSounds>(); groundPlacementManager = FindObjectOfType <GroundPlacementManager>(); selectorImage = toolBeltSlots[selectedItem].transform.GetChild(2).GetComponent <Image>(); selectorImage.enabled = true; }
void Start() { wellbeing = GetComponent <HungerThirst>(); player = GameObject.Find("Player"); }
// Start is called before the first frame update void Start() { rb2d = GetComponent <Rigidbody2D>(); PlayerHunger = GameObject.Find("HUD").GetComponent <HungerThirst>(); Stamina = 100f; }