StringAsset Class

Summary

A UnityEngine.ScriptableObject which holds a Animancer.StringReference based on its UnityEngine.Object.name.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
Base Types
  • ScriptableObject
graph BT Type-->Base0["ScriptableObject"] Type-.->Interface0["IComparable<StringAsset>"] Type-.->Interface1["IConvertable<StringReference>"] Type-.->Interface2["IConvertable<string>"] Type-.->Interface3["IHasKey"] click Interface3 "/animancer/api/Animancer/IHasKey" Type["StringAsset"] class Type type-node

Syntax

[AnimancerHelpUrl(typeof(StringAsset))]
[CreateAssetMenu(menuName = Strings.MenuPrefix + "String Asset", order = Strings.AssetMenuOrder + 2)]
public class StringAsset : ScriptableObject, IComparable<StringAsset>, 
    IConvertable<StringReference>, IConvertable<string>, IHasKey

Attributes

Type Description
AnimancerHelpUrlAttribute [Assert-Conditional] A UnityEngine.HelpURLAttribute which points to Animancer's documentation.
CreateAssetMenuAttribute

Properties

Name Value Summary
EditorComment string
[Editor-Only] [UnityEngine.SerializeField] An unused Editor-Only field where you can explain what this asset is used for.
Key Object
A key which can be used in dictionaries and hash sets.
Name StringReference
A Animancer.StringReference to the UnityEngine.Object.name.

Methods

Name Value Summary
Compare(StringAsset, StringAsset) int
Compares the Animancer.StringReference.Strings.
static
CompareTo(StringAsset) int
Compares the Animancer.StringReference.Strings.
Create(StringReference, string, string) StringAsset
[Editor-Only] Saves a new Animancer.StringAsset in the `directory` and returns it.
static
Find(StringReference, string) StringAsset
[Editor-Only] Returns a Animancer.StringAsset with the specified `name` if one exists in the project.
static
FindOrCreate(StringReference, string, string) StringAsset
[Editor-Only] If a Animancer.StringAsset exists with the specified `name`, this method returns it. If multiple assets have the same name, any one of them will be returned. Otherwise, a new asset will be saved in the `createDirectory` and returned.
static
ToString() string
Returns the Animancer.StringAsset.Name.
ToStringReferences(StringAsset[]) StringReference[]
Creates a new array containing the Animancer.StringAsset.Names.
static
ToStrings(StringAsset[]) string[]
Creates a new array containing the Animancer.StringAsset.Names.
static

Operators

Name Value Summary
implicit operator string(StringAsset) string
implicit operator StringReference(StringAsset) StringReference