コード例 #1
0
        void OnGUI()
        {
            _scrollViewPosition = EditorGUILayout.BeginScrollView(_scrollViewPosition);
            {
                var offsetY = EntitasEditorLayout.DrawHeaderTexture(this, _headerTexture);
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Version: " + _localVersion);
                GUILayout.Space(offsetY - 24);

                var descriptionStyle = new GUIStyle(GUI.skin.label);
                descriptionStyle.wordWrap = true;
                foreach (var migration in _migrations)
                {
                    EntitasEditorLayout.BeginVerticalBox();
                    {
                        EditorGUILayout.LabelField(migration.version, EditorStyles.boldLabel);
                        EditorGUILayout.LabelField(migration.description, descriptionStyle);
                        if (GUILayout.Button("Apply migration " + migration.version))
                        {
                            migrate(migration);
                        }
                    }
                    EntitasEditorLayout.EndVertical();
                }
            }
            EditorGUILayout.EndScrollView();
        }