Skip to content

Commit

Permalink
Refactoring menus and adding application manager setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherSchubert committed Oct 31, 2021
1 parent 55efe23 commit 86fc39f
Show file tree
Hide file tree
Showing 90 changed files with 511 additions and 416 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"com.appalachia.unity3d.third-party.hendrikhaupt": "0.1.0",
"com.appalachia.unity3d.third-party.amplify": "0.1.0",
"com.appalachia.unity3d.third-party.virtualmethod": "0.1.0",
"com.unity.timeline": "1.6.2"
"com.unity.timeline": "1.6.2",
"com.unity.inputsystem": "1.1.1"
},
"scripts": {
"preversion": "bash ~/com.appalachia/appa/appa package unity3d preversion",
Expand Down
1 change: 1 addition & 0 deletions src/Buoyancy/Appalachia.Simulation.Buoyancy.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"GUID:9e24947de15b9834991c9d8411ea37cf",
"GUID:2665a8d13d1b3f18800f46e256720795",
"GUID:e0cd26848372d4e5c891c569017e11f1",
"GUID:75469ad4d38634e559750d17036d5f7c",
"GUID:d8b63aba1907145bea998dd612889d6b",
"GUID:df380645f10b7bc4b97d4f5eb6303d95",
"GUID:84651a3751eca9349aac36a66bba901b",
Expand Down
2 changes: 1 addition & 1 deletion src/Buoyancy/BuoyancyVoxelDataGizmoSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace Appalachia.Simulation.Buoyancy
{
public class
BuoyancyVoxelDataGizmoSettings : SelfSavingSingletonScriptableObject<
BuoyancyVoxelDataGizmoSettings : SingletonAppalachiaObject<
BuoyancyVoxelDataGizmoSettings>
{
private const string _GC = "Cumulative";
Expand Down
2 changes: 1 addition & 1 deletion src/Buoyancy/Buoyant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace Appalachia.Simulation.Buoyancy
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(RigidbodyDensityManager))]
[ExecutionOrder(-90)]
public class Buoyant : AppalachiaInstancedMonoBehaviour
public class Buoyant : InstancedAppalachiaBehaviour
{
private const string _PRF_PFX = nameof(Buoyant) + ".";

Expand Down
2 changes: 1 addition & 1 deletion src/Buoyancy/Data/BuoyancyData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace Appalachia.Simulation.Buoyancy.Data
{
[Serializable]
public class BuoyancyData : SelfSavingScriptableObject<BuoyancyData>
public class BuoyancyData : AppalachiaObject<BuoyancyData>
{
[SmartLabel(Postfix = true)]
[SerializeField]
Expand Down
2 changes: 1 addition & 1 deletion src/Buoyancy/Data/BuoyancyDataCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Appalachia.Simulation.Buoyancy.Data
{
[Serializable]
public class BuoyancyDataCollection : ScriptableObjectLookupCollection<BuoyancyDataCollection,
public class BuoyancyDataCollection : AppalachiaObjectLookupCollection<BuoyancyDataCollection,
BuoyancyDataLookup, string, BuoyancyData, AppaList_string, AppaList_BuoyancyData>
{
protected override string GetUniqueKeyFromValue(BuoyancyData value)
Expand Down
2 changes: 1 addition & 1 deletion src/Buoyancy/Data/BuoyancyDataDefaults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Appalachia.Simulation.Buoyancy.Data
{
public class BuoyancyDataDefaults : SelfSavingSingletonScriptableObject<BuoyancyDataDefaults>
public class BuoyancyDataDefaults : SingletonAppalachiaObject<BuoyancyDataDefaults>
{
[SmartLabel]
[PropertyRange(0.00001f, 0.01f)]
Expand Down
2 changes: 1 addition & 1 deletion src/Buoyancy/Data/WaterPhysicsCoefficients.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Appalachia.Simulation.Buoyancy.Data
{
[Serializable]
public class
WaterPhysicsCoefficients : SelfSavingSingletonScriptableObject<WaterPhysicsCoefficients>
WaterPhysicsCoefficients : SingletonAppalachiaObject<WaterPhysicsCoefficients>
{
[InlineProperty]
[SmartLabel]
Expand Down
57 changes: 32 additions & 25 deletions src/Buoyancy/PKG.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ namespace Appalachia.Simulation.Buoyancy
{
internal static partial class PKG
{
public const int Priority = -306000;
public const string Name = "Simulation/Buoyancy";
public const string Prefix = Root + Name + "/";
public const string Root = "Appalachia/";
public const string Prefix = Root + "Simulation/Buoyancy/";
public const int Priority = 1000*80;

public static partial class Prefs
{
Expand All @@ -24,8 +25,8 @@ public static partial class Gizmos

public static partial class Menu
{
public static partial class Assets
{
public static partial class Assets
{
public const int Priority = PKG.Priority;
public const string Base = "Assets/" + Prefix;
}
Expand All @@ -34,6 +35,12 @@ public static partial class GameObject
{
public const int Priority = PKG.Priority;
public const string Base = "GameObject/" + Prefix;

public static partial class Create
{
public const int Priority = GameObject.Priority + 0;
public const string Base = "GameObject/Create/" + Prefix;
}
}

public static partial class Appalachia
Expand All @@ -43,61 +50,61 @@ public static partial class Appalachia
public static partial class Behaviours
{
public const int Priority = Appalachia.Priority;
public const string Base = Prefix + nameof(Behaviours) + "/";
public const string Base = Root + nameof(Behaviours) + "/" + Name + "/";
}

public static partial class Components
{
public const int Priority = Behaviours.Priority + 100;
public const string Base = Prefix + nameof(Components) + "/";
public const string Base = Root + nameof(Components) + "/" + Name + "/";
}

public static partial class Add
{
public const int Priority = Components.Priority + 100;
public const string Base = Prefix + nameof(Add) + "/";
public const string Base = Root + nameof(Add) + "/" + Name + "/";
}

public static partial class Create
{
public const int Priority = Add.Priority + 100;
public const string Base = Prefix + nameof(Create) + "/";
public const string Base = Root + nameof(Create) + "/" + Name + "/";
}

public static partial class Update
{
public const int Priority = Create.Priority + 100;
public const string Base = Prefix + nameof(Update) + "/";
public const string Base = Root + nameof(Update) + "/" + Name + "/";
}

public static partial class Manage
{
public const int Priority = Update.Priority + 100;
public const string Base = Prefix + nameof(Manage) + "/";
public const string Base = Root + nameof(Manage) + "/" + Name + "/";
}

public static partial class Data
{
public const int Priority = Manage.Priority + 100;
public const string Base = Prefix + nameof(Data) + "/";
public const string Base = Root + nameof(Data) + "/" + Name + "/";
}

public static partial class RootTools
{
public const int Priority = Data.Priority + 100;
public const int Priority = 0;
public const string Base = Root + "Tools/";
}

public static partial class State
{
public const int Priority = RootTools.Priority + 100;
public const string Base = Prefix + nameof(State) + "/";
public const int Priority = Data.Priority + 100;
public const string Base = Root + nameof(State) + "/" + Name + "/";
}

public static partial class Tools
{
public const int Priority = State.Priority + 100;
public const string Base = Prefix + nameof(Tools) + "/";
public const string Base = Root + nameof(Tools) + "/" + Name + "/";

public static partial class Enable
{
Expand All @@ -115,61 +122,61 @@ public static partial class Disable
public static partial class Jobs
{
public const int Priority = Tools.Priority + 100;
public const string Base = Prefix + nameof(Jobs) + "/";
public const string Base = Root + nameof(Jobs) + "/" + Name + "/";
}

public static partial class Timing
{
public const int Priority = Jobs.Priority + 100;
public const string Base = Prefix + nameof(Timing) + "/";
public const string Base = Root + nameof(Timing) + "/" + Name + "/";
}

public static partial class Utility
{
public const int Priority = Timing.Priority + 100;
public const string Base = Prefix + nameof(Utility) + "/";
public const string Base = Root + nameof(Utility) + "/" + Name + "/";
}

public static partial class Windows
{
public const int Priority = Utility.Priority + 100;
public const string Base = Prefix + nameof(Windows) + "/";
public const string Base = Root + nameof(Windows) + "/" + Name + "/";
}

public static partial class Logging
{
public const int Priority = Windows.Priority + 100;
public const string Base = Prefix + nameof(Logging) + "/";
public const string Base = Root + nameof(Logging) + "/" + Name + "/";
}

public static partial class Settings
{
public const int Priority = Logging.Priority + 100;
public const string Base = Prefix + nameof(Settings) + "/";
public const string Base = Root + nameof(Settings) + "/" + Name + "/";
}

public static partial class Packages
{
public const int Priority = Settings.Priority + 100;
public const string Base = Prefix + nameof(Packages) + "/";
public const string Base = Root + nameof(Packages) + "/" + Name + "/";
}

public static partial class External
{
public const int Priority = Packages.Priority + 100;
public const string Base = Prefix + nameof(External) + "/";
public const string Base = Root + nameof(External) + "/" + Name + "/";
}

public static partial class Debug
{
public const int Priority = External.Priority + 100;
public const string Base = Prefix + nameof(Debug) + "/";
public const string Base = Root + nameof(Debug) + "/" + Name + "/";
}

public static partial class Gizmos
{
public const int Priority = Debug.Priority + 100;
public const string Base = Prefix + nameof(Gizmos) + "/";
public const string Base = Root + nameof(Gizmos) + "/" + Name + "/";
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Buoyancy/Water.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Appalachia.Simulation.Buoyancy
{
[ExecuteAlways]
[ExecutionOrder(-100)]
public class Water : AppalachiaMonoBehaviour
public class Water : AppalachiaBehaviour
{
private const string _PRF_PFX = nameof(Water) + ".";

Expand Down
1 change: 1 addition & 0 deletions src/Core/Appalachia.Simulation.Core.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"GUID:a03736e1d95a0ed4c8a44e1ee02df53f",
"GUID:9e24947de15b9834991c9d8411ea37cf",
"GUID:e0cd26848372d4e5c891c569017e11f1",
"GUID:75469ad4d38634e559750d17036d5f7c",
"GUID:d8b63aba1907145bea998dd612889d6b",
"GUID:df380645f10b7bc4b97d4f5eb6303d95",
"GUID:84651a3751eca9349aac36a66bba901b",
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Metadata/Density/DensityMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Appalachia.Simulation.Core.Metadata.Density
{
public class DensityMetadata : SelfCategorizingNamingSavingAndIdentifyingScriptableObject<
public class DensityMetadata : CategorizableAutonamedIdentifiableAppalachiaObject<
DensityMetadata>
{
[SerializeField]
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Metadata/Density/DensityMetadataCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Appalachia.Simulation.Core.Metadata.Density
{
public class
DensityMetadataCollection : MetadataLookupBase<DensityMetadataCollection, DensityMetadata>
DensityMetadataCollection : AppalachiaMetadataCollection<DensityMetadataCollection, DensityMetadata>
{
[FoldoutGroup("Named")] public DensityMetadata ground;
[FoldoutGroup("Named")] public DensityMetadata air;
Expand Down
9 changes: 7 additions & 2 deletions src/Core/Metadata/Fuel/FuelBurnRate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@

namespace Appalachia.Simulation.Core.Metadata.Fuel
{
[CreateAssetMenu(menuName = "Internal/Metadata/Simulation/Heat/Fuel/FuelBurnRate", order = 0)]
public class FuelBurnRate : AppalachiaScriptableObject<FuelBurnRate>
public class FuelBurnRate : AppalachiaObject<FuelBurnRate>
{
public float kgCharPerHour = 2f;
public float kgBurnPerHour = 1f;
public float ignitionRate = 0.05f;

[UnityEditor.MenuItem(PKG.Menu.Assets.Base + nameof(FuelBurnRate), priority = PKG.Menu.Assets.Priority)]
public static void CreateAsset()
{
CreateNew();
}
}
}
9 changes: 7 additions & 2 deletions src/Core/Metadata/Fuel/FuelBurnScale.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@

namespace Appalachia.Simulation.Core.Metadata.Fuel
{
[CreateAssetMenu(menuName = "Internal/Metadata/Simulation/Heat/Fuel/FuelBurnScale", order = 0)]
public class FuelBurnScale : AppalachiaScriptableObject<FuelBurnScale>
public class FuelBurnScale : AppalachiaObject<FuelBurnScale>
{
public Vector3 burnScale;

[UnityEditor.MenuItem(PKG.Menu.Assets.Base + nameof(FuelBurnScale), priority = PKG.Menu.Assets.Priority)]
public static void CreateAsset()
{
CreateNew();
}
}
}
2 changes: 1 addition & 1 deletion src/Core/Metadata/Materials/PhysicMaterialWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Appalachia.Simulation.Core.Metadata.Materials
{
[SmartLabel]
public class
PhysicMaterialWrapper : SelfCategorizingAndSavingScriptableObject<PhysicMaterialWrapper>
PhysicMaterialWrapper : CategorizableAppalachiaObject<PhysicMaterialWrapper>
{
[SmartLabel]
[SmartLabelChildren]
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Metadata/Materials/PhysicsMaterialsCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Appalachia.Simulation.Core.Metadata.Materials
{
public class PhysicsMaterialsCollection : MetadataLookupBase<PhysicsMaterialsCollection, PhysicMaterialWrapper>
public class PhysicsMaterialsCollection : AppalachiaMetadataCollection<PhysicsMaterialsCollection, PhysicMaterialWrapper>
{
[FoldoutGroup("Misc")] public Material physicsVisualizationMaterial;

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Metadata/Tree/TreeIndividualMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Appalachia.Simulation.Core.Metadata.Tree
{
[Serializable]
public class
TreeIndividualMetadata : SelfSavingAndIdentifyingScriptableObject<TreeIndividualMetadata>
TreeIndividualMetadata : IdentifiableAppalachiaObject<TreeIndividualMetadata>
{
public int individualID;

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Metadata/Tree/TreeSpeciesMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Appalachia.Simulation.Core.Metadata.Tree
{
public class TreeSpeciesMetadata : SelfSavingAndIdentifyingScriptableObject<TreeSpeciesMetadata>
public class TreeSpeciesMetadata : IdentifiableAppalachiaObject<TreeSpeciesMetadata>
{
public string speciesName;

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Metadata/Wind/GlobalWindParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Appalachia.Simulation.Core.Metadata.Wind
{
public class GlobalWindParameters : SelfSavingScriptableObject<GlobalWindParameters>
public class GlobalWindParameters : AppalachiaObject<GlobalWindParameters>
{
[FoldoutGroup("System")]
[SmartLabel]
Expand Down
8 changes: 6 additions & 2 deletions src/Core/Metadata/Wood/WoodSimulationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@

namespace Appalachia.Simulation.Core.Metadata.Wood
{
[CreateAssetMenu(menuName = "Tree Species Editor/Simulation/Wood", order = 10)]
public class WoodSimulationData :
SelfCategorizingIdentifyingAndSavingScriptableObject<WoodSimulationData>
CategorizableIdentifiableAppalachiaObject<WoodSimulationData>
{
[BoxGroup("Physical")] public DensityMetadata densityMetadata;

Expand Down Expand Up @@ -85,6 +84,11 @@ private void AssignBestDensity()
#pragma warning restore 612
}

[UnityEditor.MenuItem(PKG.Menu.Assets.Base + nameof(WoodSimulationData), priority = PKG.Menu.Assets.Priority)]
public static void CreateAsset()
{
CreateNew();
}
#endif
}
}
Loading

0 comments on commit 86fc39f

Please sign in to comment.