Exemplo n.º 1
0
        private void OnTouch(TouchEventParam obj)
        {
            Ray        ray = Camera.main.ScreenPointToRay(obj.GetTouch(0).position);
            RaycastHit hitInfo;

            if (Physics.Raycast(ray, out hitInfo))
            {
                if (PvpPlayerMgr.Instance.mainPlayer != null)
                {
                    Unit unit = PvpPlayerMgr.Instance.mainPlayer.unit;
                    if (unit != null)
                    {
                        unit.ReqMove(TSVector.FromUnitVector3(hitInfo.point));
                    }
                }
            }
        }
Exemplo n.º 2
0
    void Update()
    {
        TSVector  pos;
        TSVector  forward;
        Transform t;

        t = m_cHangPoint.GetHangPoint("HangPoint1", TSVector.FromUnitVector3(transform.position), TSVector.FromUnitVector3(transform.forward), out pos, out forward);

        if (t != null)
        {
            t.gameObject.AddChildToParent(go1, "HangPoint1Child", false);
        }
        else
        {
            go1.transform.position = pos.ToUnityVector3();
            go1.transform.forward  = forward.ToUnityVector3();
        }

        t = m_cHangPoint.GetHangPoint("HangPoint2", TSVector.FromUnitVector3(transform.position), TSVector.FromUnitVector3(transform.forward), out pos, out forward);
        if (t != null)
        {
            t.gameObject.AddChildToParent(go2, "HangPoint2Child", false);
        }
        else
        {
            go2.transform.position = pos.ToUnityVector3();
            go2.transform.forward  = forward.ToUnityVector3();
        }

        t = m_cHangPoint.GetHangPoint("HangPoint3", TSVector.FromUnitVector3(transform.position), TSVector.FromUnitVector3(transform.forward), out pos, out forward);
        if (t != null)
        {
            t.gameObject.AddChildToParent(go3, "HangPoint3Child", false);
        }
        else
        {
            go3.transform.position = pos.ToUnityVector3();
            go3.transform.forward  = forward.ToUnityVector3();
        }
    }