InstantiateSystem.cs 599 B

1234567891011121314151617181920
  1. using Blue;
  2. using UnityEngine;
  3. namespace GHZLangChao
  4. {
  5. public class InstantiateSystem : SingletonMonobehaviour<InstantiateSystem>
  6. {
  7. [SerializeField] private BlueObject blueObject;
  8. public BlueObject BlueObject => blueObject;
  9. public GameObject InstantiatePrefab(GameObject prefab, GameObject parent = null)
  10. {
  11. return Instantiate(prefab, parent.transform);
  12. }
  13. public GameObject InstantiatePrefab(GameObject prefab, Transform parent = null)
  14. {
  15. return Instantiate(prefab, parent);
  16. }
  17. }
  18. }