Ejemplo n.º 1
0
        // 调整最初的状态, B 和 C 交换一下
        public void adjustInitState()
        {
            int srcIdx  = 2;
            int destIdx = 3;

            MazeRoom srcMazeRoom  = m_mazeRoomList[srcIdx];
            MazeRoom destMazeRoom = m_mazeRoomList[destIdx];

            destMazeRoom.iTag = srcMazeRoom.iTag;
            Vector3 origPos = destMazeRoom.origPos;

            destMazeRoom.origPos = srcMazeRoom.origPos;
            srcMazeRoom.iTag     = destIdx;
            srcMazeRoom.origPos  = origPos;

            Ctx.m_instance.m_maze.mazeData.roomInfo.updateRoomList();

            srcMazeRoom.mazeIOControl.disableDragTitle();
            destMazeRoom.mazeIOControl.disableDragTitle();

            srcMazeRoom.mazeRoomTrackAniControl.goToDestPos();
            destMazeRoom.mazeRoomTrackAniControl.goToDestPos();

            srcMazeRoom.mazeIOControl.enableDragTitle();
            destMazeRoom.mazeIOControl.enableDragTitle();
        }
Ejemplo n.º 2
0
 public int getRoomIdx(MazeRoom mazeRoom)
 {
     if (mazeRoom.selfGo.transform.localPosition.x <= m_trans.localPosition.x)     // 如果在左边
     {
         if (mazeRoom.selfGo.transform.localPosition.z >= m_trans.localPosition.z) // 如果在上面
         {
             return(3);
         }
         else
         {
             return(1);
         }
     }
     else                                                                          // 如果在右边
     {
         if (mazeRoom.selfGo.transform.localPosition.z >= m_trans.localPosition.z) // 如果在上面
         {
             return(2);
         }
         else
         {
             return(0);
         }
     }
 }
Ejemplo n.º 3
0
        public void initMazeRoomCount(int count_)
        {
            m_mazeRoomList.Clear();
            m_itemCount = count_;
            MazeRoom mazeRoom = null;
            string   path     = "";

            for (int idx = 0; idx < m_itemCount; ++idx)
            {
                if (Ctx.m_instance.m_maze.mazeData.bInFisrstScene())
                {
                    mazeRoom = new MazeRoom(idx);
                }
                else
                {
                    mazeRoom = new MazeRoomSecond(idx);
                }
                m_mazeRoomList.Add(mazeRoom);
                path            = string.Format("RootGo/Plane_{0}", idx);
                mazeRoom.selfGo = UtilApi.GoFindChildByPObjAndName(path);
                if (0 != idx && 4 != idx)
                {
                    mazeRoom.mazeIOControl.enableDrag();
                }
                mazeRoom.init();
            }

            path    = "RootGo/SplitGo";
            m_trans = UtilApi.GoFindChildByPObjAndName(path).transform;

            adjustInitState();
        }
Ejemplo n.º 4
0
        public void initMazeRoomCount(int count_)
        {
            m_mazeRoomList.Clear();
            m_itemCount = count_;
            MazeRoom mazeRoom = null;
            string path = "";
            for(int idx = 0; idx < m_itemCount; ++idx)
            {
                if (Ctx.m_instance.m_maze.mazeData.bInFisrstScene())
                {
                    mazeRoom = new MazeRoom(idx);
                }
                else
                {
                    mazeRoom = new MazeRoomSecond(idx);
                }
                m_mazeRoomList.Add(mazeRoom);
                path = string.Format("RootGo/Plane_{0}", idx);
                mazeRoom.selfGo = UtilApi.GoFindChildByPObjAndName(path);
                if (0 != idx && 4 != idx)
                {
                    mazeRoom.mazeIOControl.enableDrag();
                }
                mazeRoom.init();
            }

            path = "RootGo/SplitGo";
            m_trans = UtilApi.GoFindChildByPObjAndName(path).transform;

            adjustInitState();
        }
Ejemplo n.º 5
0
        static public int sortFixRoom(MazeRoom lh, MazeRoom rh)
        {
            if (lh.fixIdx < rh.fixIdx)
            {
                return(-1);
            }

            return(1);
        }
Ejemplo n.º 6
0
        static public int sortRoom(MazeRoom lh, MazeRoom rh)
        {
            if (lh.iTag < rh.iTag)
            {
                return(-1);
            }

            return(1);
        }
Ejemplo n.º 7
0
        // 拖放结束处理
        protected void onDragEnd()
        {
            int idx = Ctx.m_instance.m_maze.mazeData.roomInfo.getRoomIdx(m_mazeRoom);

            if (idx != m_mazeRoom.iTag && 0 != idx)
            {
                MazeRoom mazeRoom = Ctx.m_instance.m_maze.mazeData.roomInfo.getMazeRoom(idx);
                mazeRoom.iTag = m_mazeRoom.iTag;
                Vector3 origPos = mazeRoom.origPos;
                mazeRoom.origPos   = m_mazeRoom.origPos;
                m_mazeRoom.iTag    = idx;
                m_mazeRoom.origPos = origPos;

                Ctx.m_instance.m_maze.mazeData.roomInfo.updateRoomList();

                mazeRoom.mazeRoomTrackAniControl.moveToDestPos();
                m_mazeRoom.mazeRoomTrackAniControl.moveToDestPos();
            }
            else
            {
                m_mazeRoom.mazeRoomTrackAniControl.moveToDestPos();
            }
        }
Ejemplo n.º 8
0
        static public int sortFixRoom(MazeRoom lh, MazeRoom rh)
        {
            if (lh.fixIdx < rh.fixIdx)
            {
                return -1;
            }

            return 1;
        }
Ejemplo n.º 9
0
        static public int sortRoom(MazeRoom lh, MazeRoom rh)
        {
            if(lh.iTag < rh.iTag)
            {
                return -1;
            }

            return 1;
        }
Ejemplo n.º 10
0
 public int getRoomIdx(MazeRoom mazeRoom)
 {
     if (mazeRoom.selfGo.transform.localPosition.x <= m_trans.localPosition.x)     // 如果在左边
     {
         if (mazeRoom.selfGo.transform.localPosition.z >= m_trans.localPosition.z)    // 如果在上面
         {
             return 3;
         }
         else
         {
             return 1;
         }
     }
     else                // 如果在右边
     {
         if (mazeRoom.selfGo.transform.localPosition.z >= m_trans.localPosition.z)    // 如果在上面
         {
             return 2;
         }
         else
         {
             return 0;
         }
     }
 }
Ejemplo n.º 11
0
 public MazeIOControl(MazeRoom mazeRoom_)
 {
     m_mazeRoom = mazeRoom_;
 }
Ejemplo n.º 12
0
 public MazeIOControl(MazeRoom mazeRoom_)
 {
     m_mazeRoom = mazeRoom_;
 }