Exemple #1
0
        /// <summary>
        /// Here when a part is attached. Is also called for the initial root part
        /// of a vessel.
        /// </summary>
        /// <param name="part"></param>
        private void OnPartAttached(Part part)
        {
            ModuleSimpleFuelSwitch module = ModuleSimpleFuelSwitch.TryFind(part);

            if (module != null)
            {
                module.OnPartAttached();
            }
        }
Exemple #2
0
        /// <summary>
        /// Here when an event happens to the part in the editor.
        /// </summary>
        /// <param name="eventType"></param>
        /// <param name="part"></param>
        private void OnEditorPartEvent(ConstructionEventType eventType, Part part)
        {
            switch (eventType)
            {
            case ConstructionEventType.PartCreated:
                OnPartCreated(part);
                break;

            case ConstructionEventType.PartAttached:
                ModuleSimpleFuelSwitch.OnPartAttached(part);
                break;

            default:
                // don't care about anything else
                break;
            }
        }