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); }); }
public virtual void Init(IAtomPlugin plugin, object arg) { this.plugin = plugin; prefabFactory = gameObject.AddComponent <VamPrefabFactory>(); prefabFactory.plugin = plugin; plugin.animationEditContext.onCurrentAnimationChanged.AddListener(OnCurrentAnimationChanged); }
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); }
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; }
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>(); }
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(); }
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); }
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); }
public static ScreensManager Configure(GameObject go) { var content = VamPrefabFactory.CreateScrollRect(go); return(content.gameObject.AddComponent <ScreensManager>()); }