本文整理汇总了C#中CameraState类的典型用法代码示例。如果您正苦于以下问题:C# CameraState类的具体用法?C# CameraState怎么用?C# CameraState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CameraState类属于命名空间,在下文中一共展示了CameraState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CameraController
public CameraController(string cameraName)
{
this.cameraName = cameraName;
windowShowing = false;
image = new VisionImage();
state = CameraState.FREE;
}
开发者ID:JamesNgai,项目名称:EDMSuite,代码行数:7,代码来源:CameraController.cs
示例2: PossessPlayer
public void PossessPlayer(GameObject player)
{
if (state == CameraState.FREE_FLOW)
{
if (player.CompareTag("Salesman"))
{
character = CharacterClass.SALESMAN;
}
else if (player.CompareTag("Shopper"))
{
character = CharacterClass.SHOPPER;
}
else if (player.CompareTag("Guard"))
{
character = CharacterClass.GUARD;
}
else if (player.CompareTag("Thief"))
{
character = CharacterClass.THIEF;
}
else return;
PossessionScript ps = player.GetComponent<PossessionScript>();
ps.Possess();
possessedCharacter = player;
attachedRotation = player.transform.rotation;
attachedLocation = player.transform.position + attachedRotation * new Vector3(0, 1.85f, -2);
freeFlyLocation = transform.position;
freeFlyRotation = transform.rotation;
state = CameraState.ATTACHING;
tick = 0;
}
}
开发者ID:CG-F15-20-Rutgers,项目名称:UnityProjects,代码行数:35,代码来源:CameraP3Controller.cs
示例3: switchCameraRutine
IEnumerator switchCameraRutine( CameraState from )
{
float t = 0.0f;
Vector3 fromPos, toPos;
fromPos = quadForeground.transform.position;
toPos = (from == CameraState.AR) ? vrPos : arPos;
while (t < 1.0f) {
quadForeground.transform.position = Vector3.Lerp (fromPos, toPos, t);
t = t + 0.1f;
yield return new WaitForSeconds(0.02f);
}
if (from == CameraState.VR) {
Debug.Log("change camera to AR");
state = CameraState.AR;
} else if (from == CameraState.AR) {
Debug.Log("change camera to VR");
state = CameraState.VR;
}
yield return 0;
}
开发者ID:flashwade03,项目名称:LeapMotionVRInterface,代码行数:26,代码来源:Switcher.cs
示例4: DoClimb
//=================================================================================================================o
// Remember the last camera state when climbing
void DoClimb(string s)
{
if (s != "None") // While climbing
{
if (camState == CameraState.FirstPerson)
{
camState = CameraState.ThirdPerson;
}
else if (camState == CameraState.Orbit)
{
camState = CameraState.ThirdPerson;
}
else if (camState == CameraState.ThirdPerson)
{
return;
}
}
else // Leaving climb modus
{
if (lastState == "FirstPerson")
{
camState = CameraState.FirstPerson;
}
else if (lastState == "ThirdPerson")
{
camState = CameraState.ThirdPerson;
}
else if (lastState == "Orbit")
{
camState = CameraState.Orbit;
}
}
}
开发者ID:EricBlattberg,项目名称:ProjectDootMatrix,代码行数:35,代码来源:HeroCameraLow.cs
示例5: Reset
public override void Reset()
{
base.Reset();
m_Tween = m_StartTween;
m_CameraState = CameraState.Enter;
}
开发者ID:Imortilize,项目名称:Psynergy-Engine,代码行数:7,代码来源:BaseCamera.cs
示例6: Start
// Use this for initialization
void Start () {
combat = new CameraState(localCombatPosition,localCombatRotation);
inventory = new CameraState(localInventoryPosition,localInventoryRotation);
currentState = combat;
desiredState = combat;
}
开发者ID:ragbinder,项目名称:Pleiadian,代码行数:8,代码来源:CamPositions.cs
示例7: Update
// Update is called once per frame
void Update () {
//If the user turns left or right, change the enum
if (Input.GetKey (KeyCode.D))
{
direction = CameraState.Right;
}
else if (Input.GetKey (KeyCode.A))
{
direction = CameraState.Left;
}
//call the method to handle moving the camera over time
shiftSlow (direction);
//Add shiftIndex to the X-value of the camera to move it
transform.position = new Vector3 (toFollow.position.x + shiftIndex, toFollow.position.y, transform.position.z);
//This code is for zooming the camera
if((Input.GetAxis ("Mouse ScrollWheel") < 0f || Input.GetKey(KeyCode.PageDown))&& //If the user scrolls down
this.GetComponent<Camera>().orthographicSize < 15f) //And the camera isn't zoomed too far out already
{
this.GetComponent<Camera>().orthographicSize += 0.5f; //Zoom out
}
if ((Input.GetAxis("Mouse ScrollWheel") > 0f|| Input.GetKey(KeyCode.PageUp)) && //If the user scrolls up
this.GetComponent<Camera>().orthographicSize > 6.5) //And the camera isn't zoomed in too far already
{
this.GetComponent<Camera>().orthographicSize -= 0.5f; //Zoom in
}
}
开发者ID:LunaLovecraft,项目名称:IMDHonorsContract-Fall2014,代码行数:31,代码来源:CameraFollow.cs
示例8: Update
// Update is called once per frame
void Update()
{
_cameraState = _camera.CameraState;
CalculateSpeed();
_animator.SetFloat(AnimatorConditions.AirVelocity, _airVelocity);
switch (_cameraState)
{
case CameraState.Normal:
// Allow player to rotate their character
if (Input.GetAxis(PlayerInput.Horizontal) > 0.1f || Input.GetAxis(PlayerInput.Horizontal) < -0.1f)
{
_myTransform.Rotate(0f, Input.GetAxis(PlayerInput.Horizontal) * _rotationSpeed * Time.deltaTime, 0f);
}
// Check if character is grounded
if (_controller.isGrounded == true)
{
_moveDirection = Vector3.zero;
_airVelocity = 0f;
_animator.SetBool(AnimatorConditions.IsGrounded, true);
// Cache user input into variables
_horizontal = Input.GetAxis(PlayerInput.Horizontal);
_vertical = Input.GetAxis(PlayerInput.Vertical);
// Set values in animator conditions
_animator.SetFloat(AnimatorConditions.Direction, _horizontal);
_animator.SetFloat(AnimatorConditions.Speed, _vertical);
if (Input.GetButtonDown(PlayerInput.Jump))
{
Jump();
}
}
else
{
// Allow player to move while in air
_moveDirection.x = Input.GetAxis(PlayerInput.Horizontal) * _moveSpeed;
_moveDirection.z = Input.GetAxis(PlayerInput.Vertical) * _moveSpeed;
_moveDirection = _myTransform.TransformDirection(_moveDirection);
_animator.SetBool(AnimatorConditions.IsGrounded, false);
}
break;
case CameraState.Target:
break;
}
// Apply gravity to character
_moveDirection.y -= gravity * Time.deltaTime;
//Move character withthe _moveDirection Vector3 calculated above.
_controller.Move(_moveDirection * Time.deltaTime);
}
开发者ID:Sanjisan,项目名称:MSP-Events,代码行数:59,代码来源:PlayerMotor.cs
示例9: changeCameraState
IEnumerator changeCameraState(CameraState start, CameraState end, float timeInterval) {
isTransitioning = true;
for(float t = 0F; t < timeInterval; t += Time.deltaTime) {
transform.localPosition = Vector3.Lerp(start.position, end.position, t/timeInterval);
transform.localRotation = Quaternion.Lerp(start.rotation, end.rotation, t/timeInterval);
yield return null;
}
isTransitioning = false;
currentState = end;
}
开发者ID:ragbinder,项目名称:Pleiadian,代码行数:10,代码来源:CamPositions.cs
示例10: shiftSlow
//Take into account the player's direction and shift the camera
void shiftSlow(CameraState heading)
{
if (heading == CameraState.Right && shiftIndex < 5f)
{
shiftIndex += 0.2f;
}
else if (heading == CameraState.Left && shiftIndex > -5f)
{
shiftIndex -= 0.2f;
}
}
开发者ID:LunaLovecraft,项目名称:IMDHonorsContract-Fall2014,代码行数:12,代码来源:CameraFollow.cs
示例11: Start
// Use this for initialization
void Start () {
if (_target == null) {
Debug.Log ("no target");
}
state = CameraState.VR;
arPos = new Vector3(_target.transform.position.x, _target.transform.position.y , _target.transform.transform.position.z + 0.5f);
vrPos = new Vector3(_target.transform.position.x, _target.transform.position.y - 0.8f, _target.transform.transform.position.z + 0.5f);
plane = GameObject.Find ("Plane");
plane.transform.position = vrPos;
plane.GetComponent<Renderer>().enabled = true;
}
开发者ID:honi90,项目名称:LeapMotionVRInterface,代码行数:13,代码来源:SwitcherHDCamera.cs
示例12: ReleasePlayer
public GameObject ReleasePlayer()
{
GameObject retval = possessedCharacter;
possessedCharacter = null;
PossessionScript ps = retval.GetComponent<PossessionScript>();
ps.Depossess();
attachedLocation = transform.position;
attachedRotation = transform.rotation;
state = CameraState.DETACHING;
tick = 0;
return retval;
}
开发者ID:CG-F15-20-Rutgers,项目名称:UnityProjects,代码行数:12,代码来源:CameraP3Controller.cs
示例13: Start
void Start(){
foreach (Transform tran in transform) {
switch(tran.name)
{
case "SystemCamera":
systemCamera = tran.gameObject;
break;
case "LC":
leftCamera = tran.gameObject;
break;
case "RC":
rightCamera = tran.gameObject;
break;
case "ZeroParallaxPlane":
zeroParallaxPlane = tran.gameObject;
break;
}
}
if(Application.platform == RuntimePlatform.Android)
{
state = CameraState.AndroidRunTimeState;
systemCamera.SetActive(false);
leftCamera.SetActive(true);
rightCamera.SetActive(true);
zeroParallaxPlane.SetActive(true);
}
switch(state)
{
case CameraState.WindowsEditorState:
{
break;
}
case CameraState.WindowsStereoState:
{
initLRCameras ();
break;
}
case CameraState.AndroidRunTimeState:
{
initCameras ();
break;
}
}
zeroParallaxPlane.GetComponent<MeshRenderer> ().enabled = false;
}
开发者ID:Blavtes,项目名称:RunInto,代码行数:53,代码来源:ThreeDStereoCamera.cs
示例14: Start
// Use this for initialization
void Start()
{
if (_target == null) {
Debug.Log ("no target");
return;
}
quadForeground = GameObject.Find ("QuadForeground");
state = CameraState.VR;
vrPos = new Vector3 (0.0f, 1.0f, 0.137f);
arPos = new Vector3 (0.0f, 0.0f, 0.137f);
}
开发者ID:flashwade03,项目名称:LeapMotionVRInterface,代码行数:13,代码来源:Switcher.cs
示例15: Start
// Use this for initialization
void Start () {
if (_target == null) {
Debug.Log ("no target");
}
state = CameraState.VR;
vrPos = new Vector3(_target.transform.position.x, _target.transform.position.y +1.0f, _target.transform.transform.position.z + 0.137f);
arPos = new Vector3(_target.transform.position.x, _target.transform.position.y, _target.transform.transform.position.z + 0.137f);
quadForeground = GameObject.Find ("QuadForeground");
quadForeground.transform.position = vrPos;
}
开发者ID:honi90,项目名称:LeapMotionVRInterface,代码行数:13,代码来源:SwitcherInfaredCamera.cs
示例16: GamepadController
public GamepadController()
{
//TODO: Detect new controllers after start ?
var controllers = new[] { new Controller(UserIndex.One), new Controller(UserIndex.Two) };
StartPollingAndSendingCommands(controllers);
cameraStates = new Dictionary<int, CameraState>(5);
for (int i = 0; i < 5; i++)
{
CameraState cs = new CameraState();
cs.Active = false;
cs.Pan = "100";
cs.Tilt = 0;
cameraStates[i] = cs;
}
}
开发者ID:jpadillak,项目名称:Concordia_Capstone2013-14,代码行数:16,代码来源:GamepadController.cs
示例17: Awake
void Awake()
{
//Cursor.lockState = CursorLockMode.Locked;
//Cursor.visible = false;
cam = Camera.main;
_lockTarget = null;
_center = new Vector2(Screen.width / 2, Screen.height / 2);
_focusPoint = transform.position;
_circleOffset = _focusPoint;
_focusOffset = cam.transform.position - _focusPoint;
camState = CameraState.DEFAULT;
}
开发者ID:MurrayIRC,项目名称:frog,代码行数:16,代码来源:PlayerCamera.cs
示例18: ChangeState
void ChangeState(CameraState newState){
currentState = newState;
switch (currentState) {
case CameraState.CAMERA_MOVEMENT:
SSL.enabled = false;
ShouldChange = true;
break;
case CameraState.CAMERA_SHOOTING:
CJ.enabled = false;
ShouldChange = true;
break;
default:
Debug.Log("NO DEBERIA LLEGAR ACA");
break;
}
}
开发者ID:Ayagami,项目名称:Tesis,代码行数:16,代码来源:Player_CameraManager.cs
示例19: BaseCamera
public BaseCamera(float FOV, float AspectRatio, float NearPlane, float FarPlane,
Vector3 Position, Vector3 Target, Vector3 CameraUp)
{
fov_ = FOV;
currentFov_ = fov_;
aspectRatio_ = AspectRatio;
nearPlane_ = NearPlane;
farPlane_ = FarPlane;
position_ = Position;
target_ = Target;
cameraUp_ = CameraUp;
//switching_ = false;
cameraState_ = CameraState.Chase;
// calculate Projection and view Matricies.
updateProjectionMatrix();
updateViewMatrix();
}
开发者ID:smanoharan,项目名称:242TopGearElectrified,代码行数:18,代码来源:BaseCamera.cs
示例20: Update
public override void Update(GameTime gameTime)
{
if (state_ != camera_.CurrentCamera.State)
{
state_ = camera_.CurrentCamera.State;
defaultCategory.SetVolume(50);
switch (state_)
{
case CameraState.Chase:
cameraCue = soundBank.GetCue("chase");
cameraCue.Play();
break;
case CameraState.Reverse:
cameraCue = soundBank.GetCue("reverse");
cameraCue.Play();
break;
case CameraState.Dynamic:
cameraCue = soundBank.GetCue("dynamic");
cameraCue.Play();
break;
case CameraState.TopDown:
cameraCue = soundBank.GetCue("top_down");
cameraCue.Play();
break;
}
}
for (int i = 0; i < cueArray.Length; i++)
cueArray[i].Apply3D(listener_, CarSoundEmitters.AudioEmitters[i]);
if (car_.LinearVelocity.LengthSquared() <= 400)
musicCategory.SetVolume(car_.LinearVelocity.LengthSquared() / 16);
else if (car_.LinearVelocity.LengthSquared() > 1650)
musicCategory.SetVolume(0);
else
musicCategory.SetVolume(25);
base.Update(gameTime);
}
开发者ID:smanoharan,项目名称:242TopGearElectrified,代码行数:39,代码来源:CarSoundManager.cs
注:本文中的CameraState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论