void UpdatePanel() { //Debug.Log("Update panel " +playerData.playerUnlocks.Coins.ToString("00")); playerData.currentSelection = CarTypes[SelectionIndex]; currentSelection = CarTypes[SelectionIndex]; CoinAmount.text = playerData.playerUnlocks.Coins.ToString("00"); CarPrice.text = currentSelection.CarPrice.ToString("00"); playerData.SelectionIndex = SelectionIndex; if (!playerData.playerUnlocks.Cars[SelectionIndex]) //if unlocked { LockedImage.SetActive(true); PurchaseCarPanel.SetActive(true); UpgradeCarPanel.SetActive(false); } else { LockedImage.SetActive(false); PurchaseCarPanel.SetActive(false); UpgradeCarPanel.SetActive(true); UpdateUpgradesPanel(); } if (VisableMesh != null) { Destroy(VisableMesh); } VisableMesh = Instantiate(currentSelection.MeshObject, CenterSpawn.position, CenterSpawn.rotation, CenterSpawn); VisableMesh.transform.localEulerAngles += Vector3.up * 90; UpdateCarStats(); Title.text = currentSelection.CarType; }
void Start() { GM = GameManager.instance; input = PlayerInput.instance; playerData = PlayerData.instance; CarData = playerData.currentSelection; }
void Start() { GM = GameManager.instance; input = PlayerInput.instance; data = CarMovement.instance.CarData; }