public void moveGoti(int current, int next) { if (next >= 0) { try { if (!this.isMoving) { StartCoroutine(moveGotiSteps(next)); } } catch (System.Exception ex) { Debug.Log("moveGoti Exception " + ex.Message); } } if (next == -1) { transform.position = InitialPositionVector; transform.localScale = new Vector3(1f, 1f, 1f); currentPosition = -1; isLock = true; LudoDelegate.closeGoti(); this.CellNumber = -1; } LudoDelegate.refreshCell(); }
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; }
public void TapGotiAction() { if (this.Enable) { if (PlayerPrefs.GetInt(LudoTags.GAME_TYPE) != LudoTags.OFFLINE) { if (this.playerID.Equals(PlayerPrefs.GetString(GetPlayerDetailsTags.PLAYER_ID))) { gotiAction(); } } else { gotiAction(); } } else { Debug.Log("is not enable"); } LudoDelegate.refreshCell(); }