Beispiel #1
0
    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();
    }
Beispiel #2
0
    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 DamageOverTime()
 {
     targetHealth.TakeDamage(damage, spellData.ownerID(), charMan);
     timestamp = Time.time + interval;
 }