TopDown Engine  v3.6
MoreMountains.TopDownEngine.WeaponSpriteSortingOrderThreshold Class Reference

This class will modify the sprite associated with it's sorting order based on the current rotation of the weapon. Useful to get the weapon get in front or behind your character based on this angle on 2D weapons More...

Inheritance diagram for MoreMountains.TopDownEngine.WeaponSpriteSortingOrderThreshold:
MoreMountains.TopDownEngine.TopDownMonoBehaviour MoreMountains.Tools.MMMonoBehaviour

Public Attributes

float Threshold = 0f
 the angle threshold at which to switch the sorting order More...
 
int BelowThresholdSortingOrder = 1
 the sorting order to apply when the weapon's rotation is below threshold More...
 
int AboveThresholdSortingOrder = -1
 the sorting order to apply when the weapon's rotation is above threshold More...
 
SpriteRenderer Sprite
 the sprite whose sorting order we want to modify More...
 

Protected Member Functions

virtual void Awake ()
 On Awake we grab our weapon aim component More...
 
virtual void Update ()
 On update we change our sorting order based on current weapon angle More...
 

Protected Attributes

WeaponAim2D _weaponAim2D
 

Detailed Description

This class will modify the sprite associated with it's sorting order based on the current rotation of the weapon. Useful to get the weapon get in front or behind your character based on this angle on 2D weapons

Member Function Documentation

◆ Awake()

virtual void MoreMountains.TopDownEngine.WeaponSpriteSortingOrderThreshold.Awake ( )
protectedvirtual

On Awake we grab our weapon aim component

◆ Update()

virtual void MoreMountains.TopDownEngine.WeaponSpriteSortingOrderThreshold.Update ( )
protectedvirtual

On update we change our sorting order based on current weapon angle

Member Data Documentation

◆ _weaponAim2D

WeaponAim2D MoreMountains.TopDownEngine.WeaponSpriteSortingOrderThreshold._weaponAim2D
protected

◆ AboveThresholdSortingOrder

int MoreMountains.TopDownEngine.WeaponSpriteSortingOrderThreshold.AboveThresholdSortingOrder = -1

the sorting order to apply when the weapon's rotation is above threshold

◆ BelowThresholdSortingOrder

int MoreMountains.TopDownEngine.WeaponSpriteSortingOrderThreshold.BelowThresholdSortingOrder = 1

the sorting order to apply when the weapon's rotation is below threshold

◆ Sprite

SpriteRenderer MoreMountains.TopDownEngine.WeaponSpriteSortingOrderThreshold.Sprite

the sprite whose sorting order we want to modify

◆ Threshold

float MoreMountains.TopDownEngine.WeaponSpriteSortingOrderThreshold.Threshold = 0f

the angle threshold at which to switch the sorting order


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