Beispiel #1
0
        public static bool TryHasSoftLocks(UnityEngine.Object objectWithGUID, out bool hasSoftLocks)
        {
            string assetGuid = null;

            AssetAccess.TryGetAssetGUIDFromObject(objectWithGUID, out assetGuid);
            return(SoftLockData.TryHasSoftLocks(assetGuid, out hasSoftLocks));
        }
Beispiel #2
0
        public static bool TryGetSoftlockCount(UnityEngine.Object objectWithGUID, out int count)
        {
            string assetGuid = null;

            AssetAccess.TryGetAssetGUIDFromObject(objectWithGUID, out assetGuid);
            return(SoftLockData.TryGetSoftlockCount(assetGuid, out count));
        }
Beispiel #3
0
 public static void SetSoftlockChanges(string[] assetGUIDs)
 {
     if (SoftLockData.SoftlockSubscriber != null)
     {
         SoftLockData.SoftlockSubscriber(assetGUIDs);
     }
 }
Beispiel #4
0
 public static bool AllowsSoftLocks(UnityEngine.Object unityObject)
 {
     if (unityObject == null)
     {
         throw new ArgumentNullException("unityObject");
     }
     return(unityObject.GetType().Equals(typeof(SceneAsset)) || SoftLockData.IsPrefab(unityObject));
 }
Beispiel #5
0
        public static bool IsPrefab(string assetGUID)
        {
            bool result = false;

            UnityEngine.Object unityObject;
            if (AssetAccess.TryGetAssetFromGUID(assetGUID, out unityObject))
            {
                result = SoftLockData.IsPrefab(unityObject);
            }
            return(result);
        }
Beispiel #6
0
        public static bool TryHasSoftLocks(string assetGuid, out bool hasSoftLocks)
        {
            hasSoftLocks = false;
            bool result = false;
            int  num    = 0;

            if (SoftLockData.TryGetSoftlockCount(assetGuid, out num))
            {
                result       = true;
                hasSoftLocks = (num > 0);
            }
            return(result);
        }
        // Provides the names of all additional users editing the asset
        // with the given 'assetGuid'.
        // Defaults to an empty list.
        public static List <string> GetLocksNamesOnAsset(string assetGuid)
        {
            List <SoftLock> softLocks = null;
            List <string>   names     = new List <string>();

            if (SoftLockData.TryGetLocksOnAssetGUID(assetGuid, out softLocks))
            {
                foreach (SoftLock softLock in softLocks)
                {
                    names.Add(softLock.displayName);
                }
            }
            return(names);
        }
Beispiel #8
0
        public static bool TryGetSoftlockCount(string assetGuid, out int count)
        {
            bool result = false;

            count = 0;
            List <SoftLock> list = null;

            if (SoftLockData.TryGetLocksOnAssetGUID(assetGuid, out list))
            {
                count  = list.Count;
                result = true;
            }
            return(result);
        }
        public static List <string> GetLocksNamesOnAsset(string assetGuid)
        {
            List <SoftLock> list  = null;
            List <string>   list2 = new List <string>();

            if (SoftLockData.TryGetLocksOnAssetGUID(assetGuid, out list))
            {
                foreach (SoftLock current in list)
                {
                    list2.Add(current.displayName);
                }
            }
            return(list2);
        }
Beispiel #10
0
        private static bool TryGetLocksOnObject(UnityEngine.Object objectWithGUID, out List <SoftLock> softLocks)
        {
            bool   result    = false;
            string assetGuid = null;

            if (AssetAccess.TryGetAssetGUIDFromObject(objectWithGUID, out assetGuid))
            {
                result = SoftLockData.TryGetLocksOnAssetGUID(assetGuid, out softLocks);
            }
            else
            {
                softLocks = new List <SoftLock>();
            }
            return(result);
        }
Beispiel #11
0
        public static bool TryGetSoftlockCount(Scene scene, out int count)
        {
            count = 0;
            bool result;

            if (!scene.IsValid())
            {
                result = false;
            }
            else
            {
                string assetGuid = AssetDatabase.AssetPathToGUID(scene.path);
                bool   flag      = SoftLockData.TryGetSoftlockCount(assetGuid, out count);
                result = flag;
            }
            return(result);
        }
Beispiel #12
0
        private static bool TryHasSoftLocks(Scene scene, out bool hasSoftLocks)
        {
            string assetGuid = AssetDatabase.AssetPathToGUID(scene.path);

            return(SoftLockData.TryHasSoftLocks(assetGuid, out hasSoftLocks));
        }