private void Construct(GitManager gitManager, GitReflectionHelper reflectionHelper, UniGitData data, ILogger logger, GitSettingsJson gitSettings, GitCallbacks gitCallbacks, GitInitializer initializer, GitSettingsManager settingsManager, UniGitPaths paths, IGitResourceManager resourceManager) { this.resourceManager = resourceManager; this.paths = paths; this.settingsManager = settingsManager; this.logger = logger; this.gitSettings = gitSettings; this.initializer = initializer; if (gitManager == null) { logger.Log(LogType.Error, "Git manager cannot be null."); return; } if (this.gitCallbacks != null) { Unsubscribe(this.gitCallbacks); } this.data = data; this.gitManager = gitManager; this.gitManager.AddWatcher(this); this.reflectionHelper = reflectionHelper; Subscribe(gitCallbacks); }
internal static void Init(GitManager gitManager, GitExternalManager externalManager, GitCallbacks gitCallbacks, ILogger logger, GitProjectOverlay gitProjectOverlay, GitReflectionHelper reflectionHelper, GitInitializer initializer) { GitProjectContextMenus.gitManager = gitManager; GitProjectContextMenus.externalManager = externalManager; GitProjectContextMenus.gitCallbacks = gitCallbacks; GitProjectContextMenus.logger = logger; GitProjectContextMenus.reflectionHelper = reflectionHelper; GitProjectContextMenus.gitProjectOverlay = gitProjectOverlay; GitProjectContextMenus.initializer = initializer; }
public GitProjectOverlay(GitManager gitManager, GitCallbacks gitCallbacks, GitSettingsJson gitSettings, GitAsyncManager asyncManager, GitReflectionHelper reflectionHelper, GitOverlay gitOverlay, IGitPrefs prefs, UniGitData data, ILogger logger, InjectionHelper injectionHelper, [UniGitInjectOptional] bool cullNonAssetPaths = true) { if (iconStyle == null) { iconStyle = new GUIStyle { imagePosition = ImagePosition.ImageOnly, alignment = TextAnchor.LowerLeft, padding = new RectOffset(2, 2, 2, 2) }; lineStyle = new GUIStyle(EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector).FindStyle("IN Title")) { padding = new RectOffset(), margin = new RectOffset(), contentOffset = Vector2.zero, fixedHeight = 0, fixedWidth = 0, border = { left = 0, right = 0 } }; } this.logger = logger; this.data = data; this.gitManager = gitManager; this.gitSettings = gitSettings; this.asyncManager = asyncManager; this.gitCallbacks = gitCallbacks; this.reflectionHelper = reflectionHelper; this.gitOverlay = gitOverlay; this.prefs = prefs; this.cullNonAssetPaths = cullNonAssetPaths; this.injectionHelper = injectionHelper; gitManager.AddWatcher(this); gitCallbacks.EditorUpdate += OnEditorUpdate; gitCallbacks.ProjectWindowItemOnGUI += CustomIcons; gitCallbacks.UpdateRepository += OnUpdateRepository; //project browsers only get created before delay call but not before constructor gitCallbacks.DelayCall += () => { projectWindows = new List <EditorWindow>(Resources.FindObjectsOfTypeAll(reflectionHelper.ProjectWindowType).Cast <EditorWindow>()); }; //shortcut to getting instance id without loading asset var method = typeof(AssetDatabase).GetMethod("GetMainAssetOrInProgressProxyInstanceID", BindingFlags.NonPublic | BindingFlags.Static); if (method != null) { GetMainAssetOrInProgressProxyInstanceID = (Func <string, int>)Delegate.CreateDelegate(typeof(Func <string, int>), method); } }