| 1 | using System.Collections; |
| 2 | using System.Collections.Generic; |
| 3 | using UnityEngine; |
| 4 | |
| 5 | public class ModuleSlot : MonoBehaviour |
| 6 | { |
| 7 | [SerializeField] private ModuleBase[] modulePrefabs; |
| 8 | public ModuleBase Module { get; private set; } |
| 9 | |
| 10 | void Awake() |
| 11 | { |
| 12 | transform.LookAt(new Vector3(0, transform.position.y, 0)); |
| 13 | } |
| 14 | |
| 15 | public void Spawn() |
| 16 | { |
| 17 | Module = Instantiate(modulePrefabs[Random.Range(0, modulePrefabs.Length)], transform.position, transform.rotation); |
| 18 | } |
| 19 | } |