void Start() { FPSscript = GetComponentInParent <FirstPersonController> (); backScript = panel.GetComponent <BackScript> (); instrumentScript = current.GetComponent <InstrumentScript> (); Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; }
void EnterMenu2() { for (int i = 0; i < instrumentScript.Actions.Length; i++) { Actions [i].gameObject.SetActive(true); Text txt = Actions [i].GetComponentInChildren <Text> (); txt.text = instrumentScript.Actions [i]; objectScript = rayed.GetComponent <ObjectScript> (); backScript = Actions [i].gameObject.GetComponent <BackScript> (); backScript.isRight = (objectScript.rightAction == txt.text); Debug.Log(backScript.isRight); } for (int i = instrumentScript.Actions.Length; i < Actions.Length; i++) { Actions [i].gameObject.SetActive(false); } }