12345678910111213141516171819202122232425262728293031323334353637383940 |
- using Assets.StreetLight.Scripts;
- using System;
- using System.Linq;
- using UnityEngine;
- namespace Assets.Pong
- {
- public class Bumper : MonoBehaviour
- {
- public bool isBump1;
- public float speed = 5f;
- PersonManager PersonManager => personManagerLazy.Value;
- Lazy<PersonManager> personManagerLazy;
- private void Awake()
- {
- personManagerLazy = new Lazy<PersonManager>(FindObjectOfType<PersonManager>);
- }
- void Update()
- {
- if (PersonManager.Persons.Count == 1)
- {
- var person = PersonManager.Persons.Single();
- //if (isBump1)
- //{
- // transform.Translate(0f, Input.GetAxis("Vertical") * speed * Time.deltaTime, 0f);
- //}
- //else
- //{
- // //transform.Translate(0f, Input.GetAxis("Vertical2") * speed * Time.deltaTime, 0f);
- //}
- }
- }
- }
- }
|