v3.6.1 Documentation
Fungus.CameraManager Class Reference

Manager for main camera. More...

Inheritance diagram for Fungus.CameraManager:

Classes

class  CameraView
 

Public Member Functions

virtual void PanToPath (Camera camera, View[] viewList, float duration, Action arriveAction)
 Moves camera smoothly through a sequence of Views over a period of time. More...
 
virtual void Fade (float targetAlpha, float fadeDuration, Action fadeAction)
 Perform a fullscreen fade over a duration. More...
 
virtual void FadeToView (Camera camera, View view, float fadeDuration, bool fadeOut, Action fadeAction)
 Fade out, move camera to view and then fade back in. More...
 
virtual void Stop ()
 Stop all camera tweening. More...
 
virtual void PanToPosition (Camera camera, Vector3 targetPosition, Quaternion targetRotation, float targetSize, float duration, Action arriveAction)
 Moves camera from current position to a target position over a period of time. More...
 
virtual void StartSwipePan (Camera camera, View viewA, View viewB, float duration, float speedMultiplier, Action arriveAction)
 Activates swipe panning mode. More...
 
virtual void StopSwipePan ()
 Deactivates swipe panning mode. More...
 

Static Public Member Functions

static Texture2D CreateColorTexture (Color color, int width, int height)
 Creates a flat colored texture. More...
 

Protected Member Functions

virtual void OnGUI ()
 
virtual IEnumerator FadeInternal (float targetAlpha, float fadeDuration, Action fadeAction)
 
virtual IEnumerator PanInternal (Camera camera, Vector3 targetPos, Quaternion targetRot, float targetSize, float duration, Action arriveAction)
 
virtual IEnumerator PanToPathInternal (Camera camera, float duration, Action arriveAction, Vector3[] path)
 
virtual void SetCameraZ (Camera camera)
 
virtual void Update ()
 
virtual Vector3 CalcCameraPosition (Vector3 pos, View viewA, View viewB)
 
virtual float CalcCameraSize (Vector3 pos, View viewA, View viewB)
 

Protected Attributes

Texture2D screenFadeTexture
 
Texture2D swipePanIcon
 
Vector2 swipeIconPosition = new Vector2(1,0)
 
bool setCameraZ = true
 
float cameraZ = -10f
 
Camera swipeCamera
 
float fadeAlpha = 0f
 
bool swipePanActive
 
float swipeSpeedMultiplier = 1f
 
View swipePanViewA
 
View swipePanViewB
 
Vector3 previousMousePos
 
IEnumerator panCoroutine
 
IEnumerator fadeCoroutine
 
Dictionary< string, CameraViewstoredViews = new Dictionary<string, CameraView>()
 

Properties

Texture2D ScreenFadeTexture [set]
 Full screen texture used for screen fade effect. More...
 

Detailed Description

Manager for main camera.

Supports several types of camera transition including snap, pan & fade.

Definition at line 15 of file CameraManager.cs.

Member Function Documentation

◆ CalcCameraPosition()

virtual Vector3 Fungus.CameraManager.CalcCameraPosition ( Vector3  pos,
View  viewA,
View  viewB 
)
protectedvirtual

Definition at line 271 of file CameraManager.cs.

◆ CalcCameraSize()

virtual float Fungus.CameraManager.CalcCameraSize ( Vector3  pos,
View  viewA,
View  viewB 
)
protectedvirtual

Definition at line 285 of file CameraManager.cs.

◆ CreateColorTexture()

static Texture2D Fungus.CameraManager.CreateColorTexture ( Color  color,
int  width,
int  height 
)
static

Creates a flat colored texture.

Definition at line 344 of file CameraManager.cs.

◆ Fade()

virtual void Fungus.CameraManager.Fade ( float  targetAlpha,
float  fadeDuration,
Action  fadeAction 
)
virtual

Perform a fullscreen fade over a duration.

Definition at line 367 of file CameraManager.cs.

◆ FadeInternal()

virtual IEnumerator Fungus.CameraManager.FadeInternal ( float  targetAlpha,
float  fadeDuration,
Action  fadeAction 
)
protectedvirtual

Definition at line 92 of file CameraManager.cs.

◆ FadeToView()

virtual void Fungus.CameraManager.FadeToView ( Camera  camera,
View  view,
float  fadeDuration,
bool  fadeOut,
Action  fadeAction 
)
virtual

Fade out, move camera to view and then fade back in.

Definition at line 375 of file CameraManager.cs.

◆ OnGUI()

virtual void Fungus.CameraManager.OnGUI ( )
protectedvirtual

Definition at line 58 of file CameraManager.cs.

◆ PanInternal()

