void DelayInitialPosition() { if (ES.GetActivePlayer(0)) { UIButton[(0)].MakeActive(); ActivePlayer[0] = true; NumOfPlayers++; } if (ES.GetActivePlayer(1)) { UIButton[(8)].MakeActive(); ActivePlayer[1] = true; NumOfPlayers++; } if (ES.GetActivePlayer(2)) { UIButton[(16)].MakeActive(); ActivePlayer[2] = true; NumOfPlayers++; } if (ES.GetActivePlayer(3)) { UIButton[(24)].MakeActive(); ActivePlayer[3] = true; NumOfPlayers++; } }
// Use this for initialization void Start() { Delay = 2; SpawnWithNoControls = true; ES = GameObject.Find("EternalHolder").GetComponent <EternalScript> (); RHS = GameObject.Find("WinTextObj").GetComponent <RoundHandlerScript> (); SpawnInQue = new bool[4]; for (int i = 0; i < 4; i++) { SpawnInQue[i] = false; SpawnPointsProtection[i].SetActive(false); } if (ES.GetActivePlayer(0)) { Respawn(0); } if (ES.GetActivePlayer(1)) { Respawn(1); } if (ES.GetActivePlayer(2)) { Respawn(2); } if (ES.GetActivePlayer(3)) { Respawn(3); } }
// Use this for initialization void Start() { ES = GameObject.Find("EternalHolder").GetComponent <EternalScript> (); /* * Kfield = new Text[4]; * Dfield = new Text[4]; * Sfield = new Text[4]; * Afield = new Text[4]; * Pfield = new Text[4];*/ spotOccupied = new bool[4]; shotsFired = new int[4]; shotsHit = new int[4]; deaths = new int[4]; kills = new int[4]; Suicides = new int[4]; damageDone = new int[4]; place = new int[4]; InputEnabled = false; playerIndex = new PlayerIndex[4]; state = new GamePadState[4]; prevState = new GamePadState[4]; ActivePlayer = new bool[4]; for (int x = 0; x < 4; x++) { playerIndex [x] = (PlayerIndex)x; if (ES.GetActivePlayer(x)) { ActivePlayer[x] = true; NumOfPlayers++; } } PopulateArray(); }
void StatsDelay() { InputEnabled = true; UIBars.transform.localPosition = new Vector2(0, -2000f); for (int x = 0; x < 4; x++) { Kfield[x].text = kills[x].ToString(); Dfield[x].text = deaths[x].ToString(); Sfield[x].text = shotsFired[x].ToString(); DamageDoneField[x].text = damageDone[x].ToString(); SuicideField[x].text = Suicides[x].ToString(); float Percent; if (shotsFired[x] == 0) { Percent = 0; } else { Percent = (((float)shotsHit[x] / (float)shotsFired[x]) * 100f); if (Percent > 100) { Percent = 100; } Percent = Mathf.Round(Percent); } Afield[x].text = Percent.ToString() + "%"; Color Ctmp = Color.grey; if (ES.GetActivePlayer(x)) { Ctmp = ES.GetColor(x); weaponText[x].text = getWeapon(x); Ctmp.a = .75f; SR[x].color = Ctmp; placementField[x].text = DeterminePlace(x); titleText[x].text = GetRandomLine(); } else { readyImage[x].color = Color.green; Ctmp.a = .75f; SR[x].color = Ctmp; DeterminePlace(x); placementField[x].text = "Non Participant"; } } Invoke("EndMatch", 30f); }