void AlienIsInside(int xIdx, int yIdx, GameObject pAlien) { //Ag.LogIntense (5, true); //Ag.LogString (mName.LogWith ("Wagu") + " Alien Came .. It's Inside .......__________=================================="); Vector3 tarVect = mTileObj.GetCenter(xIdx, yIdx); tarVect = tarVect.AppliedDist(muiOption.scrlVert.Value, muiWagu.mContDist); GameObject curObj = tarVect.GetNearestFrom(null, dicCell); CuCell curCll = curObj.CellCs(); if (!pAlien.CellCs().SameKindOf(curObj)) { return; } if (curCll.muiSortOrStuck.HasValue && curCll.muiSortOrStuck.Value) { return; } //Ag.LogString (mName.LogWith ("Wagu") + " Set Alien & Alien Target "); mAlien = pAlien; if (mAlienTarget == curObj) { return; } if (mAlienTarget != null) { mAlienTarget.CellCs().Released(); } mAlienTarget = curObj; mAlienTarget.CellCs().Selected("Alien"); }
public void InsertAt(GameObject iObj) { // iObj is Alien Ag.LogIntenseWord(" Insert At " + gameObject.name + " With : " + iObj.name); //mPrevGobj.CellCs ().ShowMySortInfo (); //GameObject pre4debug = mPrevGobj; Pstn.AmIAnimating = true; CuCell iObjCs = iObj.CellCs(); if (mPrevGobj == null) { iObjCs.mSortNum = 0; } else { mPrevGobj.CellCs().mNextGobj = iObj; // Replace my position.. iObjCs.mSortNum = mSortNum; } iObjCs.mPrevGobj = mPrevGobj; // it can be null. iObjCs.mNextGobj = gameObject; // myself.. mPrevGobj = iObj; if (mPrevGobj == null) { RearrangeSortNum(iObj); } else { RearrangeSortNum(mPrevGobj); } }
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); }
void AlienSwitchProcess() // Called from Mouse Up. { if (mAlien == null || mAlienTarget == null) { return; } Ag.LogIntenseWord(" UITileManager :: AlienSwitchProcess "); CuCell aliCll = mAlien.CellCs(); CuCell curCll = mAlienTarget.CellCs(); switch (muiOption.mMethodBtwWagu) { case "SWAP": //(" UITileManager :: AlienSwitchProcess " + mAlienTarget.name.LogWith("AlienTarget")).HtLog(); aliCll.mSwapGobj = mAlienTarget; curCll.SwapSortInfoWith(mAlien); curCll.Pstn.SwapCurposiAndSetTargetWith(aliCll.Pstn); dicCell.Remove(mAlienTarget.name); break; case "INSERT": mAlienTarget.CellCs().InsertAt(mAlien); break; } muiSelectedObj = mAlien; dicCell.Add(mAlien.name, mAlien); aliCll.mAlienArrived = true; ArrangeCells(); if (mAlien.CellCs().dlgtAlien != null) { mAlien.CellCs().dlgtAlien(); } mAlien = null; EventSetAlienToTouchManager(null); ReleaseProcess(); //SetState (UiState.SELECTED); }
public void SwapSortInfoWith(GameObject pT) // switch with Alien .. { ShowMySortInfo(); pT.CellCs().ShowMySortInfo(); CuCell cll = pT.CellCs(); Ag.Swap <GameObject> (ref mPrevGobj, ref cll.mPrevGobj); Ag.Swap <GameObject> (ref mNextGobj, ref cll.mNextGobj); Ag.Swap <int> (ref mSortNum, ref cll.mSortNum); // Set Next / Prev Objects ... MyPrevIs(mPrevGobj); MyNextIs(mNextGobj); cll.MyPrevIs(cll.mPrevGobj); cll.MyNextIs(cll.mNextGobj); //" !!! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ magic ".HtLog (); ShowMySortInfo(); pT.CellCs().ShowMySortInfo(); }
// _////////////////////////////////////////////////_ _///////////////////////_ _____ 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; }