// Update is called once per frame void Update() { usernameText.text = m_Player.GetUsername(); usernameText.color = m_Player.m_Color; healthBarFill.localScale = new Vector3(1, m_Player.GetHealthAmount() / m_Player.maxHealth, 1); healthBarFill.GetComponent <Image>().color = m_Player.m_Color; }
void CheckHit(RaycastHit hit) { CmdHitTarget(hit.transform.name, currentWeapon.damage, isServer); if (hit.collider.tag == "Player") { hit.transform.GetComponent <CS_Player>().DdTakeDamage(currentWeapon.damage, m_Player.GetUsername(), m_Player.m_Color); } if (hit.collider.tag == "Bot") { hit.transform.GetComponent <CS_Bot>().DdTakeDamage(transform.name, currentWeapon.damage); } if (hit.collider.tag == "Player" || hit.collider.tag == "Bot") { m_Setup.m_Canvas.HitEffect(); } hitPos = hit.point; hitNormal = hit.normal; }