private void OnEnable()
    {
        tabContainer = new TabContainer(this.rootVisualElement);
        ListEnemyConfig      listEnemyConfig      = new ListEnemyConfig(GameConfig.Instance.enemyConfigs);
        ListTableEnemyConfig listTableEnemyConfig = new ListTableEnemyConfig(GameConfig.Instance.enemyConfigs);
        PlayerConfigEditor   playerConfigEditor   = new PlayerConfigEditor();

        //ScrollView
        //Set Flex direction of container to flew-row
        //Adjust Content Height Manual
        tabContainer.AddTab("EnemyConfig_GridView", listEnemyConfig, true);

        //Adjust Content Width Manual
        tabContainer.AddTab("EnemyConfig_ListView", listTableEnemyConfig);

        tabContainer.AddTab("Player Config", playerConfigEditor);
    }
Ejemplo n.º 2
0
        protected override async Task OnInitializedAsync()
        {
            await base.OnInitializedAsync();

            if (!TabContainer.Exists(Name))
            {
                TabContainer.AddTab(this);
            }
        }
Ejemplo n.º 3
0
        protected override async Task OnInitializedAsync()
        {
            await base.OnInitializedAsync();

            if (string.IsNullOrWhiteSpace(Name))
            {
                Name = "tab_" + (++tabIndex);
            }
            if (!TabContainer.Exists(Name))
            {
                Console.WriteLine("Add Tab:" + Name);
                TabContainer.AddTab(this);
            }
        }