Iuvo Unity 0.5.1
This is library containing a variety of helper classes and extension methods for the Unity gane engine.
GitHub | Iuvo Unity Updates | Creator
Loading...
Searching...
No Matches
IuvoUnity.Singletons.GravityManager Class Reference

Global gravity manager for all gravity bodies. More...

Inheritance diagram for IuvoUnity.Singletons.GravityManager:
IuvoUnity.Singletons.PersistentSingleton< T >

Public Member Functions

Vector3 GravityDirection ()
void SetGravityDirection (Vector3 direction)
float GravityStrength ()
void SetGlobalStrength (float strength)

Protected Member Functions

override void Awake ()
Protected Member Functions inherited from IuvoUnity.Singletons.PersistentSingleton< T >
virtual void InitializeSingleton ()

Properties

Vector3 gravityDirection = Vector3.zero [get, private set]
float gravityStrength = 0.0f [get, private set]
Properties inherited from IuvoUnity.Singletons.PersistentSingleton< T >
static bool HasInstance [get]
static T Current [get]
static T Instance [get]

Private Attributes

Vector3 defaultDirection = Vector3.down
float defaultStrength = 9.81f

Additional Inherited Members

Public Attributes inherited from IuvoUnity.Singletons.PersistentSingleton< T >
bool UnparentOnAwake = true
Static Protected Attributes inherited from IuvoUnity.Singletons.PersistentSingleton< T >
static T instance

Detailed Description

Global gravity manager for all gravity bodies.

Member Function Documentation

◆ Awake()

override void IuvoUnity.Singletons.GravityManager.Awake ( )
protectedvirtual

Reimplemented from IuvoUnity.Singletons.PersistentSingleton< T >.

20 {
21 base.Awake();
22 }

◆ GravityDirection()

Vector3 IuvoUnity.Singletons.GravityManager.GravityDirection ( )
25 {
26 return gravityDirection.Equals(Vector3.zero) ? defaultDirection.normalized : gravityDirection.normalized;
27 }

References gravityDirection.

◆ GravityStrength()

float IuvoUnity.Singletons.GravityManager.GravityStrength ( )
35 {
36 return gravityStrength == 0.0f ? defaultStrength : gravityStrength;
37 }

References defaultStrength, and gravityStrength.

◆ SetGlobalStrength()

void IuvoUnity.Singletons.GravityManager.SetGlobalStrength ( float strength)
40 {
41 defaultStrength = strength;
42 }

References defaultStrength.

◆ SetGravityDirection()

void IuvoUnity.Singletons.GravityManager.SetGravityDirection ( Vector3 direction)
30 {
31 defaultDirection = direction.normalized;
32 }

References defaultDirection.

Member Data Documentation

◆ defaultDirection

Vector3 IuvoUnity.Singletons.GravityManager.defaultDirection = Vector3.down
private

Referenced by SetGravityDirection().

◆ defaultStrength

float IuvoUnity.Singletons.GravityManager.defaultStrength = 9.81f
private

Property Documentation

◆ gravityDirection

Vector3 IuvoUnity.Singletons.GravityManager.gravityDirection = Vector3.zero
getprivate set
16{ get; private set; } = Vector3.zero;

Referenced by GravityDirection().

◆ gravityStrength

float IuvoUnity.Singletons.GravityManager.gravityStrength = 0.0f
getprivate set
17{ get; private set; } = 0.0f;

Referenced by GravityStrength().


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