Beispiel #1
0
        private void SetCarToBG(CarModel car, int up_lvl)
        {
            return;

            Quaternion rot = Quaternion.Euler(0.6f, -109f, -10f);

            var go = Resources.Load("RaceCarsPrefabs/" + car.GetPrefabName(up_lvl)) as GameObject;

            if (go != null)
            {
                currentCar = GameObject.Instantiate(go, _carParent.position, rot) as GameObject;
                currentCar.transform.SetParent(_carParent);
                currentCar.GetComponent <CarBase>().SetColorInGame(_playerManager.selectedCar.current_color);
                currentCar.transform.localPosition = new Vector3(3.32f, -1.2f, 0.18f);

                currentCar.GetComponent <Rigidbody>().isKinematic = true;
            }
            else
            {
                go         = Resources.Load("RaceCarsPrefabs/" + car.GetPrefabName(up_lvl - 1)) as GameObject;
                currentCar = GameObject.Instantiate(go, _carParent.position, rot) as GameObject;
                currentCar.transform.SetParent(_carParent);
                currentCar.transform.localPosition = new Vector3(3.32f, -1.2f, 0.18f);


                currentCar.GetComponent <Rigidbody>().isKinematic = true;
            }
        }