Skip to content

Commit

Permalink
Update docs for YarnCommand and YarnFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
desplesda committed Mar 6, 2023
1 parent dd96741 commit 2b1343d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
15 changes: 12 additions & 3 deletions Runtime/Commands/YarnCommandAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,20 @@ namespace Yarn.Unity
/// <para>This attribute may be attached to a coroutine. </para>
/// <para style="note">
/// The <see cref="DialogueRunner"/> determines if the method is a coroutine
/// if the method returns <see cref="IEnumerator"/>.
/// if the method returns <see cref="IEnumerator"/>, or if the method
/// returns a <see cref="Coroutine"/>.
/// </para>
/// <para>
/// If the method is a coroutine, the DialogueRunner will pause execution
/// until the coroutine ends.
/// If the method is a coroutine, or returns a <see cref="Coroutine"/>, the
/// DialogueRunner will pause execution until the coroutine ends.
/// </para>
/// <para>
/// Yarn Spinner for Unity finds methods with the YarnCommand attribute by
/// reading your source code. If your project uses Unity 2021.1 or earlier,
/// you will need to tell Yarn Spinner for Unity to do this manually, by
/// opening the Window method and choosing Yarn Spinner -&gt; Update Yarn
/// Commands. You don't need to do this on later versions of Unity, as it
/// will be done for you automatically when your code compiles.
/// </para>
/// </remarks>
public class YarnCommandAttribute : YarnActionAttribute
Expand Down
13 changes: 12 additions & 1 deletion Runtime/Commands/YarnFunctionAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,23 @@ namespace Yarn.Unity
/// instance's library.
/// </summary>
/// <remarks>
/// <para>
/// See <see cref="Library.RegisterFunction(string, Delegate)"/> and the
/// generic overloads for what is and is not valid.
///
/// </para>
/// <para>
/// This will throw an error if you attempt to add a function that has
/// more than 16 parameters, as that is the largest overload that
/// <see cref="Func{TResult}"/> etc has.
/// </para>
/// <para>
/// Yarn Spinner for Unity finds methods with the YarnFunction attribute by
/// reading your source code. If your project uses Unity 2021.1 or earlier,
/// you will need to tell Yarn Spinner for Unity to do this manually, by
/// opening the Window method and choosing Yarn Spinner -&gt; Update Yarn
/// Commands. You don't need to do this on later versions of Unity, as it
/// will be done for you automatically when your code compiles.
/// </para>
/// </remarks>
public class YarnFunctionAttribute : YarnActionAttribute {
[Obsolete("Use " + nameof(Name) + " instead.")]
Expand Down

0 comments on commit 2b1343d

Please sign in to comment.