public void PutBomb(Player player, BombType bombType, Vector3 position) { if (Instance == null) CreateInstance(); if (Instance != null) { MessageBomb msg = new MessageBomb(); msg.position = position; msg.netId = player.PlayerData.NetId.Value; NetworkManager.singleton.client.Send(MessageType.PutBomb, msg); } }
// private Bomb CreateNewBomb(BombType bombType) // { // GameObject prefab = Resources.Load(BOMB_PREFAB, typeof(GameObject)) as GameObject; // if (prefab != null) // { // GameObject obj = Instantiate(prefab); // obj.transform.parent = BombMgr.Instance.transform; // // mBombSync.CreateNewBomb(obj); // // Bomb bomb = obj.GetComponent<Bomb>(); // if (bomb != null) // { // mBombList.Add(bomb); // return bomb; // } // } // // return null; // } public void RemoveBomb(Bomb bomb) { if (Instance == null) CreateInstance(); if (Instance != null) { MessageBomb msg = new MessageBomb(); msg.netId = GetNetId(bomb.gameObject).Value; NetworkManager.singleton.client.Send(MessageType.RemoveBomb, msg); } }