Humanoid Control for Unity v4
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
Passer.Counter Class Reference

Description

A Counter can be used to record a integer number.

The Counter can be incremented and decremented and functions cal be called based on the value.

Version
4.0 and higher

Inherits MonoBehaviour.

Public Member Functions

void Decrement ()
 Decrements the Counter value by 1.
 
void Increment ()
 Increments the Counter value by 1.
 
void SetValueToMin ()
 Sets the Counter value to the minimum value.
 
void SetValueToMax ()
 Sets the Counter value to the maximum value.
 
void SetTimer (int seconds)
 
void SetTimer (int seconds, float speed)
 

Public Attributes

int min = 0
 The minimum value for the Counter.
 
int max = 10
 The maximum value for the Counter.
 
float timer = 0
 
bool networking = false
 Synchronize the value across the network.
 
IntEventHandlers counterEvent
 Can be used to call values based on the Counter value.
 

Protected Member Functions

virtual void Awake ()
 
virtual void FixedUpdate ()
 
virtual void CheckBounds ()
 
void CallRemote (string functionName, params object[] parameters)
 

Protected Attributes

int _value
 
PhotonView photonView
 

Properties

int value [get, set]
 Sets or gets the value of the Counter.
 

Member Function Documentation

◆ Decrement()

void Passer.Counter.Decrement ( )

Decrements the Counter value by 1.

If the Counter value is equal or lower than the minimum value, the value is not changed

◆ Increment()

void Passer.Counter.Increment ( )

Increments the Counter value by 1.

If the Counter value is equal or higher than the maximum value, the value is not changed If networking is enabled, the value is incremented on all clients and event handlers are called on all clients

Member Data Documentation

◆ counterEvent

IntEventHandlers Passer.Counter.counterEvent
Initial value:
= new IntEventHandlers() {
label = "Value Change Event",
tooltip =
"Call functions using counter values\n" +
"Parameter: the counter value",
eventTypeLabels = new string[] {
"Never",
"On Min",
"On Max",
"While Min",
"While Max",
"When Changed",
"Always"
}
}

Can be used to call values based on the Counter value.

Property Documentation

◆ value

int Passer.Counter.value
getset

Sets or gets the value of the Counter.

If networking is enabled, the value is synchoronized across the network.


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