SmallEnabler.cs 601 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
using UnityEngine;

// A simple rotating script for the walls of the player area
public class SmallEnabler : MonoBehaviour {
    public bool Activated = false;
    Renderer[] rendererComponents;

    void Start () {
        rendererComponents = GetComponentsInChildren<Renderer> ();
    }
    // Update is called once per frame
    void Update () {
13
        if (AM.i.GetPitch ()[0] < 0.5f) {
14
15
16
17
18
19
20
21
22
23
            Activated = true;
        } else {
            Activated = false;
        }

        foreach (Renderer component in rendererComponents) {
            component.enabled = Activated;
        }
    }
}