Esempio n. 1
0
    public override void OnInspectorGUI()
    {
        TileSet tileSet = (TileSet)this.target;

        if (!tileSet.BasicTilesValid())
        {
            GUILayout.Label("Basic tiles not assigned!");
            GUILayout.Label("Require 16 valid tiles.");
            GUILayout.Label("");
        }
        if (!tileSet.BackgroundTilesValid())
        {
            GUILayout.Label("Background tiles not assigned!");
            GUILayout.Label("Require valid tile for 3 types.");
            GUILayout.Label("");
        }
        if (!tileSet.BasicTilesValid() || !tileSet.BackgroundTilesValid())
        {
            if (GUILayout.Button("Auto fill by name"))
            {
                AutoFillBasicTiles();
            }
            GUILayout.Label("");
        }
        if (!tileSet.SpecialTilesValid())
        {
            GUILayout.Label("Special tiles invalid!");
            GUILayout.Label("Require valid special tile set, assign empty objects or reduce array size.");
            GUILayout.Label("");
        }
        if (tileSet.Valid())
        {
            GUILayout.Label("Tileset ready!");
        }

        DrawDefaultInspector();
    }