Corgi Engine  v9.1
MoreMountains.CorgiEngine.MMSpriteMask Class Reference

This class will automatically look for sprite renderers, particle systems, tilemaps in the scene, and change their SpriteMaskInteraction settings according to the one set in the inspector Use the NoMask tag on objects you don't want automatically setup More...

Inheritance diagram for MoreMountains.CorgiEngine.MMSpriteMask:
MoreMountains.CorgiEngine.CorgiMonoBehaviour MoreMountains.Tools.MMEventListener< MMSpriteMaskEvent >

Public Types

enum  Timescales { Timescales.Scaled, Timescales.Unscaled }
 the possible timescales this mask can operate on More...
 

Public Member Functions

virtual void MoveMaskTo (Vector2 newPosition, Vector2 newSize, float duration, MMTween.MMTweenCurve curve)
 Moves the mask to a new size and position for a certain duration and along a certain curve More...
 
virtual void ExpandAndMoveMaskTo (Vector2 newPosition, Vector2 newSize, float duration, MMTween.MMTweenCurve curve)
 Moves the mask to a new size and position after having expanded to encompass its origin size/position and the destination's size/position More...
 
virtual void OnMMEvent (MMSpriteMaskEvent spriteMaskEvent)
 Catches sprite mask events More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< MMSpriteMaskEvent >
void OnMMEvent (T eventType)
 

Public Attributes

float ScaleMultiplier = 100f
 the multiplier to apply to this mask's scale More...
 
bool AutomaticallySetupSpriteRenderers = true
 whether or not all sprite renderers should be converted More...
 
bool AutomaticallySetupParticleSystems = true
 whether or not all particle systems should be converted More...
 
bool AutomaticallySetupTilemaps = true
 whether or not all tilemaps should be converted More...
 
bool CatchEvents = true
 if this is true, this mask will move when catching a sprite mask event More...
 
Timescales Timescale = Timescales.Unscaled
 the timescale this mask operates on More...
 
SpriteMaskInteraction MaskInteraction = SpriteMaskInteraction.VisibleInsideMask
 the type of interaction to apply to all renderers More...
 

Protected Member Functions

virtual void Awake ()
 On Awake we setup our objects More...
 
virtual void SetupMaskSettingsAutomatically ()
 Looks for mask settings and updates them More...
 
virtual IEnumerator MoveMaskToCoroutine (Vector2 newPosition, Vector2 newSize, float duration, MMTween.MMTweenCurve curve)
 Coroutine that moves the mask More...
 
virtual IEnumerator ExpandAndMoveMaskToCoroutine (Vector2 newPosition, Vector2 newSize, float duration, MMTween.MMTweenCurve curve)
 A coroutine that expands the mask to cover both its current position and its destination area, then resizes itself to match the destination size More...
 
virtual Vector3 ComputeTargetPosition (Vector3 newPosition)
 Determines the new position of the mask More...
 
virtual Vector3 ComputeTargetScale (Vector3 newScale)
 Determines the scale of the mask More...
 
virtual void OnEnable ()
 On enable we start listening for events More...
 
virtual void OnDisable ()
 On disable we stop listening for events More...
 

Protected Attributes

Vector3 _initialPosition
 
Vector3 _initialScale
 
Vector3 _newPosition
 
Vector3 _newScale
 
Vector3 _targetPosition
 
Vector3 _targetScale
 

Properties

virtual float? MaskTime [get]
 

Detailed Description

This class will automatically look for sprite renderers, particle systems, tilemaps in the scene, and change their SpriteMaskInteraction settings according to the one set in the inspector Use the NoMask tag on objects you don't want automatically setup

Member Enumeration Documentation

◆ Timescales

the possible timescales this mask can operate on

Enumerator
Scaled 
Unscaled 

Member Function Documentation

◆ Awake()

virtual void MoreMountains.CorgiEngine.MMSpriteMask.Awake ( )
protectedvirtual

On Awake we setup our objects

◆ ComputeTargetPosition()

virtual Vector3 MoreMountains.CorgiEngine.MMSpriteMask.ComputeTargetPosition ( Vector3  newPosition)
protectedvirtual

Determines the new position of the mask

Parameters
newPosition
Returns

◆ ComputeTargetScale()

virtual Vector3 MoreMountains.CorgiEngine.MMSpriteMask.ComputeTargetScale ( Vector3  newScale)
protectedvirtual

Determines the scale of the mask

Parameters
newScale
Returns

◆ ExpandAndMoveMaskTo()

