Loading... ```c# using System.Collections; using System.Collections.Generic; using UnityEngine; public class AutoChangeColor : MonoBehaviour { public Material[] color; int i = 0; MeshRenderer meshRenderer; void Start() { meshRenderer = GetComponent<MeshRenderer>(); ChangeColor(); } void Update() { } private void ChangeColor() { meshRenderer.material = color[i]; if (i == 0) Invoke("ChangeColor", 3); else if(i == 1) Invoke("ChangeColor", 1); else if(i == 2) Invoke("ChangeColor", 3); i += 1; if (i == 3) i = 0; } } ``` Last modification:October 27, 2022 © Allow specification reprint Like 0 如果觉得我的文章对你有用,请随意赞赏
Comment here is closed