コード例 #1
0
        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;
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
ファイル: CanBusSensor.cs プロジェクト: team19032/team19032
 private void Awake()
 {
     RigidBody = GetComponentInParent <Rigidbody>();
     Actions   = GetComponentInParent <VehicleActions>();
     Dynamics  = GetComponentInParent <VehicleDynamics>();
     MapOrigin = MapOrigin.Find();
 }
コード例 #4
0
ファイル: CanBusSensor.cs プロジェクト: snowman8701/simulator
        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();
        }
コード例 #5
0
 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;
 }
コード例 #6
0
        private void Awake()
        {
            LastControlUpdate = Time.time;
            Controller        = GetComponentInParent <VehicleController>();
            Dynamics          = GetComponentInParent <VehicleDynamics>();

            H2VechicleControl_ = new H2VechicleAccModel();
            H2VechicleControl_.Init();

            RigidBody = GetComponentInParent <Rigidbody>();
        }
コード例 #7
0
 private void Awake()
 {
     LastControlUpdate = Time.time;
     Controller        = GetComponentInParent <VehicleController>();
     Dynamics          = GetComponentInParent <VehicleDynamics>();
 }
コード例 #8
0
 private void Start()
 {
     dynamics   = GetComponentInParent <VehicleDynamics>();
     controller = GetComponentInParent <VehicleController>();
 }
コード例 #9
0
 void Start()
 {
     Actions   = GetComponentInParent <VehicleActions>();
     Dynamics  = GetComponentInParent <VehicleDynamics>();
     StateData = new VehicleStateData();
 }