Пример #1
0
        public static void ShowWindow()
        {
            FindOrCreateWorldDescriptor();
            FindOrCreateCamera();
            FillDefaultDataIfNull();

            GetWindowWithRect(typeof(CreateSceneTemplateWindow),
                              _windowRect,
                              false,
                              "Create scene template");
            _locationName           = _worldDescriptor.Name;
            _locationDesc           = _worldDescriptor.Description;
            _guid                   = _worldDescriptor.Guid;
            _rootGuid               = _worldDescriptor.RootGuid;
            _mobileReady            = SdkSettings.MobileFeature.Enabled && _worldDescriptor.MobileReady;
            _currentVersionWasBuilt = _worldDescriptor.CurrentVersionWasBuilt;

            if (string.IsNullOrWhiteSpace(_worldDescriptor.AuthorName))
            {
                AuthorSettings.Initialize();
                _authorName  = AuthorSettings.Name;
                _authorEmail = AuthorSettings.Email;
                _authorUrl   = AuthorSettings.Url;
            }
            else
            {
                _authorName  = _worldDescriptor.AuthorName;
                _authorEmail = _worldDescriptor.AuthorEmail;
                _authorUrl   = _worldDescriptor.AuthorUrl;
            }
        }
Пример #2
0
        static void Init()
        {
            var window = GetWindow <CreateObjectWindow>(true, "Create object", true);

            window.minSize = MinWindowSize;
            window.maxSize = MaxWindowSize;
            window.Show();

            _existingObjectNames = ObjectBuildHelper.GetExistingObjectsNames();

            if (Selection.activeGameObject != null)
            {
                _gameObject = Selection.activeGameObject;

                string objectTypeName = Regex.Replace(_gameObject.name, "([A-ZА-Я])", " $1");
                objectTypeName   = ObjectBuildHelper.ConvertToNiceName(objectTypeName).Trim();
                _objectClassName = objectTypeName
                                   .Replace(" ", "")
                                   .Replace("(", "")
                                   .Replace(")", "")
                                   .Replace("-", "");

                _localizedName   = objectTypeName;
                _localizedNameRU = objectTypeName;
            }

            AuthorSettings.Initialize();
            _authorName  = AuthorSettings.Name;
            _authorEmail = AuthorSettings.Email;
            _authorUrl   = AuthorSettings.Url;

            _scrollPosition = Vector2.zero;
        }
Пример #3
0
        private void DrawAuthorSettings()
        {
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);

            GUILayout.Label("Author:", EditorStyles.miniBoldLabel);
            _authorName  = EditorGUILayout.TextField("Name", _authorName);
            _authorEmail = EditorGUILayout.TextField("E-Mail", _authorEmail);
            _authorUrl   = EditorGUILayout.TextField("URL", _authorUrl);

            GUILayout.BeginHorizontal();

            if (GUILayout.Button("Reset to default author settings"))
            {
                AuthorSettings.Initialize();

                if (string.IsNullOrWhiteSpace(AuthorSettings.Name))
                {
                    AuthorSettingsWindow.Init();
                }
                else
                {
                    _authorName  = AuthorSettings.Name;
                    _authorEmail = AuthorSettings.Email;
                    _authorUrl   = AuthorSettings.Url;
                }
            }

            GUILayout.EndHorizontal();

            DrawAuthorCanNotBeEmptyHelpBox();

            EditorGUILayout.EndVertical();
        }
Пример #4
0
        public static void Init()
        {
            _window = GetWindow <AuthorSettingsWindow>(false, "Default Author Info", true);

            _window.minSize = WindowSize;
            _window.maxSize = WindowSize;

            _window.Show();

            AuthorSettings.Initialize();
        }
Пример #5
0
        private void DrawReloadButton()
        {
            bool enabled = AuthorSettings.IsChanged();

            EditorGUI.BeginDisabledGroup(!enabled);
            if (GUILayout.Button("Reload"))
            {
                AuthorSettings.Initialize();
                Debug.Log("Default author info have been reloaded.");
            }
            EditorGUI.EndDisabledGroup();
        }
Пример #6
0
 private void DrawRevertToDefaultValuesButton()
 {
     if (GUILayout.Button("Clear"))
     {
         if (EditorUtility.DisplayDialog("Default author info", $"Default author info will revert", "OK", "Cancel"))
         {
             AuthorSettings.Clear();
             AuthorSettings.Initialize();
             Debug.Log("Default author info have been reverted.");
         }
     }
 }
Пример #7
0
        private void DrawSaveButton()
        {
            bool enabled = AuthorSettings.IsChanged() && !string.IsNullOrWhiteSpace(AuthorSettings.Name);

            EditorGUI.BeginDisabledGroup(!enabled);
            if (GUILayout.Button("Save"))
            {
                AuthorSettings.SaveAll();
                AuthorSettings.Initialize();
                Debug.Log("Default author info have been updated.");
            }
            EditorGUI.EndDisabledGroup();
        }
Пример #8
0
        private void OnGUI()
        {
            if (string.IsNullOrWhiteSpace(AuthorSettings.SavedName))
            {
                AuthorSettings.Initialize();
            }

            GUILayout.BeginVertical(EditorStyles.inspectorFullWidthMargins);
            DrawFields();
            EditorGUILayout.Space();
            DrawControls();
            DrawNameCanNotBeEmptyHelpBox();
            GUILayout.EndVertical();
        }