Hey guys, I start to learn scripting in Unity, I tried to create a simple script where I can enable different buttons for different hardware capabillities. I have a button for devices with Gyroscope support, and a button for devices without Gyroscope, here is my script, but when I start the game nothing actually happens.
using UnityEngine;
using System.Collections;
public class DetectGyro : MonoBehaviour {
private bool GyroscopeSupport;
public Gyroscope GyroEnabler;
public GameObject ok1;
public GameObject ok;
void Start() {
GyroscopeSupport = SystemInfo.supportsGyroscope;
GyroEnabler.enabled = true;
}
void StartActivate() {
if (GyroscopeSupport == null)
ok1.SetActive (false);
}
}