public void Initialize() { if (ListOfPlayerCharactor.Count == 0) { for (int i = 0; i < 4; i++) { ListOfPlayerCharactor.Add(Instantiate(PlayerPrefab, PlayerSpawnPoint, Quaternion.identity, transform)); PlayerPositionsArray[i] = 0; if (i >= NumOfPlayers) { ListOfPlayerCharactor[i].SetActive(false); } } ColorCodePlayerTokens(); } else { for (int i = 0; i < NumOfPlayers; i++) { PlayerTokenPositionAdjust(i); ListOfPlayerCharactor[i].SetActive(true); } } OnTurnFinalized?.Invoke(); }
private IEnumerator Movement_Cuts(Vector3 iniPos, Vector3 fPos, int PlayerIndex, float duration) { float currTime = 0f; while (currTime < duration) { ListOfPlayerCharactor[PlayerIndex].transform.position = Vector3.Lerp(iniPos, fPos, currTime / duration); yield return(new WaitForSeconds(0.1f)); currTime += 0.1f; } ListOfPlayerCharactor[PlayerIndex].transform.position = fPos; OnTurnFinalized?.Invoke(); }