La feature était désorganisé et il n'y avait rien pour tester ou démontrer la fonctionalité J'ai rangé tous les scripts dans des dossiers enfants de LevelEditor. Tous les fichiers du level editor sont dans le namespace GatherAndDefend.LevelEditor. J'ai ajouté un type de tile qui peut instantier un prefab au startup. J'ai créé un level de test.
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;
|
|
}
|
|
}
|
|
} |