Beispiel #1
0
 void ModeChange()
 {
     if (gameTask.controllerTask.CameraModeChangeButton())
     {
         if (cameraMode == CameraMode.Free)
         {
             gameTask.eventCount--;
             cameraMode = CameraMode.Target;
             BaseCamera newBase = gameObject.AddComponent <TargetCamera>();
             newBase.LoadCamera(baseCamera);
             Destroy(baseCamera);
             baseCamera = newBase;
         }
         else if (cameraMode == CameraMode.Target &&
                  gameTask.eventCount == 0)
         {
             gameTask.eventCount++;
             cameraMode = CameraMode.Free;
             BaseCamera newBase = gameObject.AddComponent <FreeCamera>();
             newBase.LoadCamera(baseCamera);
             Destroy(baseCamera);
             baseCamera = newBase;
         }
     }
 }