コード例 #1
0
        public Controls(ISteeringWheel steeringWheel, Pedals pedals)
        {
            _steeringWheel = steeringWheel;
            _pedals        = pedals;

            Name = $"Controls: {Guid.NewGuid().ToString()}";
        }
コード例 #2
0
ファイル: SteerHand.cs プロジェクト: sultim-t/ShootAndDrive
        void Awake()
        {
            steeringWheel      = player.GetComponentInChildren <ISteeringWheel>();
            steerHandAnimation = GetComponent <Animation>();
            steerState         = steerHandAnimation[SteerAnimationName];

            Debug.Assert(player != null, "Player is not set", this);
            Debug.Assert(player.Vehicle != null, "Player's vehicle is not set", this);

            // set this hand as a child for the vehicle;
            // used for proper vehicle rotation (i.e. with steering hand)
            transform.SetParent(player.Vehicle.RotatingTransform, true);

            canBeUpdated = false;

            player.OnPlayerStateChange += ChangeState;
        }
コード例 #3
0
        /// <summary>
        /// Init player, must be called before 'Start'
        /// </summary>
        public void Init()
        {
            MainCamera = GetComponentInChildren <Camera>();


            // player must be faced to world forward
            transform.forward = Vector3.forward;


            // init vehicle
            Vehicle = GetComponentInChildren <PlayerVehicle>(true);
            Debug.Assert(Vehicle != null, "There must be a 'PlayerVehicle' as child object", this);

            Vehicle.Init(this);
            steeringWheel = Vehicle.SteeringWheel;

            // init weapons
            weaponsController = GetComponentInChildren <WeaponsController>();
            weaponsController.SetOwner(this);

            SignToEvents();
        }
コード例 #4
0
 public Car(ISteeringWheel steeringWheel, IIdentification identification)
 {
     this.steeringWheel  = steeringWheel;
     this.identification = identification;
 }
コード例 #5
0
 public Model3(ISteeringWheel steeringWheel, IBreak breakInstance) : base(steeringWheel, breakInstance)
 {
 }
コード例 #6
0
 public void SetSteeringWheel(ISteeringWheel steeringWheel)
 {
     this.SteeringWheel = steeringWheel;
 }
コード例 #7
0
 public Car(ISteeringWheel steeringWheel, IBreak breakInstance)
 {
     SetSteeringWheel(steeringWheel);
     SetBreak(breakInstance);
 }