Browse Source

Reverted IStage interface

master
Christopher 8 years ago
parent
commit
24c840cf1e
  1. 35
      Assets/Fungus/Scripts/Components/Stage.cs
  2. 66
      Assets/Fungus/Scripts/Interfaces/IStage.cs
  3. 12
      Assets/Fungus/Scripts/Interfaces/IStage.cs.meta

35
Assets/Fungus/Scripts/Components/Stage.cs

@ -12,7 +12,7 @@ namespace Fungus
/// Define a set of screen positions where character sprites can be displayed.
/// </summary>
[ExecuteInEditMode]
public class Stage : PortraitController, IStage
public class Stage : PortraitController
{
[Tooltip("Canvas object containing the stage positions.")]
[SerializeField] protected Canvas portraitCanvas;
@ -76,26 +76,57 @@ namespace Fungus
return Stage.activeStages[0];
}
#region IStage implementation
#region Public methods
/// <summary>
/// Canvas object containing the stage positions.
/// </summary>
public virtual Canvas PortraitCanvas { get { return portraitCanvas; } }
/// <summary>
/// Dim portraits when a character is not speaking.
/// </summary>
public virtual bool DimPortraits { get { return dimPortraits; } set { dimPortraits = value; } }
/// <summary>
/// Duration for fading character portraits in / out.
/// </summary>
public virtual float FadeDuration { get { return fadeDuration; } set { fadeDuration = value; } }
/// <summary>
/// Duration for moving characters to a new position.
/// </summary>
public virtual float MoveDuration { get { return moveDuration; } set { moveDuration = value; } }
/// <summary>
/// Ease type for the fade tween.
/// </summary>
public virtual LeanTweenType FadeEaseType { get { return fadeEaseType; } }
/// <summary>
/// Constant offset to apply to portrait position.
/// </summary>
public virtual Vector2 ShiftOffset { get { return shiftOffset; } }
/// <summary>
/// The position object where characters appear by default.
/// </summary>
public virtual Image DefaultPosition { get { return defaultPosition; } }
/// <summary>
/// List of stage position rect transforms in the stage.
/// </summary>
public virtual List<RectTransform> Positions { get { return positions; } }
/// <summary>
/// List of currently active characters on the stage.
/// </summary>
public virtual List<Character> CharactersOnStage { get { return charactersOnStage; } }
/// <summary>
/// Searches the stage's named positions
/// If none matches the string provided, give a warning and return a new RectTransform
/// </summary>
public RectTransform GetPosition(string positionString)
{
if (string.IsNullOrEmpty(positionString))

66
Assets/Fungus/Scripts/Interfaces/IStage.cs

@ -1,66 +0,0 @@
// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus).
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE)
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
namespace Fungus
{
/// <summary>
/// Define a set of screen positions where character sprites can be displayed.
/// </summary>
public interface IStage
{
/// <summary>
/// Canvas object containing the stage positions.
/// </summary>
Canvas PortraitCanvas { get; }
/// <summary>
/// Dim portraits when a character is not speaking.
/// </summary>
bool DimPortraits { get; set; }
/// <summary>
/// Duration for fading character portraits in / out.
/// </summary>
float FadeDuration { get; set; }
/// <summary>
/// Duration for moving characters to a new position.
/// </summary>
float MoveDuration { get; set; }
/// <summary>
/// Ease type for the fade tween.
/// </summary>
LeanTweenType FadeEaseType { get; }
/// <summary>
/// Constant offset to apply to portrait position.
/// </summary>
Vector2 ShiftOffset { get; }
/// <summary>
/// The position object where characters appear by default.
/// </summary>
Image DefaultPosition { get; }
/// <summary>
/// List of stage position rect transforms in the stage.
/// </summary>
List<RectTransform> Positions { get; }
/// <summary>
/// List of currently active characters on the stage.
/// </summary>
List<Character> CharactersOnStage { get; }
/// <summary>
/// Searches the stage's named positions
/// If none matches the string provided, give a warning and return a new RectTransform
/// </summary>
RectTransform GetPosition(string positionString);
}
}

12
Assets/Fungus/Scripts/Interfaces/IStage.cs.meta

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: a88bde623f95a46e49febd46fe50b19c
timeCreated: 1473689190
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Loading…
Cancel
Save