Example #1
0
        void onMapClick(GameObject go, Vector2 mappos)
        {
            Vector2 pos2;

            if (RectTransformUtility.ScreenPointToLocalPointInRectangle(worldmap.instance.m_goMapcon.GetComponent <RectTransform>(), mappos, InterfaceMgr.ui_Camera_cam, out pos2))
            {
                pos2 = Quaternion.Inverse(mapRotation) * pos2;
                Vector3 pos = SceneCamera.getPosByMiniMap(pos2, mapScale);
                if (pos.x == Mathf.Infinity)
                {
                    return;
                }

                if (SelfRole.fsm.Autofighting)
                {
                    SelfRole.fsm.Stop();
                }
                SelfRole.moveto(pos, null);
            }


            //Vector3 offset = go.transform.position;


            //mappos.x = mappos.x - offset.x;
            //mappos.y = mappos.y - offset.y;
            //Vector3 pos = SceneCamera.getPosByMiniMap(mappos, mapScale);
            //if (pos.x == Mathf.Infinity)
            //    return;

            //SelfRole.moveto(pos, null);
        }
Example #2
0
        private void onMapClick(GameObject go, Vector2 mappos)
        {
            Vector2 vector;
            bool    flag = RectTransformUtility.ScreenPointToLocalPointInRectangle(worldmap.instance.m_goMapcon.GetComponent <RectTransform>(), mappos, InterfaceMgr.ui_Camera_cam, out vector);

            if (flag)
            {
                vector = Quaternion.Inverse(this.mapRotation) * vector;
                Vector3 posByMiniMap = SceneCamera.getPosByMiniMap(vector, this.mapScale, 20f);
                bool    flag2        = posByMiniMap.x == float.PositiveInfinity;
                if (!flag2)
                {
                    bool autofighting = SelfRole.fsm.Autofighting;
                    if (autofighting)
                    {
                        SelfRole.fsm.Stop();
                    }
                    SelfRole.moveto(posByMiniMap, null, false, 0.3f, true);
                }
            }
        }