Reorganization and many improvements of rendering
This commit is contained in:
144
Assets/Scripts/Config/SimulationConfig.cs
Normal file
144
Assets/Scripts/Config/SimulationConfig.cs
Normal file
@@ -0,0 +1,144 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "SimulationConfig", menuName = "Simulation/Config", order = 1)]
|
||||
public class SimulationConfig : ScriptableObject
|
||||
{ [Header("Simulation Settings")]
|
||||
public float timeScale = 0.05f;
|
||||
|
||||
[Header("Missile Swarm Configurations")]
|
||||
public List<SwarmConfig> missile_swarm_configs = new List<SwarmConfig>();
|
||||
|
||||
[Header("Target Swarm Configurations")]
|
||||
public List<SwarmConfig> target_swarm_configs = new List<SwarmConfig>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class DynamicConfig
|
||||
{
|
||||
public LaunchConfig launch_config;
|
||||
public SensorConfig sensor_config;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class SwarmConfig
|
||||
{
|
||||
public int num_agents;
|
||||
public AgentConfig agent_config;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class AgentConfig
|
||||
{
|
||||
public MissileType missile_type;
|
||||
public TargetType target_type;
|
||||
public InitialState initial_state;
|
||||
public StandardDeviation standard_deviation;
|
||||
public DynamicConfig dynamic_config;
|
||||
public PlottingConfig plotting_config;
|
||||
public SubmunitionsConfig submunitions_config;
|
||||
public string prefabName;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class InitialState
|
||||
{
|
||||
public Vector3 position;
|
||||
public Vector3 rotation;
|
||||
public Vector3 velocity;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class StandardDeviation
|
||||
{
|
||||
public Vector3 position;
|
||||
public Vector3 velocity;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class LaunchConfig
|
||||
{
|
||||
public float launch_time;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class PlottingConfig
|
||||
{
|
||||
public Color color;
|
||||
public LineStyle linestyle;
|
||||
public Marker marker;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class SubmunitionsConfig
|
||||
{
|
||||
public int num_submunitions;
|
||||
public LaunchConfig launch_config;
|
||||
public SubmunitionAgentConfig agent_config;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class SubmunitionAgentConfig
|
||||
{
|
||||
public MissileType missile_type;
|
||||
public InitialState initial_state;
|
||||
public StandardDeviation standard_deviation;
|
||||
public DynamicConfig dynamic_config;
|
||||
public PlottingConfig plotting_config;
|
||||
public string prefabName;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class SensorConfig
|
||||
{
|
||||
public SensorType type;
|
||||
public float frequency;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class TargetConfig
|
||||
{
|
||||
public TargetType target_type;
|
||||
public InitialState initial_state;
|
||||
public PlottingConfig plotting_config;
|
||||
public string prefabName;
|
||||
}
|
||||
|
||||
public enum MissileType
|
||||
{
|
||||
HYDRA_70,
|
||||
MICROMISSILE
|
||||
}
|
||||
|
||||
public enum TargetType
|
||||
{
|
||||
DRONE
|
||||
}
|
||||
|
||||
public enum ConfigColor
|
||||
{
|
||||
BLUE,
|
||||
GREEN,
|
||||
RED
|
||||
}
|
||||
|
||||
public enum LineStyle
|
||||
{
|
||||
DOTTED,
|
||||
SOLID
|
||||
}
|
||||
|
||||
public enum Marker
|
||||
{
|
||||
TRIANGLE_UP,
|
||||
TRIANGLE_DOWN,
|
||||
SQUARE
|
||||
}
|
||||
|
||||
public enum SensorType
|
||||
{
|
||||
IDEAL
|
||||
}
|
||||
11
Assets/Scripts/Config/SimulationConfig.cs.meta
Normal file
11
Assets/Scripts/Config/SimulationConfig.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79f1fe138866d6a40b209a4edcf2ee06
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
73
Assets/Scripts/Config/StaticConfig.cs
Normal file
73
Assets/Scripts/Config/StaticConfig.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public class StaticConfig
|
||||
{
|
||||
[System.Serializable]
|
||||
public class AccelerationConfig
|
||||
{
|
||||
[Tooltip("Maximum reference acceleration")]
|
||||
public float maxReferenceAcceleration = 300f;
|
||||
[Tooltip("Reference speed")]
|
||||
public float referenceSpeed = 1000f;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class BoostConfig
|
||||
{
|
||||
[Tooltip("Boost time in seconds")]
|
||||
public float boostTime = 0.3f;
|
||||
[Tooltip("Boost acceleration")]
|
||||
public float boostAcceleration = 350f;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class LiftDragConfig
|
||||
{
|
||||
[Tooltip("Lift coefficient")]
|
||||
public float liftCoefficient = 0.2f;
|
||||
[Tooltip("Drag coefficient")]
|
||||
public float dragCoefficient = 0.7f;
|
||||
[Tooltip("Lift to drag ratio")]
|
||||
public float liftDragRatio = 5f;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class BodyConfig
|
||||
{
|
||||
[Tooltip("Mass in kg")]
|
||||
public float mass = 0.37f;
|
||||
[Tooltip("Cross-sectional area in m²")]
|
||||
public float crossSectionalArea = 3e-4f;
|
||||
[Tooltip("Fin area in m²")]
|
||||
public float finArea = 6e-4f;
|
||||
[Tooltip("Body area in m²")]
|
||||
public float bodyArea = 1e-2f;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class HitConfig
|
||||
{
|
||||
[Tooltip("Hit radius")]
|
||||
public float hitRadius = 1f;
|
||||
[Tooltip("Kill probability")]
|
||||
public float killProbability = 0.9f;
|
||||
}
|
||||
|
||||
[Header("Acceleration Configuration")]
|
||||
public AccelerationConfig accelerationConfig;
|
||||
|
||||
[Header("Boost Configuration")]
|
||||
public BoostConfig boostConfig;
|
||||
|
||||
[Header("Lift and Drag Configuration")]
|
||||
public LiftDragConfig liftDragConfig;
|
||||
|
||||
[Header("Body Configuration")]
|
||||
public BodyConfig bodyConfig;
|
||||
|
||||
[Header("Hit Configuration")]
|
||||
public HitConfig hitConfig;
|
||||
}
|
||||
11
Assets/Scripts/Config/StaticConfig.cs.meta
Normal file
11
Assets/Scripts/Config/StaticConfig.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35d9cdcf93cb04b40a7538fc87071e3b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user