Ejemplo n.º 1
0
        void OnGUI()
        {
            _scrollViewPosition = EditorGUILayout.BeginScrollView(_scrollViewPosition);
            {
                EntitasEditorLayout.DrawTexture(_headerTexture);

                var descriptionStyle = new GUIStyle(GUI.skin.label);
                descriptionStyle.wordWrap = true;
                for (int i = 0; i < _migrations.Length; i++)
                {
                    var migration = _migrations[i];
                    _showMigration[i] = EntitasEditorLayout.DrawSectionHeaderToggle(migration.version, _showMigration[i]);
                    if (_showMigration[i])
                    {
                        EntitasEditorLayout.BeginSectionContent();
                        {
                            EditorGUILayout.LabelField(migration.description, descriptionStyle);
                            if (GUILayout.Button("Apply migration " + migration.version))
                            {
                                migrate(migration, this);
                            }
                        }
                        EntitasEditorLayout.EndSectionContent();
                    }
                }
            }
            EditorGUILayout.EndScrollView();
        }