Exemple #1
0
 public WheelAnimationHandler(KSPWheelSubmodule module, string animationName, float animationSpeed, int animationLayer, KSPWheelState initialState, bool invertAnimation, WrapMode wrapMode)
 {
     this.module           = module;
     callback              = (WheelAnimationCallback)module;//dirty, but whatever...
     this.currentAnimState = initialState;
     this.invertAnimation  = invertAnimation;
     this.wrapMode         = wrapMode;
     this.animationData.Add(new AnimationData(module.part, animationName, animationSpeed, animationLayer, wrapMode));
 }
Exemple #2
0
        public static T[] getControllerSubmodules <T>(this KSPWheelSubmodule s) where T : KSPWheelSubmodule
        {
            List <T> modules = new List <T>();
            int      len     = s.controller.subModules.Count;

            for (int i = 0; i < len; i++)
            {
                if (s.controller.subModules[i] is T)
                {
                    modules.Add((T)s.controller.subModules[i]);
                }
            }
            return(modules.ToArray());
        }