Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }