示例#1
0
 public void Following_Update()
 {
     //followHandler.Enable = true;
     //Leave UserMode and Being AI Mode
     AIVehicle.SetActive(true);
     if (Input.GetButtonDown(VRAVEStrings.Right_Paddle))
     {
         (UserCar.GetComponent <CarUserControl>() as CarUserControl).enabled = false;
         cameraFade.StartAlphaFade(Color.black, false, 2f, () =>
         {
             ChangeState(States.ChangeMode);
             cameraFade.ResetPlane();
         });
     }
 }
示例#2
0
        private IEnumerator postStopStateChange(float time)
        {
            yield return(new WaitForSeconds(time));

            cameraFade.StartAlphaFade(Color.black, false, 3f, () => {
                if (GetState().Equals(States.UserStopped))                  //fix this so I'm not checking states all the time
                //Debug.Log("Preparing to reset scenario...");
                {
                    resetScenario();
                    cameraFade.ResetPlane();
                    ChangeState(States.AIDriveRoute);
                }
                else
                {
                    cameraFade.ResetPlane();
                    //Debug.Log("Else statement reached in postStopStateChange()");
                }
            });
        }
示例#3
0
        /************* Coroutines *****************/

        private IEnumerator PostCollisionStateChange(float time)
        {
            yield return(new WaitForSeconds(time));

            mirrorFlag = 0;
            // use a lambda expression to define the callback
            cameraFade.StartAlphaFade(Color.black, false, 3f, () => {
                if (m_humanDrivingState)
                {
                    UserCar.SetActive(false);
                    resetIntersectionScenario();
                    cameraFade.ResetPlane();
                    ChangeState(States.AIDrivingToIntersectionBriefing);
                }
                else
                {
                    cameraFade.ResetPlane();
                    ChangeState(States.TrashcanBriefing);
                }
            });
        }