Browse Source

Refactored UI command comments

master
Christopher 9 years ago
parent
commit
b0371ce81c
  1. 7
      Assets/Fungus/UI/Scripts/Commands/FadeUI.cs
  2. 7
      Assets/Fungus/UI/Scripts/Commands/GetText.cs
  3. 6
      Assets/Fungus/UI/Scripts/Commands/SetInteractable.cs
  4. 5
      Assets/Fungus/UI/Scripts/Commands/SetSliderValue.cs
  5. 6
      Assets/Fungus/UI/Scripts/Commands/SetText.cs
  6. 6
      Assets/Fungus/UI/Scripts/Commands/TweenUI.cs
  7. 8
      Assets/Fungus/UI/Scripts/Commands/Write.cs
  8. 4
      Assets/Fungus/UI/Scripts/EventHandlers/ButtonClicked.cs
  9. 4
      Assets/Fungus/UI/Scripts/EventHandlers/EndEdit.cs
  10. 9
      Assets/Fungus/UI/Scripts/SelectOnEnable.cs
  11. 4
      Assets/Fungus/UI/Scripts/TextTagParser.cs
  12. 14
      Assets/Fungus/UI/Scripts/Writer.cs
  13. 19
      Assets/Fungus/UI/Scripts/WriterAudio.cs

7
Assets/Fungus/UI/Scripts/Commands/FadeUI.cs

@ -5,13 +5,13 @@
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using Fungus; using Fungus;
namespace Fungus namespace Fungus
{ {
/// <summary>
/// Fades a UI object.
/// </summary>
[CommandInfo("UI", [CommandInfo("UI",
"Fade UI", "Fade UI",
"Fades a UI object")] "Fades a UI object")]
@ -153,5 +153,4 @@ namespace Fungus
return true; return true;
} }
} }
} }

7
Assets/Fungus/UI/Scripts/Commands/GetText.cs

@ -5,16 +5,16 @@
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using System;
using System.Collections;
using UnityEngine.Serialization; using UnityEngine.Serialization;
namespace Fungus namespace Fungus
{ {
/// <summary>
/// Gets the text property from a UI Text object and stores it in a string variable.
/// </summary>
[CommandInfo("UI", [CommandInfo("UI",
"Get Text", "Get Text",
"Gets the text property from a UI Text object and stores it in a string variable.")] "Gets the text property from a UI Text object and stores it in a string variable.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class GetText : Command public class GetText : Command
{ {
@ -94,5 +94,4 @@ namespace Fungus
} }
} }
} }
} }

6
Assets/Fungus/UI/Scripts/Commands/SetInteractable.cs

@ -5,12 +5,13 @@
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
namespace Fungus namespace Fungus
{ {
/// <summary>
/// Set the interactable sate of selectable objects.
/// </summary>
[CommandInfo("UI", [CommandInfo("UI",
"Set Interactable", "Set Interactable",
"Set the interactable sate of selectable objects.")] "Set the interactable sate of selectable objects.")]
@ -97,5 +98,4 @@ namespace Fungus
return false; return false;
} }
} }
} }

5
Assets/Fungus/UI/Scripts/Commands/SetSliderValue.cs

