public GoalData( AccumulatedFrame match, Player player, LastScore lastScore, float gameClock, Vector2 goalPos, float angleIntoGoal, bool backboard, Team.TeamColor goalColor, bool?leftHanded, float?underhandedness, List <Vector3> discTrajectory) { eventType = EventType.goal; matchData = match; GameClock = gameClock; Player = player; LastScore = lastScore; GoalPos = goalPos; GoalAngle = angleIntoGoal; Backboard = backboard; GoalColor = goalColor; LeftHanded = leftHanded; this.underhandedness = underhandedness; DiscTrajectory = new List <Vector3>(discTrajectory); }
public void CalculateScore() { if (Score > LastScore) { PlayerPrefs.SetInt("Score", Score); } EndUI.SetActive(true); //只有物体显示后才能获取到对象,否则为抛出空指针异常 NowScore = GameObject.Find("NowScore"); HighScore = GameObject.Find("HighScore"); NowScore.GetComponent <Text>().text = Score.ToString(); HighScore.GetComponent <Text>().text = LastScore.ToString(); if (Input.GetKey(KeyCode.Mouse0)) { SceneManager.LoadScene("UI"); } }
public void CalculateScore() { if (Score > LastScore) { PlayerPrefs.SetInt("Score", Score); } if (EndUI == null) { return; } EndUI.SetActive(true); NowScore = GameObject.Find("NowScore"); HighScore = GameObject.Find("HighScore"); NowScore.GetComponent <Text>().text = Score.ToString(); HighScore.GetComponent <Text>().text = LastScore.ToString(); GameObject.Find("Text").GetComponent <Text>().text = string.Format("Score\r\n{0}\n\nHigh score\n{1}", Score.ToString(), LastScore.ToString()); if (Input.GetKey(KeyCode.Mouse0)) { SceneManager.LoadScene("UI"); } }