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


C# CameraMode类代码示例

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


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

示例1: Camera

 public Camera(Rectangle viewportRect)
 {
     speed = 4f;
     zoom = 1f;
     viewportRectangle = viewportRect;
     mode = CameraMode.Follow;
 }
开发者ID:RainbowCupcake,项目名称:MLPTheMasterQuest,代码行数:7,代码来源:Camera.cs

示例2: Update

 public override void Update(GameTime gameTime)
 {
     KeyboardManager KManager = (KeyboardManager)Game.Services.GetService(typeof(KeyboardManager));
     if (KManager.IsKeyPressed(Keys.M))
     {
         Mode = (CameraMode)(((int)Mode + 1) % 2);
     }
     float X = KManager.IsKeyDown(Keys.Right) ? 1 : 0;
     X -= KManager.IsKeyDown(Keys.Left) ? 1 : 0;
     float Z = KManager.IsKeyDown(Keys.Down) ? 1 : 0;
     Z -= KManager.IsKeyDown(Keys.Up) ? 1 : 0;
     Vector3 move = new Vector3(X, 0, Z);
     if (move.Length() > 0)
     {
         world_.Translation += move;
     }
     view_ = Matrix.CreateLookAt(world_.Translation, world_.Forward + world_.Translation, world_.Up);
     switch (Mode)
     {
         case CameraMode.PROJECTIVE:
             projection_ = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, Game.GraphicsDevice.Viewport.AspectRatio, 0.1f, 100);
             break;
         case CameraMode.ORTHOGONAL:
             projection_ = Matrix.CreateOrthographic(Game.GraphicsDevice.Viewport.Width/20, Game.GraphicsDevice.Viewport.Height/20, 0.1f, 100);
             break;
     }
     base.Update(gameTime);
 }
开发者ID:TheSuperGoge,项目名称:UnDeadSchool,代码行数:28,代码来源:Camera.cs

示例3: Camera

 public Camera(Game game, Matrix world)
     : base(game)
 {
     world_ = world;
     Mode = CameraMode.PROJECTIVE;
     string shit = CameraMode.PROJECTIVE.ToString();
 }
开发者ID:TheSuperGoge,项目名称:UnDeadSchool,代码行数:7,代码来源:Camera.cs

示例4: UseEditCamera

 public void UseEditCamera()
 {
     editCam.gameObject.SetActive(true);
       boofyCam.gameObject.SetActive(false);
       editCam.orthographicSize = editCameraSize;
       cameraMode = CameraMode.kEdit;
 }
开发者ID:kevrcav,项目名称:MotherDragon,代码行数:7,代码来源:BoofyCamera.cs

示例5: Camera

 public Camera(Rectangle viewportRectangle)
 {
     _speed = DefaultSpeed;
     Zoom = DefaultZoom;
     _viewportRectangle = viewportRectangle;
     _mode = CameraMode.Follow;
 }
开发者ID:redomex,项目名称:LevertPokemon,代码行数:7,代码来源:Camera.cs

示例6: setFocus

 public void setFocus(GameObject targetObject)
 {
     if(mode != CameraMode.Move)
         previousMode = mode;
     mode = CameraMode.Move;
     moveTarget = targetObject;
 }
开发者ID:rameshvarun,项目名称:TheSixthSun,代码行数:7,代码来源:CameraControls.cs

示例7: CombinedCamera

 public CombinedCamera(Tank target, CameraMode initialMode, Vector3 initialPosition)
 {
     this.mode = initialMode;
     this.tank = target;
     this.focus = target.getPosition();
     this.position = initialPosition;
 }
开发者ID:AstromechZA,项目名称:CSC3020H-Tank-Control,代码行数:7,代码来源:CombinedCamera.cs

示例8: IncreaseView

 public void IncreaseView()
 {
     if (CameraMode == CameraMode.FirstPerson)
         CameraMode = CameraMode.Overhead;
     else
         CameraMode ++;
 }
开发者ID:matthewrenze,项目名称:asteroids,代码行数:7,代码来源:CameraChase.cs

示例9: DecreaseView

 public void DecreaseView()
 {
     if (CameraMode == CameraMode.Overhead)
         CameraMode = CameraMode.FirstPerson;
     else
         CameraMode --;
 }
开发者ID:matthewrenze,项目名称:asteroids,代码行数:7,代码来源:CameraChase.cs

