Esempio n. 1
0
    void SwapBetweenFrames(GameObject pHome, GameObject pDest)
    {
        Ag.LogIntenseWord("SwapBetweenFrames  " + pHome.name + "   " + pDest.name);

        CuCell alien = pHome.CellCs();
        CuCell targt = pDest.CellCs();

        alien.Pstn.SwapCurposiAndSetTargetWith(targt.Pstn);

        FrameHome.RemoveCellWith(pHome.name, pDest);
        FrameDest.RemoveCellWith(pDest.name, pHome);

        Ag.Swap <int> (ref alien.mSortNum, ref targt.mSortNum);
        Ag.Swap <GameObject> (ref alien.mPrevGobj, ref targt.mPrevGobj);
        Ag.Swap <GameObject> (ref alien.mNextGobj, ref targt.mNextGobj);
    }
Esempio n. 2
0
    //  _////////////////////////////////////////////////_    _///////////////////////_    _____  Switch  _____  Combination  _____
    public void InsertRemove(Vector3 pV)
    { // called from TouchUp ..
        if (FrameHome == null || FrameDest == null || Liaison == null)
        {
            SetNull();
            return;
        }

        Ag.LogIntenseWord("[ CuLiaison :: InsertRemove ] { 84 }  >>>  Frame HOme / Dest :: " + FrameHome.mName + " / " + FrameDest.mName);
        //Ag.LogDouble ("    Liaison >> " + Liaison.name + EmptyCellIdx.LogWith ("EmptyCellIdx")); // + " , " + FrameDest.mSwitchObj);

        string homeSelect = HomeSel != null ? HomeSel.name : " __ NULL __ ";
        string destSwitch = DestSwt != null ? DestSwt.name : " __ NULL __ ";

        Ag.LogDouble("     [ CuLiaison :: InsertRemove ] { 90 }  " + homeSelect.LogWith("Home Select") + destSwitch.LogWith("Dest Switch"));

        if (DestSwt == null)
        {
            FrameHome.RemoveCellWith(Liaison.name);
            FrameDest.AddCellAt(EmptyCellIdx, Liaison);
            SetNull();
            return;
        }
        "  >>>     ".HtLog();

        if (HomeSel == null)
        {
            SetNull();
            return;
        }

        SwapBetweenFrames(HomeSel, DestSwt);

        /*  if (FrameDest != null)
         *  FrameDest.LogPositions ();  // debug
         * if (FrameHome != null)
         *  FrameHome.LogPositions ();  // */
        SetNull();
    }
Esempio n. 3
0
    //  _////////////////////////////////////////////////_    _///////////////////////_    _____  Switch  _____  Btw Frames  _____
    void LiaisonSwitch()
    { // Called from Mouse Up.   UITileManager :: AlienSwitchProcess
        //if (mAlien == null || mAlienTarget == null)            return;
        Ag.LogIntenseWord(" CuLiaison :: LiaisonSwitch ");

        CuCell     alien  = Liaison.CellCs();
        CuCell     targt  = FrameDest.mSwitchObj.CellCs();
        GameObject Target = FrameDest.mSwitchObj;

        if (!alien.SameKindOf(Target))
        {
            FrameHome = FrameDest = null;
            Liaison   = null;
            return;
        }

        switch ("SWAP")
        {
        case "SWAP":

            FrameHome.RemoveCellWith(Liaison.name, Target);
            FrameDest.RemoveCellWith(Target.name, Liaison);

            Ag.Swap <int> (ref alien.mSortNum, ref targt.mSortNum);
            Ag.Swap <GameObject> (ref alien.mPrevGobj, ref targt.mPrevGobj);
            Ag.Swap <GameObject> (ref alien.mNextGobj, ref targt.mNextGobj);

            alien.Pstn.SwapCurposiAndSetTargetWith(targt.Pstn);
            break;
            //case "INSERT":            //Target.CellCs ().InsertAt (mAlien);
        }

        FrameDest.ArrangeCells();
        FrameHome.ArrangeCells();

        FrameHome = FrameDest = null;
        Liaison   = null;
    }