示例#1
0
 public void Remove(IAtomPlugin plugin)
 {
     plugin.RemoveSpacer(Component.Container);
 }
示例#2
0
        public virtual void Dispose()
        {
            onScreenChangeRequested.RemoveAllListeners();
            plugin.animation.CurrentAnimationChanged.RemoveListener(OnCurrentAnimationChanged);

            _disposing = true;
            foreach (var component in _storables)
            {
                if (component == null)
                {
                    continue;
                }

                if (component is JSONStorableStringChooser)
                {
                    plugin.RemovePopup((JSONStorableStringChooser)component);
                }
                else if (component is JSONStorableFloat)
                {
                    plugin.RemoveSlider((JSONStorableFloat)component);
                }
                else if (component is JSONStorableString)
                {
                    plugin.RemoveTextField((JSONStorableString)component);
                }
                else if (component is JSONStorableBool)
                {
                    plugin.RemoveToggle((JSONStorableBool)component);
                }
                else
                {
                    SuperController.LogError($"VamTimeline: Cannot remove component {component}");
                }
            }
            _storables.Clear();

            foreach (var component in _components)
            {
                if (component is UIDynamicButton)
                {
                    plugin.RemoveButton((UIDynamicButton)component);
                }
                else if (component is UIDynamicPopup)
                {
                    plugin.RemovePopup((UIDynamicPopup)component);
                }
                else if (component is UIDynamicSlider)
                {
                    plugin.RemoveSlider((UIDynamicSlider)component);
                }
                else if (component is UIDynamicTextField)
                {
                    plugin.RemoveTextField((UIDynamicTextField)component);
                }
                else if (component is UIDynamicToggle)
                {
                    plugin.RemoveToggle((UIDynamicToggle)component);
                }
                else
                {
                    plugin.RemoveSpacer(component);
                }
            }
            _components.Clear();
        }