MenuOpenProject() 개인적인 메소드

private MenuOpenProject ( ) : void
리턴 void
예제 #1
0
        static void CheckForAutoOpen()
        {
            double timeInSeconds            = (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
            int    unityLaunchTimeInSeconds = (int)(timeInSeconds - EditorApplication.timeSinceStartup);
            int    prevUnityLaunchTime      = EditorPrefs.GetInt("VSCode_UnityLaunchTime", 0);

            if (unityLaunchTimeInSeconds > prevUnityLaunchTime)
            {
                VSCode.MenuOpenProject();
                EditorPrefs.SetInt("VSCode_UnityLaunchTime", unityLaunchTimeInSeconds);
            }
        }
예제 #2
0
파일: VSCode.cs 프로젝트: dftty/LeetCode
        /// <summary>
        /// Checks whether it should auto-open VSCode
        /// </summary>
        /// <remarks>
        /// VSCode() gets called on Launch and Run, through IntializeOnLoad
        /// https://docs.unity3d.com/ScriptReference/InitializeOnLoadAttribute.html
        /// To make sure it only opens VSCode when Unity (re)launches (i.e. opens a project),
        /// we compare the launch time, which we calculate using EditorApplication.timeSinceStartup.
        /// </remarks>
        static void CheckForAutoOpen()
        {
            double timeInSeconds            = (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
            int    unityLaunchTimeInSeconds = (int)(timeInSeconds - EditorApplication.timeSinceStartup);
            int    prevUnityLaunchTime      = EditorPrefs.GetInt("VSCode_UnityLaunchTime", 0);

            // If launch time has changed, then Unity was re-opened
            if (unityLaunchTimeInSeconds > prevUnityLaunchTime)
            {
                // Launch VSCode
                VSCode.MenuOpenProject();
                // Save new launch time
                EditorPrefs.SetInt("VSCode_UnityLaunchTime", unityLaunchTimeInSeconds);
            }
        }
예제 #3
0
파일: VSCode.cs 프로젝트: Kazura23/PowerUp
        /// <summary>
        /// Integration Constructor
        /// </summary>
        static VSCode()
        {
            if (Enabled)
            {
                UpdateUnityPreferences(true);
                UpdateLaunchFile();

                // Add Update Check
                DateTime targetDate = LastUpdate.AddDays(UpdateTime);
                if (DateTime.Now >= targetDate && AutomaticUpdates)
                {
                    CheckForUpdate();
                }

                // Open VS Code automatically when project is loaded
                if (AutoOpenEnabled)
                {
                    VSCode.MenuOpenProject();
                }
            }

            // Event for when script is reloaded
            System.AppDomain.CurrentDomain.DomainUnload += System_AppDomain_CurrentDomain_DomainUnload;
        }