Example #1
0
    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
    }
Example #2
0
    static void RemoveTexRef(TiledSpriteRenderer _tiledSprite)
    {
        var index = GetTexIndex();

        foreach (List <TiledSpriteRenderer> sprites in index.Values)
        {
            sprites.Remove(_tiledSprite);
        }
    }
Example #3
0
 static void OnPostprocessAllAssets(
     string[] _importedAssets,
     string[] _deletedAssets,
     string[] _movedToPaths,
     string[] _movedFromPaths
     )
 {
     TiledSpriteRenderer.OnAssetsImported(_importedAssets, _deletedAssets, _movedToPaths, _movedFromPaths);
 }
Example #4
0
 static void RemoveTexRef(TiledSpriteRenderer _tiledSprite)
 {
     var index = GetTexIndex();
     foreach (List<TiledSpriteRenderer> sprites in index.Values) {
         sprites.Remove(_tiledSprite);
     }
 }
Example #5
0
    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
    }