Ejemplo n.º 1
0
    public BallController(string prefabName, ILevelRoot gameplayCanvas, Vector2 startPosition)
    {
        _ballView     = GameObject.Instantiate(Resources.Load <BallView>(prefabName), gameplayCanvas.Transform, true);
        StartPosition = startPosition;

        _ballView.Collision += OnCollision;
    }
Ejemplo n.º 2
0
    public BaseBlock(string prefabName, ILevelRoot levelRoot, Vector3 position)
    {
        var template = Resources.Load <BlockView>(prefabName);

        View = GameObject.Instantiate(template, levelRoot.Transform, true);
        View.transform.position = position;
    }
Ejemplo n.º 3
0
 public Player(string prefabName, ILevelRoot gameplayCanvas, Vector2 startPosition)
 {
     _playerView   = GameObject.Instantiate(Resources.Load <PlayerView>(prefabName), gameplayCanvas.Transform, true);
     StartPosition = startPosition;
 }
Ejemplo n.º 4
0
    public ScoreController(ILevelRoot levelRoot)
    {
        var template = Resources.Load <ScoreView>("Prefabs/ScoreView");

        View = GameObject.Instantiate(template, levelRoot.Transform);
    }
Ejemplo n.º 5
0
    public TimePanelController(ILevelRoot levelRoot)
    {
        var template = Resources.Load <TimePanelView>("Prefabs/TimePanelView");

        _view = GameObject.Instantiate(template, levelRoot.Transform);
    }