Exemplo n.º 1
0
 private void InitView(GamePipe pipe, GamePlumbingController plumbingController, GamePlumbingDragView plumbingDragView)
 {
     pipe.RegisterOnPipeUpdated(OnPipeUpdated);
     gamePlumbingDragView   = plumbingDragView;
     gamePlumbingController = plumbingController;
     OnPipeUpdated(pipe);
 }
 private void InitSpawner(GamePlumbingDragView plumbingDragView, GamePlumbingController plumbingController, GameSpawner spawner)
 {
     gamePlumbingDragView   = plumbingDragView;
     gamePlumbingController = plumbingController;
     Spawner = spawner;
 }
    public static GameShapeSpawnerView CreateSpawnerView(GameObject spawnerPrefab, GameSpawner spawner, GameObject parent, GamePlumbingDragView gamePlumbingDragView, GamePlumbingController gamePlumbingController)
    {
        GameObject spawnerObj = Instantiate(spawnerPrefab, spawner.SpawnPosition, Quaternion.identity);

        spawnerObj.transform.parent = parent.transform;
        GameShapeSpawnerView component = spawnerObj.AddComponent <GameShapeSpawnerView>();

        component.InitSpawner(gamePlumbingDragView, gamePlumbingController, spawner);
        return(component);
    }
Exemplo n.º 4
0
    public static GamePipeView CreatePipe(GameObject pipePrefab, GamePipe pipeDef, GameObject parent, GamePlumbingController plumbingController, GamePlumbingDragView plumbingDragView)
    {
        Vector3    position      = pipeDef.StartPoint;
        GameObject newPipeObject = Instantiate(pipePrefab, position, Quaternion.identity);

        newPipeObject.transform.SetParent(parent.transform);
        GamePipeView component = newPipeObject.AddComponent <GamePipeView>();

        component.InitView(pipeDef, plumbingController, plumbingDragView);
        return(component);
    }