コード例 #1
0
    private void LoadTileSets()
    {
        _tilesetList  = UnityInternal.GetAssetsInProjectOfType <Tileset>();
        _tilesetNames = _tilesetList.Select(t => t.Name).ToArray();

        if (_tilesetList.Count > 0)
        {
            SetTileSet(_tilesetList[0].InstanceID);
        }

        UpdateTextureList();
    }
コード例 #2
0
    private void LoadTilesets()
    {
        TilesetList = UnityInternal.GetAssetsInProjectOfType <Tileset>().ToArray();

        // if no tileset set yet, set
        if (TilesetList.Length > 0 && !_parent.Tileset)
        {
            SetTileSet(TilesetList[0].InstanceID);
        }

        _parent.Repaint();
    }
コード例 #3
0
    private static List <Tileset> LoadAllTilesets()
    {
        var tilesetData = UnityInternal.GetAssetsInProjectOfType <Tileset>().ToArray();
        var tilesets    = new List <Tileset>();

// ReSharper disable LoopCanBeConvertedToQuery
        foreach (var t in tilesetData)
// ReSharper restore LoopCanBeConvertedToQuery
        {
            var path    = AssetDatabase.GetAssetPath(t.InstanceID);
            var tileset = AssetDatabase.LoadAssetAtPath(path, typeof(Tileset)) as Tileset;
            tilesets.Add(tileset);
        }

        return(tilesets);
    }
コード例 #4
0
ファイル: TilerWindow.cs プロジェクト: senaarma/Geesenado
    private bool UpdateRequired()
    {
        var version = EditorPrefs.GetInt("TilerVersion", 0);

        if (version == TilerVersion)
        {
            return(false);
        }

        var tilesets = UnityInternal.GetAssetsInProjectOfType <Tileset>().ToArray();

        // no tilesets to update anyway
        if (tilesets.Length == 0)
        {
            EditorPrefs.SetInt("TilerVersion", TilerVersion);
            return(false);
        }

        return(true);
    }