예제 #1
0
    public void UnEquipItem(GameObject item)
    {
        ItemObjectMsg msg = new ItemObjectMsg();

        msg.item = item;

        m_client.Send(SendUnEquipItemMsg, msg);
    }
예제 #2
0
    public void TFTrue(GameObject item)
    {
        ItemObjectMsg msg = new ItemObjectMsg();

        msg.item = item;

        m_client.Send(TFTruemsg, msg);
    }
예제 #3
0
    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);
    }
예제 #4
0
    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);
        }
    }
예제 #5
0
    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);
    }