Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void OnCollisionEnter2D(Collision2D collision)
- {
- CmdChargeWave(collision.transform.position, NetID);
- }
- [Command]
- void CmdChargeWave(Vector3 HitPlace, int ownerid)
- {
- GameObject bullet = (GameObject)Instantiate(SnareWave, HitPlace, Quaternion.identity);
- bullet.transform.GetChild(0).GetComponent<SnareWave>().OwnerID = ownerid;
- NetworkServer.Spawn(bullet);
- }
- /////////////////////////////////
- SnareWave裡面
- [SyncVar]
- public int OwnerID = -1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement