//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; } }
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; } }
/*----------------------------------------------------------------------------- | 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); }
public FollowCamera(Entity targetEntity, CameraStyle cameraStyle = CameraStyle.LockOn) : this(targetEntity, null, cameraStyle) { }
public FollowCamera(Entity targetEntity, Camera camera, CameraStyle cameraStyle = CameraStyle.LockOn) { _targetEntity = targetEntity; _cameraStyle = cameraStyle; Camera = camera; }
public void SetNewCameraStyle(CameraStyle newCameraStyle) { cameraStyle = newCameraStyle; }
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(); }
/*----------------------------------------------------------------------------- | 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; } }
/*----------------------------------------------------------------------------- | 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; } }