riversong code showcase
This commit is contained in:
115
Source/Riversong/Game/World/Buildings/BuildingDefinition.cs
Normal file
115
Source/Riversong/Game/World/Buildings/BuildingDefinition.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace DanieleMarotta.RiversongCodeShowcase
|
||||
{
|
||||
[CreateAssetMenu(fileName = "BuildingDefinition", menuName = "Riversong Code Showcase/Building Definition")]
|
||||
public class BuildingDefinition : GameDataAsset, IComparable<BuildingDefinition>
|
||||
{
|
||||
public int UIOrder;
|
||||
|
||||
[PreviewField]
|
||||
public Sprite Icon;
|
||||
|
||||
public string BuildingName = "Building";
|
||||
|
||||
[TextArea(5, 10)]
|
||||
public string BuildingDescription = "Building";
|
||||
|
||||
public AssetReferenceGameObject Visualization;
|
||||
|
||||
public List<ProductAmountAuthoring> BuildingMaterials;
|
||||
|
||||
public int Width = 1;
|
||||
|
||||
public int Height = 1;
|
||||
|
||||
public int Range;
|
||||
|
||||
[LabelText("AoE Layer")]
|
||||
public int AoELayer;
|
||||
|
||||
public bool CanBeDeleted = true;
|
||||
|
||||
[TitleGroup("Workers")]
|
||||
public int WorkerCount;
|
||||
|
||||
public float SpawnCooldown;
|
||||
|
||||
[TitleGroup("Storage")]
|
||||
public int StorageCapacity = 1000;
|
||||
|
||||
[LabelText("Show Storage Tooltip?")]
|
||||
public bool ShowStorageTooltip;
|
||||
|
||||
[TitleGroup("Harvester")]
|
||||
[LabelText("Resource")]
|
||||
public ResourceNodeDefinition HarvestedResource;
|
||||
|
||||
[TitleGroup("Hunter")]
|
||||
public CritterDefinition TargetCritter;
|
||||
|
||||
[TitleGroup("Farm")]
|
||||
public bool IsFarm;
|
||||
|
||||
[LabelText("Product")]
|
||||
public ProductDefinition FarmProduct;
|
||||
|
||||
[HorizontalGroup("Farm/Dropped Amount")]
|
||||
[LabelText("Amt. Min")]
|
||||
public int MinDroppedAmount = 1;
|
||||
|
||||
[HorizontalGroup("Farm/Dropped Amount")]
|
||||
[LabelText("Amt. Max")]
|
||||
public int MaxDroppedAmount = 1;
|
||||
|
||||
[TitleGroup("Producer")]
|
||||
public RecipeDefinition Recipe;
|
||||
|
||||
[LabelText("Delivers Output?")]
|
||||
public bool DeliversOutput = true;
|
||||
|
||||
[TitleGroup("Provider")]
|
||||
[LabelText("Products")]
|
||||
public List<ProductAmountAuthoring> ProvidedProducts;
|
||||
|
||||
[LabelText("Fetches Products?")]
|
||||
public bool FetchesProducts = true;
|
||||
|
||||
[TitleGroup("House")]
|
||||
[LabelText("Is House?")]
|
||||
public bool IsHouse;
|
||||
|
||||
[ShowIf("IsHouse")]
|
||||
public List<HouseTierAuthoring> HouseTiers;
|
||||
|
||||
[TitleGroup("Storage")]
|
||||
[LabelText("Is Storage?")]
|
||||
public bool IsStorage;
|
||||
|
||||
[TitleGroup("Placement Rules")]
|
||||
[LabelText("Near Water?")]
|
||||
public bool NearWater;
|
||||
|
||||
[LabelText("Requires Fertile Tile?")]
|
||||
public bool RequiresFertileTile;
|
||||
|
||||
public int CompareTo(BuildingDefinition other)
|
||||
{
|
||||
return UIOrder.CompareTo(other.UIOrder);
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class HouseTierAuthoring
|
||||
{
|
||||
public int Capacity = 1;
|
||||
|
||||
public List<ProductAmountAuthoring> UpgradeMaterials;
|
||||
|
||||
public List<PopulationNeedAuthoring> Needs;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user