Example #1
0
        private void RemoveResource <T>(T resource, IntMap <AssetEntry <T> > map) where T : UnityEngine.Object
        {
            if (resource == null)
            {
                return;
            }
            int            id = resource.GetHashCode();
            AssetEntry <T> entry;

            if (map.TryGetValue(id, out entry))
            {
                map.Remove(entry.linkedId);
                map.Remove(id);
            }
        }
Example #2
0
        private void RemoveResource <T>(string path, IntMap <AssetEntry <T> > map) where T : UnityEngine.Object
        {
            if (string.IsNullOrEmpty(path))
            {
                return;
            }

            int            pathId = path.GetHashCode();
            AssetEntry <T> entry;

            if (map.TryGetValue(pathId, out entry))
            {
                map.Remove(entry.linkedId);
                map.Remove(pathId);
            }
        }