public void finishRobotMaking() { if (robotMaking) { shop = null; SceneManager.UnloadSceneAsync("RobotShop"); cam.gameObject.SetActive(true); robotMaking = false; } }
IEnumerator LoadYourAsyncScene(Building building) { var asyncLoad = SceneManager.LoadSceneAsync("RobotShop", LoadSceneMode.Additive); // Wait until the asynchronous scene fully loads while (!asyncLoad.isDone) { yield return(null); } shop = GameObject.FindObjectOfType <RobotShop>(); shop.ownBuilding = (Prototype)building; cam.gameObject.SetActive(false); robotMaking = true; }
private static void Builder() { //create robot shop with robot builders RobotShop robotShop = new RobotShop(); IRobotBuilder robotBuilder; //construct and display animal robots robotBuilder = new AnimalRobotBuilder(); robotShop.Construct(robotBuilder); Robot animalRobot = robotBuilder.GetRobot(); animalRobot.Show(); //construct and display human robots robotBuilder = new HumanRobotBuilder(); robotShop.Construct(robotBuilder); Robot humanRobot = robotBuilder.GetRobot(); humanRobot.Show(); }