WIP IADS and Vessel structure

more-targets
Daniel Lovell 2024-09-12 20:06:47 -07:00
parent 10bdd5db16
commit d0ef6c3fc4
7 changed files with 180 additions and 9 deletions

View File

@ -2385,6 +2385,74 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &2052906803
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2052906806}
- component: {fileID: 2052906805}
- component: {fileID: 2052906804}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2052906804
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2052906803}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SendPointerHoverToParent: 1
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &2052906805
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2052906803}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &2052906806
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2052906803}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1660057539 &9223372036854775807 --- !u!1660057539 &9223372036854775807
SceneRoots: SceneRoots:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2394,3 +2462,4 @@ SceneRoots:
- {fileID: 674567085} - {fileID: 674567085}
- {fileID: 253946927} - {fileID: 253946927}
- {fileID: 694951366} - {fileID: 694951366}
- {fileID: 2052906806}

8
Assets/Scripts/IADS.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9c6197c2ed2c6bc49b0667188a72a29d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,39 @@
using UnityEngine;
using System.Collections.Generic;
using System.Collections;
using System;
// Integrated Air Defense System
public class IADS : MonoBehaviour
{
public enum TargetStatus {
UNASSIGNED,
ASSIGNED,
HIT,
DEGRADED,
DESTROYED
}
// Look up target status by unique target ID
public Dictionary<string, TargetStatus> _targetStatusDictionary;
private List<Target> _targets;
private List<Missile> _missiles;
private List<Vessel> _vessels;
public delegate void RegisterNewTargetDelegate(Target target);
public event RegisterNewTargetDelegate OnRegisterNewTarget;
void Start()
{
_targets = new List<Target>();
}
public void RegisterNewTarget(Target target) {
_targets.Add(target);
OnRegisterNewTarget?.Invoke(target);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a5899f1049cf3d64e8c06c1db772c879
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,33 @@
using UnityEngine;
using System.Collections.Generic;
public class Vessel : MonoBehaviour
{
[SerializeField]
private List<Missile> missileInventory = new List<Missile>();
public void AddMissile(Missile missile)
{
if (missile != null)
{
missileInventory.Add(missile);
}
}
public void RemoveMissile(Missile missile)
{
missileInventory.Remove(missile);
}
public List<Missile> GetMissileInventory()
{
return new List<Missile>(missileInventory);
}
public int GetMissileCount()
{
return missileInventory.Count;
}
// Additional methods can be added here as needed
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 607b5f69ae2775c4ab0089839f65fd61
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -14,37 +14,37 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
timeScale: 0.2 timeScale: 0.2
missile_swarm_configs: missile_swarm_configs:
- num_agents: 10 - num_agents: 20
agent_config: agent_config:
missile_type: 0 missile_type: 0
target_type: 0 target_type: 0
initial_state: initial_state:
position: {x: 0, y: 10, z: 0} position: {x: 0, y: 10, z: 0}
rotation: {x: -45, y: 0, z: 0} rotation: {x: -45, y: 0, z: 0}
velocity: {x: 0, y: 0, z: 10} velocity: {x: 0, y: 10, z: 10}
standard_deviation: standard_deviation:
position: {x: 10, y: 10, z: 10} position: {x: 10, y: 10, z: 10}
velocity: {x: 0, y: 0, z: 0} velocity: {x: 5, y: 0, z: 5}
dynamic_config: dynamic_config:
launch_config: launch_config:
launch_time: 0 launch_time: 0
sensor_config: sensor_config:
type: 0 type: 0
frequency: 0 frequency: 1
plotting_config: plotting_config:
color: {r: 0, g: 0, b: 0, a: 0} color: {r: 0, g: 0, b: 0, a: 0}
linestyle: 0 linestyle: 0
marker: 0 marker: 0
submunitions_config: submunitions_config:
num_submunitions: 10 num_submunitions: 7
launch_config: launch_config:
launch_time: 2 launch_time: 1.5
agent_config: agent_config:
missile_type: 1 missile_type: 1
initial_state: initial_state:
position: {x: 0, y: 0, z: 0} position: {x: -38.074936, y: 286.19226, z: 293.8709}
rotation: {x: 0, y: 0, z: 0} rotation: {x: 0, y: 0, z: 0}
velocity: {x: 0, y: 0, z: 0} velocity: {x: -20.437624, y: 181.02332, z: 193.21309}
standard_deviation: standard_deviation:
position: {x: 5, y: 5, z: 5} position: {x: 5, y: 5, z: 5}
velocity: {x: 0, y: 0, z: 0} velocity: {x: 0, y: 0, z: 0}
@ -53,7 +53,7 @@ MonoBehaviour:
launch_time: 0 launch_time: 0
sensor_config: sensor_config:
type: 0 type: 0
frequency: 0 frequency: 1
plotting_config: plotting_config:
color: {r: 0, g: 0, b: 0, a: 0} color: {r: 0, g: 0, b: 0, a: 0}
linestyle: 0 linestyle: 0