示例#1
0
 private void Start()
 {
     try
     {
         goalText = FindObjectOfType <GoalTextOnline>().GetComponent <GoalTextOnline>();
         counter  = FindObjectOfType <TurnCounter>().GetComponent <TurnCounter>();
         soccer   = FindObjectOfType <SoccerSpeedControl>().GetComponent <SoccerSpeedControl>();
     }
     catch (Exception e)
     {
         //Avoid crash
     }
     //Debug data remove
     //PlayerPrefs.DeleteAll();
 }
示例#2
0
 private void Update()
 {
     if (goalText == null || counter == null || soccer == null)
     {
         try
         {
             goalText = FindObjectOfType <GoalTextOnline>().GetComponent <GoalTextOnline>();
             counter  = FindObjectOfType <TurnCounter>().GetComponent <TurnCounter>();
             soccer   = FindObjectOfType <SoccerSpeedControl>().GetComponent <SoccerSpeedControl>();
         }
         catch (Exception e)
         {
             //Avoid crash
         }
     }
 }