7 [
Attribute(
"", UIWidgets.ResourceNamePicker,
"SCR_ManualCamera prefab",
"et")]
8 private ResourceName m_CameraPrefab;
10 private CameraManager m_CameraManager;
11 private IEntity m_Camera;
26 void CreateCamera(vector transform[4])
31 EntitySpawnParams spawnParams =
new EntitySpawnParams;
32 spawnParams.Transform = transform;
42 BaseWorld world =
GetGame().GetWorld();
47 world.GetCurrentCamera(transform);
48 CreateCamera(transform);
74 static IEntity GetCameraInstance()
78 return core.GetCamera();
84 override bool CanCreate()
86 if (m_CameraPrefab.IsEmpty())
88 Print(
"Cannot initialize SCR_DebugCameraCore, m_CameraPrefab is empty!", LogLevel.ERROR);
94 Print(
string.Format(
"Cannot initialize SCR_DebugCameraCore, prefab '%1' is %2, not SCR_ManualCamera!", m_CameraPrefab.GetPath(),
type), LogLevel.ERROR);
101 override void OnUpdate(
float timeSlice)
109 Print(
"Attempting to start debug camera when the editor is opened. There is no need for that.", LogLevel.NORMAL);
117 if (m_CameraManager && m_CameraManager.CurrentCamera() !=
m_Camera)
119 m_CameraManager.SetCamera(CameraBase.Cast(
m_Camera));
129 override void OnGameStart()
131 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_MANUAL_CAMERA_FREE,
"lctrl+lalt+c",
"Debug manual camera",
"Cheats");
134 m_CameraManager =
GetGame().GetCameraManager();
136 #ifdef PLATFORM_WINDOWS
138 FileIO.DeleteFile(
"$profile:.EditorSettings.conf");
143 override void OnGameEnd()