fork download
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class PlayerScript : MonoBehaviour
  6. {
  7. public float playerVelocity;
  8. private Vector3 playerPosition;
  9.  
  10. // Вызывается для загруки
  11. void Start ()
  12. {
  13. // получим начальную позицию платформы
  14. playerPosition = gameObject.transform.position;
  15. }
  16.  
  17. // Update вызывается при отрисовке каждого кадра игры
  18. void Update ()
  19. {
  20. // горизонтальное движение
  21. playerPosition.x += Input.GetAxis("Horizontal") * playerVelocity;
  22.  
  23. // выход из игры
  24. if (Input.GetKeyDown(KeyCode.Escape))
  25. {
  26. Application.Quit();
  27. }
  28.  
  29. // обновим позицию платформы
  30. transform.position = playerPosition;
  31. }
  32. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(3,7): error CS0246: The type or namespace name `UnityEngine' could not be found. Are you missing an assembly reference?
prog.cs(5,29): error CS0246: The type or namespace name `MonoBehaviour' could not be found. Are you missing an assembly reference?
prog.cs(8,10): error CS0246: The type or namespace name `Vector3' could not be found. Are you missing `System.Numerics' using directive?
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty