private void Awake() { if (!Instance) { Instance = this; } }
// Start is called before the first frame update void Start() { sceneManager = GameObject.FindWithTag("RaceSceneManager"); gameManager = GameObject.FindObjectOfType <RaceGameManager>(); totalLaps = 5; currentLaps = 0; updateLaps(currentLaps, totalLaps); player1 = GameObject.FindWithTag("RacePlayer"); player2 = GameObject.FindWithTag("RacePlayer2"); player3 = GameObject.FindWithTag("RacePlayer3"); aux1 = PlayerPrefs.GetInt("firstP1"); aux2 = PlayerPrefs.GetInt("firstP2"); aux3 = PlayerPrefs.GetInt("firstP3"); assignAux(); }
void Start() { rb = GetComponent <Rigidbody2D>(); camera = GameObject.FindWithTag("MainCamera"); ambulance = GameObject.FindWithTag("Ambulance"); gameManager = GameObject.FindObjectOfType <RaceGameManager>(); player2 = GameObject.FindWithTag("RacePlayer2"); player3 = GameObject.FindWithTag("RacePlayer3"); currentPlayer = MenuController.currentPlayer; //transform.rotation.z = PlayerPrefs.GetFloat("PlayerRotation"); // transform.Rotate(0,0,0); //transform.rotation = Quaternion.Euler(0,0,PlayerPrefs.GetFloat("PlayerRotation")); //transform.rotation = Quaternion.Euler(0,0,0); //transform.Rotate(PlayerPrefs.GetFloat("PlayerRotationX"),PlayerPrefs.GetFloat("PlayerRotationY"),PlayerPrefs.GetFloat("PlayerRotationZ")); // transform.rotation = Quaternion.Euler( //PlayerPrefs.GetFloat("PlayerRotationX"), //PlayerPrefs.GetFloat("PlayerRotationY"), //PlayerPrefs.GetFloat("PlayerRotationZ")); transform.eulerAngles = new Vector3(PlayerPrefs.GetFloat("PlayerRotationX"), PlayerPrefs.GetFloat("PlayerRotationY"), PlayerPrefs.GetFloat("PlayerRotationZ")); LoadCar(); tribuneGuard = PlayerPrefs.GetInt(currentPlayer + "StoreObjectActive3"); if (tribuneGuard == 1) { activateTribuneGuard(); } rainTire = PlayerPrefs.GetInt(currentPlayer + "StoreObjectActive4"); immunity = PlayerPrefs.GetInt(currentPlayer + "StoreObjectActive5"); RaceTireSpawnerController.inmunidad = immunity; }