RemoteTech.RTCore.Update C# (CSharp) Method

Update() public method

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.
public Update ( ) : void
return void
        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();
            }
        }