/// <summary> /// Updates the GUI with appropriate data when called /// </summary> public void UpdateUI() { plyr1health.text = Player1Health.ToString(); plyr2health.text = Player2Health.ToString(); totalxp.text = TotalExperience.ToString(); currentGP.text = CurrentGP.ToString(); }
// Use this for initialization void Start() { rb2d = gameObject.GetComponent <Rigidbody2D>(); anim = gameObject.GetComponent <Animator>(); sounds = gameObject.GetComponents <AudioSource>(); playerHealth = 100f; playerMadness = 0f; item = "null"; pauseGame = false; maxSpeed = .5f; speed = 50; dead = false; shotgun = false; latestBuy = 0; bulletDamage = 150f; damageUpgrade = 0f; elixir = false; blink = false; explosive = false; call = true; revive = false; canPause = false; colliderCount = 0f; speedCount = 0f; reviving = false; lockTransform = false; bossDead = false; canMove = true; movementDirection = new string[] { "left", "right", "up", "down" }; ItemUI = GameObject.Find("Item"); reviveImage = ItemUI.transform.Find("ReviveUI").gameObject; elixirImage = ItemUI.transform.Find("ElixirUI").gameObject; eyeImage = ItemUI.transform.Find("EyeUI").gameObject; explosiveImage = ItemUI.transform.Find("ExplosiveUI").gameObject; HealthPercentage = GameObject.Find("Player1Health").transform; healthscript = HealthPercentage.GetComponent <Player1Health>(); MadnessPercentage = GameObject.Find("Player1Madness").transform; madnessscript = MadnessPercentage.GetComponent <Player1Madness>(); CameraFollow = GameObject.Find("Main Camera").transform; camerascript = CameraFollow.GetComponent <CameraFollow>(); AmmoCount = GameObject.Find("AmmoCount").transform; ammoScript = AmmoCount.GetComponent <Ammo>(); moveForward = GameObject.Find("MoveForward"); GoImage = moveForward.GetComponent <Image>(); StatsUI = GameObject.Find("SpeedAndDamage"); speedUI = StatsUI.transform.Find("Speed").gameObject; damageUI = StatsUI.transform.Find("Damage").gameObject; StartCoroutine(OpenGamePlayPanel()); }
void Start() { GameObject player1Object = GameObject.FindGameObjectWithTag("Player1"); if (player1Object != null) { player1Health = player1Object.GetComponent <Player1Health>(); } if (player1Health == null) { Debug.Log("Cannot find 'Player2Health' script"); } }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody> (); isOkayToBlock = true; axe = transform.Find("_Axe").Find("axe").gameObject; axe.SetActive(false); bow = transform.Find("_Bow").Find("strangeBow").gameObject; bow.SetActive(false); anim = axe.GetComponent <Animation> (); swingingRightNow = false; shootingRightNow = false; playerHealth = transform.GetComponent <Player1Health> (); }