private void PickByMe() { var whoAttr = ObjectManager.objectManager.GetMyAttr(); var cg = CGPlayerCmd.CreateBuilder(); cg.Cmd = "Pick"; var pickAction = PickItemAction.CreateBuilder(); pickAction.Id = netView.GetServerID(); pickAction.ItemId = itemData.ObjectId; pickAction.ItemNum = num; pickAction.Who = whoAttr.GetComponent <KBEngine.KBNetworkView>().GetServerID(); cg.PickAction = pickAction.Build(); NetworkUtil.Broadcast(cg); }
IEnumerator PickItem(GameObject who) { PickItemFromNetwork(who); var cg = CGPlayerCmd.CreateBuilder(); cg.Cmd = "Pick"; var pickAction = PickItemAction.CreateBuilder(); pickAction.Id = netView.GetServerID(); pickAction.ItemId = itemData.ObjectId; pickAction.ItemNum = num; pickAction.Who = who.GetComponent <KBEngine.KBNetworkView>().GetServerID(); cg.PickAction = pickAction.Build(); NetworkUtil.Broadcast(cg); NetworkUtil.RemoveEntityToNetwork(netView); yield break; }