Bumper.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Assets.StreetLight.Scripts;
  2. using System;
  3. using System.Linq;
  4. using UnityEngine;
  5. namespace Assets.Pong
  6. {
  7. public class Bumper : MonoBehaviour
  8. {
  9. public bool isBump1;
  10. public float speed = 5f;
  11. PersonManager PersonManager => personManagerLazy.Value;
  12. Lazy<PersonManager> personManagerLazy;
  13. private void Awake()
  14. {
  15. personManagerLazy = new Lazy<PersonManager>(FindObjectOfType<PersonManager>);
  16. }
  17. void Update()
  18. {
  19. if (PersonManager.Persons.Count == 1)
  20. {
  21. var person = PersonManager.Persons.Single();
  22. //if (isBump1)
  23. //{
  24. // transform.Translate(0f, Input.GetAxis("Vertical") * speed * Time.deltaTime, 0f);
  25. //}
  26. //else
  27. //{
  28. // //transform.Translate(0f, Input.GetAxis("Vertical2") * speed * Time.deltaTime, 0f);
  29. //}
  30. }
  31. }
  32. }
  33. }