Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class FakeRenderCubemap : MonoBehaviour {
- public Cubemap cubemap;
- public float updateFrequency = .5f;
- private float lastUpdate = 0f;
- void Start() {
- FakeRenderCubemapFace[] children = transform.GetComponentsInChildren<FakeRenderCubemapFace> ();
- foreach (FakeRenderCubemapFace face in children) {
- face.updateFrequency = updateFrequency;
- face.cubemap = cubemap;
- }
- }
- void LateUpdate() {
- if (Time.time > lastUpdate + updateFrequency) {
- lastUpdate = Time.time;
- cubemap.Apply ();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment