示例#1
0
    void MoveSend()
    {
        Vector3 pos      = transform.position;
        float   distance = Vector3.Distance(m_prevPos, pos);

        m_prevPos = transform.position;

        Vector3 velocity = (transform.position - m_prevPos) / Time.deltaTime;
        Vector3 sendPos  = m_prevPos + (velocity * (Time.deltaTime - m_lastSendTime));

        NetworkManager.Instance().SendEnemyMoveMessage(
            JSONMessageTool.ToJsonEnemyMove(m_name, sendPos.x, sendPos.y, 0, true, Vector3.zero));
    }
示例#2
0
    protected void MoveSend()
    {
        Vector3 pos      = transform.position;
        float   distance = Vector3.Distance(m_prevPos, pos);

        m_prevPos = transform.position;

        Vector3 velocity = (transform.position - m_prevPos) / Time.deltaTime;
        Vector3 sendPos  = m_prevPos + (velocity * (Time.deltaTime - m_lastSendTime));

        NetworkManager.Instance().SendEnemyMoveMessage(
            JSONMessageTool.ToJsonEnemyMove(m_name,
                                            pos.x, pos.y, 0,
                                            m_skeletonAnimation.skeleton.flipX,
                                            sendPos));
        m_lastSendTime = Time.deltaTime;
    }
    void MoveSend()
    {
        if (m_isNetworkObject)
        {
            return;
        }
        Vector3 pos = transform.position;

        m_prevPos = transform.position;

        Vector3 velocity = (transform.position - m_prevPos) / Time.deltaTime;
        Vector3 sendPos  = m_prevPos + (velocity * (Time.deltaTime - m_lastSendTime));

        NetworkManager.Instance().SendEnemyMoveMessage(
            JSONMessageTool.ToJsonEnemyMove(m_bulletName,
                                            pos.x, pos.y,
                                            transform.rotation.eulerAngles.z,
                                            m_filp,
                                            sendPos,
                                            (m_alive) ? null : "Delete"));
    }
    // Network Move Message Send ------------------------------------!
    // 조종하는 녀석만 이걸 실행한다.
    void MoveSend()
    {
        Vector3 pos      = transform.position;
        float   distance = Vector3.Distance(m_prevPos, pos);

        m_prevPos = transform.position;

        Vector3 velocity = (transform.position - m_prevPos) / Time.deltaTime;
        Vector3 sendPos  = m_prevPos + (velocity * (Time.deltaTime - m_lastSendTime));

        //dirPos.Normalize();


        NetworkManager.Instance().SendEnemyMoveMessage(
            JSONMessageTool.ToJsonEnemyMove(m_movePlayerName + "_robot",
                                            pos.x, pos.y,
                                            (int)NetworkOrderController.AreaInfo.AREA_SPACE,
                                            m_skletonAnimation.skeleton.flipX,
                                            sendPos));
        m_lastSendTime = Time.deltaTime;
    }
示例#5
0
    void ChargeMoveSend()
    {
        if (string.IsNullOrEmpty(m_userName) || string.IsNullOrEmpty(NetworkOrderController.ORDER_NAME))
        {
            return;
        }

        Vector3 pos      = m_chargePad.gameObject.transform.position;
        float   distance = Vector3.Distance(m_prevChargePos, pos);

        Vector3 velocity = (m_chargePad.transform.position - m_prevChargePos) / Time.deltaTime;
        Vector3 sendPos  = m_prevChargePos + (velocity * (Time.deltaTime - m_lastSendTime_charge));

        NetworkManager.Instance().SendEnemyMoveMessage(
            JSONMessageTool.ToJsonEnemyMove(
                NetworkOrderController.ORDER_NAME + "_pad",
                pos.x, pos.y,
                0, // :: Area 선택해서 날림
                false,
                new Vector3(pos.x, pos.y, -1.0f)));
        m_lastSendTime_charge = Time.deltaTime;
    }