一個題目板可以秀圖片,放入三個圖片,圖片一秒會換下一張
- 增加cube
- 增加material
- shader改成specular
- 照片拉到material右邊正方形框
- 把程式拉給cube
- 再把下面做好的material放入程式底下
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class chagneMatQuck : MonoBehaviour
{
public Material one;
public Material two;
public Material three;
// Start is called before the first frame update
void Start()
{
}
int frameN=0;
// Update is called once per frame
void Update()
{
if(frameN%60==0){
int now= (int)(frameN/60)%3;
Renderer thisRend = GetComponent<Renderer>();
if(now==0) thisRend.material = one;
if(now==1) thisRend.material = two;
if(now==2) thisRend.material = three;
}
frameN++;
}
}
沒有留言:
張貼留言