ExplosionHit() public static method

public static ExplosionHit ( Vector3 position, Quaternion rotation ) : void
position Vector3
rotation Quaternion
return void
Beispiel #1
0
    void Collide(Transform trans, Vector3 point, Vector3 normal)
    {
        bool playerWasHit = DoDamageTo(trans, point);

        if (playerWasHit)
        {
            ScreenSpaceDebug.AddMessage("HIT", point, Color.green);
        }
        if (recoil > 0)
        {
            DoRecoil(point, playerWasHit);
        }

        if (playerWasHit)
        {
            EffectsScript.ExplosionHit(point, Quaternion.LookRotation(normal));
        }
        else
        {
            EffectsScript.Explosion(point, Quaternion.LookRotation(normal));
        }

        dead = true;
        Destroy(GetComponent <Rigidbody>());
        GetComponent <Renderer>().enabled = false;
    }
// ReSharper disable once UnusedMember.Local
    protected void OthersReceiveHit(int damage, Vector3 point, uLink.NetworkViewID instigatorPresenceViewID)
    {
		EffectsScript.ExplosionHit( point, Quaternion.LookRotation( Vector3.up ) );
        if (networkView.isMine)
        {
            DoDamageOwner(damage, point,
                PlayerPresence.TryGetPlayerPresenceFromNetworkViewID(instigatorPresenceViewID));
        }
    }