Activating and deactivating games

To automate the activation and deactivation of games we will modify the BallGame script to take care of that for its game objects. Edit BallGame.cs and add the following functions to enable or disable the ball, court, and goal:

File: BallGame.cs
public void Activate() { BallThrowControl.gameObject.SetActive(true); CourtGameObject.SetActive(true); GoalCollisionBehavior.gameObject.SetActive(true); } public void Deactivate() { BallThrowControl.gameObject.SetActive(false); CourtGameObject.SetActive(false); GoalCollisionBehavior.gameObject.SetActive(false); }
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset