void Update() { handSwitch = GameObject.Find("Hands").GetComponent <HandSwitch>(); if (handSwitch.front == true) { if (frontMicrobe) { EnableComponents(); } else { DisableComponents(); } } else if (handSwitch.front != true) { if (frontMicrobe) { DisableComponents(); } else { EnableComponents(); } } }
// Use this for initialization void Awake() { handSwitch = GameObject.Find("Hands").GetComponent <HandSwitch>(); if (handSwitch == null) { Debug.LogError("CANT FIND HANDS SCRIPT!!!"); } int randomChance = Random.Range(-1, 1); if (randomChance == 0) { frontMicrobe = false; } else { frontMicrobe = true; } if (frontMicrobe) { if (handSwitch.front == true) { EnableComponents(); } else { DisableComponents(); } } else { if (handSwitch.front == true) { DisableComponents(); } else { EnableComponents(); } } }