コード例 #1
0
ファイル: FContext.cs プロジェクト: ly774508966/frame3Sharp
        // 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();
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 protected virtual void OnSceneChanged(SceneObject so, SceneChangeType type)
 {
     FUtil.SafeSendAnyEvent(ChangedEvent, this, so, type);
 }
コード例 #4
0
 void behaviors_modified()
 {
     Behaviors.Sort((x, y) => x.b.Priority.CompareTo(y.b.Priority));
     FUtil.SafeSendAnyEvent(OnSetChanged, this);
 }
コード例 #5
0
ファイル: BoxContainer.cs プロジェクト: xiaodelea/frame3Sharp
 public virtual void PostOnModified()
 {
     FUtil.SafeSendAnyEvent(OnContainerBoundsModified, this);
 }
コード例 #6
0
ファイル: BoxContainer.cs プロジェクト: xiaodelea/frame3Sharp
 private void OnProviderBoundsModified(object sender)
 {
     bounds = Provider.ContainerBounds;
     FUtil.SafeSendAnyEvent(OnContainerBoundsModified, this);
 }
コード例 #7
0
ファイル: BoxContainer.cs プロジェクト: xiaodelea/frame3Sharp
 // [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);
 }
コード例 #8
0
ファイル: BoxContainer.cs プロジェクト: xiaodelea/frame3Sharp
 protected virtual void Context_OnWindowResized()
 {
     FUtil.SafeSendAnyEvent(OnContainerBoundsModified, this);
 }
コード例 #9
0
 private void Context_OnWindowResized()
 {
     DebugUtil.Log(2, "WINDOW RESIZE EVENT");
     FUtil.SafeSendAnyEvent(OnContainerBoundsModified, this);
 }