| | 1 | | using UnityEngine; |
| | 2 | |
|
| | 3 | | public class NFTShapeFactory : ScriptableObject |
| | 4 | | { |
| | 5 | | [SerializeField] GameObject[] loaderControllersPrefabs; |
| | 6 | |
|
| | 7 | | static NFTShapeFactory instance = null; |
| | 8 | | public static NFTShapeFactory i |
| | 9 | | { |
| | 10 | | get |
| | 11 | | { |
| 21 | 12 | | if (instance == null) |
| | 13 | | { |
| 1 | 14 | | instance = Resources.Load<NFTShapeFactory>("NFTShapeFactory"); |
| | 15 | | } |
| 21 | 16 | | return instance; |
| | 17 | | } |
| | 18 | | } |
| | 19 | |
|
| | 20 | | public static GameObject InstantiateLoaderController(int index) |
| | 21 | | { |
| 7 | 22 | | if (i != null && index >= 0 && index < i.loaderControllersPrefabs.Length) |
| | 23 | | { |
| 7 | 24 | | return Object.Instantiate(i.loaderControllersPrefabs[index]); |
| | 25 | | } |
| 0 | 26 | | return Object.Instantiate(Resources.Load("NFTShapeLoader_Classic") as GameObject); |
| | 27 | | } |
| | 28 | |
|
| 2 | 29 | | private NFTShapeFactory() { } |
| | 30 | | } |