Exemplo n.º 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
    }
Exemplo n.º 2
0
    static void RemoveTexRef(TiledSpriteRenderer _tiledSprite)
    {
        var index = GetTexIndex();

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