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); } }
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()); }