123456789101112131415161718192021222324252627 |
- using UnityEngine;
- using System.Collections;
- public class SwitchAd : MonoBehaviour
- {
- public MeshRenderer Renderer;
- public Material[] Materials;
- private static int id = 0;
- private static void Next()
- {
- id++;
- if (id>5)
- {
- id = 0;
- }
- }
- // Use this for initialization
- private void OnEnable()
- {
- Renderer.sharedMaterial = Materials[id];
- Next();
- // Debug.Log("change");
- }
- }
|