示例#1
0
        static VersionCheckerEvent()
        {
            if (Application.isBatchMode)
            {
                return;
            }

            CreatorProjectSettings settings = CreatorProjectSettings.Load();

            if (settings == null || string.IsNullOrEmpty(settings.ProjectCreatorVersion))
            {
                return;
            }

            if (settings.ProjectCreatorVersion == unknownVersionString || EditorUtils.GetCoreVersion() == unknownVersionString)
            {
                return;
            }

            if (settings.ProjectCreatorVersion != EditorUtils.GetCoreVersion())
            {
                IAnalyticsTracker tracker = AnalyticsUtils.CreateTracker();
                tracker.Send(new AnalyticsEvent()
                {
                    Category = "creator", Action = "updated", Label = EditorUtils.GetCoreVersion()
                });
                settings.ProjectCreatorVersion = EditorUtils.GetCoreVersion();
                settings.Save();
            }
        }
示例#2
0
        private static void OnDependenciesRetrieved(object sender, DependencyManager.DependenciesEnabledEventArgs e)
        {
            CreatorProjectSettings settings = CreatorProjectSettings.Load();

            if (settings.IsFirstTimeStarted)
            {
                settings.IsFirstTimeStarted = false;
                settings.Save();
                Show();
            }

            DependencyManager.OnPostProcess -= OnDependenciesRetrieved;
        }
示例#3
0
 /// <summary>
 /// This is a check if the new input system is active OR another concrete implementation of the InputController exists.
 /// </summary>
 static InputSystemChecker()
 {
     try
     {
         // This will throw an InvalidOperationException when no concrete implementation is found.
         Type type = InputController.ConcreteType;
     }
     catch (InvalidOperationException)
     {
         if (CreatorProjectSettings.Load().IsFirstTimeStarted == false)
         {
             EditorUtility.DisplayDialog("Attention required!", message, "Understood");
         }
     }
 }
    /// <summary>
    /// Loads the Creator settings for this Unity project from Resources.
    /// </summary>
    /// <returns>Creator Settings</returns>
    public static CreatorProjectSettings Load()
    {
        CreatorProjectSettings settings = Resources.Load <CreatorProjectSettings>("CreatorProjectSettings");

        if (settings == null)
        {
            if (!Directory.Exists("Assets/Resources"))
            {
                Directory.CreateDirectory("Assets/Resources");
            }
            // Create an instance
            settings = CreateInstance <CreatorProjectSettings>();
            AssetDatabase.CreateAsset(settings, "Assets/Resources/CreatorProjectSettings.asset");
            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();

            return(settings);
        }
        return(settings);
    }