@ -5,11 +5,12 @@
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using System.Collections;
namespace Fungus namespace Fungus
{ {
/// <summary>
/// Sets the value property of a slider object.
/// </summary>
[CommandInfo("UI", [CommandInfo("UI",
"Set Slider Value", "Set Slider Value",
"Sets the value property of a slider object")] "Sets the value property of a slider object")]

6
Assets/Fungus/UI/Scripts/Commands/SetText.cs

@ -5,16 +5,16 @@
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using System;
using System.Collections;
using UnityEngine.Serialization; using UnityEngine.Serialization;
namespace Fungus namespace Fungus
{ {
/// <summary>
/// Sets the text property on a UI Text object and/or an Input Field object.
/// </summary>
[CommandInfo("UI", [CommandInfo("UI",
"Set Text", "Set Text",
"Sets the text property on a UI Text object and/or an Input Field object.")] "Sets the text property on a UI Text object and/or an Input Field object.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class SetText : Command, ILocalizable public class SetText : Command, ILocalizable
{ {

6
Assets/Fungus/UI/Scripts/Commands/TweenUI.cs

@ -4,14 +4,14 @@
*/ */
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Fungus; using Fungus;
namespace Fungus namespace Fungus
{ {
/// <summary>
/// Abstract base class for TweenUI commands.
/// </summary>
public abstract class TweenUI : Command public abstract class TweenUI : Command
{ {
[Tooltip("List of objects to be affected by the tween")] [Tooltip("List of objects to be affected by the tween")]

8
Assets/Fungus/UI/Scripts/Commands/Write.cs

@ -4,17 +4,15 @@
*/ */
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
using System;
using System.Collections;
using UnityEngine.Serialization;
namespace Fungus namespace Fungus
{ {
/// <summary>
/// Writes content to a UI Text or Text Mesh object.
/// </summary>
[CommandInfo("UI", [CommandInfo("UI",
"Write", "Write",
"Writes content to a UI Text or Text Mesh object.")] "Writes content to a UI Text or Text Mesh object.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class Write : Command, ILocalizable public class Write : Command, ILocalizable
{ {

4
Assets/Fungus/UI/Scripts/EventHandlers/ButtonClicked.cs

@ -5,10 +5,12 @@
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using System.Collections;
namespace Fungus namespace Fungus
{ {
/// <summary>
/// The block will execute when the user clicks on the target UI button object.
/// </summary>
[EventHandlerInfo("UI", [EventHandlerInfo("UI",
"Button Clicked", "Button Clicked",
"The block will execute when the user clicks on the target UI button object.")] "The block will execute when the user clicks on the target UI button object.")]

4
Assets/Fungus/UI/Scripts/EventHandlers/EndEdit.cs

@ -5,10 +5,12 @@
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using System.Collections;
namespace Fungus namespace Fungus
{ {
/// <summary>
/// The block will execute when the user finishes editing the text in the input field.
/// </summary>
[EventHandlerInfo("UI", [EventHandlerInfo("UI",
"End Edit", "End Edit",
"The block will execute when the user finishes editing the text in the input field.")] "The block will execute when the user finishes editing the text in the input field.")]

9
Assets/Fungus/UI/Scripts/SelectOnEnable.cs

@ -3,17 +3,20 @@ using UnityEngine.UI;
namespace Fungus namespace Fungus
{ {
/// <summary>
/// Select the UI element when the gameobject is enabled.
/// </summary>
[RequireComponent(typeof(Selectable))] [RequireComponent(typeof(Selectable))]
public class SelectOnEnable : MonoBehaviour public class SelectOnEnable : MonoBehaviour
{ {
private Selectable selectable; protected Selectable selectable;
private void Awake() protected void Awake()
{ {
selectable = GetComponent<Selectable>(); selectable = GetComponent<Selectable>();
} }
private void OnEnable() protected void OnEnable()
{ {
selectable.Select(); selectable.Select();
} }

4
Assets/Fungus/UI/Scripts/TextTagParser.cs

@ -9,7 +9,9 @@ using System.Text.RegularExpressions;
namespace Fungus namespace Fungus
{ {
/// <summary>
/// Parses a string for special Fungus text tags.
/// </summary>
public class TextTagParser public class TextTagParser
{ {
public enum TokenType public enum TokenType

14
Assets/Fungus/UI/Scripts/Writer.cs

@ -13,10 +13,9 @@ using System.Text;
namespace Fungus namespace Fungus
{ {
/// <summary>
/** /// Implement this interface to be notified about Writer events.
* Implement this interface to be notified about Writer events /// </summary>
*/
public interface IWriterListener public interface IWriterListener
{ {
/// ///
@ -41,7 +40,10 @@ namespace Fungus
/// Called every time the Writer writes a new character glyph. /// Called every time the Writer writes a new character glyph.
void OnGlyph(); void OnGlyph();
} }
/// <summary>
/// Writes text using a typewriter effect to a UI text object.
/// </summary>
public class Writer : MonoBehaviour, IDialogInputListener public class Writer : MonoBehaviour, IDialogInputListener
{ {
[Tooltip("Gameobject containing a Text, Inout Field or Text Mesh object to write to")] [Tooltip("Gameobject containing a Text, Inout Field or Text Mesh object to write to")]
@ -70,12 +72,10 @@ namespace Fungus
// This property is true when the writer is waiting for user input to continue // This property is true when the writer is waiting for user input to continue
protected bool isWaitingForInput; protected bool isWaitingForInput;
public bool IsWaitingForInput { get { return isWaitingForInput; } } public bool IsWaitingForInput { get { return isWaitingForInput; } }
// This property is true when the writer is writing text or waiting (i.e. still processing tokens) // This property is true when the writer is writing text or waiting (i.e. still processing tokens)
protected bool isWriting; protected bool isWriting;
public bool IsWriting { get { return isWriting; } } public bool IsWriting { get { return isWriting; } }
protected float currentWritingSpeed; protected float currentWritingSpeed;

19
Assets/Fungus/UI/Scripts/WriterAudio.cs

@ -4,14 +4,13 @@
*/ */
using UnityEngine; using UnityEngine;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
namespace Fungus namespace Fungus
{ {
/* /// <summary>
* Manages audio effects for Dialogs /// Manages audio effects for Dialogs.
*/ /// </summary>
public class WriterAudio : MonoBehaviour, IWriterListener public class WriterAudio : MonoBehaviour, IWriterListener
{ {
[Tooltip("Volume level of writing sound effects")] [Tooltip("Volume level of writing sound effects")]
@ -74,12 +73,12 @@ namespace Fungus
targetAudioSource.volume = 0f; targetAudioSource.volume = 0f;
} }
/** /// <summary>
* Plays a voiceover audio clip. /// Plays a voiceover audio clip.
* Voiceover behaves differently than speaking sound effects because it /// Voiceover behaves differently than speaking sound effects because it
* should keep on playing after the text has finished writing. It also /// should keep on playing after the text has finished writing. It also
* does not pause for wait tags, punctuation, etc. /// does not pause for wait tags, punctuation, etc.
*/ /// </summary>
public virtual void PlayVoiceover(AudioClip voiceOverClip) public virtual void PlayVoiceover(AudioClip voiceOverClip)
{ {
if (targetAudioSource == null) if (targetAudioSource == null)

Loading…
Cancel
Save