void Update() { if (!initialized) { citizenVehicleInfoPanel = GameObject.Find("(Library) CitizenVehicleWorldInfoPanel").GetComponent<CitizenVehicleWorldInfoPanel>(); citizenVehicleInfoPanel.Find<UITextField>("VehicleName").width = 200; citizenVehicleCameraButton = CreateCameraButton ( citizenVehicleInfoPanel.component, (component, param) => { InstanceID instance = Util.ReadPrivate<CitizenVehicleWorldInfoPanel, InstanceID>(citizenVehicleInfoPanel, "m_InstanceID"); FPSCamera.instance.vehicleCamera.SetFollowInstance(instance.Vehicle); if (FPSCamera.instance.hideUIComponent != null && FPSCamera.instance.config.integrateHideUI) { FPSCamera.instance.hideUIComponent.SendMessage("Hide"); } } ); // cityServiceVehicleInfoPanel = GameObject.Find("(Library) CityServiceVehicleWorldInfoPanel").GetComponent<CityServiceVehicleWorldInfoPanel>(); cityServiceVehicleInfoPanel.Find<UITextField>("VehicleName").width = 200; cityServiceVehicleCameraButton = CreateCameraButton ( cityServiceVehicleInfoPanel.component, (component, param) => { InstanceID instance = Util.ReadPrivate<CityServiceVehicleWorldInfoPanel, InstanceID>(cityServiceVehicleInfoPanel, "m_InstanceID"); FPSCamera.instance.vehicleCamera.SetFollowInstance(instance.Vehicle); if (FPSCamera.instance.hideUIComponent != null && FPSCamera.instance.config.integrateHideUI) { FPSCamera.instance.hideUIComponent.SendMessage("Hide"); } } ); // publicTransportVehicleInfoPanel = GameObject.Find("(Library) PublicTransportVehicleWorldInfoPanel").GetComponent<PublicTransportVehicleWorldInfoPanel>(); publicTransportVehicleInfoPanel.Find<UITextField>("VehicleName").width = 200; publicTransportCameraButton = CreateCameraButton ( publicTransportVehicleInfoPanel.component, (component, param) => { InstanceID instance = Util.ReadPrivate<PublicTransportVehicleWorldInfoPanel, InstanceID>(publicTransportVehicleInfoPanel, "m_InstanceID"); FPSCamera.instance.vehicleCamera.SetFollowInstance(instance.Vehicle); if (FPSCamera.instance.hideUIComponent != null && FPSCamera.instance.config.integrateHideUI) { FPSCamera.instance.hideUIComponent.SendMessage("Hide"); } } ); // citizenInfoPanel = GameObject.Find("(Library) CitizenWorldInfoPanel").GetComponent<CitizenWorldInfoPanel>(); citizenInfoPanel.Find<UITextField>("PersonName").width = 180; citizenCameraButton = CreateCameraButton ( citizenInfoPanel.component, (component, param) => { InstanceID instance = Util.ReadPrivate<CitizenWorldInfoPanel, InstanceID>(citizenInfoPanel, "m_InstanceID"); FPSCamera.instance.citizenCamera.SetFollowInstance(instance.Citizen); if (FPSCamera.instance.hideUIComponent != null && FPSCamera.instance.config.integrateHideUI) { FPSCamera.instance.hideUIComponent.SendMessage("Hide"); } } ); // initialized = true; } }
void Update() { if (!initialized) { citizenVehicleInfoPanel = GameObject.Find("(Library) CitizenVehicleWorldInfoPanel").GetComponent <CitizenVehicleWorldInfoPanel>(); citizenVehicleInfoPanel.Find <UITextField>("VehicleName").width = 200; citizenVehicleCameraButton = CreateCameraButton ( citizenVehicleInfoPanel.component, (component, param) => { InstanceID instance = Util.ReadPrivate <CitizenVehicleWorldInfoPanel, InstanceID>(citizenVehicleInfoPanel, "m_InstanceID"); FPSCamera.instance.vehicleCamera.SetFollowInstance(instance.Vehicle); if (FPSCamera.instance.hideUIComponent != null && FPSCamera.instance.config.integrateHideUI) { FPSCamera.instance.hideUIComponent.SendMessage("Hide"); } } ); // cityServiceVehicleInfoPanel = GameObject.Find("(Library) CityServiceVehicleWorldInfoPanel").GetComponent <CityServiceVehicleWorldInfoPanel>(); cityServiceVehicleInfoPanel.Find <UITextField>("VehicleName").width = 200; cityServiceVehicleCameraButton = CreateCameraButton ( cityServiceVehicleInfoPanel.component, (component, param) => { InstanceID instance = Util.ReadPrivate <CityServiceVehicleWorldInfoPanel, InstanceID>(cityServiceVehicleInfoPanel, "m_InstanceID"); FPSCamera.instance.vehicleCamera.SetFollowInstance(instance.Vehicle); if (FPSCamera.instance.hideUIComponent != null && FPSCamera.instance.config.integrateHideUI) { FPSCamera.instance.hideUIComponent.SendMessage("Hide"); } } ); // publicTransportVehicleInfoPanel = GameObject.Find("(Library) PublicTransportVehicleWorldInfoPanel").GetComponent <PublicTransportVehicleWorldInfoPanel>(); publicTransportVehicleInfoPanel.Find <UITextField>("VehicleName").width = 200; publicTransportCameraButton = CreateCameraButton ( publicTransportVehicleInfoPanel.component, (component, param) => { InstanceID instance = Util.ReadPrivate <PublicTransportVehicleWorldInfoPanel, InstanceID>(publicTransportVehicleInfoPanel, "m_InstanceID"); FPSCamera.instance.vehicleCamera.SetFollowInstance(instance.Vehicle); if (FPSCamera.instance.hideUIComponent != null && FPSCamera.instance.config.integrateHideUI) { FPSCamera.instance.hideUIComponent.SendMessage("Hide"); } } ); // citizenInfoPanel = GameObject.Find("(Library) CitizenWorldInfoPanel").GetComponent <CitizenWorldInfoPanel>(); citizenInfoPanel.Find <UITextField>("PersonName").width = 180; citizenCameraButton = CreateCameraButton ( citizenInfoPanel.component, (component, param) => { InstanceID instance = Util.ReadPrivate <CitizenWorldInfoPanel, InstanceID>(citizenInfoPanel, "m_InstanceID"); FPSCamera.instance.citizenCamera.SetFollowInstance(instance.Citizen); if (FPSCamera.instance.hideUIComponent != null && FPSCamera.instance.config.integrateHideUI) { FPSCamera.instance.hideUIComponent.SendMessage("Hide"); } } ); // initialized = true; } }
void Update() { if (!initialized) { privateVehicleInfoPanel = GameObject.Find("(Library) CitizenVehicleWorldInfoPanel").GetComponent <CitizenVehicleWorldInfoPanel>(); privateVehicleInfoPanel.Find <UITextField>("VehicleName").width = 150; drivePrivateVehicleBtn = CreateCameraButton ( privateVehicleInfoPanel.component, (component, param) => { Vector3 position; Vector3 rotation; VehicleInfo vehicleInfo; InstanceID instance = ReflectionUtils.ReadPrivate <CitizenVehicleWorldInfoPanel, InstanceID>(privateVehicleInfoPanel, "m_InstanceID"); vehicleInfo = instance.Vehicle != 0 ? manager.m_vehicles.m_buffer[instance.Vehicle].Info : manager.m_parkedVehicles.m_buffer[instance.ParkedVehicle].Info; position = instance.Vehicle != 0 ? manager.m_vehicles.m_buffer[instance.Vehicle].GetLastFrameData().m_position : manager.m_parkedVehicles.m_buffer[instance.ParkedVehicle].m_position; rotation = instance.Vehicle != 0 ? manager.m_vehicles.m_buffer[instance.Vehicle].GetLastFrameData().m_rotation.eulerAngles : manager.m_parkedVehicles.m_buffer[instance.ParkedVehicle].m_rotation.eulerAngles; VehicleHolder.getInstance().setVehicleInfo(vehicleInfo); VehicleHolder.getInstance().setActive(position, rotation); privateVehicleInfoPanel.Hide(); } ); serviceVehicleInfoPanel = GameObject.Find("(Library) CityServiceVehicleWorldInfoPanel").GetComponent <CityServiceVehicleWorldInfoPanel>(); serviceVehicleInfoPanel.Find <UITextField>("VehicleName").width = 150; driveServiceVehicleBtn = CreateCameraButton ( serviceVehicleInfoPanel.component, (component, param) => { Vector3 position; Vector3 rotation; VehicleInfo vehicleInfo; InstanceID instance = ReflectionUtils.ReadPrivate <CityServiceVehicleWorldInfoPanel, InstanceID>(serviceVehicleInfoPanel, "m_InstanceID"); vehicleInfo = instance.Vehicle != 0 ? manager.m_vehicles.m_buffer[instance.Vehicle].Info : manager.m_parkedVehicles.m_buffer[instance.ParkedVehicle].Info; position = instance.Vehicle != 0 ? manager.m_vehicles.m_buffer[instance.Vehicle].GetLastFrameData().m_position : manager.m_parkedVehicles.m_buffer[instance.ParkedVehicle].m_position; rotation = instance.Vehicle != 0 ? manager.m_vehicles.m_buffer[instance.Vehicle].GetLastFrameData().m_rotation.eulerAngles : manager.m_parkedVehicles.m_buffer[instance.ParkedVehicle].m_rotation.eulerAngles; VehicleHolder.getInstance().setVehicleInfo(vehicleInfo); VehicleHolder.getInstance().setActive(position, rotation); serviceVehicleInfoPanel.Hide(); } ); publicVehicleInfoPanel = GameObject.Find("(Library) PublicTransportVehicleWorldInfoPanel").GetComponent <PublicTransportVehicleWorldInfoPanel>(); publicVehicleInfoPanel.Find <UITextField>("VehicleName").width = 150; publicVehicleBtn = CreateCameraButton ( publicVehicleInfoPanel.component, (component, param) => { Vector3 position; Vector3 rotation; VehicleInfo vehicleInfo; InstanceID instance = ReflectionUtils.ReadPrivate <PublicTransportVehicleWorldInfoPanel, InstanceID>(publicVehicleInfoPanel, "m_InstanceID"); vehicleInfo = instance.Vehicle != 0 ? manager.m_vehicles.m_buffer[instance.Vehicle].Info : manager.m_parkedVehicles.m_buffer[instance.ParkedVehicle].Info; position = instance.Vehicle != 0 ? manager.m_vehicles.m_buffer[instance.Vehicle].GetLastFrameData().m_position : manager.m_parkedVehicles.m_buffer[instance.ParkedVehicle].m_position; rotation = instance.Vehicle != 0 ? manager.m_vehicles.m_buffer[instance.Vehicle].GetLastFrameData().m_rotation.eulerAngles : manager.m_parkedVehicles.m_buffer[instance.ParkedVehicle].m_rotation.eulerAngles; VehicleHolder.getInstance().setVehicleInfo(vehicleInfo); VehicleHolder.getInstance().setActive(position, rotation); publicVehicleInfoPanel.Hide(); } ); initialized = true; } }