Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
 private void StartMove(MoveNormal nor)
 {
     canControll = false;
     if (mUINumberManager.Move(nor))
     {
         StartCoroutine(Moving());
     }
     else
     {
         canControll = true;
     }
 }
Esempio n. 4
0
 private void StartMove(MoveNormal nor)
 {
     canControll = false;
     //Debug.Log("Move "+nor.ToString());
     if (mUINumberManager.Move(nor))
     {
         StartCoroutine(Moving());
     }
     else
     {
         canControll = true;
     }
 }
Esempio n. 5
0
 private void StartMove(MoveNormal nor)
 {
     canControll = false;
     //Debug.Log("Move "+nor.ToString());
     if (mUINumberManager.Move(nor))
         StartCoroutine(Moving());
     else
         canControll = true;
 }
Esempio n. 6
0
 public NumberComparer(MoveNormal nor)
 {
     CurNor = nor;
 }