XSGridEditor  1.0.0
XSGridEditor is a lightweight square grid map system for 2D/3D SRPG games, and comes with a simple and easy-to-use grid editing function. It can be used as a beginning for you to create SRPG games.
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
XSSLG.XSCamera Class Reference

camera movement script More...

Inheritance diagram for XSSLG.XSCamera:

Public Member Functions

virtual void Awake ()
 
virtual void Update ()
 
virtual void SetConfinerBound (Bounds bound)
 
virtual void SetPosTo (Vector3 worldPos)
 相机直接移动到位置 More...
 
virtual void MoveTo (Vector3 worldPos)
 相机以一定速度移动到位置 More...
 
virtual IEnumerator MovementAnimation ()
 携程函数处理移动 More...
 

Protected Member Functions

virtual void MoveScreen (float x, float y)
 
virtual Vector3 MoveDirection (float x, float y)
 caculate camera direction More...
 
virtual void UpdatePos (Vector3 direction)
 update camera position More...
 
virtual void ZoomScreen (float increment)
 The mouse wheel controrl to zoom in and out More...
 
virtual void UpdateCameraRotation ()
 arrow Key control camera rotation angle More...
 
virtual void FixTargetPosition (ref Vector3 targetPosition)
 
virtual void SetCameraPosition (Vector3 targetPosition)
 
virtual Vector3 WorldPosToCameraPos (Vector3 worldPos)
 计算相机看向 worldPos 的时相机自己的位置 More...
 

Protected Attributes

float moveSpeed = 30f
 screen move speed when mouse in the edge of screen More...
 
float zoomSpeed = 20f
 camera zoom speed More...
 
float cameraSizeY = 20
 Camera up and down movement range More...
 
float RotationStep = 22.5f
 Rotation angle of arrow key More...
 
Queue< Vector3MoveList = new Queue<Vector3>()
 如果要相机依次移动到多个位置, 就放入列表, 依次移动 More...
 

Properties

CinemachineInputProvider InputProvider [get, set]
 cinemachine input script More...
 
CinemachineVirtualCamera VirtualCamera [get, set]
 cinemachine virtual camera script More...
 
CinemachineConfiner Confier [get, set]
 cinemachine virtual camera move range More...
 
bool CanFreeMove = true [get, set]
 camera can move More...
 
bool IsMoving [get, protected set]
 camera is moving, if is moving we cannot use mouse to control camera More...
 
Bounds Bound = new Bounds() [get, set]
 tile map size More...
 

Detailed Description

camera movement script

Member Function Documentation

◆ Awake()

virtual void XSSLG.XSCamera.Awake ( )
inlinevirtual

◆ FixTargetPosition()

virtual void XSSLG.XSCamera.FixTargetPosition ( ref Vector3  targetPosition)
inlineprotectedvirtual

◆ MoveDirection()

virtual Vector3 XSSLG.XSCamera.MoveDirection ( float  x,
float  y 
)
inlineprotectedvirtual

caculate camera direction

Parameters
x
y
Returns

◆ MovementAnimation()

virtual IEnumerator XSSLG.XSCamera.MovementAnimation ( )
inlinevirtual

携程函数处理移动

◆ MoveScreen()

virtual void XSSLG.XSCamera.MoveScreen ( float  x,
float  y 
)
inlineprotectedvirtual

◆ MoveTo()

virtual void XSSLG.XSCamera.MoveTo ( Vector3  worldPos)
inlinevirtual

相机以一定速度移动到位置

Parameters
worldPos

◆ SetCameraPosition()

virtual void XSSLG.XSCamera.SetCameraPosition ( Vector3  targetPosition)
inlineprotectedvirtual

◆ SetConfinerBound()

virtual void XSSLG.XSCamera.SetConfinerBound ( Bounds  bound)
inlinevirtual

◆ SetPosTo()

virtual void XSSLG.XSCamera.SetPosTo ( Vector3  worldPos)
inlinevirtual

相机直接移动到位置

Parameters
worldPos

◆ Update()

virtual void XSSLG.XSCamera.Update ( )
inlinevirtual

◆ UpdateCameraRotation()

virtual void XSSLG.XSCamera.UpdateCameraRotation ( )
inlineprotectedvirtual

arrow Key control camera rotation angle

◆ UpdatePos()

virtual void XSSLG.XSCamera.UpdatePos ( Vector3  direction)
inlineprotectedvirtual

update camera position

Parameters
direction

◆ WorldPosToCameraPos()

virtual Vector3 XSSLG.XSCamera.WorldPosToCameraPos ( Vector3  worldPos)
inlineprotectedvirtual

计算相机看向 worldPos 的时相机自己的位置

Parameters
worldPos
Returns

◆ ZoomScreen()

virtual void XSSLG.XSCamera.ZoomScreen ( float  increment)
inlineprotectedvirtual

The mouse wheel controrl to zoom in and out

Parameters
increment

Member Data Documentation

◆ cameraSizeY

float XSSLG.XSCamera.cameraSizeY = 20
protected

Camera up and down movement range

◆ MoveList

Queue<Vector3> XSSLG.XSCamera.MoveList = new Queue<Vector3>()
protected

如果要相机依次移动到多个位置, 就放入列表, 依次移动

◆ moveSpeed

float XSSLG.XSCamera.moveSpeed = 30f
protected

screen move speed when mouse in the edge of screen

◆ RotationStep

float XSSLG.XSCamera.RotationStep = 22.5f
protected

Rotation angle of arrow key

◆ zoomSpeed

float XSSLG.XSCamera.zoomSpeed = 20f
protected

camera zoom speed

Property Documentation

◆ Bound

Bounds XSSLG.XSCamera.Bound = new Bounds()
getset

tile map size

◆ CanFreeMove

bool XSSLG.XSCamera.CanFreeMove = true
getset

camera can move

◆ Confier

CinemachineConfiner XSSLG.XSCamera.Confier
getsetprotected

cinemachine virtual camera move range

◆ InputProvider

CinemachineInputProvider XSSLG.XSCamera.InputProvider
getsetprotected

cinemachine input script

◆ IsMoving

bool XSSLG.XSCamera.IsMoving
getprotected set

camera is moving, if is moving we cannot use mouse to control camera

◆ VirtualCamera

CinemachineVirtualCamera XSSLG.XSCamera.VirtualCamera
getsetprotected

cinemachine virtual camera script


The documentation for this class was generated from the following file: