OctoCore 0.0.1
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace OctoCore.LevelBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Data for ceiling tiles.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "Ceiling_", menuName = "Octo/Level Builder/Ceiling")]
|
||||
public class OctoLevelBuilderCeilingData : OctoLevelBuilderData
|
||||
{
|
||||
public GameObject Prefab;
|
||||
|
||||
public override GameObject GetPrefab(int angle, WallShape shape = WallShape.Straight)
|
||||
{
|
||||
return Prefab;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 663b230d0aa40fb448ac219c0c7d57f6
|
||||
@@ -0,0 +1,20 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace OctoCore.LevelBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for tile data.
|
||||
/// </summary>
|
||||
public abstract class OctoLevelBuilderData : ScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// The referenece grid for the tile.
|
||||
/// </summary>
|
||||
public OctoLevelBuilderGridData Grid;
|
||||
|
||||
/// <summary>
|
||||
/// Get the prefab to instantiate for this tile configuration.
|
||||
/// </summary>
|
||||
public abstract GameObject GetPrefab(int angle, WallShape shape = WallShape.Straight);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c8ed7c7ac825b7e49aa3695b5393da29
|
||||
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace OctoCore.LevelBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Data for fence tiles.
|
||||
/// Similar to walls but typically lower and more decorative.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "Fence_", menuName = "Octo/Level Builder/Fence")]
|
||||
public class OctoLevelBuilderFenceData : OctoLevelBuilderData
|
||||
{
|
||||
[Header("Fence Prefabs")]
|
||||
public GameObject FenceStraight;
|
||||
public GameObject FenceCorner;
|
||||
public GameObject FenceT;
|
||||
public GameObject FenceDeadEnd;
|
||||
|
||||
public override GameObject GetPrefab(int angle, WallShape shape = WallShape.Straight)
|
||||
{
|
||||
return shape switch
|
||||
{
|
||||
WallShape.Straight => FenceStraight,
|
||||
WallShape.Corner => FenceCorner,
|
||||
WallShape.T => FenceT,
|
||||
WallShape.DeadEnd => FenceDeadEnd,
|
||||
_ => FenceStraight
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d87d7d32e3833944be2a3972446de25
|
||||
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace OctoCore.LevelBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Data for floor tiles.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "Floor_", menuName = "Octo/Level Builder/Floor")]
|
||||
public class OctoLevelBuilderFloorData : OctoLevelBuilderData
|
||||
{
|
||||
public GameObject Prefab;
|
||||
|
||||
public override GameObject GetPrefab(int angle, WallShape shape = WallShape.Straight)
|
||||
{
|
||||
return Prefab;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c8e08d3fd3a3b694da03a093f5b375cf
|
||||
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace OctoCore.LevelBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for grid data.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "Grid_", menuName = "Octo/Level Builder/Grid")]
|
||||
public class OctoLevelBuilderGridData : ScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Width en depth of a tile.
|
||||
/// </summary>
|
||||
public float TileSize = 2f;
|
||||
|
||||
/// <summary>
|
||||
/// Floor height.
|
||||
/// </summary>
|
||||
public float FloorHeight = 3.5f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b13c2498f7c6bd499d3dc1815e1758d
|
||||
@@ -0,0 +1,20 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace OctoCore.LevelBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Data for stairs tiles.
|
||||
/// Connects two floor levels.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "Stairs_", menuName = "Octo/Level Builder/Stairs")]
|
||||
public class OctoLevelBuilderStairsData : OctoLevelBuilderData
|
||||
{
|
||||
[Header("Stairs Prefab")]
|
||||
public GameObject StairsPrefab;
|
||||
|
||||
public override GameObject GetPrefab(int angle, WallShape shape = WallShape.Straight)
|
||||
{
|
||||
return StairsPrefab;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77641830072b3944882267f440086535
|
||||
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace OctoCore.LevelBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for grid data.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "Style_", menuName = "Octo/Level Builder/Style")]
|
||||
public class OctoLevelBuilderStyleData : ScriptableObject
|
||||
{
|
||||
public OctoLevelBuilderGridData Grid;
|
||||
public OctoLevelBuilderCeilingData Ceiling;
|
||||
public OctoLevelBuilderWallData Wall;
|
||||
public OctoLevelBuilderFloorData Floor;
|
||||
public OctoLevelBuilderStairsData Stairs;
|
||||
public OctoLevelBuilderFenceData Fence;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0d5c998a010b2243b41c3eb69285ff5
|
||||
@@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace OctoCore.LevelBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Data for wall tiles.
|
||||
/// Supports different shapes: straight, corner, T-junction, cross, dead-end, door, window.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "Wall_", menuName = "Octo/Level Builder/Wall")]
|
||||
public class OctoLevelBuilderWallData : OctoLevelBuilderData
|
||||
{
|
||||
[Header("Wall Prefabs")]
|
||||
public GameObject WallStraight;
|
||||
public GameObject WallCorner;
|
||||
public GameObject WallT;
|
||||
public GameObject WallCross;
|
||||
public GameObject WallDeadEnd;
|
||||
public GameObject WallDoor;
|
||||
public GameObject WallWindow;
|
||||
|
||||
public override GameObject GetPrefab(int angle, WallShape shape = WallShape.Straight)
|
||||
{
|
||||
return shape switch
|
||||
{
|
||||
WallShape.Straight => WallStraight,
|
||||
WallShape.Corner => WallCorner,
|
||||
WallShape.T => WallT,
|
||||
WallShape.Cross => WallCross,
|
||||
WallShape.DeadEnd => WallDeadEnd,
|
||||
WallShape.Door => WallDoor,
|
||||
WallShape.Window => WallWindow,
|
||||
_ => WallStraight
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5eb6603754edde4f85b7713df5381a4
|
||||
Reference in New Issue
Block a user