Ejemplo n.º 1
0
 // Gaze spawns 3 small spheres at right angles to the focusedObject
 public void OnFocusEnter()
 {
     // don't do anything if they are already viewing...
     if (!isViewing)
     {
         isViewing = !isViewing;
         GetComponent <Renderer>().material.shader = shadeOnView;
         GraphNodeManager.ToggleSubNodes(this.gameObject);
     }
     else
     {
         isViewing = !isViewing; // set to false to keep active on exit :)
     }
 }
Ejemplo n.º 2
0
 public void OnFocusExit()
 {
     // if the object was not selected
     if (isViewing)
     {
         GraphNodeManager.ToggleSubNodes(this.gameObject);
         GetComponent <Renderer>().material.shader = Shader.Find("Transparent/Diffuse");
         isViewing = false;  //no longer viewing,
     }
     // if selected
     else if (!isViewing)
     {
         isViewing = true;   // set back to true for OnFocusEnter again
     }
 }