예제 #1
0
 public void finishRobotMaking()
 {
     if (robotMaking)
     {
         shop = null;
         SceneManager.UnloadSceneAsync("RobotShop");
         cam.gameObject.SetActive(true);
         robotMaking = false;
     }
 }
예제 #2
0
    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;
    }
예제 #3
0
        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();
        }