private void LoopThroughActuators(bool newstate)
        {
            if (!spawned)
            {
                return;
            }

            foreach (Actuator thatActuator in actuators)
            {
                thatActuator.SetState(part, newstate, partLocal ? part.gameObject : null);
            }

            if (showEnableDisableOption)
            {
                if (newstate)
                {
                    Events ["JSIGuiEnableComponents"].active  = false;
                    Events ["JSIGuiDisableComponents"].active = true;
                }
                else
                {
                    Events ["JSIGuiDisableComponents"].active = false;
                    Events ["JSIGuiEnableComponents"].active  = true;
                }
            }

            currentState = newstate;

            JUtil.ForceRightclickMenuRefresh();

            if (HighLogic.LoadedSceneIsEditor)
            {
                GameEvents.onEditorShipModified.Fire(EditorLogic.fetch.ship);
            }
        }
示例#2
0
        private void LoopComponents(bool newstate)
        {
            if (!spawned)
            {
                return;
            }

            foreach (string componentText in componentList)
            {
                SetState(part, componentText, newstate, controlRendering, controlColliders);
            }
            if (showEnableDisableOption)
            {
                if (newstate)
                {
                    Events ["JSIGuiEnableComponent"].active  = false;
                    Events ["JSIGuiDisableComponent"].active = true;
                }
                else
                {
                    Events ["JSIGuiDisableComponent"].active = false;
                    Events ["JSIGuiEnableComponent"].active  = true;
                }
            }

            currentState = newstate;

            JUtil.ForceRightclickMenuRefresh();

            if (HighLogic.LoadedSceneIsEditor)
            {
                GameEvents.onEditorShipModified.Fire(EditorLogic.fetch.ship);
            }
        }
        private void SwitchToState(string newState)
        {
            ToggleGroup(currentState, false, partLocal ? part.gameObject : null);
            ToggleGroup(newState, true, partLocal ? part.gameObject : null);

            JUtil.ForceRightclickMenuRefresh();

            if (HighLogic.LoadedSceneIsEditor)
            {
                GameEvents.onEditorShipModified.Fire(EditorLogic.fetch.ship);
            }
            currentState = newState;
        }