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

Public Member Functions

Color GetColorData (Vector2 position, float intensity=1f, float alpha=1f)
 Gets the colour tint at a specific position in the scene. More...
 

Public Attributes

Texture2D tintMapTexture
 
Color colorModifier = Color.white
 
bool disableRenderer = true
 

Protected Member Functions

void Awake ()
 
void AssignTexture (Texture2D newTexture=null)
 

Protected Attributes

Texture2D actualTexture
 

Detailed Description

This script is used to change the colour tinting of 2D character sprites, based on their position in the scene. The instance of this class stored in SceneSettings' tintMap variable can be read by FollowTintMap components to determine what their SpriteRenderer's colour should be.

Member Function Documentation

◆ GetColorData()

Color AC.TintMap.GetColorData ( Vector2  position,
float  intensity = 1f,
float  alpha = 1f 
)

Gets the colour tint at a specific position in the scene.

Parameters
positionThe 2D position in the scene to get the colour tint at
intensityThe intensity of the effect, where 0 = no effect, 1 = fully tinted
alphaThe alpha value to give the final Color
Returns
The colour tint. If no appropriate texture is found, Color.white will be returned

Member Data Documentation

◆ colorModifier

Color AC.TintMap.colorModifier = Color.white

A Color to multiply the textured color by

◆ disableRenderer

bool AC.TintMap.disableRenderer = true

If True, then the MeshRenderer component will be disabled automatically when the game begins

◆ tintMapTexture

Texture2D AC.TintMap.tintMapTexture

An optional texture to make use of. If this field is null, then the texture found on the attached MeshRenderer's material will be used instead