3DSelfie  Hansjoerg Hofer (1026632), Sebastian Metzler (0927550)
toggleResult.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using System.Collections;
3 
4 public class toggleResult : MonoBehaviour {
5 
6  Renderer snakeScript;
7  ControlPoints controlpoints;
8 
15  void Start () {
16 
17  snakeScript = GameObject.Find ("SnakeScript").GetComponent<Renderer>();
18  controlpoints = GameObject.Find ("Head_mesh").GetComponent<ControlPoints>();
19 
20  }
21 
22  bool showSnake = true;
23 
30  void Update () {
31 
32  if (Input.GetKeyDown ("z")) {
33  showSnake = !showSnake;
34 
35  snakeScript.enabled = showSnake;
36  controlpoints.EnableRotation = !showSnake;
37  }
38  }
39 
40 }
ControlPoints script on mesh.