public Controls(ISteeringWheel steeringWheel, Pedals pedals) { _steeringWheel = steeringWheel; _pedals = pedals; Name = $"Controls: {Guid.NewGuid().ToString()}"; }
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; }
/// <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(); }
public Car(ISteeringWheel steeringWheel, IIdentification identification) { this.steeringWheel = steeringWheel; this.identification = identification; }
public Model3(ISteeringWheel steeringWheel, IBreak breakInstance) : base(steeringWheel, breakInstance) { }
public void SetSteeringWheel(ISteeringWheel steeringWheel) { this.SteeringWheel = steeringWheel; }
public Car(ISteeringWheel steeringWheel, IBreak breakInstance) { SetSteeringWheel(steeringWheel); SetBreak(breakInstance); }