Ejemplo n.º 1
0
 internal void init(ILevelBoundsModel model)
 {
     foreach (Transform child in transform)
     {
         model.x_min = Mathf.Min(model.x_min, child.position.x);
         model.y_min = Mathf.Min(model.y_min, child.position.y);
         model.x_max = Mathf.Max(model.x_max, child.position.x);
         model.y_max = Mathf.Max(model.y_max, child.position.y);
     }
 }
Ejemplo n.º 2
0
        internal void init(ICameraModel model, Func <Vector2> playerModelGetCachedPosition, ILevelBoundsModel levelBounds)
        {
            // get delegates from the mediator
            this.model = model;
            this.playerModelGetCachedPosition = playerModelGetCachedPosition;
            this.levelBounds = levelBounds;

            // initialize camera
            camera.orthographicSize = 20;

            // zoom on player on start
            StartCoroutine(ZoomOnPlayerOnStart());
        }