sauvegarder et charger des niveaux à partir d'un tilemap un scriptable object contient les informations pour le niveau un script avec un custom editor permet de sauvegarder un ensemble de tilemaps, ou de charger l'information contenue dans un scriptable object
24 lines
523 B
C#
24 lines
523 B
C#
using UnityEngine.Tilemaps;
|
|
using UnityEngine;
|
|
using System;
|
|
|
|
namespace GatherAndDefend.LevelEditor
|
|
{
|
|
[Serializable]
|
|
public class TileData
|
|
{
|
|
[SerializeField]
|
|
private TileBase _tile;
|
|
[SerializeField]
|
|
private Vector3Int _position;
|
|
|
|
public TileBase Tile => _tile;
|
|
public Vector3Int Position => _position;
|
|
|
|
public TileData(Vector3Int position, TileBase tile)
|
|
{
|
|
this._position = position;
|
|
this._tile = tile;
|
|
}
|
|
}
|
|
} |