BlueGit

blue-star ggj-2020

Files

ggj-2020 / Assets / GAME / Scripts / ModuleSlot.cs

ModuleSlot.cs

92128f09 History
ModuleSlot.cs 493 B Download Raw
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4
5public 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}