Ejemplo n.º 1
0
        private static RevisionsData InternalGetRevisionsData(bool withChanges, int startIndex, int numRevisions)
        {
            RevisionsData result;

            Collab.InternalGetRevisionsData_Injected(withChanges, startIndex, numRevisions, out result);
            return(result);
        }
Ejemplo n.º 2
0
        public static Collab.CollabStates GetAssetState(String assetGuid)
        {
            if (!Collab.instance.IsCollabEnabledForCurrentProject())
            {
                return(Collab.CollabStates.kCollabNone);
            }

            Collab.CollabStates assetState = Collab.GetAssetState(assetGuid, AssetDatabase.GUIDToAssetPath(assetGuid));
            return(assetState);
        }
Ejemplo n.º 3
0
        public static void OnProjectWindowItemIconOverlay(string guid, Rect drawRect)
        {
            bool flag = CollabAccess.Instance.IsServiceEnabled();

            if (flag)
            {
                Collab instance = Collab.instance;
                Collab.CollabStates assetState = instance.GetAssetState(guid);
                Overlay.DrawOverlays(assetState, drawRect);
            }
        }
Ejemplo n.º 4
0
 public static void OnProjectWindowItemIconOverlay(string guid, Rect drawRect)
 {
     if (CollabAccess.Instance.IsServiceEnabled() && UnityConnect.instance.userInfo.whitelisted)
     {
         Collab instance = Collab.instance;
         if (instance.collabInfo.whitelisted)
         {
             Overlay.DrawOverlays(instance.GetAssetState(guid), drawRect);
         }
     }
 }
Ejemplo n.º 5
0
 // Static constructor for Collab
 static Collab()
 {
     s_Instance = new Collab();
     s_Instance.projectBrowserSingleSelectionPath     = string.Empty;
     s_Instance.projectBrowserSingleMetaSelectionPath = string.Empty;
     s_Instance.m_nativeCollab = GetNativeCollab();
     ObjectListArea.postAssetIconDrawCallback    += CollabProjectHook.OnProjectWindowIconOverlay;
     AssetsTreeViewGUI.postAssetIconDrawCallback += CollabProjectHook.OnProjectBrowserNavPanelIconOverlay;
     InitializeSoftlocksViewController();
     CollabSettingsManager.statusNotifier[CollabSettingType.InProgressEnabled] += OnSettingStatusChanged;
     CollabSettingsManager.statusNotifier[CollabSettingType.InProgressEnabled] += SoftlockViewController.Instance.softLockFilters.OnSettingStatusChanged;
 }
Ejemplo n.º 6
0
        private static void onFetchSingleRevision(IntPtr ptr)
        {
            Revision?ret = null;

            if (instance.FetchSingleRevisionCallback != null && ptr != IntPtr.Zero)
            {
                Revision nativeStruct = Collab.PopulateSingleRevisionData(ptr);
                // this copies the content as it's a struct not a class.
                ret = nativeStruct;
            }

            instance.FetchSingleRevisionCallback(ret);
        }
Ejemplo n.º 7
0
 static Collab()
 {
     Collab.s_IsFirstStateChange = true;
     Collab.clientType           = new string[]
     {
         "Cloud Server",
         "Mock Server"
     };
     Collab.editorPrefCollabClientType = "CollabConfig_Client";
     Collab.s_Instance = new Collab();
     Collab.s_Instance.projectBrowserSingleSelectionPath     = string.Empty;
     Collab.s_Instance.projectBrowserSingleMetaSelectionPath = string.Empty;
     JSProxyMgr.GetInstance().AddGlobalObject("unity/collab", Collab.s_Instance);
 }
Ejemplo n.º 8
0
 public static void OnSettingStatusChanged(CollabSettingType type, CollabSettingStatus status)
 {
     if (Collab.InitializeSoftlocksViewController())
     {
         Dictionary <CollabSettingType, CollabSettingsManager.SettingStatusChanged> statusNotifier;
         Dictionary <CollabSettingType, CollabSettingsManager.SettingStatusChanged> expr_11 = statusNotifier = CollabSettingsManager.statusNotifier;
         CollabSettingType arg_42_1 = CollabSettingType.InProgressEnabled;
         Delegate          arg_38_0 = statusNotifier[CollabSettingType.InProgressEnabled];
         if (Collab.< > f__mg$cache3 == null)
         {
             Collab.< > f__mg$cache3 = new CollabSettingsManager.SettingStatusChanged(Collab.OnSettingStatusChanged);
         }
         expr_11[arg_42_1] = (CollabSettingsManager.SettingStatusChanged)Delegate.Remove(arg_38_0, Collab.< > f__mg$cache3);
         (statusNotifier = CollabSettingsManager.statusNotifier)[CollabSettingType.InProgressEnabled] = (CollabSettingsManager.SettingStatusChanged)Delegate.Combine(statusNotifier[CollabSettingType.InProgressEnabled], new CollabSettingsManager.SettingStatusChanged(SoftlockViewController.Instance.softLockFilters.OnSettingStatusChanged));
     }
 }
