first commit
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
using PlasticGui;
|
||||
using Unity.PlasticSCM.Editor;
|
||||
|
||||
namespace Unity.Cloud.Collaborate
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
internal static class ToolbarBootstrap
|
||||
{
|
||||
static ToolbarBootstrap()
|
||||
{
|
||||
ToolbarButton.InitializeIfNeeded();
|
||||
}
|
||||
}
|
||||
|
||||
internal class ToolbarButton : SubToolbar
|
||||
{
|
||||
internal static void InitializeIfNeeded()
|
||||
{
|
||||
if (CollabPlugin.IsEnabled())
|
||||
return;
|
||||
|
||||
ToolbarButton toolbar = new ToolbarButton { Width = 32f };
|
||||
Toolbar.AddSubToolbar(toolbar);
|
||||
}
|
||||
|
||||
ToolbarButton()
|
||||
{
|
||||
PlasticPlugin.OnNotificationUpdated += OnPlasticNotificationUpdated;
|
||||
|
||||
mButtonGUIContent = new GUIContent(
|
||||
string.Empty, PlasticLocalization.Name.UnityVersionControl.GetString());
|
||||
}
|
||||
|
||||
~ToolbarButton()
|
||||
{
|
||||
PlasticPlugin.OnNotificationUpdated -= OnPlasticNotificationUpdated;
|
||||
}
|
||||
|
||||
void OnPlasticNotificationUpdated()
|
||||
{
|
||||
Toolbar.RepaintToolbar();
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect rect)
|
||||
{
|
||||
Texture icon = PlasticPlugin.GetPluginStatusIcon();
|
||||
EditorGUIUtility.SetIconSize(new Vector2(16, 16));
|
||||
|
||||
mButtonGUIContent.image = icon;
|
||||
|
||||
if (GUI.Button(rect, mButtonGUIContent, "AppCommand"))
|
||||
{
|
||||
PlasticPlugin.OpenPlasticWindowDisablingOfflineModeIfNeeded();
|
||||
}
|
||||
|
||||
EditorGUIUtility.SetIconSize(Vector2.zero);
|
||||
}
|
||||
|
||||
GUIContent mButtonGUIContent;
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 100f9184f13dd20448c29dc74f30dce1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "Unity.CollabProxy.Editor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"Unity.PlasticSCM.Editor"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": false,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 17b36165d09634a48bf5a0e4bb27f4bd
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user