GetGameObjectCommand.cs 459 B

123456789101112131415161718
  1. using Blue;
  2. using UnityEngine;
  3. public class GetGameObjectCommand : ICommand
  4. {
  5. private GameObject obj;
  6. public GetGameObjectCommand(GameObject obj)
  7. {
  8. this.obj = obj;
  9. }
  10. public void OnExcute()
  11. {
  12. if(InstantiateSystem.Instance.objDic.ContainsKey(obj.name))
  13. InstantiateSystem.Instance.objDic[obj.name] = obj;
  14. else
  15. InstantiateSystem.Instance.objDic.Add(obj.name,obj);
  16. }
  17. }