// Update is called once per frame public void Update() { FPlatform.IncrementFrameCounter(); if (FPlatform.IsWindowResized()) { FUtil.SafeSendAnyEvent(OnWindowResized); } // update our wrappers around various different Input modes InputExtension.Get.Update(); // update cockpit tracking and let UI do per-frame rendering computations if (options.EnableCockpit) { ActiveCockpit.Update(); } // hardcoded Q key quits app if (Input.GetKeyUp(KeyCode.Q)) { Cursor.lockState = CursorLockMode.None; GlobalControl.Quit(); } // run per-frame actions Action execActions = nextFrameActions.GetRunnable(); nextFrameActions.Clear(); execActions(); // can either use spacecontrols or mouse, but not both at same time // [TODO] ask spatial input controller instead, it knows better (?) if (FPlatform.IsUsingVR() && SpatialController.CheckForSpatialInputActive()) { Configure_SpaceControllers(); HandleInput_SpaceControllers(); } else if (FPlatform.IsTouchDevice()) { Configure_TouchInput(); HandleInput_Touch(); } else { Configure_MouseOrGamepad(); HandleInput_MouseOrGamepad(); } // after we have handled input, do per-frame rendering computations if (options.EnableCockpit) { ActiveCockpit.PreRender(); } ToolManager.PreRender(); Scene.PreRender(); }
public void SetCurrentTime(double time, bool forceUpdate = false) { if (currentTime != time || forceUpdate) { foreach (SceneObject so in vObjects) { so.SetCurrentTime(time); } currentTime = time; FUtil.SafeSendAnyEvent(TimeChangedEvent, this, null); } }
protected virtual void OnSceneChanged(SceneObject so, SceneChangeType type) { FUtil.SafeSendAnyEvent(ChangedEvent, this, so, type); }
void behaviors_modified() { Behaviors.Sort((x, y) => x.b.Priority.CompareTo(y.b.Priority)); FUtil.SafeSendAnyEvent(OnSetChanged, this); }
public virtual void PostOnModified() { FUtil.SafeSendAnyEvent(OnContainerBoundsModified, this); }
private void OnProviderBoundsModified(object sender) { bounds = Provider.ContainerBounds; FUtil.SafeSendAnyEvent(OnContainerBoundsModified, this); }
// [RMS] if you change parameters above after construction, you can call // this method and it will cause re-layout... public virtual void NotifyParametersChanged() { FUtil.SafeSendAnyEvent(OnContainerBoundsModified, this); }
protected virtual void Context_OnWindowResized() { FUtil.SafeSendAnyEvent(OnContainerBoundsModified, this); }
private void Context_OnWindowResized() { DebugUtil.Log(2, "WINDOW RESIZE EVENT"); FUtil.SafeSendAnyEvent(OnContainerBoundsModified, this); }