Example #1
0
        IEnumerator moveGotiSteps(int next)
        {
            this.isMoving = true;
            int i = currentPosition + 1;

            while (i <= next)
            {
                int nextPos = 0;
                int Object  = 0;
                if (i >= 51)
                {
                    nextPos = homeEntryPoint + i - 51;
                    Object  = nextPos;
                }
                else
                {
                    nextPos = initialPosition + i;
                    Object  = nextPos > 52 ? nextPos - 52 : nextPos;
                }


                GameObject pos = GameObject.Find("" + Object);
                transform.position = pos.transform.position;
                currentPosition    = i;
                this.CellNumber    = Object;
                LudoDelegate.refreshCell();
                LudoDelegate.playGotiSound();
                i++;
                yield return(new WaitForSeconds(0.2f));
            }
            if (next == GotiScript.LIMIT)
            {
                gotiWin();
            }
            Debug.Log(this.playerID + " ----" + this.index + " : " + next);
            checkSafePlace();
            if (PlayerPrefs.GetInt(LudoTags.GAME_TYPE) == LudoTags.OFFLINE)
            {
                LudoDelegate.movementComplete();
            }
            this.isMoving = false;
        }