SetUpAnimation() public static method

public static SetUpAnimation ( string animationName, Part part ) : UnityEngine.AnimationState[]
animationName string
part Part
return UnityEngine.AnimationState[]
Ejemplo n.º 1
0
        public override void OnStart(PartModule.StartState state)
        {
            animStates = Utils.SetUpAnimation(ThrustAnimationName, this.part);

            foreach (ModuleEngines me in this.part.FindModulesImplementing <ModuleEngines>())
            {
                modEng     = me;
                isEngineFX = false;
                break;
            }

            foreach (ModuleEnginesFX me in this.part.FindModulesImplementing <ModuleEnginesFX>())
            {
                modEngFX   = me;
                isEngineFX = true;
                break;
            }
            HideGimbalButtons();
            part.OnEditorAttach += new Callback(HideGimbalButtons);
            if (disableGimbalToggle)
            {
                Actions["AGToggleGimbal"].active          = true;
                Events["GuiToggleGimbal"].guiActive       = true;
                Events["GuiToggleGimbal"].guiActiveEditor = true;

                foreach (ModuleGimbal mgg in this.part.FindModulesImplementing <ModuleGimbal>())
                {
                    gimbalStatus = !mgg.gimbalLock;
                }
            }
            else
            {
                Actions["AGToggleGimbal"].active = false;
            }
        }
        public override void OnStart(PartModule.StartState state)
        {
            deployStates = Utils.SetUpAnimation(animationName, part);
            engine       = part.FindModuleImplementing <ModuleEngines>();
            vtolEngines  = new List <BDVTOLAnimator>();

            engine.Actions["ActivateAction"].active = false;
            engine.Actions["ShutdownAction"].active = false;
        }
 public override void OnStart(PartModule.StartState state)
 {
     deployStates = Utils.SetUpAnimation(deployName, this.part);
     loopStates   = Utils.SetUpAnimation(loopName, this.part);
     foreach (AnimationState deploy in deployStates)
     {
         deploy.enabled = false;
     }
     foreach (AnimationState loop in loopStates)
     {
         loop.enabled = false;
     }
 }
Ejemplo n.º 4
0
        public override void OnStart(PartModule.StartState state)
        {
            animStates = Utils.SetUpAnimation(AnimationName, this.part);

            framesArray = StateFrames.Split(',');
            namesArray  = StateNames.Split(',');

            intFramesArray = new int[framesArray.Length];
            int index = 0;

            foreach (string frame in framesArray)
            {
                intFramesArray[index] = Convert.ToInt32(frame);
                index++;
            }
        }
Ejemplo n.º 5
0
        public override void OnStart(PartModule.StartState state)
        {
            foreach (var animMod in this.part.FindModulesImplementing <ModuleAnimateGeneric>())
            {
                animName = animMod.animationName;
            }

            animStates = Utils.SetUpAnimation(animName, this.part);
            Debug.Log("setup animation");
            foreach (AnimationState anim in animStates)
            {
                if (!HighLogic.LoadedSceneIsEditor)
                {
                    anim.wrapMode = WrapMode.Clamp;
                }
            }
            Debug.Log("animations set to clamp");

            if (this.part.children.Capacity > 0)
            {
                Debug.Log("part has children");
                foreach (Part node in this.part.children)
                {
                    if (node != null)
                    {
                        foreach (ModuleEngines me in node.FindModulesImplementing <ModuleEngines>())
                        {
                            if (node.attachMode == AttachModes.STACK)
                            {
                                engines.Add(me);
                                Debug.Log("added child ModuleEngine");
                            }
                        }
                    }
                }
            }
            if (HighLogic.LoadedSceneIsEditor)
            {
                Events["EditorToggle"].active = true;
            }
            else
            {
                Events["EditorToggle"].active = false;
            }
            Debug.Log("OnStart complete==============================");
        }
Ejemplo n.º 6
0
        public override void OnStart(PartModule.StartState state)
        {
            if (useAnimation)
            {
                deployStates = Utils.SetUpAnimation(animationName, part);

                foreach (var anim in deployStates)
                {
                    if (vtolModeEnabled)
                    {
                        anim.normalizedTime = targetAngle / maxAngle;
                    }

                    currentAngle = anim.normalizedTime * maxAngle;
                }
            }
        }
Ejemplo n.º 7
0
 public override void OnStart(PartModule.StartState state)
 {
     rcsStates = Utils.SetUpAnimation(AnimationName, this.part);
 }