StartC.cs 718 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class StartC : MonoBehaviour
  5. {
  6. // Start is called before the first frame update
  7. // IEnumerator wrapWaiF;
  8. void Start()
  9. {
  10. // wrapWaiF = WaitForStartTimer(3f);
  11. StartCoroutine(WaitForStartTimer(3));
  12. }
  13. // Update is called once per frame
  14. void Update()
  15. {
  16. if(Input.GetMouseButton(0))
  17. {
  18. Debug.Log("click mouse");
  19. StopCoroutine(WaitForStartTimer(3));
  20. }
  21. }
  22. IEnumerator WaitForStartTimer(float timer)
  23. {
  24. Debug.Log(111);
  25. yield return new WaitForSeconds(timer);
  26. Debug.Log(3333);
  27. }
  28. }