mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
can't reproduce
This commit is contained in:
parent
a9cbcf696e
commit
1f61f9544a
@ -60,16 +60,25 @@ void CmdFire()
|
|||||||
{
|
{
|
||||||
GameObject projectile = Instantiate(projectilePrefab, projectileMount.position, projectileMount.rotation);
|
GameObject projectile = Instantiate(projectilePrefab, projectileMount.position, projectileMount.rotation);
|
||||||
NetworkServer.Spawn(projectile);
|
NetworkServer.Spawn(projectile);
|
||||||
RpcOnFire();
|
// RpcOnFire(connectionToClient);
|
||||||
|
TargetDoMagic(connectionToClient, 42);
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is called on the tank that fired for all observers
|
// this is called on the tank that fired for all observers
|
||||||
[ClientRpc]
|
[TargetRpc]
|
||||||
void RpcOnFire()
|
void RpcOnFire(NetworkConnectionToClient conn)
|
||||||
{
|
{
|
||||||
|
Debug.Log($"RpcOnFire with conn={conn}");
|
||||||
animator.SetTrigger("Shoot");
|
animator.SetTrigger("Shoot");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TargetRpc]
|
||||||
|
public void TargetDoMagic(NetworkConnectionToClient target, int damage)
|
||||||
|
{
|
||||||
|
// This will appear on the opponent's client, not the attacking player's
|
||||||
|
Debug.Log($"Magic Damage = {damage}");
|
||||||
|
}
|
||||||
|
|
||||||
[ServerCallback]
|
[ServerCallback]
|
||||||
void OnTriggerEnter(Collider other)
|
void OnTriggerEnter(Collider other)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user