当前位置: 首页>>代码示例>>C#>>正文


C# CameraState类代码示例

本文整理汇总了C#中CameraState的典型用法代码示例。如果您正苦于以下问题:C# CameraState类的具体用法?C# CameraState怎么用?C# CameraState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CameraState类属于命名空间,在下文中一共展示了CameraState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的CameraState类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。