Advertisement
Guest User

Untitled

a guest
May 27th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1.  
  2.  
  3. private void OnCollisionEnter2D(Collision2D collision)
  4. {
  5. CmdChargeWave(collision.transform.position, NetID);
  6. }
  7.  
  8. [Command]
  9. void CmdChargeWave(Vector3 HitPlace, int ownerid)
  10. {
  11.  
  12. GameObject bullet = (GameObject)Instantiate(SnareWave, HitPlace, Quaternion.identity);
  13. bullet.transform.GetChild(0).GetComponent<SnareWave>().OwnerID = ownerid;
  14. NetworkServer.Spawn(bullet);
  15.  
  16. }
  17.  
  18.  
  19. /////////////////////////////////
  20.  
  21. SnareWave裡面
  22.  
  23. [SyncVar]
  24. public int OwnerID = -1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement