[Add] TextMeshPro & Chunk maker

This commit is contained in:
2026-03-30 06:16:25 +07:00
parent e2dab2208a
commit 0b06ff5a06
103 changed files with 70513 additions and 67 deletions
@@ -8,9 +8,12 @@ namespace InfiniteWorld
[CreateAssetMenu(menuName = "Infinite World/World Autotile Profile", fileName = "WorldAutotileProfile")]
public class WorldAutotileProfile : ScriptableObject
{
public bool autoUpdatePaletteLayout = true;
public bool autoRefreshGeneratedWorld = true;
public TileBase baseGroundTile;
public AutoTileDefinition wallTiles = new AutoTileDefinition();
public List<EnvironmentTileEntry> environmentTiles = new List<EnvironmentTileEntry>();
public List<RandomPrefabEntry> randomPrefabs = new List<RandomPrefabEntry>();
public TileBase GetWallTile(AutoTileShape shape)
{
@@ -29,11 +32,14 @@ namespace InfiniteWorld
return true;
}
for (int i = 0; i < environmentTiles.Count; i++)
if (environmentTiles != null)
{
if (environmentTiles[i] != null && environmentTiles[i].tile != null)
for (int i = 0; i < environmentTiles.Count; i++)
{
return true;
if (environmentTiles[i] != null && environmentTiles[i].tile != null)
{
return true;
}
}
}
@@ -98,6 +104,27 @@ namespace InfiniteWorld
return tile ?? center;
}
public TileBase GetAssignedTile(AutoTileShape shape)
{
return shape switch
{
AutoTileShape.Center => center,
AutoTileShape.Top => top,
AutoTileShape.Right => right,
AutoTileShape.Bottom => bottom,
AutoTileShape.Left => left,
AutoTileShape.OuterTopLeft => outerTopLeft,
AutoTileShape.OuterTopRight => outerTopRight,
AutoTileShape.OuterBottomRight => outerBottomRight,
AutoTileShape.OuterBottomLeft => outerBottomLeft,
AutoTileShape.InnerTopLeft => innerTopLeft,
AutoTileShape.InnerTopRight => innerTopRight,
AutoTileShape.InnerBottomRight => innerBottomRight,
AutoTileShape.InnerBottomLeft => innerBottomLeft,
_ => null
};
}
public bool HasAnyAssignedTiles()
{
return center != null ||
@@ -123,4 +150,12 @@ namespace InfiniteWorld
public TileBase tile;
[Min(0f)] public float weight = 1f;
}
[Serializable]
public class RandomPrefabEntry
{
public string id = "RandomPrefab";
public GameObject prefab;
[Min(0f)] public float weight = 1f;
}
}