void FixedUpdate() { if (Physics.Raycast(transform.position, transform.forward, out hit, maxDistance, mask)) { collisionObj.transform.position = hit.point; target.position = hit.point; if (!collisionObj.isPlaying) { collisionObj.Play(); } if (hit.collider.CompareTag("Player")) { PhotonView m_photonView = hit.collider.GetComponent <PhotonView>(); if (m_photonView.isMine) { collisionObj.Emit(30); PlayerHealth_NET playerHealth = hit.collider.GetComponent <PlayerHealth_NET>(); playerHealth.TakeDamage(playerHealth.maxHealth, -1, null, origin, 10.0f); } } } else { collisionObj.Stop(); target.position = transform.position + transform.forward * maxDistance; } UpdateLinerenderPos(); }
void OnTriggerExit(Collider other) { PlayerHealth_NET player = other.GetComponent <PlayerHealth_NET>(); if (!playersOutsideCircle.Contains(player) && player.m_PhotonView.isMine) { playersOutsideCircle.Add(player); } }
void Awake() { playerShop = GetComponent <ShopScript>(); spellManager = GetComponent <SpellManager>(); _playerHealth = GetComponent <PlayerHealth_NET>(); _rigidbody = GetComponent <Rigidbody>(); anim = GetComponent <Animator>(); m_PhotonView = GetComponent <PhotonView>(); }
void OnTriggerEnter(Collider other) { PhotonView m_photonView = other.GetComponent <PhotonView>(); if (m_photonView.isMine) { PlayerHealth_NET playerHealth = other.GetComponent <PlayerHealth_NET>(); playerHealth.TakeDamage(playerHealth.maxHealth, -1, null); } }
void Awake() { teleportControl = GetComponent <TeleportToShop>(); audio = GetComponent <AudioSource>(); playerHealth = GetComponent <PlayerHealth_NET>(); charMananager = GetComponent <CharacterManager_NET>(); m_photonView = GetComponent <PhotonView>(); mousePos = GetComponent <MousePositionScript>(); playerAnim = GetComponent <Animator>(); anim = GetComponent <Animator>(); }
void Start() { canPullTarget = targetTransform.GetComponent <SpellManager>().m_photonView.isMine; if (canPullTarget) { targetRb = targetTransform.GetComponent <Rigidbody>(); charMan = targetTransform.GetComponent <CharacterManager_NET>(); targetHealth = targetTransform.GetComponent <PlayerHealth_NET>(); } Destroy(this.gameObject, duration); }