public void Start()
        {
            animationControl = SSTUAnimateControlled.setupAnimationController(part, animationID, this);
            engineModule     = null;
            ModuleEnginesFX[] engines = part.GetComponents <ModuleEnginesFX>();
            int len = engines.Length;

            for (int i = 0; i < len; i++)
            {
                if (engines[i].engineID == engineID)
                {
                    engineModule = engines[i];
                }
            }
            if (engineModule == null)
            {
                MonoBehaviour.print("ERROR: Could not locate engine by ID: " + engineID + " for part: " + part + " for SSTUAnimateEngineHeat.  This will cause errors during gameplay.  Setting engine to first engine module (if present)");
                if (engines.Length > 0)
                {
                    engineModule = engines[0];
                }
            }
            setupEngineModuleGui();
            setupGuiFields(animationControl.getAnimationState(), engineModule.EngineIgnited);
        }
Exemple #2
0
 public void Start()
 {
     needsUpdate = true;
     if (!string.IsNullOrEmpty(animationID))
     {
         animationControl = SSTUAnimateControlled.setupAnimationController(part, animationID, this);
         if (animationControl != null)
         {
             onAnimationStateChange(animationControl.getAnimationState());
         }
     }
 }
Exemple #3
0
        public void Start()
        {
            if (!string.IsNullOrEmpty(animationID))
            {
                animation = SSTUAnimateControlled.setupAnimationController(part, animationID, this);
            }
            updateGUI();
            ModuleDockingNode mdn = part.GetComponent <ModuleDockingNode>();

            mdn.snapOffset   = snapAngle;
            mdn.snapRotation = enableSnap;
            MonoBehaviour.print("Set docking node module to snap angle: " + snapAngle + " enabled: " + enableSnap);
        }
Exemple #4
0
 private void initializeState()
 {
     if (initialized || !moduleIsEnabled)
     {
         return;
     }
     initialized = true;
     findTransforms();
     animationController = SSTUAnimateControlled.setupAnimationController(part, animationID, this);
     setupDefaultRotations();
     setPanelState(panelState);
     loadPivotSaveData(persistentData);
     updateGuiData();
     suncatcherAngleAxis = (Axis)Enum.Parse(typeof(Axis), sunAxis);
 }
Exemple #5
0
        public void Start()
        {
            AnimState state = AnimState.STOPPED_END;

            if (!string.IsNullOrEmpty(animationID))
            {
                animController = SSTUAnimateControlled.setupAnimationController(part, animationID, this);
                state          = animController.getAnimationState();
            }
            bool uiEnabled = state == AnimState.STOPPED_END && !autoRotate;

            if (state == AnimState.STOPPED_END && autoRotate)
            {
                rotating = true;
            }
            updateUIControlState(uiEnabled);
        }
Exemple #6
0
        public override void OnStart(PartModule.StartState state)
        {
            base.OnStart(state);
            animationControl = SSTUAnimateControlled.setupAnimationController(part, animationID, this);
            initializeGuiFields();
            updateGuiDataFromState(animationControl.getAnimationState());
            BaseAction deploy = Actions[nameof(deployAction)];

            if (deploy.actionGroup == KSPActionGroup.REPLACEWITHDEFAULT)
            {
                deploy.actionGroup = actionGroup;
            }
            BaseAction retract = Actions[nameof(retractAction)];

            if (retract.actionGroup == KSPActionGroup.REPLACEWITHDEFAULT)
            {
                retract.actionGroup = actionGroup;
            }
        }