Class AxisCounter
AxisCounter serves as a tool for implementing logic based on counting and altering numerical values.
Inherited Members
Namespace: Axis.Logic
Assembly: cs.temp.dll.dll
Syntax
public sealed class AxisCounter : AxisGameObject
Fields
Counters
Public static list of active Counters in the scene
Declaration
public static List<AxisCounter> Counters
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<T><AxisCounter> |
See Also
OnCounter
List of unity events associated with counters
Declaration
public CounterEvents OnCounter
Field Value
Type | Description |
---|---|
CounterEvents |
See Also
PersistValue
Defines wether value should be kept between scenes or sessions.
Declaration
public CounterPersistence PersistValue
Field Value
Type | Description |
---|---|
CounterPersistence |
Remarks
Remember: The persistence accounts for GameObject name to consider same counter.
See Also
ValueMax
Max value counter can reach
Declaration
public int ValueMax
Field Value
Type | Description |
---|---|
int |
See Also
ValueMin
Min value counter can reach
Declaration
public int ValueMin
Field Value
Type | Description |
---|---|
int |
See Also
Properties
value
[read-only] Current value
Declaration
public int value { get; }
Property Value
Type | Description |
---|---|
int |
See Also
Methods
CopyValue(AxisCounter)
Copy value from another AxisCounter
Declaration
public void CopyValue(AxisCounter counter)
Parameters
Type | Name | Description |
---|---|---|
AxisCounter | counter |
See Also
Down(int)
Subtracts number from current value
Declaration
public void Down(int value = 1)
Parameters
Type | Name | Description |
---|---|---|
int | value | Amount to subtract |
Remarks
Negative values will automatically count as an Up (sum)
See Also
Freeze()
Freezing the AxisCounter it will ignore any change attempt, and keep same value
Declaration
public void Freeze()
See Also
SyncValue(int)
Force the execution of a change to set specific value
Declaration
public void SyncValue(int valueTo)
Parameters
Type | Name | Description |
---|---|---|
int | valueTo |
See Also
Unfreeze()
Unfreezing the AxisCounter it will allow value changes
Declaration
public void Unfreeze()
See Also
Up(int)
Sums number to current value
Declaration
public void Up(int value = 1)
Parameters
Type | Name | Description |
---|---|---|
int | value | Amount to sum |
Remarks
Negative values will automatically count as a Down (subtract)