コード例 #1
0
    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;
    }
コード例 #2
0
ファイル: CarMovement.cs プロジェクト: jimbolemons/cargame
    void Start()
    {
        GM = GameManager.instance;

        input      = PlayerInput.instance;
        playerData = PlayerData.instance;
        CarData    = playerData.currentSelection;
    }
コード例 #3
0
 void Start()
 {
     GM    = GameManager.instance;
     input = PlayerInput.instance;
     data  = CarMovement.instance.CarData;
 }