public void Interact(DriverController initiator) { if (OnInteraction != null) { OnInteraction(initiator); } }
public void ActivateCar(DriverController driver) { _switchManager.NotifySwitch(false); driver.DeactivateCharacter(); enabled = true; _turret.enabled = true; foreach (var wheel in _wheels) { wheel.enabled = true; } _cameraFollower.SwitchFollow(transform, CameraSize); }
void Awake() { FollowOnSight.Target = transform; _driver = FindObjectOfType <DriverController>(); _driver.gameObject.SetActive(false); _turret = GetComponentInChildren <TurretController>(); _landingZones = GetComponentsInChildren <TriggerDetection>().ToList(); _cameraFollower = Camera.main.GetComponent <Follower>(); var interactible = GetComponent <Interactible>(); interactible.OnInteraction += ActivateCar; _wheels = GetComponentsInChildren <WheelRotation>(); _switchManager = FindObjectOfType <SwitchManager>(); }