public void GetInvocationData()
    {
        string levelName   = null;
        int    playerCount = -1;

        requestData = null;

        // Iterate through all selector components (Levels, Character count)
        foreach (var pair in selector.SubSelectionEntries)
        {
            // The apply button has no components
            if (pair.Value.Components.Count > 0)
            {
                GameObject            selectedMenuComponent = pair.Value.Components[pair.Value.Current];
                AbstractActionHandler componentAction       = selectedMenuComponent.GetComponent <AbstractActionHandler>();

                if (componentAction is LeaderboardWorldAction)
                {
                    levelName = ((LeaderboardWorldAction)componentAction).world.ToString();
                }
                else if (componentAction is LeaderboardPlayerCountAction)
                {
                    playerCount = (int)((LeaderboardPlayerCountAction)componentAction).playerCount;
                }

                // Apply the action of each menu component
                componentAction.PerformAction <AbstractActionHandler>(this);
            }
        }

        requestData = new RequestData(levelName, playerCount);
    }
示例#2
0
    private void ApplyQualitySettings()
    {
        // Iterate through all selector components (Resolution, Quality, Anti-Aliasing, ...)
        foreach (var pair in selector.SubSelectionEntries)
        {
            // The apply button has no components
            if (pair.Value.Components.Count > 0)
            {
                GameObject            selectedSetting = pair.Value.Components[pair.Value.Current];
                AbstractActionHandler settingAction   = selectedSetting.GetComponent <AbstractActionHandler>();

                // Apply the action of each selected setting (of the specific component)
                settingAction.PerformAction <AbstractActionHandler>(this);
            }
        }
    }