static void AddTexRef(Sprite _sprite, TiledSpriteRenderer _tiledSprite) { #if UNITY_EDITOR var index = GetTexIndex(); string texPath = null; if ((_sprite != null) && (_sprite.texture != null)) { texPath = UnityEditor.AssetDatabase.GetAssetPath(_sprite.texture); } if (string.IsNullOrEmpty(texPath)) { return; } if (!index.ContainsKey(texPath)) { index.Add(texPath, new List <TiledSpriteRenderer>()); } if (!index[texPath].Contains(_tiledSprite)) { index[texPath].Add(_tiledSprite); } #endif }
static void RemoveTexRef(TiledSpriteRenderer _tiledSprite) { var index = GetTexIndex(); foreach (List <TiledSpriteRenderer> sprites in index.Values) { sprites.Remove(_tiledSprite); } }
static void OnPostprocessAllAssets( string[] _importedAssets, string[] _deletedAssets, string[] _movedToPaths, string[] _movedFromPaths ) { TiledSpriteRenderer.OnAssetsImported(_importedAssets, _deletedAssets, _movedToPaths, _movedFromPaths); }
static void RemoveTexRef(TiledSpriteRenderer _tiledSprite) { var index = GetTexIndex(); foreach (List<TiledSpriteRenderer> sprites in index.Values) { sprites.Remove(_tiledSprite); } }
static void AddTexRef(Sprite _sprite, TiledSpriteRenderer _tiledSprite) { #if UNITY_EDITOR var index = GetTexIndex(); string texPath = null; if ((_sprite != null) && (_sprite.texture != null)) { texPath = UnityEditor.AssetDatabase.GetAssetPath(_sprite.texture); } if (string.IsNullOrEmpty(texPath)) { return; } if (! index.ContainsKey(texPath)) { index.Add(texPath, new List<TiledSpriteRenderer>()); } if (! index[texPath].Contains(_tiledSprite)) { index[texPath].Add(_tiledSprite); } #endif }