public void Setup()
        {
            snowmanPoolManager = Substitute.For<ISnowmanPoolManager>();
            taskManager = Substitute.For<IUnityTaskManager>();

            randomSpawner = new SnowmanRandomSpawner(snowmanPoolManager, taskManager);
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            prefabTemplate = new GameObject("Snowman");

            unityResources = Substitute.For<IUnityResources>();
            snowmanPoolManager = Substitute.For<ISnowmanPoolManager>();
            snowmanMoveComponent = Substitute.For<ISnowmanMoveComponent>();

            unityResources.Load(SnowmanController.SNOWMAN_ASSET_PATH, typeof(GameObject)).Returns(prefabTemplate);
            unityResources.Instantiate(prefabTemplate).Returns(prefabTemplate);
            
            snowmanController = new SnowmanController(snowmanPoolManager, unityResources);
            snowmanController.Initialize();

            var prop = snowmanController.GetType().GetField("moveComponent", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
            prop.SetValue(snowmanController, snowmanMoveComponent);
        }
Ejemplo n.º 3
0
 public SnowmanController(ISnowmanPoolManager snowmanPoolManager, IUnityResources unityResources)
 {
     this.snowmanPoolManager = snowmanPoolManager;
     this.unityResources = unityResources;
 }
Ejemplo n.º 4
0
 public SnowmanRandomSpawner(ISnowmanPoolManager snowmanPoolManager, IUnityTaskManager taskManager)
 {
     this.snowmanPoolManager = snowmanPoolManager;
     this.taskManager = taskManager;
 }