예제 #1
0
        private CameraManager(GameObject owner) : base(owner)
        {
            camera = new Camera();

            float halfOrthoWidth  = Engine.Window.OrthoWidth * 0.5f;
            float halfOrthoHeight = Engine.Window.OrthoHeight * 0.5f;

            camera.pivot      = new Vector2(halfOrthoWidth, halfOrthoHeight);
            camera.position  += camera.pivot;
            originalOrthoSize = Engine.Window.CurrentOrthoGraphicSize;

            operationNone     = new OperationNone();
            operationShake    = new OperationShake(this);
            operationSeek     = new OperationSeek(this);
            operationLerpSeek = new OperationLerpSeek(this);
            operationZoom     = new OperationZoom(this);
            operationLerpZoom = new OperationLerpZoom(this);

            currentOperation       = operationNone;
            originalCameraPosition = camera.position;
        }
예제 #2
0
        private CameraManager()
        {
            camera = new Camera();

            float halfOrthoWidth  = Graphics.Instance.Window.OrthoWidth * 0.5f;
            float halfOrthoHeight = Graphics.Instance.Window.OrthoHeight * 0.5f;

            camera.pivot      = new Vector2(halfOrthoWidth, halfOrthoHeight);
            camera.position  += camera.pivot;
            originalOrthoSize = Graphics.Instance.Window.CurrentOrthoGraphicSize;

            operationNone        = new OperationNone();
            operationShake       = new OperationShake(this);
            operationSeek        = new OperationSeek(this);
            operationLerpSeek    = new OperationLerpSeek(this);
            operationZoom        = new OperationZoom(this);
            operationLerpZoom    = new OperationLerpZoom(this);
            operationSeekClamped = new OperationSeekClamped(this);

            currentOperation       = operationNone;
            originalCameraPosition = camera.position;
        }