Esempio n. 1
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            //Get the animations
            deployStowAnimation = this.part.FindModuleImplementing <ModuleAnimateGenericSFX>();
            if (deployStowAnimation != null)
            {
                deployStowAnimation.Events["Toggle"].guiActiveEditor    = false;
                deployStowAnimation.Events["Toggle"].guiActive          = false;
                deployStowAnimation.Events["Toggle"].guiActiveUnfocused = false;
            }
            List <WBIAnimation> wbiAnimations = this.part.FindModulesImplementing <WBIAnimation>();

            foreach (WBIAnimation wbiAnim in wbiAnimations)
            {
                if (wbiAnim.animationName == upDownAnimationName)
                {
                    upDownAnimation = wbiAnim;
                    break;
                }
            }
            if (upDownAnimation != null)
            {
                upDownAnimation.showGui(false);
            }
            UpdateGUI();
        }
Esempio n. 2
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            //Get the telescopic animation
            anim = this.part.FindModuleImplementing <WBIAnimation>();
        }
Esempio n. 3
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            overheatDisplay = this.part.FindModuleImplementing <ModuleOverheatDisplay>();
            lightAnim       = this.part.FindModuleImplementing <WBIAnimation>();
            if (lightAnim != null)
            {
                lightAnim.showGui(false);
            }

            Events["StartResourceConverter"].guiActive       = false;
            Events["StartResourceConverter"].guiActiveEditor = false;
            Events["StopResourceConverter"].guiActive        = false;
            Events["StopResourceConverter"].guiActiveEditor  = false;
            Actions["StopResourceConverterAction"].active    = false;
            Actions["StartResourceConverterAction"].active   = false;

            if (reactorIsOn)
            {
                this.Activate();
                Events["ToggleReactor"].guiName = "Reactor Off";
            }
            else
            {
                Events["ToggleReactor"].guiName = "Reactor On";
            }
        }
Esempio n. 4
0
        public override void OnStart(StartState state)
        {
            if (animationLayer == kDefaultAnimationLayer)
            {
                animationLayer = kDefaultLightAnimationLayer;
            }

            base.OnStart(state);
            Animation anim = this.part.FindModelAnimators(animationName)[0];

            anim[animationName].layer = animationLayer;

            //Find the lights
            lights = this.part.gameObject.GetComponentsInChildren <Light>();
            Log("THERE! ARE! " + lights.Length + " LIGHTS!");
            setupLights();

            if (string.IsNullOrEmpty(toggleFriendAnimation) == false)
            {
                List <WBIAnimation> animations = this.part.FindModulesImplementing <WBIAnimation>();
                int          totalCount        = animations.Count;
                WBIAnimation friendAnim;
                for (int index = 0; index < totalCount; index++)
                {
                    friendAnim = animations[index];
                    if (friendAnim.animationName == toggleFriendAnimation)
                    {
                        friendAnimation = friendAnim;
                        break;
                    }
                }
            }
        }
Esempio n. 5
0
 public override void OnStart(StartState state)
 {
     base.OnStart(state);
     
     //Get the telescopic animation
     anim = this.part.FindModuleImplementing<WBIAnimation>();
 }
Esempio n. 6
0
        public override void OnStart(StartState state)
        {
            if (animationLayer == kDefaultAnimationLayer)
            {
                animationLayer = kDefaultLightAnimationLayer;
            }

            base.OnStart(state);
            Animation[] animators = this.part.FindModelAnimators(animationName);
            if (animators != null && animators.Length >= 1)
            {
                Animation anim = animators[0];
                anim[animationName].layer = animationLayer;
            }

            //Find the lights
            lights = this.part.gameObject.GetComponentsInChildren <Light>();
            Log("THERE! ARE! " + lights.Length + " LIGHTS!");
            setupLights();

            if (string.IsNullOrEmpty(toggleFriendAnimation) == false)
            {
                List <WBIAnimation> animations = this.part.FindModulesImplementing <WBIAnimation>();
                int          totalCount        = animations.Count;
                WBIAnimation friendAnim;
                for (int index = 0; index < totalCount; index++)
                {
                    friendAnim = animations[index];
                    if (friendAnim.animationName == toggleFriendAnimation)
                    {
                        friendAnimation = friendAnim;
                        break;
                    }
                }
            }

            if (fixedUpdateHelper == null)
            {
                fixedUpdateHelper = this.part.gameObject.AddComponent <FixedUpdateHelper>();
                fixedUpdateHelper.onFixedUpdateDelegate = OnUpdateFixed;
            }
            fixedUpdateHelper.enabled = true;
        }