InstantiateGOCommand.cs 416 B

1234567891011121314151617
  1. using Blue;
  2. using UnityEngine;
  3. public struct InstantiateGOCommand : ICommand
  4. {
  5. private GameObject prefab;
  6. private GameObject parent;
  7. public InstantiateGOCommand(GameObject prefab,GameObject parent =null)
  8. {
  9. this.prefab = prefab;
  10. this.parent = parent;
  11. }
  12. public void OnExcute()
  13. {
  14. InstantiateSystem.Instance.InstantiatePrefab(prefab,parent);
  15. }
  16. }