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

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

@ -5,16 +5,16 @@
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Collections;
using UnityEngine.Serialization;
namespace Fungus
{
/// <summary>
/// Gets the text property from a UI Text object and stores it in a string variable.
/// </summary>
[CommandInfo("UI",
"Get Text",
"Gets the text property from a UI Text object and stores it in a string variable.")]
[AddComponentMenu("")]
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.UI;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
{
/// <summary>
/// Set the interactable sate of selectable objects.
/// </summary>
[CommandInfo("UI",
"Set Interactable",
"Set the interactable sate of selectable objects.")]
@ -97,5 +98,4 @@ namespace Fungus
return false;
}
}
}

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

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

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

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

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

@ -4,14 +4,14 @@
*/
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using Fungus;
namespace Fungus
{
/// <summary>
/// Abstract base class for TweenUI commands.
/// </summary>
public abstract class TweenUI : Command
{
[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.UI;
using System;
using System.Collections;
using UnityEngine.Serialization;
namespace Fungus
{
/// <summary>
/// Writes content to a UI Text or Text Mesh object.
/// </summary>
[CommandInfo("UI",
"Write",
"Writes content to a UI Text or Text Mesh object.")]
[AddComponentMenu("")]
public class Write : Command, ILocalizable
{

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

@ -5,10 +5,12 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
namespace Fungus
{
/// <summary>
/// The block will execute when the user clicks on the target UI button object.
/// </summary>
[EventHandlerInfo("UI",
"Button Clicked",
"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.UI;
using System.Collections;
namespace Fungus
{
/// <summary>
/// The block will execute when the user finishes editing the text in the input field.
/// </summary>
[EventHandlerInfo("UI",
"End Edit",
"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
{
/// <summary>
/// Select the UI element when the gameobject is enabled.
/// </summary>
[RequireComponent(typeof(Selectable))]
public class SelectOnEnable : MonoBehaviour
{
private Selectable selectable;
protected Selectable selectable;
private void Awake()
protected void Awake()
{
selectable = GetComponent<Selectable>();
}
private void OnEnable()
protected void OnEnable()
{
selectable.Select();
}

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

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

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

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

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

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

Loading…
Cancel
Save