Ejemplo n.º 9
0
        private static void OnFetchRevisions(IntPtr nativeData)
        {
            RevisionsService service = instance;

            if (service == null || service.FetchRevisionsCallback == null)
            {
                return;
            }

            RevisionsResult history = null;

            if (nativeData != IntPtr.Zero)
            {
                RevisionsData data = Collab.PopulateRevisionsData(nativeData);
                history = new RevisionsResult();
                history.Revisions.AddRange(data.Revisions);
                history.RevisionsInRepo = data.RevisionsInRepo;
            }

            service.FetchRevisionsCallback(history);
        }
Ejemplo n.º 10
0
 static Collab()
 {
     Collab.s_IsFirstStateChange = true;
     Collab.clientType           = new string[]
     {
         "Cloud Server",
         "Mock Server"
     };
     Collab.editorPrefCollabClientType = "CollabConfig_Client";
     Collab.s_Instance = new Collab();
     Collab.s_Instance.projectBrowserSingleSelectionPath     = string.Empty;
     Collab.s_Instance.projectBrowserSingleMetaSelectionPath = string.Empty;
     JSProxyMgr.GetInstance().AddGlobalObject("unity/collab", Collab.s_Instance);
     if (Collab.< > f__mg$cache0 == null)
     {
         Collab.< > f__mg$cache0 = new ObjectListArea.OnAssetIconDrawDelegate(CollabProjectHook.OnProjectWindowIconOverlay);
     }
     ObjectListArea.postAssetIconDrawCallback += Collab.< > f__mg$cache0;
     if (Collab.< > f__mg$cache1 == null)
     {
         Collab.< > f__mg$cache1 = new AssetsTreeViewGUI.OnAssetIconDrawDelegate(CollabProjectHook.OnProjectBrowserNavPanelIconOverlay);
     }
     AssetsTreeViewGUI.postAssetIconDrawCallback += Collab.< > f__mg$cache1;
     if (!Collab.InitializeSoftlocksViewController())
     {
         Dictionary <CollabSettingType, CollabSettingsManager.SettingStatusChanged> statusNotifier;
         Dictionary <CollabSettingType, CollabSettingsManager.SettingStatusChanged> expr_BC = statusNotifier = CollabSettingsManager.statusNotifier;
         CollabSettingType arg_ED_1 = CollabSettingType.InProgressEnabled;
         Delegate          arg_E3_0 = statusNotifier[CollabSettingType.InProgressEnabled];
         if (Collab.< > f__mg$cache2 == null)
         {
             Collab.< > f__mg$cache2 = new CollabSettingsManager.SettingStatusChanged(Collab.OnSettingStatusChanged);
         }
         expr_BC[arg_ED_1] = (CollabSettingsManager.SettingStatusChanged)Delegate.Combine(arg_E3_0, Collab.< > f__mg$cache2);
     }
 }
Ejemplo n.º 11
0
 public void GetRevision(string revId)
 {
     Collab.GetSingleRevisionData(true, revId);
 }
Ejemplo n.º 12
0
 public RevisionsService(Collab collabInstance, UnityConnect connectInstance)
 {
     this.collab  = collabInstance;
     this.connect = connectInstance;
     this.history = new RevisionsResult();
 }
Ejemplo n.º 13
0
 public RevisionsService(Collab collabInstance, UnityConnect connectInstance)
 {
     collab   = collabInstance;
     connect  = connectInstance;
     instance = this;
 }
Ejemplo n.º 14
0
 public static void OnSettingStatusChanged(CollabSettingType type, CollabSettingStatus status)
 {
     Collab.InitializeSoftlocksViewController();
 }
Ejemplo n.º 15
0
 public RevisionsData GetRevisionsData(bool withChanges, int startIndex, int numRevisions)
 {
     return(Collab.InternalGetRevisionsData(withChanges, startIndex, numRevisions));
 }
Ejemplo n.º 16
0
 public Revision[] GetRevisions(bool withChanges = false, int startIndex = 0, int numRevisions = -1)
 {
     return(Collab.InternalGetRevisions(withChanges, startIndex, numRevisions));
 }
Ejemplo n.º 17
0
 public void GetRevisions(int offset, int count)
 {
     // Only send down request for the desired data.
     Collab.GetRevisionsData(true, offset, count);
 }