TestGetMaterial.cs 592 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class TestGetMaterial : MonoBehaviour
  5. {
  6. Material oldmat;
  7. // Start is called before the first frame update
  8. void Start()
  9. {
  10. oldmat = gameObject.GetComponent<MeshRenderer>().material;
  11. StartCoroutine(Show());
  12. }
  13. private IEnumerator Show()
  14. {
  15. yield return new WaitForSeconds(3);
  16. Func();
  17. }
  18. private void Func()
  19. {
  20. Debug.Log("ÑÓʱ2sÖ´ÐÐ");
  21. }
  22. // Update is called once per frame
  23. void Update()
  24. {
  25. }
  26. }