public void NotifyMatchOver(MatchScenario scenario) { if (GameOver()) { return; } switch (scenario) { case MatchScenario.PlayerWon: player_score++; break; case MatchScenario.OpponentWon: opponent_score++; break; } player_score_text.text = player_score.ToString(); opponent_score_text.text = opponent_score.ToString(); if (++matches >= Constants.MATCHES) { OnGameOver(); } }
void Start() { ball = GameObject.Find("Ball"); match = (GameObject.Find("MatchScenario") != null)? GameObject.Find("MatchScenario").GetComponent<MatchScenario> (): null; initPosition = transform.localPosition; initRotation = transform.rotation; initLocalRotation = transform.localRotation; }
public void NotifyMatchWinner(MatchScenario scenario) { if (playing_regular_game) { match_holder.NotifyMatchOver(scenario); if (!match_holder.GameOver()) { StartOver(); } } else { if (scenario == MatchScenario.Draw) { match_holder.NotifyPenaltyLose(); } else { match_holder.NotifyPenaltyWon(); } } }
// Use this for initialization void Start() { match = GameObject.Find("MatchScenario").GetComponent<MatchScenario> (); match_IL = GameObject.Find("GameMatch").GetComponent<Camera_InputListener> (); shotTargetPosition = GameObject.Find("GoalPost").transform.position; if( shotTarget != null ) { shotTargetPosition = shotTarget.transform.position; } else { shotTargetPosition = Vector3.zero; } }
void Start() { match = (GameObject.Find("MatchScenario") != null)? GameObject.Find("MatchScenario").GetComponent<MatchScenario> (): null; //Physics.IgnoreLayerCollision(9, 10); }