Show / Hide Table of Contents

Class WeaverAnimationData

Contains a series of animation clips that can be played with WeaverAnimationPlayer

Inheritance
object
Object
ScriptableObject
WeaverAnimationData
Inherited Members
ScriptableObject.SetDirty()
ScriptableObject.CreateInstance(string)
ScriptableObject.CreateInstance(Type)
ScriptableObject.CreateInstance<T>()
Namespace: WeaverCore.Utilities
Assembly: WeaverCore.dll
Syntax
[CreateAssetMenu(fileName = "WeaverAnimation", menuName = "WeaverCore/Weaver Sprite Animation Data")]
public class WeaverAnimationData : ScriptableObject

Properties

| Edit this page View Source

AllClips

A list of all added clips

Declaration
public IEnumerable<WeaverAnimationData.Clip> AllClips { get; }
Property Value
Type Description
IEnumerable<WeaverAnimationData.Clip>
| Edit this page View Source

AnimationCount

How many clips have been added

Declaration
public int AnimationCount { get; }
Property Value
Type Description
int
| Edit this page View Source

ClipCount

The amount of clips added to the data object

Declaration
public int ClipCount { get; }
Property Value
Type Description
int
| Edit this page View Source

ClipNames

A list of all added clip names

Declaration
public IEnumerable<string> ClipNames { get; }
Property Value
Type Description
IEnumerable<string>

Methods

| Edit this page View Source

AddClip(Clip)

Adds a clip

Declaration
public bool AddClip(WeaverAnimationData.Clip clip)
Parameters
Type Name Description
WeaverAnimationData.Clip clip

The clip to be added

Returns
Type Description
bool

Returns true if the clip is added, or false of the clip is already added

| Edit this page View Source

Clear()

Removes all clips from the animation data object

Declaration
public void Clear()
| Edit this page View Source

GetClip(string)

Finds a clip with the specified name

Declaration
public WeaverAnimationData.Clip GetClip(string clipName)
Parameters
Type Name Description
string clipName

The name of the clip to look for

Returns
Type Description
WeaverAnimationData.Clip

Returns the clip with the specified name

Exceptions
Type Condition
Exception

Throws an exception if the clip does not exist

| Edit this page View Source

GetClipDuration(string)

Gets the duration of a specific clip

Declaration
public float GetClipDuration(string clipName)
Parameters
Type Name Description
string clipName
Returns
Type Description
float
| Edit this page View Source

GetClipFPS(string)

Gets the FPS of a certain clip

Declaration
public float GetClipFPS(string clipName)
Parameters
Type Name Description
string clipName
Returns
Type Description
float
| Edit this page View Source

GetClipFrameCount(string)

Gets the amount of frames in a specific clip

Declaration
public int GetClipFrameCount(string clipName)
Parameters
Type Name Description
string clipName
Returns
Type Description
int
| Edit this page View Source

GetClipWrapMode(string)

Gets the wrap mode for the specified clip. Throws an exception if the clip doesn't exist

Declaration
public WeaverAnimationData.WrapMode GetClipWrapMode(string clipName)
Parameters
Type Name Description
string clipName

The clip to retrieve the wrap mode from

Returns
Type Description
WeaverAnimationData.WrapMode

Returns the wrap mode for the clip

| Edit this page View Source

GetFrameFromClip(string, int)

Given a frame index, will get the sprite corresponding to that frame

Declaration
public Sprite GetFrameFromClip(string clipName, int frameIndex)
Parameters
Type Name Description
string clipName

The clip to get the frame from

int frameIndex

The frame index

Returns
Type Description
Sprite

Returns the sprite at the frame index

| Edit this page View Source

GetStartingFrame(string)

Gets the first frame of a clip

Declaration
public int GetStartingFrame(string clipName)
Parameters
Type Name Description
string clipName

The clip to get the first frame of

Returns
Type Description
int

Returns the starting frame of the clip

Exceptions
Type Condition
Exception

Throws if the clip doesn't exist in the Animation Data Object

| Edit this page View Source

GoToNextFrame(string, int)

Increments the clip to the next frame. Returns -1 if the animation is completed

Declaration
public int GoToNextFrame(string clipName, int previousFrame)
Parameters
Type Name Description
string clipName

The clip to increment to the next frame

int previousFrame

The previous frame the clip was on

Returns
Type Description
int

The new frame the clip should go to, or -1 if the clip is done

Exceptions
Type Condition
Exception

Throws an exception if the clip does not exist in the animation data object

| Edit this page View Source

GoToNextFrame(string, int, WrapMode)

Given the wrap mode and previous frame of a clip, will give the next frame in the clip

Declaration
public int GoToNextFrame(string clipName, int previousFrame, WeaverAnimationData.WrapMode wrapMode)
Parameters
Type Name Description
string clipName

The name of the clip to get the frame from

int previousFrame

The previous frame in the clip

WeaverAnimationData.WrapMode wrapMode

The wrap mode of the clip

Returns
Type Description
int

Returns the next frame in the clip's sequence

| Edit this page View Source

HasClip(string)

Returns whether the clip with the specified name is added

Declaration
public bool HasClip(string clipName)
Parameters
Type Name Description
string clipName

The clip name to check for

Returns
Type Description
bool

Returns whether the clip with the specified name is added

| Edit this page View Source

HasClip(Clip)

Returns whether the clip has been added

Declaration
public bool HasClip(WeaverAnimationData.Clip clip)
Parameters
Type Name Description
WeaverAnimationData.Clip clip

The clip to check for

Returns
Type Description
bool

Returns whether the clip has been added

| Edit this page View Source

RemoveClip(string)

Removes a clip with the specified name

Declaration
public bool RemoveClip(string clipName)
Parameters
Type Name Description
string clipName

The name of the clip to remove

Returns
Type Description
bool

Returns whether the clip has been removed

| Edit this page View Source

RemoveClip(Clip)

Removes a clip

Declaration
public bool RemoveClip(WeaverAnimationData.Clip clip)
Parameters
Type Name Description
WeaverAnimationData.Clip clip

The clip to remove

Returns
Type Description
bool

Returns whether the clip has been removed

| Edit this page View Source

TryGetClip(string, out Clip)

Attempts to get a clip with the specified name

Declaration
public bool TryGetClip(string clipName, out WeaverAnimationData.Clip clip)
Parameters
Type Name Description
string clipName

The name of the clip to get

WeaverAnimationData.Clip clip

The output clip

Returns
Type Description
bool

Returns true if a clip was found

Extension Methods

ReflectionUtilities.ReflectCallMethod(object, string, object[], BindingFlags)
ReflectionUtilities.ReflectGetField(object, string, BindingFlags)
ReflectionUtilities.ReflectGetMethod(object, string, BindingFlags)
ReflectionUtilities.ReflectGetProperty(object, string, BindingFlags)
ReflectionUtilities.ReflectSetField(object, string, object, BindingFlags)
ReflectionUtilities.ReflectSetProperty(object, string, object, BindingFlags)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