getAnimationState() public method

public getAnimationState ( ) : AnimState
return AnimState
コード例 #1
0
 public void Start()
 {
     animationControl = SSTUAnimateControlled.locateAnimationController(part, animationID, onAnimationStatusChanged);
     engineModule = (ModuleEnginesFX)part.Modules[engineModuleIndex];//unsafe, but intend it to crash if setup improperly
     setupEngineModuleGui();
     setupGuiFields(animationControl.getAnimationState(), engineModule.EngineIgnited);
 }
コード例 #2
0
 public override void OnStart(PartModule.StartState state)
 {
     base.OnStart(state);
     animationControl = SSTUAnimateControlled.locateAnimationController(part, animationID, onAnimationStatusChanged);
     initializeGuiFields();
     updateGuiDataFromState(animationControl.getAnimationState());
 }
コード例 #3
0
        public void Start()
        {
            animationControl = SSTUAnimateControlled.locateAnimationController(part, animationID, onAnimationStatusChanged);
            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);
        }
コード例 #4
0
 public void Start()
 {
     animationControl = SSTUAnimateControlled.locateAnimationController(part, animationID, onAnimationStatusChanged);
     engineModule     = (ModuleEnginesFX)part.Modules[engineModuleIndex];//unsafe, but intend it to crash if setup improperly
     setupEngineModuleGui();
     setupGuiFields(animationControl.getAnimationState(), engineModule.EngineIgnited);
 }
コード例 #5
0
 public void Start()
 {
     needsUpdate = true;
     if (animationID >= 0)
     {
         animationControl = SSTUAnimateControlled.locateAnimationController(part, animationID, onAnimationStateChange);
         if (animationControl != null)
         {
             onAnimationStateChange(animationControl.getAnimationState());
         }
     }
 }
コード例 #6
0
 public void Start()
 {
     needsUpdate = true;
     if (!string.IsNullOrEmpty(animationID))
     {
         animationControl = SSTUAnimateControlled.setupAnimationController(part, animationID, this);
         if (animationControl != null)
         {
             onAnimationStateChange(animationControl.getAnimationState());
         }
     }
 }
コード例 #7
0
        private void setupDefaultRotations()
        {
            AnimState state = animationController.getAnimationState();

            animationController.setToState(AnimState.STOPPED_END);//will trigger an animation sample
            int len = pivotData.Length;

            for (int i = 0; i < len; i++)
            {
                pivotData[i].defaultOrientation = pivotData[i].pivotTransform.localRotation;
            }
            animationController.setToState(state);//restore actual state...
        }
コード例 #8
0
        public void deployEngineEvent()
        {
            AnimState state = animationControl.getAnimationState();

            if (state != AnimState.STOPPED_END)
            {
                setAnimationState(AnimState.PLAYING_FORWARD);
            }
            else
            {
                engineModule.Activate();
            }
            setupGuiFields(animationControl.getAnimationState(), engineModule.EngineIgnited);
        }
コード例 #9
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);
        }
コード例 #10
0
        public void Start()
        {
            AnimState state = AnimState.STOPPED_END;

            if (animationID >= 0)
            {
                animController = SSTUAnimateControlled.locateAnimationController(part, animationID, onAnimStateChange);
                state          = animController.getAnimationState();
            }
            bool uiEnabled = state == AnimState.STOPPED_END && !autoRotate;

            if (state == AnimState.STOPPED_END && autoRotate)
            {
                rotating = true;
            }
            updateUIControlState(uiEnabled);
        }
コード例 #11
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;
            }
        }
コード例 #12
0
        private void updateGUI()
        {
            bool enabled = true;

            if (animation != null)
            {
                AnimState state = animation.getAnimationState();
                enabled = state == AnimState.STOPPED_END && HighLogic.LoadedSceneIsFlight;
            }
            ModuleDockingNode mdn = part.GetComponent <ModuleDockingNode>();

            if (mdn == null)
            {
                enabled = false;
            }
            else if (mdn.otherNode == null)
            {
                enabled = false;
            }
            Events["weldEvent"].guiActive = enabled;

            //TODO update animateUsable GUI to disable the 'extend' buttons when docking node is docked
        }
コード例 #13
0
 public override void OnStart(PartModule.StartState state)
 {
     if (controlID == -1) { moduleControlEnabled = true; }
     base.OnStart(state);
     animationControl = SSTUAnimateControlled.locateAnimationController(part, animationID, onAnimationStatusChanged);
     initializeGuiFields();
     updateGuiDataFromState(animationControl.getAnimationState());
 }
コード例 #14
0
 public void Start()
 {
     needsUpdate = true;
     if (animationID >= 0)
     {
         animationControl = SSTUAnimateControlled.locateAnimationController(part, animationID, onAnimationStateChange);
         if (animationControl != null) { onAnimationStateChange(animationControl.getAnimationState()); }
     }
 }
コード例 #15
0
 public override void OnStart(PartModule.StartState state)
 {
     base.OnStart(state);
     animationControl = SSTUAnimateControlled.locateAnimationController(part, animationID, onAnimationStatusChanged);
     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;
     }
 }
コード例 #16
0
 //TODO - might need to force-disable effects (if they exist)
 //find animations, check for control enabled
 public override void OnStart(PartModule.StartState state)
 {
     if(controlID==-1){moduleControlEnabled=true;}
     animationControl = SSTUAnimateControlled.locateAnimationController (part, animationID, onAnimationStatusChanged);
     base.OnStart(state);
     if(moduleControlEnabled)
     {
         setupGuiFields(animationControl==null? SSTUAnimState.STOPPED_END : animationControl.getAnimationState(), EngineIgnited);
     }
     else//disabled engine entire, disable all events/gui stuff/staging icon
     {
         disableAllGuiFields();
         if(part.stagingIcon!=null && part.stagingIcon.Equals(DefaultIcons.LIQUID_ENGINE.ToString()))
         {
             part.stagingIcon = string.Empty;
         }
     }
 }
コード例 #17
0
 public void onModuleEnableChange(bool moduleEnabled)
 {
     updateGuiDataFromState(animationControl.getAnimationState());
 }
コード例 #18
0
 public void Start()
 {
     animationControl = SSTUAnimateControlled.locateAnimationController(part, animationID, onAnimationStatusChanged);
     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);
 }