Beispiel #1
0
        private IEnumerator InitUIDeferred()
        {
            yield return(StartCoroutine(VamPrefabFactory.LoadUIAssets()));

            var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>();

            var scrollRect = scriptUI.fullWidthUIContent.transform.parent.parent.parent.GetComponent <ScrollRect>();

            if (scrollRect == null)
            {
                SuperController.LogError("VamTimeline: Scroll rect not at the expected hierarchy position");
            }
            else
            {
                scrollRect.elasticity   = 0;
                scrollRect.inertia      = false;
                scrollRect.movementType = ScrollRect.MovementType.Clamped;
            }

            ui             = Editor.AddTo(scriptUI.fullWidthUIContent);
            ui.popupParent = UITransform;
            ui.Bind(this);
            if (animation != null)
            {
                ui.Bind(animation);
            }
            ui.screensManager.onScreenChanged.AddListener(screen =>
            {
                if (controllerInjectedUI != null)
                {
                    controllerInjectedUI.screensManager.ChangeScreen(screen);
                }
                peers.SendScreen(screen);
            });
        }
Beispiel #2
0
 public virtual void Init(IAtomPlugin plugin, object arg)
 {
     this.plugin          = plugin;
     prefabFactory        = gameObject.AddComponent <VamPrefabFactory>();
     prefabFactory.plugin = plugin;
     plugin.animationEditContext.onCurrentAnimationChanged.AddListener(OnCurrentAnimationChanged);
 }
Beispiel #3
0
        public void Bind(IAtomPlugin plugin, string defaultScreen = null)
        {
            _plugin = plugin;

            _leftPanelPrefabFactory        = leftPanel.AddComponent <VamPrefabFactory>();
            _leftPanelPrefabFactory.plugin = plugin;

            _controlPanel = CreateControlPanel(leftPanel);
            _controlPanel.Bind(plugin);

            InitClipboardUI();

            InitChangeCurveTypeUI();

            _curves = InitCurvesUI();

            tabs.Add(AnimationsScreen.ScreenName);
            tabs.Add(TargetsScreen.ScreenName);
            tabs.Add(EditAnimationScreen.ScreenName);
            tabs.Add(MoreScreen.ScreenName);
            _expandButton = tabs.Add("Collapse >");
            InitToggleRightPanelButton(_expandButton);
            tabs.onTabSelected.AddListener(screenName =>
            {
                screensManager.ChangeScreen(screenName);
                Expand(true);
            });

            screensManager = InitScreensManager(rightPanel);
            screensManager.onScreenChanged.AddListener(screenName => tabs.Select(screenName));
            screensManager.Bind(plugin, defaultScreen);
        }
Beispiel #4
0
 public virtual void Init(IAtomPlugin plugin)
 {
     this.plugin          = plugin;
     prefabFactory        = gameObject.AddComponent <VamPrefabFactory>();
     prefabFactory.plugin = plugin;
     plugin.animation.onCurrentAnimationChanged.AddListener(OnCurrentAnimationChanged);
     current = plugin.animation?.current;
 }
Beispiel #5
0
        public DopeSheet()
        {
            CreateBackground(gameObject, _style.BackgroundColor);
            CreateLabelsBackground();

            _content = VamPrefabFactory.CreateScrollRect(gameObject);
            _content.GetComponent <VerticalLayoutGroup>().spacing = _style.RowSpacing;
            _scrubberRect = CreateScrubber(_content.transform.parent.gameObject, _style.ScrubberColor).GetComponent <RectTransform>();
        }
Beispiel #6
0
 public void Bind(IAtomPlugin plugin)
 {
     _prefabFactory        = gameObject.AddComponent <VamPrefabFactory>();
     _prefabFactory.plugin = plugin;
     _animationsJSON       = InitAnimationSelectorUI();
     _scrubber             = InitScrubber();
     InitFrameNav(plugin.manager.configurableButtonPrefab);
     InitPlaybackButtons(plugin.manager.configurableButtonPrefab);
     _dopeSheet = InitDopeSheet();
 }
Beispiel #7
0
        public static CurveTypePopup Create(VamPrefabFactory prefabFactory)
        {
            var curveTypeJSON = new JSONStorableStringChooser("Change curve", CurveTypeValues.labels2, "", "Curve type");
            var curveTypeUI   = prefabFactory.CreatePopup(curveTypeJSON, false, true);

            curveTypeUI.popupPanelHeight = 260f;

            var curveTypePopup = curveTypeUI.gameObject.AddComponent <CurveTypePopup>();

            curveTypePopup.curveTypeJSON = curveTypeJSON;
            curveTypePopup.curveTypeUI   = curveTypeUI;

            return(curveTypePopup);
        }
Beispiel #8
0
        public static CurveTypePopup Create(VamPrefabFactory prefabFactory)
        {
            var curveTypeJSON = new JSONStorableStringChooser("Change curve", CurveTypeValues.DisplayCurveTypes, "", "Change curve");
            var curveTypeUI   = prefabFactory.CreateScrollablePopup(curveTypeJSON);

            curveTypeUI.popupPanelHeight = 300f;

            var curveTypePopup = curveTypeUI.gameObject.AddComponent <CurveTypePopup>();

            curveTypePopup.curveTypeJSON = curveTypeJSON;
            curveTypePopup.curveTypeUI   = curveTypeUI;

            return(curveTypePopup);
        }
Beispiel #9
0
        public static ScreensManager Configure(GameObject go)
        {
            var content = VamPrefabFactory.CreateScrollRect(go);

            return(content.gameObject.AddComponent <ScreensManager>());
        }