BigEnabler.cs 595 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 BigEnabler : MonoBehaviour {
    public bool Activated = false;
    Renderer[] rendererComponents;

    void Start () {
        rendererComponents = GetComponentsInChildren<Renderer> ();
    }
    // Update is called once per frame
    void Update () {
Nathan De Castro's avatar
Nathan De Castro committed
13
        if (AM.i.GetRMS () > 10.0f) {
14 15 16 17 18 19 20 21 22 23
            Activated = true;
        } else {
            Activated = false;
        }

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