### Get Tags by Start Index Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.TagCollection Retrieves all tags starting from a given index. ```csharp public IEnumerable TagsAt(int startIndex)__ ``` -------------------------------- ### Get Tags into Buffer by Start Index Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.TagCollection Populates a buffer with tags starting from a specified index and returns the count of tags added. ```csharp public int TagsAt(int startIndex, TMPEffectTagTuple[] buffer, int bufferIndex = 0)__ ``` -------------------------------- ### Install TMPEffects via Git URL Source: https://tmpeffects.luca3317.dev/manual/installation Use this git URL in the Unity Package Manager to install TMPEffects directly. Ensure the path parameter is correctly specified. ```git https://github.com/Luca3317/TMPEffects.git?path=/Package ``` -------------------------------- ### Quadratic Bezier Curve with Start, Control, and End Points Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Extensions.AnimationCurveUtility Creates a quadratic Bezier curve using explicit start, control, and end Vector2 points. This overload provides precise control over the curve's shape. ```csharp public static AnimationCurve QuadraticBezier(Vector2 startPoint, Vector2 controlPoint, Vector2 endPoint) ``` -------------------------------- ### Get Tag by Index and Order Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.TagCollection Retrieves a tag from the collection at a specified start index. If order is not provided, the first tag at that index is returned. ```csharp public TMPEffectTag TagAt(int startIndex, int? order = null)__ ``` -------------------------------- ### Get Tag at Specific Index and Order Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.ReadOnlyTagCollection.html Retrieves a tag at a specified start index, with an optional order to resolve multiple tags at the same index. If order is not specified, the first tag at the index is returned. ```csharp public TMPEffectTag TagAt(int startIndex, int? order = null) ``` -------------------------------- ### startIndex Field Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.TagCollection.StartIndexOnly.html Represents the starting index of the tag collection. ```csharp public readonly int startIndex ``` -------------------------------- ### TMPWriter StartWriter Method Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Components.TMPWriter Starts or resumes the writing process. ```csharp public void StartWriter() ``` -------------------------------- ### StartIndex Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Components.Animator.ITMPSegmentData.html Gets the index of the first character of the segment within the containing text. This property defines the start of the segment. ```csharp int StartIndex { get; } ``` -------------------------------- ### TagAt Method Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.IReadOnlyTagCollection.html Gets a specific tag at a given start index, optionally filtered by order. If order is not specified, it returns the first tag found at that index. Use this for precise tag retrieval. ```csharp TMPEffectTag TagAt(int startIndex, int? order = null) ``` -------------------------------- ### Try Add Tag (with indices) Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.ITagCollection.html Attempts to add a new tag to the collection with specified start and end indices, and order. If order is not specified, it defaults to the first position at the start index. ```APIDOC ## TryAdd(TMPEffectTag tag, int startIndex = 0, int endIndex = -1, int? orderAtIndex = null) ### Description Attempt to add a new tag to the collection. If `orderAtIndex` is left to default, the order will be assigned so it is the first tag at the given `startIndex`. ### Method bool ### Endpoint N/A (Method call) ### Parameters #### Path Parameters - **tag** (TMPEffectTag) - Required - The tag to add. - **startIndex** (int) - Optional - The tag's start index. Defaults to 0. - **endIndex** (int) - Optional - The tag's end index. Defaults to -1. - **orderAtIndex** (int?) - Optional - The tag's order at index. ### Response #### Success Response (bool) - **true** if the tag was successfully added; **false** otherwise. ``` -------------------------------- ### StartWriter Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Components.TMPWriter Starts or resumes the text writing process. ```APIDOC ## StartWriter() ### Description Start (or resume) writing. ### Method public void StartWriter() ``` -------------------------------- ### Parameters Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.TMPEffectTag.html Gets the parameters of the tag. ```APIDOC ## Parameters ### Description Gets the parameters of the tag. ### Property Value ReadOnlyDictionary ``` -------------------------------- ### Show Command Example Source: https://tmpeffects.luca3317.dev/manual/tmpwriter_builtincommands Ensures the text block is displayed from the very beginning, regardless of previous commands. It takes no parameters. ```TMPWriter SHOWN ``` -------------------------------- ### Wave Animation using AutoParameters Source: https://tmpeffects.luca3317.dev/manual/tmpanimator_creatinganimations This example demonstrates creating a custom wave animation using the AutoParameters attribute for simplified parameter management. It defines wave behavior and offset calculation. ```csharp using System.Collections.Generic; using UnityEngine; using TMPEffects.CharacterData; using static TMPEffects.ParameterUtility; using static TMPEffects.TMPAnimations.AnimationUtility; using TMPEffects.Extensions; namespace TMPEffects.TMPAnimations.Animations { [AutoParameters] [CreateAssetMenu(fileName = "new WaveAnimation", menuName = "TMPEffects/Animations/Wave")] public partial class WaveAnimation : TMPAnimation { [Tooltip("The wave that defines the behavior of this animation. No prefix.\nFor more information about Wave, see the section on it in the documentation.")] [SerializeField, AutoParameterBundle("")] Wave wave = new Wave(AnimationCurveUtility.EaseInOutSine(), AnimationCurveUtility.EaseInOutSine(), 0.5f, 0.5f, 1f, 1f, 0.2f); [Tooltip("The way the offset for the wave is calculated.\nFor more information about Wave, see the section on it in the documentation.\nAliases: waveoffset, woffset, waveoff, woff")] [SerializeField, AutoParameter("waveoffset")] OffsetType waveOffsetType = OffsetType.XPos; // Animate the character private partial void Animate(CharData cData, AutoParametersData data, IAnimationContext context) { // Evaluate the wave data structure at the current time, with the characters offset (see AnimationUtility section for info on this) float eval = data.wave.Evaluate(context.animatorContext.PassedTime, GetWaveOffset(cData, context, data.waveOffsetType)).Value; // Set the new position of the character cData.SetPosition(cData.info.initialPosition + Vector3.up * eval); } } } ``` -------------------------------- ### TMPEffectTagIndices OrderAtIndex Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.TMPEffectTagIndices.html Gets the order at the start index, used to define order among tags with the same start index. ```csharp public int OrderAtIndex { get; } ``` -------------------------------- ### TagsAt (startIndex) Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.TagCollection Retrieves all tags starting from a specified index. ```APIDOC ## TagsAt (startIndex) ### Description Get the tags starting at the given `startIndex`. ### Method Signature ```csharp public IEnumerable TagsAt(int startIndex) ``` ### Parameters #### Path Parameters - **startIndex** (int) - The start index. ### Returns - **IEnumerable** - All tags starting at the given `startIndex`. ``` -------------------------------- ### Get Tags Starting at Specific Index Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.ReadOnlyTagCollection.html Retrieves all TMPEffectTagTuple elements starting from a given index. This is useful for processing a contiguous block of tags. ```csharp public IEnumerable TagsAt(int startIndex) ``` -------------------------------- ### Wait Command Example Source: https://tmpeffects.luca3317.dev/manual/tmpwriter_builtincommands Pauses the TMPWriter for a specified duration in seconds. Use this to control pacing. ```TMPWriter WAIT ``` -------------------------------- ### PassedTime Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Components.Animator.ReadOnlyAnimatorContext.html Gets the total time elapsed since the animator started. ```csharp public float PassedTime { get; } ``` -------------------------------- ### Using Parameter Bundles with AutoParameters Source: https://tmpeffects.luca3317.dev/manual/autoparameters Demonstrates how to use the AutoParameterBundle attribute to incorporate predefined parameter bundles like 'Wave' into a class, allowing for grouped parameter modifications. ```csharp [AutoParameters] public partial class SomeClass : TMPAnimation { [AutoParameterBundle(prefix: ""), SerializeField] private Wave wave; [AutoParameterBundle("w2:"), SerializeField] private Wave wave; // ... } ``` -------------------------------- ### TagsAt Method (IEnumerable) Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.ReadOnlyTagCollection.html Retrieves all TMPEffectTagTuple elements starting from a specified index. This method is useful for getting a subset of tags from the collection. ```APIDOC ## Method TagsAt ### Description Get the tags starting at the given `startIndex`. ### Parameters #### Parameters - **startIndex** (int) - Required - The start index. ### Returns IEnumerable All tags starting at the given `startIndex`. ``` -------------------------------- ### Basic Class Structure with AutoParameters Source: https://tmpeffects.luca3317.dev/manual/autoparameters Demonstrates the minimal structure for a partial class deriving from TMPAnimation and using the AutoParameters attribute. ```csharp using TMPEffects.AutoParameters.Attributes; using TMPEffects.CharacterData; using TMPEffects.TMPAnimations; [AutoParameters] public partial class YourClass : TMPAnimation { // if youre making a command, this will of course say ExecuteCommand private partial void Animate(CharData cData, AutoParametersData data, IAnimationContext context) { } } ``` -------------------------------- ### Wave Constructor (Basic) Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Parameters.Wave Initializes a new instance of the Wave class with specified curves and periods. ```csharp public Wave(AnimationCurve upwardCurve, AnimationCurve downwardCurve, float upPeriod, float downPeriod, float amplitude)__ ``` -------------------------------- ### CommandContext.Writer Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPCommands.CommandContext.html Gets or sets the TMPWriter that raised this command. ```APIDOC ## CommandContext.Writer Property ### Description The TMPWriter that raised this command. ### Property Value TMPWriter ``` -------------------------------- ### Debug Command Example Source: https://tmpeffects.luca3317.dev/manual/tmpwriter_builtincommands Prints a message to the Unity console. Supports different message types like 'log', 'warning', or 'error'. ```TMPWriter ``` -------------------------------- ### StartIndexOnly Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.TagCollection.StartIndexOnly.html Initializes a new instance of the StartIndexOnly struct with the specified start index. ```csharp public StartIndexOnly(int startIndex) ``` -------------------------------- ### Wave Constructor (Copy) Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Parameters.Wave Initializes a new instance of the Wave class as a copy of an existing Wave object. ```csharp public Wave(Wave original)__ ``` -------------------------------- ### TMPWriter WriteOnStart Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Components.TMPWriter Specifies whether writing should begin when the TMPWriter's Start method is called. ```csharp public bool WriteOnStart { get; set; } ``` -------------------------------- ### Remove Tag at Start Index Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.ITagCollection.html Removes a tag at a specific start index, optionally by its order. If order is null, the first tag at the start index is removed. Returns true if a tag was removed. ```csharp bool RemoveAt(int startIndex, int? order = null) ``` -------------------------------- ### TagInfo(int, int, TagType, char, string, string) Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TextProcessing.ParsingUtility.TagInfo.html Initializes a new instance of the TagInfo class with specified tag details. This constructor allows for the creation of a TagInfo object populated with all essential information about a parsed tag, including its position, type, prefix, name, and parameters. ```APIDOC ## TagInfo(int startIndex, int endIndex, ParsingUtility.TagType type, char prefix, string name, string parameterString) Constructor ### Description Initializes a new instance of the TagInfo class with specified tag details. This constructor allows for the creation of a TagInfo object populated with all essential information about a parsed tag, including its position, type, prefix, name, and parameters. ### Method Constructor ### Parameters #### Path Parameters - **startIndex** (int) - Description not specified in source. - **endIndex** (int) - Description not specified in source. - **type** (ParsingUtility.TagType) - Description not specified in source. - **prefix** (char) - Description not specified in source. - **name** (string) - Description not specified in source. - **parameterString** (string) - Description not specified in source. ``` -------------------------------- ### startIndex Field Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TextProcessing.ParsingUtility.TagInfo Represents the start index of the tag in the source text. ```APIDOC ## startIndex ### Description Start index of the tag in the source text. ### Field Value int ``` -------------------------------- ### UseCustom Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Parameters.PowerEnum-2.html Gets a boolean value indicating whether the custom value is being used. ```csharp public bool UseCustom { get; } ``` -------------------------------- ### TagAt Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.TagCollection Retrieves a tag from the collection at a specified start index and order. If order is not specified, the first tag at the start index is returned. ```APIDOC ## TagAt ### Description Get the tag at the given `startIndex` with the correct `order`. If `order` is left to default, the first tag at `startIndex` will be returned. ### Method Signature ```csharp public TMPEffectTag TagAt(int startIndex, int? order = null) ``` ### Parameters #### Path Parameters - **startIndex** (int) - The start index. - **order** (int?) - Optional. The order at the start index. ### Returns - **TMPEffectTag** - The tag at the given indices, if it exists; otherwise null. ``` -------------------------------- ### Wave Constructor (Default) Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Parameters.Wave Initializes a new instance of the Wave class with default values. ```csharp public Wave()__ ``` -------------------------------- ### ObservableDictionary Property: Indexer Source: https://tmpeffects.luca3317.dev/api/TMPEffects.SerializedCollections.ObservableDictionary-2.html Gets or sets the element with the specified key. Throws exceptions for null keys, key not found (on get), or if the dictionary is read-only (on set). ```csharp public TValue this[TKey key] { get; set; } ``` -------------------------------- ### CommandContext Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPCommands.CommandContext.html Initializes a new instance of the CommandContext class. ```APIDOC ## CommandContext Constructor ### Description Initializes a new instance of the CommandContext class. ### Parameters #### Parameters - **writer** (TMPWriter) - The TMPWriter instance. - **indices** (TMPEffectTagIndices) - The indices of the tag that triggered this command. ``` -------------------------------- ### Wave Constructors Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Parameters.Wave Provides constructors for initializing a Wave object with different parameters to define its shape, period, and amplitude. ```APIDOC ## Wave() ### Description Initializes a new instance of the Wave class. ### Method Wave() ### Parameters None ``` ```APIDOC ## Wave(AnimationCurve, AnimationCurve, float, float, float) ### Description Initializes a new instance of the Wave class with specified upward and downward curves, periods, and amplitude. ### Method Wave(AnimationCurve upwardCurve, AnimationCurve downwardCurve, float upPeriod, float downPeriod, float amplitude) ### Parameters #### Parameters - **upwardCurve** (AnimationCurve) - Description not specified. - **downwardCurve** (AnimationCurve) - Description not specified. - **upPeriod** (float) - Description not specified. - **downPeriod** (float) - Description not specified. - **amplitude** (float) - Description not specified. ``` ```APIDOC ## Wave(AnimationCurve, AnimationCurve, float, float, float, float, float) ### Description Initializes a new instance of the Wave class with specified curves, periods, amplitude, and wait times. ### Method Wave(AnimationCurve upwardCurve, AnimationCurve downwardCurve, float upPeriod, float downPeriod, float amplitude, float crestWait, float troughWait) ### Parameters #### Parameters - **upwardCurve** (AnimationCurve) - Description not specified. - **downwardCurve** (AnimationCurve) - Description not specified. - **upPeriod** (float) - Description not specified. - **downPeriod** (float) - Description not specified. - **amplitude** (float) - Description not specified. - **crestWait** (float) - Description not specified. - **troughWait** (float) - Description not specified. ``` ```APIDOC ## Wave(Wave) ### Description Initializes a new instance of the Wave class as a copy of another Wave object. ### Method Wave(Wave original) ### Parameters #### Parameters - **original** (Wave) - The original Wave object to copy. ``` -------------------------------- ### Remove All Tags Starting at Index Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.ObservableTagCollection.html Removes all tags from the collection starting at a specified index. Optionally saves removed tags into a buffer. Returns the count of removed tags. ```csharp public override int RemoveAllAt(int startIndex, TMPEffectTagTuple[] buffer = null, int bufferIndex = 0) ``` -------------------------------- ### Parameterized TagInfo Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TextProcessing.ParsingUtility.TagInfo.html Initializes a new instance of the TagInfo class with specified tag details. ```csharp public TagInfo(int startIndex, int endIndex, ParsingUtility.TagType type, char prefix, string name, string parameterString)__ ``` -------------------------------- ### Remove All Tags at Start Index Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.ITagCollection.html Removes all tags starting from a specified index. An optional buffer can be provided to store the removed tags. Returns the count of removed tags. ```csharp int RemoveAllAt(int startIndex, TMPEffectTagTuple[] buffer = null, int bufferIndex = 0) ``` -------------------------------- ### CompositeTMPKeywordDatabase Constructors Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Databases.CompositeTMPKeywordDatabase.html Initializes a new instance of the CompositeTMPKeywordDatabase class with a specified array of keyword databases. ```APIDOC ## CompositeTMPKeywordDatabase(ITMPKeywordDatabase[]) ### Description Initializes a new instance of the CompositeTMPKeywordDatabase class. ### Parameters #### databases - **databases** (ITMPKeywordDatabase[]) - Required - An array of ITMPKeywordDatabase instances to combine. ``` -------------------------------- ### TagInfo startIndex Field Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TextProcessing.ParsingUtility.TagInfo.html Represents the start index of the tag in the source text. ```csharp public int startIndex__ ``` -------------------------------- ### Remove Tag At Specific Index Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.ITagCollection.html Removes a tag at a specific start index. An optional order parameter can be used to specify which tag to remove if multiple exist at the start index. ```APIDOC ## RemoveAt(int startIndex, int? order = null) ### Description Remove the tag starting at the given `startIndex` with the correct `order`. If `order` is left to default, the first tag at `startIndex` will be removed. ### Method bool ### Endpoint N/A (Method call) ### Parameters #### Path Parameters - **startIndex** (int) - Required - The start index. - **order** (int?) - Optional - The order at the start index. ### Response #### Success Response (bool) - **true** if a tag was removed; **false** otherwise. ``` -------------------------------- ### CompositeTMPKeywordDatabase Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Databases.CompositeTMPKeywordDatabase.html Initializes a new instance of the CompositeTMPKeywordDatabase class with an array of ITMPKeywordDatabase instances. The order of databases in the array determines their precedence. ```csharp public CompositeTMPKeywordDatabase(ITMPKeywordDatabase[] databases) ``` -------------------------------- ### CharData.Info Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.CharacterData.CharData.Info.html Initializes a new instance of the CharData.Info struct with the specified character and word information. ```APIDOC ## Constructor Info ### Description Initializes a new instance of the CharData.Info struct. ### Parameters * **index** (int) - The index of the character. * **cInfo** (TMP_CharacterInfo) - The character information. * **wordIndex** (int) - The index of the word the character belongs to. * **wInfo** (TMP_WordInfo) - The word information. ``` -------------------------------- ### Linear Bezier Curve from Start and End Points Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Extensions.AnimationCurveUtility Creates a linear Bezier curve defined by a start and end Vector2 point. This overload is useful for simple line segments. ```csharp public static AnimationCurve LinearBezier(Vector2 start, Vector2 end) ``` -------------------------------- ### Scaling a Character Source: https://tmpeffects.luca3317.dev/manual/animatingacharacter Use the SetScale method to adjust the character's scale. This example demonstrates ping-ponging the scale between zero and one. ```csharp public void Animate(CharData cData, IAnimationContext context) { // Ping-pong the scale between (0, 0, 0) and (1, 1, 1) over time float val = Mathf.PingPong(context.animatorContext.PassedTime, 1); Vector3 scale = Vector3.one * val; cData.SetScale(scale); } ``` -------------------------------- ### Skippable Command Example Source: https://tmpeffects.luca3317.dev/manual/tmpwriter_builtincommands Controls whether the text can be skipped by the user. Set to 'true' to allow skipping, or 'false' to prevent it. ```TMPWriter WHEN IM SKIPPED, I WONT GO ALL THE WAY ``` -------------------------------- ### TagInfo() Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TextProcessing.ParsingUtility.TagInfo.html Initializes a new instance of the TagInfo class with default values. This constructor is used when a tag's information needs to be created without immediate specific data. ```APIDOC ## TagInfo() Constructor ### Description Initializes a new instance of the TagInfo class with default values. This constructor is used when a tag's information needs to be created without immediate specific data. ### Method Constructor ### Parameters None ``` -------------------------------- ### Prefix Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.TMPEffectTag.html Gets the prefix of the tag. ```APIDOC ## Prefix ### Description Gets the prefix of the tag. ### Property Value char ``` -------------------------------- ### ExecuteInstantly Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPCommands.ITMPCommand.html Indicates whether a command should execute immediately when the TMPWriter starts writing. ```csharp bool ExecuteInstantly { get; } ``` -------------------------------- ### Wave Constructor (Extended) Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Parameters.Wave Initializes a new instance of the Wave class with specified curves, periods, and wait times. ```csharp public Wave(AnimationCurve upwardCurve, AnimationCurve downwardCurve, float upPeriod, float downPeriod, float amplitude, float crestWait, float troughWait)__ ``` -------------------------------- ### Name Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.TMPEffectTag.html Gets the name of the tag. ```APIDOC ## Name ### Description Gets the name of the tag. ### Property Value string ``` -------------------------------- ### Simple Scaling Animation Source: https://tmpeffects.luca3317.dev/manual/creatinganimations_script Implement the Animate method to scale each character to double its original size. This is a basic example to demonstrate animation logic. ```csharp private partial void Animate(CharData cData, AutoParametersData data, IAnimationContext context) { cData.SetScale(Vector3.one * 2); } ``` -------------------------------- ### Tag Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPEvents.TMPEventArgs.html Gets the tag of the event. ```APIDOC ## Tag Property ### Description Gets the tag of the event. ### Property Value TMPEffectTag ``` -------------------------------- ### Default TagInfo Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TextProcessing.ParsingUtility.TagInfo.html Initializes a new instance of the TagInfo class with default values. ```csharp public TagInfo()__ ``` -------------------------------- ### Try Add Tag with Start/End Indices and Order Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.ObservableTagCollection.html Attempts to add a tag to the collection with specified start and end indices, and an optional order. Returns true if successful. ```csharp public override bool TryAdd(TMPEffectTag tag, int startIndex = 0, int endIndex = -1, int? orderAtIndex = null) ``` -------------------------------- ### TMPEventArgs.Tag Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPEvents.TMPEventArgs Gets the tag of the event. ```csharp public TMPEffectTag Tag { get; } ``` -------------------------------- ### RemoveAllAt Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.ObservableTagCollection.html Removes all tags starting from a specified index. ```APIDOC ## RemoveAllAt(int, TMPEffectTagTuple[], int) ### Description Removes all tags starting at the given `startIndex`. ### Method `public override int RemoveAllAt(int startIndex, TMPEffectTagTuple[] buffer = null, int bufferIndex = 0)` ### Parameters - **startIndex** (int) - Required - The start index. - **buffer** (TMPEffectTagTuple[]) - Optional - Buffer to save the removed tags into. Leave at default if you do not want to get the tags. - **bufferIndex** (int) - Optional - The offset index of the buffer, i.e. the index at which the tags should be inserted into `buffer`. ### Returns - int - The amount of removed tags. ``` -------------------------------- ### TagCollection.BinarySearchIndexFirstIndexOf Method Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.TagCollection Performs a binary search to find the first index of a tag based on start index. ```csharp protected int BinarySearchIndexFirstIndexOf(TagCollection.StartIndexOnly indices) ``` -------------------------------- ### PowerEnum Constructors Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Parameters.PowerEnum-2.html Provides documentation for the constructors of the PowerEnum class, detailing how to initialize PowerEnum objects with or without custom values. ```APIDOC ## PowerEnum() ### Description Initializes a new instance of the PowerEnum class with default values. ### Constructor `public PowerEnum()` ## PowerEnum(TEnum) ### Description Initializes a new instance of the PowerEnum class with a specified enum value. ### Constructor `public PowerEnum(TEnum enumValue)` #### Parameters - **enumValue** (TEnum) - The enum value to set for the PowerEnum. ## PowerEnum(TEnum, TCustom) ### Description Initializes a new instance of the PowerEnum class with a specified enum value and a custom value. ### Constructor `public PowerEnum(TEnum enumValue, TCustom customValue)` #### Parameters - **enumValue** (TEnum) - The enum value to set for the PowerEnum. - **customValue** (TCustom) - The custom object value to associate with the PowerEnum. ## PowerEnum(TEnum, TCustom, bool) ### Description Initializes a new instance of the PowerEnum class with a specified enum value, a custom value, and a flag indicating whether to use the custom value. ### Constructor `public PowerEnum(TEnum enumValue, TCustom customValue, bool useCustom)` #### Parameters - **enumValue** (TEnum) - The enum value to set for the PowerEnum. - **customValue** (TCustom) - The custom object value to associate with the PowerEnum. - **useCustom** (bool) - A boolean flag indicating whether the custom value should be used. ``` -------------------------------- ### Writer Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPEvents.TMPEventArgs.html Gets the TMPWriter that invoked this event. ```APIDOC ## Writer Property ### Description Gets the TMPWriter that invoked this event. ### Property Value TMPWriter ``` -------------------------------- ### Writer Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPCommands.ReadOnlyCommandContext.html Gets the TMPWriter that raised this command. ```APIDOC ## Writer ### Description Gets the TMPWriter that raised this command. ### Property Value TMPWriter ``` -------------------------------- ### TryGetUnityObject Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Databases.ITMPKeywordDatabase.html Attempts to retrieve a UnityEngine.Object associated with a given string key. Returns true if successful, false otherwise. ```APIDOC ## Method: TryGetUnityObject ### Description Attempts to retrieve a UnityEngine.Object associated with a given string key. Returns true if successful, false otherwise. ### Signature ```csharp bool TryGetUnityObject(string str, out UnityEngine.Object obj) ``` ### Parameters #### Path Parameters - **str** (string) - The string key to look up. - **obj** (out Object) - The UnityEngine.Object value if the key is found. ### Returns - **bool** - True if a UnityEngine.Object was found and retrieved, false otherwise. ``` -------------------------------- ### Quadratic Bezier Curve from Variable Arguments Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Extensions.AnimationCurveUtility Constructs a quadratic Bezier curve from a variable number of Vector2 points using the 'params' keyword for flexible input. ```csharp public static AnimationCurve QuadraticBezier(params Vector2[] points) ``` -------------------------------- ### TMPEventArgs.Writer Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPEvents.TMPEventArgs Gets the TMPWriter that invoked this event. ```csharp public TMPWriter Writer { get; } ``` -------------------------------- ### TryGetUnityObject Method Signature Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Databases.TMPKeywordDatabaseBase.html Abstract method to attempt retrieving a Unity Object associated with a given string key. ```csharp public abstract bool TryGetUnityObject(string str, out Object obj)__ ``` -------------------------------- ### Writer Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPCommands.ICommandContext.html Gets the TMPWriter that raised this command. ```csharp TMPWriter Writer { get; } ``` -------------------------------- ### AnimatorContext Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPAnimations.ReadOnlyAnimationContext.html Gets the context of the animating TMPAnimator. ```csharp public IAnimatorContext AnimatorContext { get; } ``` -------------------------------- ### OnStartWriter Event Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Components.TMPWriter Event raised when the TMPWriter begins or resumes writing text. ```csharp public UnityEvent OnStartWriter ``` -------------------------------- ### Value Field Source: https://tmpeffects.luca3317.dev/api/TMPEffects.SerializedCollections.SerializedKeyValuePair-2.html Gets the value of the key-value pair. ```APIDOC ## Value ### Description Gets the value of the key-value pair. ### Field Value TValue ``` -------------------------------- ### TMPBasicAnimationDatabase Methods Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Databases.AnimationDatabase.TMPBasicAnimationDatabase.html Provides documentation for the public methods of the TMPBasicAnimationDatabase class. ```APIDOC ## Class TMPBasicAnimationDatabase ### Description Stores TMPAnimation objects. ### Methods #### ContainsEffect(string name) ##### Description Check whether this database contains an animation associated with the given name. ##### Parameters - **name** (string) - The identifier of the animation. ##### Returns - bool - true if this database contains an animation associated with the given name; false otherwise. #### GetEffect(string name) ##### Description Get the animation associated with the given name. ##### Parameters - **name** (string) - The identifier of the animation. ##### Returns - TMPAnimation - The animation associated with the given name. ##### Exceptions - KeyNotFoundException - InvalidOperationException ``` -------------------------------- ### TagCollection.TempIndices Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.TagCollection.TempIndices.html Initializes a new instance of the TagCollection.TempIndices struct with specified start index and order at index. ```APIDOC ## TempIndices(int startIndex, int orderAtIndex) ### Description Initializes a new instance of the TagCollection.TempIndices struct. ### Parameters #### Parameters - **startIndex** (int) - Description of startIndex - **orderAtIndex** (int) - Description of orderAtIndex ``` -------------------------------- ### TagCollection.TempIndices Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.TagCollection.TempIndices Initializes a new instance of the TagCollection.TempIndices struct with specified start index and order at index. ```APIDOC ## TempIndices(int, int) ### Description Initializes a new instance of the TagCollection.TempIndices struct. ### Parameters * **startIndex** (int) - The starting index. * **orderAtIndex** (int) - The order at index. ``` -------------------------------- ### Key Field Source: https://tmpeffects.luca3317.dev/api/TMPEffects.SerializedCollections.SerializedKeyValuePair-2.html Gets the key of the key-value pair. ```APIDOC ## Key ### Description Gets the key of the key-value pair. ### Field Value TKey ``` -------------------------------- ### Try Add Tag with Start/End Indices and Order Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.ITagCollection.html Attempts to add a new tag to the collection with specified start and end indices. If orderAtIndex is null, it defaults to the first position at the startIndex. Returns true if the tag was added. ```csharp bool TryAdd(TMPEffectTag tag, int startIndex = 0, int endIndex = -1, int? orderAtIndex = null) ``` -------------------------------- ### Constructors Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Tags.Collections.ObservableTagCollection.html Initializes a new instance of the ObservableTagCollection class. ```APIDOC ## ObservableTagCollection(IList, ITMPTagValidator) ### Description Initializes a new instance of the ObservableTagCollection class with a list of tags and an optional validator. ### Parameters - **tags** (IList) - The initial list of tags. - **validator** (ITMPTagValidator) - An optional tag validator. ``` ```APIDOC ## ObservableTagCollection(ITMPTagValidator) ### Description Initializes a new instance of the ObservableTagCollection class with an optional validator. ### Parameters - **validator** (ITMPTagValidator) - An optional tag validator. ``` -------------------------------- ### TagProcessorManager Constructors Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TextProcessing.TagProcessorManager.html Initializes a new instance of the TagProcessorManager class. ```APIDOC ## TagProcessorManager() ### Description Initializes a new instance of the TagProcessorManager class. ### Method Constructor ### Parameters None ``` -------------------------------- ### CharData.Info Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.CharacterData.CharData.Info.html Initializes a new instance of the CharData.Info struct. It takes the character's index, TMP_CharacterInfo, word index, and TMP_WordInfo as parameters. ```csharp public Info(int index, TMP_CharacterInfo cInfo, int wordIndex, TMP_WordInfo wInfo)__ ``` -------------------------------- ### Indices Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPEvents.TMPEventArgs.html Gets the indices of the tag associated with the event. ```APIDOC ## Indices Property ### Description Gets the indices of the tag. ### Property Value TMPEffectTagIndices ``` -------------------------------- ### Wave.Evaluate Method (Time, Offset) Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Parameters.Wave Evaluates the wave at a specific time and offset. Returns the wave's value and direction at that point. ```csharp public (float Value, int Direction) Evaluate(float time, float offset)__ ``` -------------------------------- ### Indices Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPCommands.ReadOnlyCommandContext.html Gets the indices of the tag that triggered this command. ```APIDOC ## Indices ### Description Gets the indices of the tag that triggered this command. ### Property Value TMPEffectTagIndices ``` -------------------------------- ### TMPEventArgs.Indices Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPEvents.TMPEventArgs Gets the indices of the tag associated with the event. ```csharp public TMPEffectTagIndices Indices { get; } ``` -------------------------------- ### TagProcessorManager Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TextProcessing.TagProcessorManager.html Initializes a new instance of the TagProcessorManager class. ```csharp public TagProcessorManager() ``` -------------------------------- ### ReadOnlyCommandContext Writer Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPCommands.ReadOnlyCommandContext.html Gets the TMPWriter that raised this command. ```csharp public TMPWriter Writer { get; }__ ``` -------------------------------- ### TMPSceneCommand Methods Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPCommands.TMPSceneCommand.html Methods available for executing and managing TMPSceneCommands. ```APIDOC ## Methods ### ExecuteCommand - **Description**: Executes the command. - **Signature**: `void ExecuteCommand(ICommandContext context)` - **Parameters**: - `context` (ICommandContext): The context in which the command is executed. ### GetNewCustomData - **Description**: Gets a new custom data object for this command. - **Signature**: `object GetNewCustomData()` - **Returns**: `object` - The custom data object for this command. ### SetParameters - **Description**: Sets the parameters for the command. - **Signature**: `void SetParameters(object customData, IDictionary parameters, ITMPKeywordDatabase keywordDatabase)` - **Parameters**: - `customData` (object): The custom data for this command. - `parameters` (IDictionary): Parameters as key-value-pairs. - `keywordDatabase` (ITMPKeywordDatabase): The keyword database used for parsing the parameter values. ### ValidateParameters - **Description**: Validates the given parameters. - **Signature**: `bool ValidateParameters(IDictionary parameters, ITMPKeywordDatabase keywordDatabase)` - **Parameters**: - `parameters` (IDictionary): The parameters as key-value pairs. - `keywordDatabase` (ITMPKeywordDatabase): The keyword database used for parsing the parameter values. - **Returns**: `bool` - true if the parameters were successfully validated; false otherwise. ``` -------------------------------- ### TryGetUnityObject Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Databases.TMPSceneKeywordDatabase.html Attempts to retrieve a UnityEngine.Object associated with a given string keyword. Returns true if successful, false otherwise. ```APIDOC ## TryGetUnityObject(string, out Object) ### Description Attempts to retrieve a UnityEngine.Object associated with a given string keyword. Returns true if successful, false otherwise. ### Method `public override bool TryGetUnityObject(string str, out UnityEngine.Object result)` ### Parameters #### Path Parameters - **str** (string) - Description of the string parameter. - **result** (Object) - Output parameter for the retrieved UnityEngine.Object. ### Returns - **bool** - True if a UnityEngine.Object was found and retrieved, false otherwise. ``` -------------------------------- ### SegmentData Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPAnimations.ReadOnlyAnimationContext.html Gets the data pertaining to the animation segment. ```csharp public SegmentData SegmentData { get; } ``` -------------------------------- ### Reset Method Source: https://tmpeffects.luca3317.dev/api/TMPEffects.CharacterData.VertexData.html Resets the mesh to its initial state. ```csharp public void Reset() ``` -------------------------------- ### Duration Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPAnimations.GenericAnimation.html Gets or sets the duration of the animation in seconds. ```csharp public float Duration { get; set; } ``` -------------------------------- ### AnimatorContext Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPAnimations.AnimationContext.html Gets or sets the context of the animating TMPAnimator. ```csharp public IAnimatorContext AnimatorContext { get; set; } ``` -------------------------------- ### DummyShowAnimation Methods Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPAnimations.ShowAnimations.DummyShowAnimation.html This section details the public methods available in the DummyShowAnimation class, including Animate, GetNewCustomData, SetParameters, and ValidateParameters. ```APIDOC ## Class DummyShowAnimation Namespace TMPEffects.TMPAnimations.ShowAnimations ## Methods ### Animate(CharData, IAnimationContext) Animate the given character. #### Parameters `cData` CharData Data about the character. `context` IAnimationContext Data about the animator. ### GetNewCustomData() Get a new custom data object for this animation. #### Returns object The custom data object for this animation. ### SetParameters(object, IDictionary, ITMPKeywordDatabase) Set the parameters for the animation. #### Parameters `customData` object The custom data for this animation. `parameters` IDictionary Parameters as key-value-pairs. `keywordDatabase` ITMPKeywordDatabase The keyword database used for parsing the parameter values. ### ValidateParameters(IDictionary, ITMPKeywordDatabase) Validate the given parameters. #### Parameters `parameters` IDictionary The parameters as key-value pairs `keywordDatabase` ITMPKeywordDatabase The keyword database used for parsing the parameter values #### Returns bool true if the parameters were successfully validated; false otherwise. ``` -------------------------------- ### Modifier Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Modifiers.TMPMeshModifiers Gets the modifier flags applied to this instance. ```csharp public TMPMeshModifiers.ModifierFlags Modifier { get; }__ ``` -------------------------------- ### Custom Keyword Database for Yarn Spinner Variables Source: https://tmpeffects.luca3317.dev/manual/yarnspinner Implement a custom keyword database to use Yarn Spinner variables with TMPEffects. This example shows how to support float variables. ```csharp public class MyDB : TMPSceneKeywordDatabaseBase { [SerializeField] private InMemoryVariableStorage storage; public override bool TryGetFloat(string str, out float result) { return storage.TryGetValue(str, out result); } // We dont want to support AnimationCurve keywords defined in YarnSpinner, so just return false public override bool TryGetAnimCurve(string str, out AnimationCurve result) { result = default; return false; } // ... ``` -------------------------------- ### TMPParameterBundleAttribute Constructor Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Parameters.Attributes.TMPParameterBundleAttribute.html Initializes a new instance of the TMPParameterBundleAttribute class with a specified display name. ```csharp public TMPParameterBundleAttribute(string displayName) ``` -------------------------------- ### CompositeTMPKeywordDatabase.Databases Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Databases.CompositeTMPKeywordDatabase.html Gets the collection of keyword databases that are combined in this instance. ```APIDOC ## Databases ### Description Retrieves the collection of ITMPKeywordDatabase instances that constitute this composite database. ### Property Value - IEnumerable - The collection of databases. ``` -------------------------------- ### SceneOffsetTypePowerEnum Constructors Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Parameters.SceneOffsetTypePowerEnum.html Provides constructors for initializing SceneOffsetTypePowerEnum objects with different configurations. ```APIDOC ## SceneOffsetTypePowerEnum() ### Description Initializes a new instance of the SceneOffsetTypePowerEnum class. ### Method Constructor ### Parameters None ``` ```APIDOC ## SceneOffsetTypePowerEnum(OffsetType) ### Description Initializes a new instance of the SceneOffsetTypePowerEnum class with a specified offset type. ### Method Constructor ### Parameters #### Path Parameters - **offsetType** (OffsetType) - Required - The offset type to set. ``` ```APIDOC ## SceneOffsetTypePowerEnum(OffsetType, TMPSceneOffsetProvider) ### Description Initializes a new instance of the SceneOffsetTypePowerEnum class with a specified offset type and custom offset provider. ### Method Constructor ### Parameters #### Path Parameters - **offsetType** (OffsetType) - Required - The offset type to set. - **customOffsetProvider** (TMPSceneOffsetProvider) - Required - The custom offset provider to use. ``` ```APIDOC ## SceneOffsetTypePowerEnum(OffsetType, TMPSceneOffsetProvider, bool) ### Description Initializes a new instance of the SceneOffsetTypePowerEnum class with a specified offset type, custom offset provider, and a flag to indicate whether to use the custom provider. ### Method Constructor ### Parameters #### Path Parameters - **offsetType** (OffsetType) - Required - The offset type to set. - **customOffsetProvider** (TMPSceneOffsetProvider) - Required - The custom offset provider to use. - **useCustom** (bool) - Required - A flag indicating whether to use the custom offset provider. ``` -------------------------------- ### Animator Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Components.Animator.ReadOnlyAnimatorContext.html Gets the animating TMPAnimator associated with this context. ```csharp public TMPAnimator Animator { get; } ``` -------------------------------- ### ReadOnlyCharData.Scale Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.CharacterData.ReadOnlyCharData.html Gets the current scale of the character as a Vector3. ```csharp public Vector3 Scale { get; } ``` -------------------------------- ### TryGetUnityObject Method Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Databases.TMPKeywordDatabase.html Attempts to parse a string into a UnityEngine.Object. Returns true if successful, false otherwise. ```csharp public override bool TryGetUnityObject(string str, out UnityEngine.Object result) ``` -------------------------------- ### ReadOnlyCharData.PositionDelta Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.CharacterData.ReadOnlyCharData.html Gets the change in position of the character as a Vector3. ```csharp public Vector3 PositionDelta { get; } ``` -------------------------------- ### TryGetColor Method Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Databases.TMPKeywordDatabase.html Attempts to parse a string into a Color value. Returns true if successful, false otherwise. ```csharp public override bool TryGetColor(string str, out Color result) ``` -------------------------------- ### ReadOnlyCharData.Position Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.CharacterData.ReadOnlyCharData.html Gets the current position of the character as a Vector3. ```csharp public Vector3 Position { get; } ``` -------------------------------- ### ReadOnlyCharData.InitialScale Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.CharacterData.ReadOnlyCharData.html Gets the initial scale of the character as a Vector3. ```csharp public Vector3 InitialScale { get; } ``` -------------------------------- ### SceneOffsetTypePowerEnum Constructor with OffsetType, Custom Provider, and UseCustom Flag Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Parameters.SceneOffsetTypePowerEnum.html Initializes a new instance of the SceneOffsetTypePowerEnum class with a specified offset type, custom offset provider, and a flag to indicate whether to use the custom provider. ```csharp public SceneOffsetTypePowerEnum(TMPParameterTypes.OffsetType offsetType, TMPSceneOffsetProvider customOffsetProvider, bool useCustom) ``` -------------------------------- ### ExecuteCommand Method Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPCommands.TMPGenericSceneCommand.html Executes the command logic within the provided command context. ```csharp public void ExecuteCommand(ICommandContext context) ``` -------------------------------- ### ReadOnlyCharData.InitialRotation Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.CharacterData.ReadOnlyCharData.html Gets the initial rotation of the character as a Quaternion. ```csharp public Quaternion InitialRotation { get; } ``` -------------------------------- ### Full Wave Animation Implementation Source: https://tmpeffects.luca3317.dev/manual/tmpanimator_creatinganimations This C# code provides the complete implementation for the built-in wave animation. It requires understanding of AnimationUtility, ParameterUtility, and the process of animating characters within TMPEffects. ```csharp using System.Collections.Generic; using UnityEngine; using TMPEffects.CharacterData; using static TMPEffects.ParameterUtility; using static TMPEffects.TMPAnimations.AnimationUtility; using TMPEffects.Extensions; namespace TMPEffects.TMPAnimations.Animations { [CreateAssetMenu(fileName = "new WaveAnimation", menuName = "TMPEffects/Animations/Wave")] public class WaveAnimation : TMPAnimation { [Tooltip("The wave that defines the behavior of this animation. No prefix.\nFor more information about Wave, see the section on it in the documentation.")] [SerializeField] Wave wave = new Wave(AnimationCurveUtility.EaseInOutSine(), AnimationCurveUtility.EaseInOutSine(), 0.5f, 0.5f, 1f, 1f, 0.2f); [Tooltip("The way the offset for the wave is calculated.\nFor more information about Wave, see the section on it in the documentation.\nAliases: waveoffset, woffset, waveoff, woff")] [SerializeField] OffsetType waveOffsetType = OffsetType.XPos; // Animate the character public override void Animate(CharData cData, IAnimationContext context) { // Cast your custom data object to the type Data data = (Data)context.customData; // Evaluate the wave data structure at the current time, with the characters offset (see AnimationUtility section for info on this) float eval = data.wave.Evaluate(context.animatorContext.PassedTime, GetWaveOffset(cData, context, data.waveOffsetType)).Value; // Set the new position of the character cData.SetPosition(cData.info.initialPosition + Vector3.up * eval); } // Validate the tag's parameters public override bool ValidateParameters(IDictionary parameters) { // If there is no parameters, return true (wave does not have any required parameters) if (parameters == null) return true; // If there is a parameter "waveoffset" (or one of its aliases) // but it has the wrong type, return false if (HasNonWaveOffsetParameter(parameters, "waveoffset")) return false; // If the wave parameters could not be validated, return false // Note: "WaveParameters" does not refer to anything specific to "WaveAnimation" here. // WaveParameters is a predefined parameter bundle in ParameterUtility. See the section on it for more info. if (!ValidateWaveParameters(parameters)) return false; // else return true return true; } // Create the custom data object, set the default values for the parameters, and return it public override object GetNewCustomData() { return new Data() { wave = this.wave, waveOffsetType = this.waveOffsetType }; } // Set the parameters defined in the tag public override void SetParameters(object customData, IDictionary parameters) { // If there is no parameters, return early if (parameters == null) return; // Cast your custom data object to the type Data data = (Data)customData; // If has the waveoffset parameter set it in your custom data object if (TryGetWaveOffsetParameter(out var wot, parameters, "waveoffset")) data.waveOffsetType = wot; // Set the wave in your custom data object // As with ValidateWaveParameters, "Wave" refers to the parameter bundle // defined in ParameterUtility, not "WaveAnimation". data.wave = CreateWave(this.wave, GetWaveParameters(parameters)); } // The class used to store the parameter values private class Data { public Wave wave; public OffsetType waveOffsetType; } } } ``` -------------------------------- ### ReadOnlyCharData.InitialPosition Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.CharacterData.ReadOnlyCharData.html Gets the initial position of the character as a Vector3. ```csharp public Vector3 InitialPosition { get; } ``` -------------------------------- ### TryGetFloat Method Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Databases.TMPKeywordDatabase.html Attempts to parse a string into a float value. Returns true if successful, false otherwise. ```csharp public override bool TryGetFloat(string str, out float result) ``` -------------------------------- ### Quadratic Bezier Curve from Points Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Extensions.AnimationCurveUtility Generates a quadratic Bezier curve from a sequence of Vector2 points. Requires System.Collections.Generic. ```csharp public static AnimationCurve QuadraticBezier(IEnumerable points) ``` -------------------------------- ### ReadOnlyCommandContext Indices Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPCommands.ReadOnlyCommandContext.html Gets the indices of the tag that triggered this command. ```csharp public TMPEffectTagIndices Indices { get; }__ ``` -------------------------------- ### ITMPCommand Methods Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPCommands.ITMPCommand.html Methods available for executing and configuring ITMPCommand instances. ```APIDOC ## Methods ### ExecuteCommand **Description**: Execute the command. **Signature**: `void ExecuteCommand(ICommandContext context)` **Parameters**: - `context` (ICommandContext) - The context for command execution. ### GetNewCustomData **Description**: Get a new custom data object for this command. **Signature**: `object GetNewCustomData()` **Returns**: `object` - The custom data object for this command. ### SetParameters **Description**: Set the parameters for the command. **Signature**: `void SetParameters(object customData, IDictionary parameters, ITMPKeywordDatabase keywordDatabase)` **Parameters**: - `customData` (object) - The custom data for this command. - `parameters` (IDictionary) - Parameters as key-value-pairs. - `keywordDatabase` (ITMPKeywordDatabase) - The keyword database used for parsing the parameter values. ``` -------------------------------- ### CommandContext.Indices Property Source: https://tmpeffects.luca3317.dev/api/TMPEffects.TMPCommands.CommandContext.html Gets or sets the indices of the tag that triggered this command. ```APIDOC ## CommandContext.Indices Property ### Description The indices of the tag that triggered this command. ### Property Value TMPEffectTagIndices ``` -------------------------------- ### TryGetColor Method Signature Source: https://tmpeffects.luca3317.dev/api/TMPEffects.Databases.TMPKeywordDatabaseBase.html Abstract method to attempt retrieving a Color value associated with a given string key. ```csharp public abstract bool TryGetColor(string str, out Color result)__ ```