示例10: newTargetView

 public void newTargetView(Transform newTransform)
 {
     cameraMode = CameraMode.ToTarget;
     targetPosition = newTransform.position + Vector3.up * 2;
     targetOffset = newTransform.forward * 3 + newTransform.up * 3 + newTransform.right * 3;
     isTransforming = true;
 }
开发者ID:ray-z,项目名称:RPG,代码行数:7,代码来源:CameraController.cs

示例11: SetCameraMode

    public void SetCameraMode(CameraMode mode)
    {
        SingleCamera.enabled = mode == CameraMode.Single;

        for(int i = 0; i < SideBySideCamera.Length;i++){
            SideBySideCamera[i].enabled = mode == CameraMode.SideBySide;
        }
    }
开发者ID:Dio-Deus,项目名称:solitude,代码行数:8,代码来源:SwitchCamera.cs

示例12: PanOut

 //call this to pan out and away from boat at end of level
 public void PanOut()
 {
     lerpTimer = Time.time;
     isPanningOut = true;
     startPosition = transform.position;
     panAwayPosition = new Vector3(transform.position.x + -50f, transform.position.y + 100f, transform.position.z + -50f);
     thisCameraMode = CameraMode.lerpToDestination;
 }
开发者ID:BrainRushIO,项目名称:ASALearningApp,代码行数:9,代码来源:HoverFollowCam.cs

示例13: ToggleLockOn

 public void ToggleLockOn( GameObject t )
 {
     if( mode is CameraMode.LockedOn ) {
       mode = mode.Switch( new CameraMode.Free() );
     } else {
       mode = mode.Switch( new CameraMode.LockedOn( t ) );
     }
 }
开发者ID:nulldatamap,项目名称:mubah-unity,代码行数:8,代码来源:CameraController.cs

示例14: Camera

 public Camera(Rectangle viewport, Configuration.Controls controls, Vector2 position, CameraMode mode = CameraMode.Follow)
 {
     _controls = controls;
     Speed = 4.0f;
     _zoom = 1.0f;
     _viewport = viewport;
     Position = position;
     _mode = mode;
 }
开发者ID:Sharparam,项目名称:DiseasedToast,代码行数:9,代码来源:Camera.cs

示例15: Update

    // Update is called once per frame
    void Update()
    {
        float lerpVal = Time.deltaTime*0.1f*60f;

        if(Input.GetKeyDown(KeyCode.Return))
        {
            CurrentCameraMode = CameraMode.Game;
            _CurrentCamPos = transform.position;
            _CurrentTargetPos = _LookAtPos;
        }
        // Menu camera
        if(CurrentCameraMode == CameraMode.Menu)
        {
            if(_CamPosIndex < _CamPosList.Count-1)
            {
                if(_CamPosList[_CamPosIndex+1] && Mathf.Abs(_CamPosList[_CamPosIndex+1].position.x - transform.position.x) < 0.25f)
                {
                    Debug.Log("close enough");
                    ++_CamPosIndex;
                }

                transform.position = Vector3.Lerp(transform.position, _CamPosList[_CamPosIndex+1].position, lerpVal/10);

                    _LookAtPos = transform.position;
                    _LookAtPos.y -= 1.0f;
                    transform.LookAt(_LookAtPos);

            }
            else if(_CamPosIndex == _CamPosList.Count - 1)
                {
                    _LookAtPos = Vector3.Lerp(_LookAtPos, EndTarget.position, lerpVal/20);
                    transform.LookAt(_LookAtPos);
                }
        }
        // Game camera
        else if(CurrentCameraMode == CameraMode.Game)
        {
            if(!_PlayerDied)
            {
                CalcDesiredPos();
            }

            if(Input.GetKeyDown(KeyCode.Space))
            {
                _DesiredCamDist = CamDistFar;
            }
            if(Input.GetKeyUp(KeyCode.Space))
            {
                _DesiredCamDist = CamDist;
            }
            _CurrentCamPos = Vector3.Lerp(_CurrentCamPos,_DesiredCamPos,lerpVal);
            _CurrentTargetPos = Vector3.Lerp(_CurrentTargetPos,_DesiredTargetPos,lerpVal);
            _CurrentCamDist = Mathf.Lerp(_CurrentCamDist,_DesiredCamDist,lerpVal);

            CalcLookat();
        }
    }
开发者ID:josbalcaen,项目名称:BrainsEden,代码行数:58,代码来源:CameraFollow.cs


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