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)); }
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()); }