Esempio n. 1
0
        private void OnGUI()
        {
            titleContent.text = "Unity Settings for Quest";
            EditorGUILayout.LabelField("Unity Preferences", EditorStyles.boldLabel);
            var allActions = new List <Action>();

            EditorGUILayout.LabelField($"{i18n.CacheServerModeLabel}: {UnityQuestSettings.GetCacheServerMode()}");

            if (!UnityQuestSettings.ValidateCacheServerMode())
            {
                EditorGUILayout.HelpBox(i18n.CacheServerHelp, MessageType.Warning);
                allActions.Add(UnityQuestSettings.EnableLocalCacheServer);
                if (GUILayout.Button(i18n.CacheServerButtonLabel))
                {
                    UnityQuestSettings.EnableLocalCacheServer();
                }
            }

            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Build Settings", EditorStyles.boldLabel);

            EditorGUILayout.LabelField($"{i18n.TextureCompressionLabel}: {UnityQuestSettings.GetAndroidTextureCompression()}");
            if (!UnityQuestSettings.ValidateAndroidTextureCompression())
            {
                EditorGUILayout.HelpBox(i18n.TextureCompressionHelp, MessageType.Warning);
                allActions.Add(UnityQuestSettings.EnableAndroidASTC);
                if (GUILayout.Button(i18n.TextureCompressionButtonLabel))
                {
                    UnityQuestSettings.EnableAndroidASTC();
                }
            }

            EditorGUILayout.Space();

            if (allActions.Count >= 2)
            {
                if (GUILayout.Button(i18n.ApplyAllButtonLabel))
                {
                    foreach (var action in allActions)
                    {
                        action();
                    }
                }
            }
            else if (allActions.Count == 0)
            {
                EditorGUILayout.HelpBox(i18n.AllAppliedHelp, MessageType.Info);
            }

            EditorGUILayout.Space();
            EditorGUILayout.Space();

            var showOnLoad = VRCQuestToolsSettings.IsShowSettingsWindowOnLoadEnabled;

            showOnLoad = EditorGUILayout.Toggle(i18n.ShowOnStartupLabel, showOnLoad);
            VRCQuestToolsSettings.IsShowSettingsWindowOnLoadEnabled = showOnLoad;
        }
Esempio n. 2
0
        static void DelayInit()
        {
            EditorApplication.delayCall -= DelayInit;
            var lastVersion = VRCQuestToolsSettings.LastVersion;
            var hasUpdated  = !lastVersion.Equals(VRCQuestTools.Version);

            if (hasUpdated)
            {
                VRCQuestToolsSettings.LastVersion = VRCQuestTools.Version;
            }
            var hasInvalidSettings = !UnityQuestSettings.ValidateAll();

            if (hasInvalidSettings && (VRCQuestToolsSettings.IsShowSettingsWindowOnLoadEnabled || hasUpdated))
            {
                Init();
            }
        }