You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
874 B

9 years ago
9 years ago
9 years ago
9 years ago
  1. using UnityEngine;
  2. using System.Collections;
  3. public class playerId : MonoBehaviour {
  4. public bool idVanish = false;
  5. public GameObject p1;
  6. public GameObject p2;
  7. public GameObject p3;
  8. public GameObject p4;
  9. // Use this for initialization
  10. void Start () {
  11. }
  12. // Update is called once per frame
  13. void Update () {
  14. transform.eulerAngles = new Vector3 (transform.eulerAngles.x, 180, transform.eulerAngles.z);
  15. if (Input.GetKeyDown (KeyCode.Backspace)) {
  16. idVanish = true;
  17. if (idVanish) {
  18. p1.gameObject.SetActive (false);
  19. p2.gameObject.SetActive (false);
  20. p3.SetActive (false);
  21. p4.SetActive (false);
  22. Debug.Log ("player ID false");
  23. }
  24. }
  25. if (Input.GetKeyDown (KeyCode.Backspace) && idVanish == true) {
  26. p1.SetActive (true);
  27. p2.SetActive (true);
  28. p3.SetActive (true);
  29. p4.SetActive (true);
  30. idVanish = false;
  31. }
  32. }
  33. }