private void Start() { AgentController = GetComponentInParent <AgentController>(); dynamics = GetComponentInParent <VehicleDynamics>(); actions = GetComponentInParent <VehicleActions>(); Debug.Assert(dynamics != null); Debug.Assert(actions != null); Debug.Assert(SimulatorManager.Instance != null); controls = SimulatorManager.Instance.controls; controls.VehicleWheel.Accel.performed += AccelPerformed; controls.VehicleWheel.Accel.canceled += AccelCanceled; controls.VehicleWheel.Brake.performed += BrakePerformed; controls.VehicleWheel.Brake.canceled += BrakeCanceled; controls.VehicleWheel.Steer.performed += SteerPerformed; controls.VehicleWheel.ButtonA.performed += ButtonA; controls.VehicleWheel.ButtonB.performed += ButtonB; controls.VehicleWheel.ButtonX.performed += ButtonX; controls.VehicleWheel.ButtonY.performed += ButtonY; controls.VehicleWheel.ButtonRB.performed += ButtonRB; controls.VehicleWheel.ButtonLB.performed += ButtonLB; controls.VehicleWheel.ButtonSelect.performed += ButtonSelect; controls.VehicleWheel.ButtonStart.performed += ButtonStart; controls.VehicleWheel.ButtonRSB.performed += ButtonRSB; controls.VehicleWheel.ButtonLSB.performed += ButtonLSB; controls.VehicleWheel.ButtonCenter.performed += ButtonCenter; controls.VehicleWheel.DPad.performed += DPad; }
private void Start() { AgentController = GetComponentInParent <AgentController>(); dynamics = GetComponentInParent <VehicleDynamics>(); actions = GetComponentInParent <VehicleActions>(); Debug.Assert(dynamics != null); Debug.Assert(actions != null); Debug.Assert(SimulatorManager.Instance != null); controls = SimulatorManager.Instance.controls; if (SystemInfo.operatingSystemFamily == OperatingSystemFamily.Linux && Application.isEditor) { // empty } else { controls.Vehicle.Direction.started += DirectionStarted; controls.Vehicle.Direction.performed += DirectionPerformed; controls.Vehicle.Direction.canceled += DirectionCanceled; controls.Vehicle.ShiftFirst.performed += ShiftFirstPerformed; controls.Vehicle.ShiftReverse.performed += ShiftReversePerformed; controls.Vehicle.ParkingBrake.performed += ParkingBrakePerformed; controls.Vehicle.Ignition.performed += IgnitionPerformed; controls.Vehicle.HeadLights.performed += HeadLightsPerformed; controls.Vehicle.IndicatorLeft.performed += IndicatorLeftPerformed; controls.Vehicle.IndicatorRight.performed += IndicatorRightPerformed; controls.Vehicle.IndicatorHazard.performed += IndicatorHazardPerformed; controls.Vehicle.FogLights.performed += FogLightsPerformed; controls.Vehicle.InteriorLight.performed += InteriorLightPerformed; } }
private void Awake() { RigidBody = GetComponentInParent <Rigidbody>(); Actions = GetComponentInParent <VehicleActions>(); Dynamics = GetComponentInParent <VehicleDynamics>(); MapOrigin = MapOrigin.Find(); }
public override void OnBridgeSetup(IBridge bridge) { Bridge = bridge; Writer = bridge.AddWriter <CanBusData>(Topic); RigidBody = GetComponentInParent <Rigidbody>(); Actions = GetComponentInParent <VehicleActions>(); Dynamics = GetComponentInParent <VehicleDynamics>(); MapOrigin = MapOrigin.Find(); }
public override void Init() { startTime = SimulatorManager.Instance.CurrentTime; vehicleName = transform.root.name; dynamics = GetComponent <VehicleDynamics>(); actions = GetComponent <VehicleActions>(); inputs.AddRange(GetComponentsInChildren <IVehicleInputs>()); initialPosition = transform.position; initialRotation = transform.rotation; }
private void Awake() { LastControlUpdate = Time.time; Controller = GetComponentInParent <VehicleController>(); Dynamics = GetComponentInParent <VehicleDynamics>(); H2VechicleControl_ = new H2VechicleAccModel(); H2VechicleControl_.Init(); RigidBody = GetComponentInParent <Rigidbody>(); }
private void Awake() { LastControlUpdate = Time.time; Controller = GetComponentInParent <VehicleController>(); Dynamics = GetComponentInParent <VehicleDynamics>(); }
private void Start() { dynamics = GetComponentInParent <VehicleDynamics>(); controller = GetComponentInParent <VehicleController>(); }
void Start() { Actions = GetComponentInParent <VehicleActions>(); Dynamics = GetComponentInParent <VehicleDynamics>(); StateData = new VehicleStateData(); }