internal static void EnableForWorkspace() { if (sIsEnabledForWorkspace) { return; } WorkspaceInfo wkInfo = FindWorkspace.InfoForApplicationPath( Application.dataPath, PlasticApp.PlasticAPI); if (wkInfo == null) { return; } sIsEnabledForWorkspace = true; PlasticApp.SetWorkspace(wkInfo); AssetStatusCache = new AssetStatusCache( wkInfo, PlasticApp.PlasticAPI.IsGluonWorkspace(wkInfo)); AssetMenuItems.Enable(); AssetsProcessors.Enable(); DrawAssetOverlay.Enable(); DrawInspectorOperations.Enable(); }
void OnEnable() { processor.AssetModificationProcessor.ForceCheckout = EditorPrefs.GetBool("forceCheckoutPlasticSCM"); wantsMouseMove = true; if (mException != null) { return; } minSize = new Vector2( UnityConstants.PLASTIC_WINDOW_MIN_SIZE_WIDTH, UnityConstants.PLASTIC_WINDOW_MIN_SIZE_HEIGHT); SetupWindowTitle(); GuiMessage.Initialize(new UnityPlasticGuiMessage(this)); PlasticApp.InitializeIfNeeded(); RegisterApplicationFocusHandlers(this); PlasticMethodExceptionHandling.InitializeAskCredentialsUi( new CredentialsUiImpl(this)); ClientEncryptionServiceProvider.SetEncryptionPasswordProvider( new MissingEncryptionPasswordPromptHandler(this)); if (mPlasticAPI == null) { mPlasticAPI = new PlasticAPI(); } mPlasticWebRestApi = new PlasticWebRestApi(); mEventSenderScheduler = EventTracking.Configure( mPlasticWebRestApi, AssetsPath.IsRunningAsUPMPackage() ? ApplicationIdentifier.UnityPackage : ApplicationIdentifier.UnityAssetStorePlugin, IdentifyEventPlatform.Get()); if (mEventSenderScheduler != null) { mPingEventLoop = new PingEventLoop(); mPingEventLoop.Start(); mPingEventLoop.SetUnityVersion(Application.unityVersion); CollabPlugin.GetVersion(pluginVersion => mPingEventLoop.SetPluginVersion(pluginVersion)); } InitializePlastic(); }
internal static void Enable() { if (sIsEnabled) { return; } sIsEnabled = true; PlasticApp.InitializeIfNeeded(); if (!FindWorkspace.HasWorkspace(Application.dataPath)) { return; } EnableForWorkspace(); }
static void ClosePlasticWindow(PlasticWindow window) { UnRegisterApplicationFocusHandlers(window); PlasticApp.Dispose(); DrawInspectorOperations.Disable(); DrawAssetOverlay.Dispose(); if (window.mEventSenderScheduler != null) { window.mPingEventLoop.Stop(); window.mEventSenderScheduler.End(); } DisposeNewIncomingChanges(window); AvatarImages.Dispose(); }
internal static void Disable() { try { PlasticApp.Dispose(); if (!sIsEnabledForWorkspace) { return; } AssetsProcessors.Disable(); AssetMenuItems.Disable(); DrawAssetOverlay.Disable(); DrawInspectorOperations.Disable(); } finally { sIsEnabled = false; sIsEnabledForWorkspace = false; } }
void OnEnable() { wantsMouseMove = true; if (mException != null) { return; } GuiMessage.Initialize(new UnityPlasticGuiMessage(this)); PlasticApp.Initialize(); RegisterApplicationFocusHandlers(this); CredentialsUIRegistrar.RegisterCredentialsUI( new CredentialsUiImpl(this)); ClientEncryptionServiceProvider.SetEncryptionPasswordProvider( new MissingEncryptionPasswordPromptHandler(this)); mPlasticAPI = new PlasticAPI(); mPingEventLoop = new PingEventLoop(); mEventSenderRestApi = new SimpleEventSenderRestApi( PlasticWebApiUris.GetBaseUri()); mEventSenderScheduler = EventTracking.Configure( mEventSenderRestApi, ApplicationIdentifier.UnityPackage, IdentifyEventPlatform.Get()); if (mEventSenderScheduler != null) { mPingEventLoop.Start(); } InitializePlastic(); EditorApplication.update += AutoCommitOperation.AutoCommit; }
void OnEnable() { wantsMouseMove = true; if (mException != null) { return; } SetupWindowTitle(false); GuiMessage.Initialize(new UnityPlasticGuiMessage(this)); PlasticApp.InitializeIfNeeded(); RegisterApplicationFocusHandlers(this); PlasticMethodExceptionHandling.InitializeAskCredentialsUi( new CredentialsUiImpl(this)); ClientEncryptionServiceProvider.SetEncryptionPasswordProvider( new MissingEncryptionPasswordPromptHandler(this)); mPlasticAPI = new PlasticAPI(); mPlasticWebRestApi = new PlasticWebRestApi(); mEventSenderScheduler = EventTracking.Configure( mPlasticWebRestApi, ApplicationIdentifier.UnityPackage, IdentifyEventPlatform.Get()); if (mEventSenderScheduler != null) { mPingEventLoop = new PingEventLoop(); mPingEventLoop.Start(); mPingEventLoop.SetUnityVersion(Application.unityVersion); } InitializePlastic(); }