//call this and pass in a new camera type to change the camer(coonected to a trigger object)
 public void SwitchCamera(CameraStyle newCamera)
 {
     switch(newCamera)										//check the new camera variable
     {
     case CameraStyle.Standard:								//if it is standard....
         camStyle = CameraStyle.other;
         Debug.LogError ("Moving from standard to other");	//switch it to the other camera
         break;
     case CameraStyle.other:									//if it is other....
         camStyle = CameraStyle.Standard;
         Debug.LogError ("Moving from other to Standard");	//switch back to standard
         break;
     }
 }
예제 #2
0
        public void follow( Entity targetEntity, CameraStyle cameraStyle = CameraStyle.CameraWindow )
        {
            _targetEntity = targetEntity;
            _cameraStyle = cameraStyle;
            var cameraBounds = camera.bounds;

            switch( _cameraStyle )
            {
                case CameraStyle.CameraWindow:
                    var w = ( cameraBounds.width / 6 );
                    var h = ( cameraBounds.height / 3 );
                    deadzone = new RectangleF( ( cameraBounds.width - w ) / 2, ( cameraBounds.height - h ) / 2, w, h );
                    break;
                case CameraStyle.LockOn:
                    deadzone = new RectangleF( cameraBounds.width / 2, cameraBounds.height / 2, 10, 10 );
                    break;
            }
        }
예제 #3
0
        /*-----------------------------------------------------------------------------
        | Sets the movement style of our camera man.
        |       -----------------------------------------------------------------------------*/

        public virtual void setStyle(CameraStyle style)
        {
            if (this.mStyle != CameraStyle.Orbit && style == CameraStyle.Orbit)
            {
                this.mStyle = CameraStyle.Orbit;
                Target      = Target;
                this.mCamera.FixedYawAxis = Vector3.UnitY;
            }
            else if (this.mStyle != CameraStyle.FreeLook && style == CameraStyle.FreeLook)
            {
                this.mStyle = CameraStyle.FreeLook;
                this.mCamera.AutoTrackingTarget = null;
                this.mCamera.FixedYawAxis       = Vector3.UnitY;
            }
            else if (this.mStyle != CameraStyle.Manual && style == CameraStyle.Manual)
            {
                this.mStyle = CameraStyle.Manual;
                this.mCamera.AutoTrackingTarget = null;
                this.mCamera.FixedYawAxis       = Vector3.UnitY;
            }
        }
 public void TopDown()
 {
     isCamTopDown = true;
     cameraStyle  = CameraStyle.topDown;
     ChangeCameraPos(isCamTopDown);
 }
 public void Interact()
 {
     isCamTopDown = false;
     cameraStyle  = CameraStyle.freeRoam;
     ChangeCameraPos(isCamTopDown);
 }
예제 #6
0
 public FollowCamera(Entity targetEntity, CameraStyle cameraStyle = CameraStyle.LockOn) : this(targetEntity,
                                                                                               null, cameraStyle)
 {
 }
예제 #7
0
 public FollowCamera(Entity targetEntity, Camera camera, CameraStyle cameraStyle = CameraStyle.LockOn)
 {
     _targetEntity = targetEntity;
     _cameraStyle  = cameraStyle;
     Camera        = camera;
 }
예제 #8
0
 public void SetNewCameraStyle(CameraStyle newCameraStyle)
 {
     cameraStyle = newCameraStyle;
 }
예제 #9
0
 public FollowCamera(Entity targetEntity, CameraStyle cameraStyle = CameraStyle.LockOn, Measurement deadzoneMeasurement = Measurement.FixedPixel)
     : this(targetEntity, null, cameraStyle)
 {
 }
 public void OnBoolChanged(bool manual)
 {
     CamStyle = manual ? CameraStyle.Manual : CameraStyle.Auto;
     OnStyleChanged();
 }
예제 #11
0
		/*-----------------------------------------------------------------------------
		| Sets the movement style of our camera man.
		-----------------------------------------------------------------------------*/
		public virtual void setStyle( CameraStyle style )
		{
			if ( mStyle != CameraStyle.Orbit && style == CameraStyle.Orbit )
			{
				mStyle = CameraStyle.Orbit;
				Target = Target;
				mCamera.FixedYawAxis = Vector3.UnitY;
			}
			else if ( mStyle != CameraStyle.FreeLook && style == CameraStyle.FreeLook )
			{
				mStyle = CameraStyle.FreeLook;
			    mCamera.SetAutoTracking( false, (SceneNode)null );
				mCamera.FixedYawAxis = Vector3.UnitY;
			}
			else if ( mStyle != CameraStyle.Manual && style == CameraStyle.Manual )
			{
				mStyle = CameraStyle.Manual;
                mCamera.SetAutoTracking(false, (SceneNode)null);
				mCamera.FixedYawAxis = Vector3.UnitY;
			}
		}
예제 #12
0
		/*-----------------------------------------------------------------------------
		| Sets the movement style of our camera man.
		-----------------------------------------------------------------------------*/

		public virtual void setStyle( CameraStyle style )
		{
			if ( this.mStyle != CameraStyle.Orbit && style == CameraStyle.Orbit )
			{
				this.mStyle = CameraStyle.Orbit;
				Target = Target;
				this.mCamera.FixedYawAxis = Vector3.UnitY;
			}
			else if ( this.mStyle != CameraStyle.FreeLook && style == CameraStyle.FreeLook )
			{
				this.mStyle = CameraStyle.FreeLook;
				this.mCamera.AutoTrackingTarget = null;
				this.mCamera.FixedYawAxis = Vector3.UnitY;
			}
			else if ( this.mStyle != CameraStyle.Manual && style == CameraStyle.Manual )
			{
				this.mStyle = CameraStyle.Manual;
				this.mCamera.AutoTrackingTarget = null;
				this.mCamera.FixedYawAxis = Vector3.UnitY;
			}
		}