virtual IEnumerator Fungus.CameraManager.PanInternal ( Camera  camera,
Vector3  targetPos,
Quaternion  targetRot,
float  targetSize,
float  duration,
Action  arriveAction 
)
protectedvirtual

Definition at line 124 of file CameraManager.cs.

◆ PanToPath()

virtual void Fungus.CameraManager.PanToPath ( Camera  camera,
View []  viewList,
float  duration,
Action  arriveAction 
)
virtual

Moves camera smoothly through a sequence of Views over a period of time.

Definition at line 310 of file CameraManager.cs.

◆ PanToPathInternal()

virtual IEnumerator Fungus.CameraManager.PanToPathInternal ( Camera  camera,
float  duration,
Action  arriveAction,
Vector3 []  path 
)
protectedvirtual

Definition at line 176 of file CameraManager.cs.

◆ PanToPosition()

virtual void Fungus.CameraManager.PanToPosition ( Camera  camera,
Vector3  targetPosition,
Quaternion  targetRotation,
float  targetSize,
float  duration,
Action  arriveAction 
)
virtual

Moves camera from current position to a target position over a period of time.

Definition at line 423 of file CameraManager.cs.

◆ SetCameraZ()

virtual void Fungus.CameraManager.SetCameraZ ( Camera  camera)
protectedvirtual

Definition at line 208 of file CameraManager.cs.

◆ StartSwipePan()

virtual void Fungus.CameraManager.StartSwipePan ( Camera  camera,
View  viewA,
View  viewB,
float  duration,
float  speedMultiplier,
Action  arriveAction 
)
virtual

Activates swipe panning mode.

The player can pan the camera within the area between viewA & viewB.

Definition at line 461 of file CameraManager.cs.

◆ Stop()

virtual void Fungus.CameraManager.Stop ( )
virtual

Stop all camera tweening.

Definition at line 413 of file CameraManager.cs.

◆ StopSwipePan()

virtual void Fungus.CameraManager.StopSwipePan ( )
virtual

Deactivates swipe panning mode.

Definition at line 493 of file CameraManager.cs.

◆ Update()

virtual void Fungus.CameraManager.Update ( )
protectedvirtual

Definition at line 224 of file CameraManager.cs.

Member Data Documentation

◆ cameraZ

float Fungus.CameraManager.cameraZ = -10f
protected

Definition at line 30 of file CameraManager.cs.

◆ fadeAlpha

float Fungus.CameraManager.fadeAlpha = 0f
protected

Definition at line 35 of file CameraManager.cs.

◆ fadeCoroutine

IEnumerator Fungus.CameraManager.fadeCoroutine
protected

Definition at line 47 of file CameraManager.cs.

◆ panCoroutine

IEnumerator Fungus.CameraManager.panCoroutine
protected

Definition at line 46 of file CameraManager.cs.

◆ previousMousePos

Vector3 Fungus.CameraManager.previousMousePos
protected

Definition at line 43 of file CameraManager.cs.

◆ screenFadeTexture

Texture2D Fungus.CameraManager.screenFadeTexture
protected

Definition at line 18 of file CameraManager.cs.

◆ setCameraZ

bool Fungus.CameraManager.setCameraZ = true
protected

Definition at line 27 of file CameraManager.cs.

◆ storedViews

Dictionary<string, CameraView> Fungus.CameraManager.storedViews = new Dictionary<string, CameraView>()
protected

Definition at line 56 of file CameraManager.cs.

◆ swipeCamera

Camera Fungus.CameraManager.swipeCamera
protected

Definition at line 33 of file CameraManager.cs.

◆ swipeIconPosition

Vector2 Fungus.CameraManager.swipeIconPosition = new Vector2(1,0)
protected

Definition at line 24 of file CameraManager.cs.

◆ swipePanActive

bool Fungus.CameraManager.swipePanActive
protected

Definition at line 38 of file CameraManager.cs.

◆ swipePanIcon

Texture2D Fungus.CameraManager.swipePanIcon
protected

Definition at line 21 of file CameraManager.cs.

◆ swipePanViewA

View Fungus.CameraManager.swipePanViewA
protected

Definition at line 41 of file CameraManager.cs.

◆ swipePanViewB

View Fungus.CameraManager.swipePanViewB
protected

Definition at line 42 of file CameraManager.cs.

◆ swipeSpeedMultiplier

float Fungus.CameraManager.swipeSpeedMultiplier = 1f
protected

Definition at line 40 of file CameraManager.cs.

Property Documentation

◆ ScreenFadeTexture

Texture2D Fungus.CameraManager.ScreenFadeTexture
set

Full screen texture used for screen fade effect.

The screen fade texture.

Definition at line 362 of file CameraManager.cs.


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