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.

34 lines
756 B

  1. using UnityEngine;
  2. using System.Collections;
  3. public class playerId : MonoBehaviour {
  4. public bool idVanish = true;
  5. // Use this for initialization
  6. void Start () {
  7. }
  8. // Update is called once per frame
  9. void Update () {
  10. transform.eulerAngles = new Vector3 (transform.eulerAngles.x, 180, transform.eulerAngles.z);
  11. if (Input.GetKeyDown (KeyCode.Backspace)) {
  12. idVanish = true;
  13. if (idVanish) {
  14. transform.position = new Vector3 (transform.position.x, -100, transform.position.z);
  15. idVanish = false;
  16. Debug.Log ("player ID true");
  17. }
  18. }
  19. if (Input.GetKeyDown (KeyCode.Backspace) && idVanish == false) {
  20. transform.position = new Vector3 (transform.position.x, 100, transform.position.z);
  21. idVanish = true;
  22. }
  23. }
  24. }