protected virtual void InitializeSelector()
    {
        TransitionHandlerInterface[] pickedTransitions    = MenuReloadedUtil.MapTransitionEnumToHandler(transitions);
        ElementPressedHandler[]      pickedPressedHandler = MenuReloadedUtil.MapElementPressedEnumToHandler(pressedHandlerEnum);

        if (menuSelection != MenuSelection.SubSelection)
        {
            selector = new Selector(startIndex, components, pickedTransitions, pickedPressedHandler, true);
        }
        else
        {
            selector = new SelectorWithSubSelector(startIndex, components, pickedTransitions, pickedPressedHandler, false, MenuReloadedUtil.MapTransitionEnumToHandler(subSelectorTransition));
        }
    }
    public void HandleMenuSpawnTransition(Dictionary <int, GameObject> components, SelectorInterface selector)
    {
        foreach (var pair in components)
        {
            NavigationInformation info = pair.Value.GetComponent <NavigationInformation>();
            RectTransform         rect = pair.Value.GetComponent <RectTransform>();

            rect.localScale = Vector3.zero;

            if (pair.Key == selector.Current)
            {
                LeanTween.scale(rect, info.OriginalScale, tweenTime).setEase(easeType).setUseEstimatedTime(true);
            }
            else
            {
                LeanTween.scale(rect, info.DeselectedScale, tweenTime).setEase(easeType).setUseEstimatedTime(true);
            }
        }
    }
Exemple #3
0
    private void Initialize()
    {
        // Initialize the menu manager and the selector
        menuManager = GetComponent <AbstractMenuManager>();
        selector    = menuManager.Selector;
        menuManager.NavigationNext     += HandleNextSelection;
        menuManager.NavigationPrevious += HandlePreviousSelection;

        levelIslands = new RectTransform[menuManager.MenuComponents.Count];

        // Fill the internal level array
        for (int i = 0; i < levelIslands.Length; i++)
        {
            GameObject tmp;
            menuManager.MenuComponents.TryGetValue(i, out tmp);
            levelIslands[i] = tmp.GetComponent <RectTransform>();
        }

        // Other initialization steps
        originalArrowColor = leftArrow.color;
        RepositionElements();
    }
    private void Initialize()
    {
        menuManager = GetComponent <AbstractMenuManager>();
        menuManager.NavigationNext     += HandleSelectionChange;
        menuManager.NavigationPrevious += HandleSelectionChange;

        menuManager.NavigationNext     += TextChangedNext;
        menuManager.NavigationPrevious += TextChangedPrevious;

        selector = menuManager.Selector;

        gameModes = new ImageData[menuManager.MenuComponents.Count];
        for (int i = 0; i < gameModes.Length; i++)
        {
            GameObject tmp;
            menuManager.MenuComponents.TryGetValue(i, out tmp);
            gameModes[i] = new ImageData(tmp.GetComponent <RectTransform>());
        }

        outerBorderPointUp   = new Vector2(textPosition.x, 1200f);
        outerBorderPointDown = new Vector2(textPosition.x, -outerBorderPointUp.y);
        TweenText(wavesTextContainer, outerBorderPointUp, textPosition);
    }
        public FiledSelector(SelectorInterface f)
        {
            InitializeComponent();

            Element = f;
        }