示例#1
0
 public void moveGotibySelection(int number, int gotiNumber)
 {
     for (int i = 0; i < this.TurnValue.Count; i++)
     {
         int num = int.Parse(this.TurnValue[i]);
         if (number == num)
         {
             this.TurnValue.Remove(i);
             GotiScript obj = this.getGotiByNumber(gotiNumber);
             if (obj != null)
             {
                 if (obj.isLock && (number == 6 || number == 1))
                 {
                     number     = 1;
                     obj.isLock = false;
                     obj.moveGoti(obj.currentPosition, 0);
                 }
                 else
                 {
                     obj.moveGoti(obj.currentPosition, obj.currentPosition + number);
                 }
             }
             break;
         }
     }
 }
示例#2
0
        public bool MoveGotiByAI(int num)
        {
            if (num == 6 || num == 1)
            {
                if (this.openLockGoti(num))
                {
                    Debug.Log("Open Goti " + num);
                    return(true);
                }
                Debug.Log("Open not Goti " + num);
            }

            for (int j = 0; j < goti.Length; j++)
            {
                GotiScript obj = goti[j].GetComponent <GotiScript>();
                if (obj != null && (!obj.isLock) && (obj.currentPosition + num) <= GotiScript.LIMIT)
                {
                    Debug.Log("Open Other Goti " + num);
                    obj.moveGoti(obj.currentPosition, obj.currentPosition + num);
                    return(true);
                }
            }


            return(false);
        }
示例#3
0
        public void readyGoti(int gotiNumber, JSONNode steps)
        {
            GotiScript obj = this.getGotiByNumber(gotiNumber);

            if (obj != null)
            {
                obj.readyGoti(steps);
            }
        }
示例#4
0
        public void WinGoti(int gotiNumber)
        {
            GotiScript obj = this.getGotiByNumber(gotiNumber);

            if (obj != null)
            {
                obj.gotiWin();
            }
        }
示例#5
0
        public void MoveGoti(int gotiNumber, int from, int to)
        {
            GotiScript obj = this.getGotiByNumber(gotiNumber);

            if (obj != null)
            {
                obj.moveGoti(from, to);
            }
            LudoDelegate.stopAnimation();
        }
示例#6
0
 public GotiScript getLockGoti()
 {
     for (int j = 0; j < goti.Length; j++)
     {
         GotiScript obj = goti[j].GetComponent <GotiScript>();
         if (obj.isLock)
         {
             return(obj);
         }
     }
     return(null);
 }
示例#7
0
        public bool openLockGoti(int num)
        {
            GotiScript obj = this.getLockGoti();

            if (obj != null)
            {
                obj.isLock = false;
                obj.moveGoti(obj.currentPosition, 0);
                return(true);
            }
            return(false);
        }
示例#8
0
        public int getNumberOfLockGoti()
        {
            int count = 0;

            for (int j = 0; j < goti.Length; j++)
            {
                GotiScript obj = goti[j].GetComponent <GotiScript>();
                if (obj.isLock)
                {
                    count++;
                }
            }
            return(count);
        }
示例#9
0
        void MovePanel(JSONNode TurnValue)
        {
            int Position = GotiScript.getGotiPosition(transform.gameObject);

            switch (Position)
            {
            case GotiScript.LEFT:
                if (TurnValue.Count == 2)
                {
                    Panel.transform.localPosition = new Vector3(34.0f, Panel.transform.localPosition.y, 0.0f);
                }
                else
                {
                    Panel.transform.localPosition = new Vector3(78.0f, Panel.transform.localPosition.y, 0.0f);
                }
                break;

            case GotiScript.RIGHT:
                if (TurnValue.Count == 2)
                {
                    Panel.transform.localPosition = new Vector3(-34.0f, Panel.transform.localPosition.y, 0.0f);
                }
                else
                {
                    Panel.transform.localPosition = new Vector3(-78.0f, Panel.transform.localPosition.y, 0.0f);
                }
                break;

            case GotiScript.TOP:
                Panel.transform.localPosition = new Vector3(0.0f, Panel.transform.localPosition.y, 0.0f);
                break;

            case GotiScript.BOTTOM:
                Panel.transform.localPosition = new Vector3(0.0f, Panel.transform.localPosition.y, 0.0f);
                break;

            default:
                Panel.transform.localPosition = new Vector3(0.0f, Panel.transform.localPosition.y, 0.0f);
                break;
            }
        }