Пример #1
0
 // Change mode
 override public void OnButtonDownBack1()
 {
     if (selected)
     {
         initialPosition = transform.position;
         onEditModeUI[(int)currentMode].gameObject.SetActive(false);
         currentMode = (editModes)(((int)currentMode + 1) % NUM_MODES);
         onEditModeUI[(int)currentMode].gameObject.SetActive(true);
     }
 }
Пример #2
0
 // Grab | Drop object
 override public void OnButtonDownA()
 {
     selected = !selected;
     GameObject.FindObjectOfType <AudioSource>().PlayOneShot(Resources.Load <AudioClip>("Audios/Grab"));
     if (!selected)
     {
         onEditModeUI[(int)currentMode].gameObject.SetActive(false);
         currentMode = editModes.TRANSLATE;
         RemoveInteraction();
         GetComponent <Rigidbody>().constraints = RigidbodyConstraints.None;
     }
     else
     {
         GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezeAll;
         onHoverUI.gameObject.SetActive(false);
         onEditModeUI[(int)currentMode].gameObject.SetActive(true);
     }
     Camera.main.transform.GetChild(0).gameObject.SetActive(!selected);
 }