AutoAddSpawner.cs 731 B

12345678910111213141516171819202122232425262728293031
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class AutoAddSpawner : MonoBehaviour
  5. {
  6. // Start is called before the first frame update
  7. public static int DuplicateId = 0;
  8. void Start()
  9. {
  10. AutoAddSpawner.DuplicateId = GameDateManager.Instance.GateID;
  11. string[] spStr = this.gameObject.name.Split('_');
  12. if(spStr.Length > 1)
  13. {
  14. if(DuplicateId == int.Parse(spStr[1]))
  15. {
  16. this.gameObject.SetActive(true);
  17. }
  18. else
  19. {
  20. this.gameObject.SetActive(false);
  21. }
  22. }
  23. }
  24. // Update is called once per frame
  25. void Update()
  26. {
  27. }
  28. }