micromissiles-unity/Assets/Scripts/IADS/Vessel.cs

28 lines
612 B
C#
Raw Normal View History

2024-09-12 20:06:47 -07:00
using UnityEngine;
using System.Collections.Generic;
2024-09-13 22:45:25 -07:00
public class Vessel : MonoBehaviour {
[SerializeField]
private List<Missile> missileInventory = new List<Missile>();
2024-09-12 20:06:47 -07:00
2024-09-13 22:45:25 -07:00
public void AddMissile(Missile missile) {
if (missile != null) {
missileInventory.Add(missile);
2024-09-12 20:06:47 -07:00
}
2024-09-13 22:45:25 -07:00
}
2024-09-12 20:06:47 -07:00
2024-09-13 22:45:25 -07:00
public void RemoveMissile(Missile missile) {
missileInventory.Remove(missile);
}
2024-09-12 20:06:47 -07:00
2024-09-13 22:45:25 -07:00
public List<Missile> GetMissileInventory() {
return new List<Missile>(missileInventory);
}
2024-09-12 20:06:47 -07:00
2024-09-13 22:45:25 -07:00
public int GetMissileCount() {
return missileInventory.Count;
}
2024-09-12 20:06:47 -07:00
2024-09-13 22:45:25 -07:00
// Additional methods can be added here as needed
2024-09-12 20:06:47 -07:00
}