public void Substitute() { var subbedPlayer = Team.Players.Single(p => p.Number == SelectedNumber); var substitutePlayer = SelectedSubstitute; SubstitutedPlayers.Add(subbedPlayer); substitutePlayer.Location.XamlX = subbedPlayer.Location.XamlX; substitutePlayer.Location.XamlY = subbedPlayer.Location.XamlY; TeamFormation[TeamFormation. Where(kvp => kvp.Value.Number == subbedPlayer.Number). Select(kvp => kvp.Key).Single()] = substitutePlayer; UpdatePlayerShirts(); PlayerNumbers.Remove(SelectedNumber); PlayerSubstitutes.Remove(substitutePlayer); NotifyOfPropertyChange(() => PlayerSubstitutes); NotifyOfPropertyChange(() => PlayerNumbers); SelectedNumber = 0; SelectedSubstitute = null; ++SubstitutesUsed; }
public void SetMass(MassTypes massType, PlayerNumbers playerNumber) { if ( !(massType is MassTypes.Void) && playerNumber == this.speedController ) { GetComponent <Rigidbody>().mass = massType == MassTypes.Heavy ? this.heavyMass : this.lightMass; } }
public override void Initialize(PlayerNumbers pNumber) { playerNumber = pNumber; client = GameObject.Find("Network").GetComponent <UnityClient>(); mainCamera = GameObject.Find("Main Camera").GetComponent <Camera>(); if (mainCamera == null) { Debug.LogError("mainCamera is not set, will cause errors"); } }
public void ChangeTurn() { currentTurnPlayer.GetComponent <Player>().ToggleTurn(); foreach (Transform child in transform) { currentTurnPlayer = child.gameObject; currentTurnPlayer.GetComponent <Player>().ToggleTurn(); number = currentTurnPlayer.GetComponent <Player>().GetPlayerNumber(); //currentTurnPlayer.GetComponent<Player>().GetPlayerNumber(); child.SetAsLastSibling(); break; } }
public void ShowWinner(PlayerNumbers player) { if (!CheckForWinnerTextGameObject()) { return; } gameOverUI.SetActive(true); switch (player) { case PlayerNumbers.ONE: { winnerText.text = redWinsText; winnerText.color = redWinsColor; break; } case PlayerNumbers.TWO: { winnerText.text = blueWinsText; winnerText.color = blueWinsColor; break; } case PlayerNumbers.THREE: { Debug.LogError("Currently does not support three players"); break; } case PlayerNumbers.FOUR: { Debug.LogError("Currently does not support four players"); break; } default: Debug.LogError("PlayerNumbers is not valid"); break; } }
public void ChangeColor(PlayerNumbers player) { switch (player) { case PlayerNumbers.ONE: { outline1.effectColor = outline3.effectColor = redColor; Color blah = new Color(redColor.r, redColor.g, redColor.b, 0.062f); Debug.Log(blah.r.ToString() + " " + blah.g.ToString() + " " + blah.b.ToString() + " " + blah.a.ToString()); outline2.effectColor = blah; break; } case PlayerNumbers.TWO: { outline1.effectColor = outline3.effectColor = blueColor; Color blah = new Color(blueColor.r, blueColor.g, blueColor.b, 0.062f); Debug.Log(blah.r.ToString() + " " + blah.g.ToString() + " " + blah.b.ToString() + " " + blah.a.ToString()); outline2.effectColor = blah; break; } case PlayerNumbers.THREE: { Debug.LogError("Three players not currently supported"); break; } case PlayerNumbers.FOUR: { Debug.LogError("Four players not currently supported"); break; } default: break; } }
public override void Initialize(PlayerNumbers pNumber) { //client = GameObject.Find("Network").GetComponent<UnityClient>(); }
public static bool Action1Up(PlayerNumbers playerNumber) { return Action1Up((int) playerNumber); }
public static bool PauseDown(PlayerNumbers playerNumber) { return PauseDown((int) playerNumber); }
public static float LeftStickVertical(PlayerNumbers playerNumber) { return LeftStickVertical((int) playerNumber); }
public static float LeftStickHorizontal(PlayerNumbers playerNumber) { return LeftStickHorizontal((int) playerNumber); }
public static bool Action2Down(PlayerNumbers playerNumber) { return Action2Down((int) playerNumber); }
public virtual void Initialize(PlayerNumbers pNumber) { }