class MAGES::CharacterController::MAGESCharacterController

Overview

The MAGESCharacterController class. More…

class MAGESCharacterController: public MonoBehaviour
{
public:
    // properties

    SerializableDictionary Instances;
    AnimatorController MAGESAnimator;
    HeadController MAGESHeadController;
    bool InitializedController;

    // methods

    void PlayAnimation(
        string animationName,
        AnimationDurationType type = AnimationDurationType.Persistent,
        float normalizedTimeOffset = 0f,
        float animationSpeed = 1f
    );

    void PlayAnimationReverse(
        string animationName,
        AnimationDurationType type = AnimationDurationType.Persistent,
        float normalizedTimeOffset = 0f,
        float animationSpeed = 1f
    );

    void LookAt(
        Vector3 position,
        float lookForSeconds = 0f,
        float lookInSeconds = 0f
    );
};

Detailed Documentation

The MAGESCharacterController class.

Properties

SerializableDictionary Instances

Gets a static dictionary to keep track of all MAGESCharacterController instances by GameObject name.

AnimatorController MAGESAnimator

Gets or sets the MAGESAnimator.

HeadController MAGESHeadController

Gets or sets the MAGESHeadController.

bool InitializedController

Gets or sets a value indicating whether the controller has been initialized.

Methods

void PlayAnimation(
    string animationName,
    AnimationDurationType type = AnimationDurationType.Persistent,
    float normalizedTimeOffset = 0f,
    float animationSpeed = 1f
)

Wrapper Function for MAGESAnimator. Will play an animation.

Parameters:

animationName

The Animation name.

type

The animation duration type.

normalizedTimeOffset

The normalized time offset the animation will start playing from.

animationSpeed

The speed the animation will play with.

void PlayAnimationReverse(
    string animationName,
    AnimationDurationType type = AnimationDurationType.Persistent,
    float normalizedTimeOffset = 0f,
    float animationSpeed = 1f
)

Wrapper Function for MAGESAnimator. Will play an animation in reverse.

Parameters:

animationName

The Animation name.

type

The animation duration type.

normalizedTimeOffset

The normalized time offset the animation will start playing from.

animationSpeed

The speed the animation will play with.

void LookAt(
    Vector3 position,
    float lookForSeconds = 0f,
    float lookInSeconds = 0f
)

Wrapper function for look at function to look at objects.

Parameters:

position

The position of the gameObject you want to look at.

lookForSeconds

Look for x amount of seconds. If 0 then it wont stop looking.

lookInSeconds

Smoothly rotate the head to look at the target in x seconds.