static void InitializeProfilerSlaveProcess() { if (!File.Exists(userPrefProfilerLayoutPath) || File.GetLastWriteTime(systemProfilerLayoutPath) > File.GetLastWriteTime(userPrefProfilerLayoutPath)) { var parentDir = Path.GetDirectoryName(userPrefProfilerLayoutPath); if (parentDir != null && !System.IO.Directory.Exists(parentDir)) { System.IO.Directory.CreateDirectory(parentDir); } File.Copy(systemProfilerLayoutPath, userPrefProfilerLayoutPath, true); } WindowLayout.LoadWindowLayout(userPrefProfilerLayoutPath, false); SessionState.SetBool("OOPP.Initialized", true); EditorApplication.update -= InitializeProfilerSlaveProcessDomain; EditorApplication.update += InitializeProfilerSlaveProcessDomain; }
static void InitializeProfilerSlaveProcess() { if (!File.Exists(userPrefProfilerLayoutPath) || File.GetLastWriteTime(systemProfilerLayoutPath) > File.GetLastWriteTime(userPrefProfilerLayoutPath)) { var parentDir = Path.GetDirectoryName(userPrefProfilerLayoutPath); if (parentDir != null && !System.IO.Directory.Exists(parentDir)) { System.IO.Directory.CreateDirectory(parentDir); } File.Copy(systemProfilerLayoutPath, userPrefProfilerLayoutPath, true); } WindowLayout.LoadWindowLayout(userPrefProfilerLayoutPath, false); s_SlaveProfilerWindow = EditorWindow.GetWindowDontShow <ProfilerWindow>(); SetupProfilerWindow(s_SlaveProfilerWindow); EditorApplication.delayCall += SetupProfilerDriver; }
private static void OnModeChangeLayouts(ModeChangedArgs args) { // Prevent double loading the default/last layout already done by the WindowLayout system. if (args.prevIndex == -1) { return; } if (!HasCapability(ModeCapability.LayoutSwitching, true)) { return; } // Save previous mode layout var prevLayoutPath = Path.Combine(Application.temporaryCachePath, $"{k_ModeLayoutKeyName}-{GetModeId(args.prevIndex)}.wlt"); WindowLayout.SaveWindowLayout(prevLayoutPath); // Load exiting layout if available var modeLayoutPath = Path.Combine(Application.temporaryCachePath, $"{k_ModeLayoutKeyName}-{GetModeId(args.nextIndex)}.wlt"); if (File.Exists(modeLayoutPath)) { WindowLayout.LoadWindowLayout(modeLayoutPath, false, false); } else { var layouts = GetModeDataSection(args.nextIndex, k_LayoutsSectionName) as IList <object>; if (layouts != null && layouts.Count > 0) { var layoutPath = layouts[0] as string; if (layoutPath != null) { WindowLayout.LoadWindowLayout(layoutPath, false, false); } } } WindowLayout.ReloadWindowLayoutMenu(); }
public static bool LoadWindowLayout(string path) { return(WindowLayout.LoadWindowLayout(path, false)); }
public static bool LoadWindowLayout(string path) { bool newProjectLayoutWasCreated = false; return(WindowLayout.LoadWindowLayout(path, newProjectLayoutWasCreated)); }