Beispiel #1
0
 static void HandleVersionControlOverlays(string guid, Rect drawRect)
 {
     if (Provider.isActive)
     {
         string vcsType = VersionControlSettings.mode;
         if (vcsType == ExternalVersionControl.Disabled ||
             vcsType == ExternalVersionControl.AutoDetect ||
             vcsType == ExternalVersionControl.Generic)
         {
             return; // no icons for these version control systems
         }
         Asset asset = Provider.GetAssetByGUID(guid);
         if (asset != null)
         {
             string metaPath  = asset.path.Trim('/') + ".meta";
             Asset  metaAsset = Provider.GetAssetByPath(metaPath);
             Overlay.DrawProjectOverlay(asset, metaAsset, drawRect);
         }
     }
 }
Beispiel #2
0
        static void HandleVersionControlOverlays(string guid, Rect drawRect)
        {
            var vco = VersionControlManager.activeVersionControlObject;

            if (vco != null)
            {
                var extension = vco.GetExtension <IIconOverlayExtension>();
                if (extension != null)
                {
                    var assetPath = AssetDatabase.GUIDToAssetPath(guid);
                    if (!string.IsNullOrEmpty(assetPath))
                    {
                        extension.DrawOverlay(assetPath, IconOverlayType.Project, drawRect);
                    }
                }
                return;
            }

            if (Provider.isActive)
            {
                string vcsType = VersionControlSettings.mode;
                if (vcsType == ExternalVersionControl.Disabled ||
                    vcsType == ExternalVersionControl.AutoDetect ||
                    vcsType == ExternalVersionControl.Generic)
                {
                    return; // no icons for these version control systems
                }
                Asset asset = Provider.GetAssetByGUID(guid);
                if (asset != null)
                {
                    string metaPath  = asset.path.Trim('/') + ".meta";
                    Asset  metaAsset = Provider.GetAssetByPath(metaPath);
                    Overlay.DrawProjectOverlay(asset, metaAsset, drawRect);
                }
            }
        }