public void Init(ITickProcessor tickProcessor, CameraActor mainCamera) { TickProcessor = tickProcessor; Camera = mainCamera.Component; if (_child) { _child.Init(tickProcessor, mainCamera); } foreach (var data in _datas) { _actorDatas.SetAndInitialize(this, Instantiate(data)); } foreach (var behaviour in _behaviours) { _actorBehaviours.SetAndInitialize(this, Instantiate(behaviour)); } OnInitializeComplete?.Invoke(this, null); OnInitializeComplete = null; OnAwake(); }
protected override void CreateDefaultCamera() { var camComponent = new ArcBallCameraComponent(Vector3.Zero, 10.0f, 45.0f, -45.0f, 0.0f, RenderConfig.ScreenSize, 0.1f, 500.0f); CurrentCamera = new CameraActor(camComponent); SceneGraph.AddActor(CurrentCamera); }
protected virtual void CreateDefaultCamera() { CurrentCamera = new CameraActor(new FlyCameraComponent(new Vector3(0, 0, 15), RenderConfig.ScreenSize, 0.1f, 500.0f)); SceneGraph.AddActor(CurrentCamera); }
void FixedUpdate() { deltaTime = Time.fixedDeltaTime; t = 1 - Mathf.Pow(0.001f, deltaTime); currentCamera = cameraTypes[(int)currentCamMode]; //Controller and movement UpdateState(); try { direction = currentCamera.transformToView(controls.inLeftH, Vector3.up); direction = direction.normalized; traversalFacade.refresh(direction, controls.jump, controls.sprinting, false); } catch (Exception e) { Debug.LogWarning("something from Update Movement: " + e.Message); Debug.LogWarning("additional: " + e.StackTrace); } try { //charAnimation.UpdateState(); //charAnimation.UpdateAnimation(); } catch (Exception e) { Debug.LogWarning("Animation error, probably had to divide by zero: " + e.Message); } //camera based stuff try{ //Vector3 playerOffset = new Vector3(charMovement.getVelocity().x, (charMovement.isInAir()? 0.5f : 1) * charMovement.getVelocity().y, charMovement.getVelocity().z); currentCamera.setCameraSettings(cameraSettings); currentCamera.refresh(controls.inRightH); } catch (Exception) { Debug.LogWarning("something from Camera"); } }
internal static unsafe void Invoke(UObject WorldContextObject, LatentActionInfo LatentInfo, CameraActor Camera, string NameOverride, string Notes, AutomationScreenshotOptions Options) { long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L }; byte *b = (byte *)p; *((IntPtr *)(b + 0)) = WorldContextObject; *((LatentActionInfo *)(b + 8)) = LatentInfo; *((IntPtr *)(b + 40)) = Camera; var NameOverride_handle = GCHandle.Alloc(NameOverride, GCHandleType.Pinned); *(IntPtr *)(b + 48) = NameOverride_handle.AddrOfPinnedObject(); *(int *)(b + IntPtr.Size + 48) = NameOverride.Length; *(int *)(b + IntPtr.Size + 4 + 48) = NameOverride.Length; var Notes_handle = GCHandle.Alloc(Notes, GCHandleType.Pinned); *(IntPtr *)(b + 64) = Notes_handle.AddrOfPinnedObject(); *(int *)(b + IntPtr.Size + 64) = Notes.Length; *(int *)(b + IntPtr.Size + 4 + 64) = Notes.Length; *((AutomationScreenshotOptions *)(b + 80)) = Options; Main.GetProcessEvent(AutomationBlueprintFunctionLibrary.DefaultObject, TakeAutomationScreenshotAtCamera_ptr, new IntPtr(p));; NameOverride_handle.Free(); Notes_handle.Free(); } }
///<summary>Takes a screenshot of the game's viewport, from a particular camera actors POV. Does not capture any UI.</summary> public static void TakeAutomationScreenshotAtCamera(UObject WorldContextObject, LatentActionInfo LatentInfo, CameraActor Camera, string NameOverride, string Notes, AutomationScreenshotOptions Options) => AutomationBlueprintFunctionLibrary_methods.TakeAutomationScreenshotAtCamera_method.Invoke(WorldContextObject, LatentInfo, Camera, NameOverride, Notes, Options);
public void LoadMainCamera() { _gameCamera = Object.Instantiate(_cameraConfig.MainCamera); }
public override void LoadContent() { camera = Scene.Cameras[CameraName]; base.LoadContent(); }