Beispiel #1
0
        // Psuedo-event from checking Update()
        private void OnReferenceTransfomPartChange(Part part)
        {
            Log.Trace("Entering PlaneMode.OnReferenceTransfomPartChange()");
            Log.Debug("ReferenceTransformPart has changed");

            if (part != null)
            {
                Log.Debug("part is not null, finding ModulePlaneMode on: " + part.partInfo.title);
                var modulePlaneMode = part.FindModuleImplementing <ModulePlaneMode>();

                if (modulePlaneMode != null)
                {
                    Log.Debug("Found ModulePlaneMode, updating _currentModulePlaneMode and calling SetControlMode()");

                    _currentModulePlaneMode = modulePlaneMode;
                    SetControlMode(_currentModulePlaneMode.ControlMode);
                }
            }
            else
            {
                Log.Debug("part is null, updating _currentModulePlaneMode");
                _currentModulePlaneMode = null;
            }

            Log.Trace("Leaving PlaneMode.OnReferenceTransfomPartChange()");
        }
Beispiel #2
0
        // Psuedo-event from checking Update()
        private void OnReferenceTransfomPartChange(Part part)
        {
            Log.Trace("Entering PlaneMode.OnReferenceTransfomPartChange()");
            Log.Debug("ReferenceTransformPart has changed");

            if (part != null)
            {
                Log.Debug("part is not null, finding ModulePlaneMode on: " + part.partInfo.title);
                var modulePlaneMode = part.FindModuleImplementing<ModulePlaneMode>();

                if (modulePlaneMode != null)
                {
                    Log.Debug("Found ModulePlaneMode, updating _currentModulePlaneMode and calling SetControlMode()");

                    _currentModulePlaneMode = modulePlaneMode;
                    SetControlMode(_currentModulePlaneMode.ControlMode);
                }
            }
            else
            {
                Log.Debug("part is null, updating _currentModulePlaneMode");
                _currentModulePlaneMode = null;
            }

            Log.Trace("Leaving PlaneMode.OnReferenceTransfomPartChange()");
        }