using Assets.StreetLight.Scripts; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class Bumper : MonoBehaviour { public bool isBump1; public float speed = 5f; PersonManager PersonManager => personManagerLazy.Value; Lazy personManagerLazy; private void Awake() { personManagerLazy = new Lazy(FindObjectOfType); } void Update() { if (isBump1) { transform.Translate(0f, Input.GetAxis("Vertical") * speed * Time.deltaTime, 0f); } else { //transform.Translate(0f, Input.GetAxis("Vertical2") * speed * Time.deltaTime, 0f); } } }