Ejemplo n.º 1
0
    //-------------------------------------------------------------------------------//
    void MoveSend()
    {
        Vector3 pos      = transform.position;
        float   distance = Vector3.Distance(m_prevPos, pos);

        float area = (float)((m_inSpace) ? (int)NetworkOrderController.AreaInfo.AREA_SPACE : (int)NetworkOrderController.AreaInfo.AREA_ROBOT);

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

        NetworkManager.Instance().SendMoveMessage(
            JSONMessageTool.ToJsonMove(
                m_userName,
                pos.x, pos.y,
                area, // :: Area 선택해서 날림
                m_skletonAnimation.skeleton.flipX,
                sendPos));
        m_lastSendTime = Time.deltaTime;
    }
Ejemplo n.º 2
0
    //-------------------------------------------------------------------------------------//
    // Use this for initialization

    void Start()
    {
        m_leftStart   = m_Left.transform.position;
        m_centerStart = m_Center.transform.position;
        m_rightStart  = m_Right.transform.position;


        m_sprLeft   = m_Left.GetComponent <SkeletonGraphic>();
        m_sprCenter = m_Center.GetComponent <SkeletonGraphic>();
        m_sprRight  = m_Right.GetComponent <SkeletonGraphic>();

        m_Center.transform.SetAsFirstSibling();
        m_Left.transform.SetSiblingIndex(1);
        m_Right.transform.SetSiblingIndex(2);

        UIUpdate();

        Vector3 p = NetworkManager.Instance().m_playerStartPosition.transform.position;

        NetworkManager.Instance().SendMoveMessage(JSONMessageTool.ToJsonMove(
                                                      GameManager.Instance().PLAYER.USER_NAME + "_robo",
                                                      p.x, p.y, 0, true, Vector3.zero));
        //  SoundManager.Instance().PlayBGM(1);
    }