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); }
// _////////////////////////////////////////////////_ _///////////////////////_ _____ 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; }