コード例 #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));
        }
コード例 #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));
        }
コード例 #3
0
 public static void SetSoftlockChanges(string[] assetGUIDs)
 {
     if (SoftLockData.SoftlockSubscriber != null)
     {
         SoftLockData.SoftlockSubscriber(assetGUIDs);
     }
 }
コード例 #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));
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #7
0
        // 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);
        }
コード例 #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);
        }
コード例 #9
0
        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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #12
0
        private static bool TryHasSoftLocks(Scene scene, out bool hasSoftLocks)
        {
            string assetGuid = AssetDatabase.AssetPathToGUID(scene.path);

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