evershade/Assets/Data/ScriptableObjects/MapSo.cs

45 lines
1.3 KiB
C#

using Types.Map;
using UnityEngine;
using UnityEngine.Serialization;
namespace Data.ScriptableObjects
{
[CreateAssetMenu(fileName = "Map", menuName = "Game Data/Map")]
public class MapSo : ScriptableObject
{
public string sceneName; // The name of the scene this map corresponds to
public Vector3 gridPosition;
public Vector2Int gridSize;
public Vector2Int playerStartPosition;
[FormerlySerializedAs("Grid")] public TileGrid grid;
public MapSo(MapSo map)
{
sceneName = map.sceneName;
gridPosition = map.gridPosition;
grid = map.grid;
playerStartPosition = map.playerStartPosition;
gridSize = map.gridSize;
}
// TODO: we will need some sort of default grid rules that we can apply to each map
// to prevent people from planting crops on the road or in the water, stuff like that.
// public GridRules gridRules;
public void Initialize()
{
// GridSo = CreateInstance<TileGridSo>();
}
public Map Clone()
{
return new Map(this);
}
public MapSo CloneSo()
{
return CreateInstance<MapSo>();
}
}
}