// Use this for initialization void Start() { // Setting Variables Whiteness = true; colorTimer = 0; spawnDarkBall = false; spawnLightBall = true; balls_Left = 3; score = 0; ball_Speed = 2.5f; speed_Incrementer = 0.01f; game_Over = false; // Calling functions UpdateBalls(); UpdateScore(); InvokeRepeating("blockSpeedUpdater", 1, 1); InvokeRepeating("colorTimerIncrementor", 1, 1); // Assign Ball Spawner Script ballSpawnerObject = GameObject.FindWithTag("Ball_Spawner"); if (ballSpawnerObject != null) { ballSpawner = ballSpawnerObject.GetComponent <Ball_Spawner> (); } // Assign Bottom Block Spawner Script bottomBlockSpawnerObject = GameObject.FindWithTag("Bottom_Block_Spawner"); if (bottomBlockSpawnerObject != null) { bottomBlockSpawner = bottomBlockSpawnerObject.GetComponent <Bottom_Block_Spawner> (); } // Assign Top Block Spawner Script topBlockSpawnerObject = GameObject.FindWithTag("Top_Block_Spawner"); if (topBlockSpawnerObject != null) { topBlockSpawner = topBlockSpawnerObject.GetComponent <Top_Block_Spawner> (); } ballScriptObject = GameObject.FindWithTag("Ball"); if (ballScriptObject != null) { ballScript = ballScriptObject.GetComponent <Ball_Script> (); } }
// Use this for initialization void Start() { // Setting Variables Whiteness = true; colorTimer = 0; spawnDarkBall = false; spawnLightBall = true; balls_Left = 3; score = 0; ball_Speed = 2.5f; speed_Incrementer = 0.01f; game_Over = false; // Calling functions UpdateBalls (); UpdateScore (); InvokeRepeating ("blockSpeedUpdater", 1, 1); InvokeRepeating ("colorTimerIncrementor", 1, 1); // Assign Ball Spawner Script ballSpawnerObject = GameObject.FindWithTag ("Ball_Spawner"); if (ballSpawnerObject != null) { ballSpawner = ballSpawnerObject.GetComponent <Ball_Spawner> (); } // Assign Bottom Block Spawner Script bottomBlockSpawnerObject = GameObject.FindWithTag ("Bottom_Block_Spawner"); if (bottomBlockSpawnerObject != null) { bottomBlockSpawner = bottomBlockSpawnerObject.GetComponent <Bottom_Block_Spawner> (); } // Assign Top Block Spawner Script topBlockSpawnerObject = GameObject.FindWithTag ("Top_Block_Spawner"); if (topBlockSpawnerObject != null) { topBlockSpawner = topBlockSpawnerObject.GetComponent <Top_Block_Spawner> (); } ballScriptObject = GameObject.FindWithTag ("Ball"); if (ballScriptObject != null) { ballScript = ballScriptObject.GetComponent <Ball_Script> (); } }