示例#1
0
    void Start()
    {
        theSelectedScenario = SelectedScenario.S_SelectedScenarioScript;
        theStationManager   = StationManager.S_StationManager;
        theScoreManager     = ScoreManager.S_ScoreManager;
        thePowerControl     = PowerControl.S_PowerControl;
        theUIManager        = UIManager.S_UIManager;

        thePowerControl.TogglePowerLock(true);
        theStationManager.StationUpdate();
        thePowerControl.SetSpeedLimit(initialSpeedLimit);

        StartGameSection();
    }
示例#2
0
 void OnTriggerEnter(Collider _other)
 {
     if (_other.gameObject.tag == "Train_Car_Front")
     {
         if (!tutorial)
         {
             if (speedEventType == SpeedEventType.SpeedLimit)
             {
                 Debug.Log("Current Speed Limit: " + speedEventValue);
                 thePowerControl.SetSpeedLimit(speedEventValue);
                 if (thePowerControl.KmhSpeed <= speedEventValue)
                 {
                     theScoreManager.Scoring_SpeedLimit(true);
                     //theGameMaster.Scoring_UnderSpeedLimit();
                 }
             }
             else if (speedEventType == SpeedEventType.SpeedRecommendation)
             {
                 Debug.Log("Speed Recommendation: " + speedEventValue);
                 if (thePowerControl.KmhSpeed == speedEventValue)
                 {
                     theScoreManager.Scoring_RecommendedSpeed();
                 }
             }
         }
         else if (tutorial)
         {
             if (speedEventType == SpeedEventType.SpeedLimit)
             {
                 Debug.Log("Current Speed Limit: " + speedEventValue);
                 thePowerControlTutorial.SetSpeedLimit(speedEventValue);
                 if (thePowerControlTutorial.KmhSpeed <= speedEventValue)
                 {
                     theScoreManagerTutorial.Scoring_SpeedLimit(true);
                     //theGameMaster.Scoring_UnderSpeedLimit();
                 }
             }
             else if (speedEventType == SpeedEventType.SpeedRecommendation)
             {
                 Debug.Log("Speed Recommendation: " + speedEventValue);
                 if (thePowerControlTutorial.KmhSpeed == speedEventValue)
                 {
                     theScoreManagerTutorial.Scoring_RecommendedSpeed();
                 }
             }
         }
     }
 }