private void Start() { scoreUpdater = scoreCounterObject.GetComponent <UpdateScore>(); gameOverScreen = gameOverScreenObject.GetComponent <GameOverScreen>(); gController = GameObject.FindGameObjectWithTag(Tags.GameController).GetComponent <GameplayController>(); playerSoundSrc = GetComponent <AudioSource>(); spriteRenderer = GetComponent <SpriteRenderer>(); bScroller = GameObject.FindGameObjectWithTag(Tags.GameController).GetComponent <BlockScroller>(); //Find out which joysticks we have connected, if any string[] controllers = Input.GetJoystickNames(); foreach (string controller in controllers) { Debug.Log(controller); if (controller.Contains("Xbox")) { UsingXBoneController = true; } if (controller.Contains("PLAYSTATION")) { Debug.Log("Detected PS3 Controller"); UsingPS3Controller = true; } } }
// Start is called before the first frame update void Start() { //BlockSpawner.cs is on the same object as GameOverScreen.cs, no need to have more than one object bSpawner = blockSpawningController.GetComponent <BlockSpawner>(); bScroller = blockSpawningController.GetComponent <BlockScroller>(); }