public void Update() { OnFrameUpdate.Invoke(); if (FlightGlobals.ActiveVessel == null || FlightGlobals.ActiveVessel.packed) { return; } var vs = Satellites[FlightGlobals.ActiveVessel]; if (vs != null) { GetLocks(); if (vs.HasLocalControl) { ReleaseLocks(); } else if (vs.FlightComputer != null && vs.FlightComputer.InputAllowed) { foreach (KSPActionGroup ag in GetActivatedGroup()) { vs.FlightComputer.Enqueue(ActionGroupCommand.WithGroup(ag)); } } } else { ReleaseLocks(); } }
public override void DidUpdateFrame(ARSession session, ARFrame frame) { using (frame) { OnFrameUpdate?.Invoke(session, frame); } }
public static void InvokeFrameUpdate() { if (OnFrameUpdate != null) { OnFrameUpdate.Invoke(); } }
private void updateView() { long now = stopWatch.ElapsedMilliseconds; if (viewUpdateInterval < now - lastUpdate) { lastUpdate = now; OnFrameUpdate?.Invoke(this, new FrameEventArgs(player, asteroids, stopWatch.ElapsedMilliseconds / 1000L)); } }
/// <summary> /// Called by the Unity engine during the game logic phase. /// This function is called once per frame. It is the main workhorse function for frame updates. /// </summary> public void Update() { OnFrameUpdate.Invoke(); if (FlightGlobals.ActiveVessel == null || FlightGlobals.ActiveVessel.packed) { return; } var vs = Satellites[FlightGlobals.ActiveVessel]; if (vs != null) { GetLocks(); if (vs.HasLocalControl) { ReleaseLocks(); } else if (vs.FlightComputer != null && vs.FlightComputer.InputAllowed) { #if !KSP131 var axisGroups = GetPressedAxisGroup(); for (int i = 0; i < axisGroups.Count(); i++) { if (axisGroups.ElementAt(i).Item2 != 0) //skip both - and + keys pressed at same time { vs.FlightComputer.Enqueue(AxisGroupCommand.WithGroup(axisGroups.ElementAt(i).Item1, axisGroups.ElementAt(i).Item2)); } } #endif var actionGroups = GetActivatedActionGroup(); for (int i = 0; i < actionGroups.Count(); i++) { vs.FlightComputer.Enqueue(ActionGroupCommand.WithGroup(actionGroups.ElementAt(i))); } } } else { ReleaseLocks(); } }
public void SetFrameUpdateEvent(OnFrameUpdate handler) { this.frameUpdateEvent = handler; }
private void EngineWindow_UpdateFrame(object sender, FrameEventArgs e) { OnFrameUpdate?.Invoke(this, new Events.EventArgs.UpdateFrameEventArgs(e.Time)); KeyboardInput.Update(); }
public void Update() { OnFrameUpdate.Invoke(); }