public bool MoveTo(MoveNormal nor, UINumber forwardNum) { MergeNumber = 0; switch (nor) { case MoveNormal.Up: moveToUP(forwardNum); break; case MoveNormal.Down: moveToDown(forwardNum); break; case MoveNormal.Left: moveToLeft(forwardNum); break; case MoveNormal.Right: moveToRight(forwardNum); break; } if (GotoPos.Equals(CurPos)) { return(false); } StartCoroutine(Moving(forwardNum)); Father.RemoveEmptyPos(GotoPos); Father.AddEmptyPos(CurPos); return(true); }
public bool Move(MoveNormal nor) { bool ismove = false; CurMergeScore = 0; CurMergeMaxNumber = 0; OnMapNumbers.Sort(new NumberComparer(nor)); //foreach(UINumber num in OnMapNumbers) //{ // Debug.Log(num.CurPos.ToString()); //} int count = OnMapNumbers.Count; for (int i = 0; i < count; i++) { if (i != 0) { ismove = ismove | OnMapNumbers[i].MoveTo(nor, OnMapNumbers[i - 1]); } else { ismove = ismove | OnMapNumbers[i].MoveTo(nor, null); } } return(ismove); }
private void StartMove(MoveNormal nor) { canControll = false; if (mUINumberManager.Move(nor)) { StartCoroutine(Moving()); } else { canControll = true; } }
private void StartMove(MoveNormal nor) { canControll = false; //Debug.Log("Move "+nor.ToString()); if (mUINumberManager.Move(nor)) { StartCoroutine(Moving()); } else { canControll = true; } }
private void StartMove(MoveNormal nor) { canControll = false; //Debug.Log("Move "+nor.ToString()); if (mUINumberManager.Move(nor)) StartCoroutine(Moving()); else canControll = true; }
public NumberComparer(MoveNormal nor) { CurNor = nor; }