// Use this for initialization protected void Start() { rb = GetComponent <Rigidbody2D>(); touchObject = null; touched = false; touching = false; SelectRandomSprite(); difficultyManager = GameObject.Find("DifficultyManager"); if (difficultyManager != null) { difficultyManagerController = difficultyManager.GetComponent <DifficultyManagerController>(); } if (rb == null) { rb = GetComponent <Rigidbody2D>(); } }
// Use this for initialization private void Start() { timeBetweenSpawn = startingTimeBetweenSpawn; touchCount = defaultTouchCount; gravityScale = defaultGravityScale; startTime = Time.timeSinceLevelLoad; if (Debug.isDebugBuild) { Debug.Log("Spawn Rate: " + timeBetweenSpawn); } cd = GetComponent <BoxCollider2D>(); if (difficultyManager != null) { difficultyManagerController = difficultyManager.GetComponent <DifficultyManagerController>(); } }
// Use this for initialization private void Start() { int tmp = PlayerPrefs.GetInt("SFXVolume"); mixer.SetFloat("sfxVolume", tmp == -20 ? -80 : tmp); tmp = PlayerPrefs.GetInt("MusicVolume"); mixer.SetFloat("musicVolume", tmp == -20 ? -80 : tmp); tmp = PlayerPrefs.GetInt("MasterVolume"); mixer.SetFloat("masterVolume", tmp == -20 ? -80 : tmp); Time.timeScale = 1f; score = -1; difficultyManagerControl = difficultyManager.GetComponent <DifficultyManagerController>(); difficultyManagerControl.StartTimer(); if (Debug.isDebugBuild) { Debug.Log("Start woo"); } restarting = false; }