Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.FollowTintMap Class Reference
Inheritance diagram for AC.FollowTintMap:

Public Member Functions

void ResetTintMap ()
 
void SetIntensity (float _targetIntensity, float _fadeTime=0f)
 Changes the intensity of a TintMap's effect. More...
 
VisibilityData SaveData (VisibilityData visibilityData)
 Updates a VisibilityData class with its own variables that need saving. More...
 
void LoadData (VisibilityData data)
 Updates its own variables from a VisibilityData class. More...
 

Public Attributes

bool useDefaultTintMap = true
 
TintMap tintMap
 
float intensity = 1f
 
bool affectChildren = false
 

Protected Member Functions

void Awake ()
 
void OnEnable ()
 
void OnDisable ()
 
void LateUpdate ()
 

Protected Attributes

TintMap actualTintMap
 
SpriteRenderer _spriteRenderer
 
SpriteRenderer[] _spriteRenderers
 
float targetIntensity
 
float initialIntensity
 
float fadeStartTime
 
float fadeTime
 

Detailed Description

Attach this script to a GameObject to affect the colour values of its SpriteRenderer component, according to a TintMap. This is intended for 2D character sprites, to provide lighting effects when moving around a scene.

Member Function Documentation

◆ LoadData()

void AC.FollowTintMap.LoadData ( VisibilityData  data)

Updates its own variables from a VisibilityData class.

Parameters
dataThe VisibilityData class to load from

◆ ResetTintMap()

void AC.FollowTintMap.ResetTintMap ( )

Assigns the internal TintMap to follow based on the chosen public variables.

◆ SaveData()

VisibilityData AC.FollowTintMap.SaveData ( VisibilityData  visibilityData)

Updates a VisibilityData class with its own variables that need saving.

Parameters
visibilityDataThe original VisibilityData class
Returns
The updated VisibilityData class

◆ SetIntensity()

void AC.FollowTintMap.SetIntensity ( float  _targetIntensity,
float  _fadeTime = 0f 
)

Changes the intensity of a TintMap's effect.

Parameters
_targetIntensityThe new intensity value
_fadeTimeThe duration, in seconds, to change the intensity over. If = 0, the change will be instantaneous.

Member Data Documentation

◆ affectChildren

bool AC.FollowTintMap.affectChildren = false

If True, then SpriteRenderer components found elsewhere in the object's hierarchy will also be affected

◆ intensity

float AC.FollowTintMap.intensity = 1f

How intense the colour-tiniting effect is. 0 = no effect, 1 = fully tinted

◆ tintMap

TintMap AC.FollowTintMap.tintMap

The TintMap to make use of, if useDefaultTintMap = False

◆ useDefaultTintMap

bool AC.FollowTintMap.useDefaultTintMap = true

If True, then the tintMap defined in SceneSettings will be used as this sprite's colour tinter.