예제 #1
0
 /// <summary>
 /// Given the current state of the primary camera,
 /// moves the rear view camera close to it to display the
 /// cars behind the player's car in the mirror.
 /// Only display the rear view mirror in third person mode.
 /// </summary>
 /// <param name="primaryCamera">The primary camera.</param>
 public void UpdateRearViewMirror(PrimaryCamera primaryCamera)
 {
     if (primaryCamera.CamType == PrimaryCamera.CameraType.ThirdPerson)
     {
         // Move rear view camera to the location of the primary 3rd person camera...
         rearViewCamera.transform.position = primaryCamera.transform.position + new Vector3(0, 3, 0);        // Move up and a little forward
         rearViewCamera.transform.rotation = primaryCamera.transform.rotation * Quaternion.Euler(0, 180, 0); // Rotate to face rear of car
         gameObject.SetActive(true);
     }
     else
     {
         gameObject.SetActive(false);
     }
 }
예제 #2
0
        void RegistryInit(string DefaultOysterAddress,int DefaultOysterConnectionPort, int DefaultOysterFilePort,string DefaultOysterDeviceID,string OysterDeviceFriendlyName, bool ManualConfiguration,
			RecordOptions.ScreenRecordType RecordType,
			string WindowTitleToRecord,
			ScreenEncoder.CapturePerformance ScreenCapturePerformance,
			RecordOptions.CameraSelection CamerasSelected,
			int MinutesToRecord, int SecondsToCountdown,
			string ScreenProfileDirectory, string ScreenWMVDirectory,
			RecordOptions.PrimaryCamera CameraPrimary)
        {
            m_sDefaultOysterDeviceAddress = (string)
                m_RegKey.GetValue("DefaultOysterDeviceAddress",DefaultOysterDeviceAddress);
            m_iDefaultOysterDeviceConnectionPort = (int)
                m_RegKey.GetValue("DefaultOysterDeviceConnectionPort",DefaultOysterDeviceConnectionPort);
            m_iDefaultOysterDeviceFilePort = (int)
                m_RegKey.GetValue("DefaultOysterDeviceFilePort",DefaultOysterDeviceFilePort);
            m_sDefaultOysterAddress = (string)
                m_RegKey.GetValue("DefaultOysterAddress",DefaultOysterAddress);
            m_iDefaultOysterConnectionPort = (int)
                m_RegKey.GetValue("DefaultOysterConnectionPort",DefaultOysterConnectionPort);
            m_iDefaultOysterFilePort = (int)
                m_RegKey.GetValue("DefaultOysterFilePort",DefaultOysterFilePort);
            m_sDefaultOysterDeviceID = (string)
                m_RegKey.GetValue("DefaultOysterDeviceID",DefaultOysterDeviceID);
            m_sOysterDeviceFriendlyName = (string)
                m_RegKey.GetValue("OysterDeviceFriendlyName",OysterDeviceFriendlyName);
            m_bManualConfiguration = bool.Parse((string)m_RegKey.GetValue("ManualConfiguration",ManualConfiguration.ToString()));
            m_ScreenRecordType = (RecordOptions.ScreenRecordType)
                System.Enum.Parse(typeof(RecordOptions.ScreenRecordType),
                (string)m_RegKey.GetValue("RecordType",RecordType.ToString()));
            m_sWindowTitleToRecord = (string)
                m_RegKey.GetValue("WindowTitleToRecord",WindowTitleToRecord);
            m_ScreenCapturePerformance = (ScreenEncoder.CapturePerformance)
                System.Enum.Parse(typeof(ScreenEncoder.CapturePerformance),
                (string)m_RegKey.GetValue("CapturePerformance",ScreenCapturePerformance.ToString()));
            m_CameraSelection = (RecordOptions.CameraSelection)
                System.Enum.Parse(typeof(RecordOptions.CameraSelection),
                (string)m_RegKey.GetValue("SelectedCamera",CamerasSelected.ToString()));
            m_iMinutesToRecord = (int)m_RegKey.GetValue("MinutesToRecord",MinutesToRecord);
            m_iMinutesToCountdown = (int)m_RegKey.GetValue("SecondsToCountdown",SecondsToCountdown);
            m_sProfileDirectory =
                (string)m_RegKey.GetValue("ProfileDirectory",ScreenProfileDirectory);
            m_sProfileDirectory = RemoveTrailingBackslashFromPath(m_sProfileDirectory);
            m_sWMVDirectory = (string) m_RegKey.GetValue("WMVDirectory",ScreenWMVDirectory);
            m_sWMVDirectory = RemoveTrailingBackslashFromPath(m_sWMVDirectory);
            m_PrimaryCamera = (RecordOptions.PrimaryCamera)
                System.Enum.Parse(typeof(RecordOptions.PrimaryCamera),
                (string)m_RegKey.GetValue("CameraPrimary",CameraPrimary.ToString()));
            m_bHasBeenSaved = bool.Parse((string)m_RegKey.GetValue("HasBeenSaved",false.ToString()));
        }