virtual void MoreMountains.CorgiEngine.MMSpriteMask.ExpandAndMoveMaskTo ( Vector2  newPosition,
Vector2  newSize,
float  duration,
MMTween.MMTweenCurve  curve 
)
virtual

Moves the mask to a new size and position after having expanded to encompass its origin size/position and the destination's size/position

Parameters
newPosition
newSize
duration
curve

◆ ExpandAndMoveMaskToCoroutine()

virtual IEnumerator MoreMountains.CorgiEngine.MMSpriteMask.ExpandAndMoveMaskToCoroutine ( Vector2  newPosition,
Vector2  newSize,
float  duration,
MMTween.MMTweenCurve  curve 
)
protectedvirtual

A coroutine that expands the mask to cover both its current position and its destination area, then resizes itself to match the destination size

Parameters
newPosition
newSize
duration
curve
Returns

◆ MoveMaskTo()

virtual void MoreMountains.CorgiEngine.MMSpriteMask.MoveMaskTo ( Vector2  newPosition,
Vector2  newSize,
float  duration,
MMTween.MMTweenCurve  curve 
)
virtual

Moves the mask to a new size and position for a certain duration and along a certain curve

Parameters
newPosition
newSize
duration
curve

◆ MoveMaskToCoroutine()

virtual IEnumerator MoreMountains.CorgiEngine.MMSpriteMask.MoveMaskToCoroutine ( Vector2  newPosition,
Vector2  newSize,
float  duration,
MMTween.MMTweenCurve  curve 
)
protectedvirtual

Coroutine that moves the mask

Parameters
newPosition
newSize
duration
curve
Returns

◆ OnDisable()

virtual void MoreMountains.CorgiEngine.MMSpriteMask.OnDisable ( )
protectedvirtual

On disable we stop listening for events

◆ OnEnable()

virtual void MoreMountains.CorgiEngine.MMSpriteMask.OnEnable ( )
protectedvirtual

On enable we start listening for events

◆ OnMMEvent()

virtual void MoreMountains.CorgiEngine.MMSpriteMask.OnMMEvent ( MMSpriteMaskEvent  spriteMaskEvent)
virtual

Catches sprite mask events

Parameters
spriteMaskEvent

◆ SetupMaskSettingsAutomatically()

virtual void MoreMountains.CorgiEngine.MMSpriteMask.SetupMaskSettingsAutomatically ( )
protectedvirtual

Looks for mask settings and updates them

Member Data Documentation

◆ _initialPosition

Vector3 MoreMountains.CorgiEngine.MMSpriteMask._initialPosition
protected

◆ _initialScale

Vector3 MoreMountains.CorgiEngine.MMSpriteMask._initialScale
protected

◆ _newPosition

Vector3 MoreMountains.CorgiEngine.MMSpriteMask._newPosition
protected

◆ _newScale

Vector3 MoreMountains.CorgiEngine.MMSpriteMask._newScale
protected

◆ _targetPosition

Vector3 MoreMountains.CorgiEngine.MMSpriteMask._targetPosition
protected

◆ _targetScale

Vector3 MoreMountains.CorgiEngine.MMSpriteMask._targetScale
protected

◆ AutomaticallySetupParticleSystems

bool MoreMountains.CorgiEngine.MMSpriteMask.AutomaticallySetupParticleSystems = true

whether or not all particle systems should be converted

◆ AutomaticallySetupSpriteRenderers

bool MoreMountains.CorgiEngine.MMSpriteMask.AutomaticallySetupSpriteRenderers = true

whether or not all sprite renderers should be converted

◆ AutomaticallySetupTilemaps

bool MoreMountains.CorgiEngine.MMSpriteMask.AutomaticallySetupTilemaps = true

whether or not all tilemaps should be converted

◆ CatchEvents

bool MoreMountains.CorgiEngine.MMSpriteMask.CatchEvents = true

if this is true, this mask will move when catching a sprite mask event

◆ MaskInteraction

SpriteMaskInteraction MoreMountains.CorgiEngine.MMSpriteMask.MaskInteraction = SpriteMaskInteraction.VisibleInsideMask

the type of interaction to apply to all renderers

◆ ScaleMultiplier

float MoreMountains.CorgiEngine.MMSpriteMask.ScaleMultiplier = 100f

the multiplier to apply to this mask's scale

◆ Timescale

Timescales MoreMountains.CorgiEngine.MMSpriteMask.Timescale = Timescales.Unscaled

the timescale this mask operates on

Property Documentation

◆ MaskTime

virtual float? MoreMountains.CorgiEngine.MMSpriteMask.MaskTime
get

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