public void UnEquipItem(GameObject item) { ItemObjectMsg msg = new ItemObjectMsg(); msg.item = item; m_client.Send(SendUnEquipItemMsg, msg); }
public void TFTrue(GameObject item) { ItemObjectMsg msg = new ItemObjectMsg(); msg.item = item; m_client.Send(TFTruemsg, msg); }
void OnClientThrowItem(NetworkMessage recvmsg) { ItemObjectMsg msg = recvmsg.ReadMessage <ItemObjectMsg>(); Item item = msg.item.GetComponent <Item>(); GameObject owner = msg.owner; item.OnField = true; item.transform.SetPositionAndRotation(owner.transform.position + owner.transform.forward + Vector3.up, Quaternion.identity); }
public void SendThrowItemMsg(GameObject item, GameObject owner) { ItemObjectMsg msg = new ItemObjectMsg(); msg.item = item; msg.owner = owner; if (m_client.isConnected) { m_client.Send(ThrowItemMsg, msg); } }
void OnClientPickUpItem(NetworkMessage recvmsg) { ItemObjectMsg msg = recvmsg.ReadMessage <ItemObjectMsg>(); Item item = msg.item.GetComponent <Item>(); GameObject owner = msg.owner; item.Owner = owner; Transform[] children = owner.GetComponentsInChildren <Transform>(); string equipTag = item.getEquipTag(); foreach (Transform child in children) { if (child.CompareTag(equipTag)) { item.setEquipPoint(child); } } item.OnField = false; item.gameObject.transform.SetPositionAndRotation(transform.position + Vector3.down * 5f, Quaternion.identity); }