public void SelectVehicle(short vehicleId, VehicleGuiData guiData) { // update the selected team vehicle in the gamestate tracker currentVehicleId = vehicleId; lockButton.interactable = true; textGui vehicleData = new textGui(guiData.displayName, guiData.speed, guiData.strength, guiData.weapon, guiData.ultimate); GetComponent <PhotonView>().RPC(nameof(DisplaySelectedVehicle_RPC), RpcTarget.All, vehicleId, otherId, (short)PhotonNetwork.LocalPlayer.ActorNumber, JsonUtility.ToJson(vehicleData)); }
public void SetupButton(string vehicleNameLocal, short vehicleIdLocal, VehicleSelector vehicleSelectorLocal) { vehicleName = vehicleNameLocal; vehicleId = vehicleIdLocal; vehicleSelector = vehicleSelectorLocal; // load any information about the characters here: car = Resources.Load(prefix + vehicleName) as GameObject; if (car.GetComponent <VehicleGuiData>() != null) { Debug.Log("Get Component"); VehicleGuiData guiData = car.GetComponent <VehicleGuiData>(); icon = guiData.icon; image.sprite = icon; if (showVehicleNameText) { vehicleNameText.text = guiData.displayName; } vehicleGuiData = guiData; } }