public void brainTrn() { if (brn == false) { brn = true; brnenum = brnlist.Brain2; brainText.text = "Brain 2"; } else { brn = false; brnenum = brnlist.Brain1; brainText.text = "Brain 1"; } }
void Start() { ResetModel(); brain1 = GameObject.Find("Brain"); // brain2 = GameObject.Find("Brain"); solar = GameObject.Find("Rotate"); var rotate = solar.GetComponent <Button>(); var button = brain1.GetComponent <Button>(); // var button2 = brain2.GetComponent<Button>(); // var button2 = button.onClick.AddListener(() => { if (brn == false) { brn = true; brnenum = brnlist.Brain2; brainText.text = "Brain 2"; } else { brn = false; brnenum = brnlist.Brain1; brainText.text = "Brain 1"; } }); rotate.onClick.AddListener(() => { if (controlZoom == false) { controlZoom = true; buttonText.text = "Zoom"; } else { controlZoom = false; buttonText.text = "Rotate"; } }); brnenum = brnlist.Brain1; brain1.SetActive(true); brain2.SetActive(false); }
private void Update() { brain1 = GameObject.Find("Brain"); solar = GameObject.Find("Rotate"); var rotate = solar.GetComponent <Button>(); var button = brain1.GetComponent <Button>(); // var button2 = button.onClick.AddListener(() => { if (brn == false) { brn = true; brnenum = brnlist.Brain2; brainText.text = "Brain 2"; } else { brn = false; brnenum = brnlist.Brain1; brainText.text = "Brain 1"; } }); rotate.onClick.AddListener(() => { if (controlZoom == false) { controlZoom = true; buttonText.text = "Zoom"; } else { controlZoom = false; buttonText.text = "Rotate"; } }); switch (brnenum) { case brnlist.Brain1: brain1.SetActive(true); brain2.SetActive(false); break; case brnlist.Brain2: brain1.SetActive(false); brain2.SetActive(true); break; } if (NRInput.GetButtonDown(ControllerButton.TRIGGER)) { m_PreviousPos = NRInput.GetTouch(); } else if (NRInput.GetButton(ControllerButton.TRIGGER)) { UpdateScroll(); } else if (NRInput.GetButtonUp(ControllerButton.TRIGGER)) { m_PreviousPos = Vector2.zero; } }