diff --git a/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs b/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs index 7eb3ac90..4c6525b9 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs @@ -27,7 +27,7 @@ namespace Fungus [Tooltip("What to do to audio")] [SerializeField] protected controlType control; - public controlType Control { get { return control; } } + public virtual controlType Control { get { return control; } } [Tooltip("Audio clip to play")] [SerializeField] protected AudioSourceData _audioSource; diff --git a/Assets/Fungus/Camera/Scripts/Commands/FadeToView.cs b/Assets/Fungus/Camera/Scripts/Commands/FadeToView.cs index ed0d97bb..45beb717 100644 --- a/Assets/Fungus/Camera/Scripts/Commands/FadeToView.cs +++ b/Assets/Fungus/Camera/Scripts/Commands/FadeToView.cs @@ -22,7 +22,7 @@ namespace Fungus [Tooltip("View to transition to when Fade is complete")] [SerializeField] protected View targetView; - public View TargetView { get { return targetView; } } + public virtual View TargetView { get { return targetView; } } [Tooltip("Wait until the fade has finished before executing next command")] [SerializeField] protected bool waitUntilFinished = true; diff --git a/Assets/Fungus/Camera/Scripts/Commands/MoveToView.cs b/Assets/Fungus/Camera/Scripts/Commands/MoveToView.cs index 85a47526..810e8025 100644 --- a/Assets/Fungus/Camera/Scripts/Commands/MoveToView.cs +++ b/Assets/Fungus/Camera/Scripts/Commands/MoveToView.cs @@ -19,7 +19,7 @@ namespace Fungus [Tooltip("View to transition to when move is complete")] [SerializeField] protected View targetView; - public View TargetView { get { return targetView; } } + public virtual View TargetView { get { return targetView; } } [Tooltip("Wait until the fade has finished before executing next command")] [SerializeField] protected bool waitUntilFinished = true; diff --git a/Assets/Fungus/Camera/Scripts/View.cs b/Assets/Fungus/Camera/Scripts/View.cs index 7f756f16..bdd48b5a 100644 --- a/Assets/Fungus/Camera/Scripts/View.cs +++ b/Assets/Fungus/Camera/Scripts/View.cs @@ -17,21 +17,21 @@ namespace Fungus /// [Tooltip("Orthographic size of the camera view in world units.")] [SerializeField] protected float viewSize = 0.5f; - public float ViewSize { get { return viewSize; } set { viewSize = value; } } + public virtual float ViewSize { get { return viewSize; } set { viewSize = value; } } /// /// Aspect ratio of the primary view rectangle. e.g. a 4:3 aspect ratio = 1.333. /// [Tooltip("Aspect ratio of the primary view rectangle. (e.g. 4:3 aspect ratio = 1.333)")] [SerializeField] protected Vector2 primaryAspectRatio = new Vector2(4, 3); - public Vector2 PrimaryAspectRatio { get { return primaryAspectRatio; } set { primaryAspectRatio = value; } } + public virtual Vector2 PrimaryAspectRatio { get { return primaryAspectRatio; } set { primaryAspectRatio = value; } } /// /// Aspect ratio of the secondary view rectangle. e.g. a 2:1 aspect ratio = 2/1 = 2.0. /// [Tooltip("Aspect ratio of the secondary view rectangle. (e.g. 2:1 aspect ratio = 2.0)")] [SerializeField] protected Vector2 secondaryAspectRatio = new Vector2(2, 1); - public Vector2 SecondaryAspectRatio { get { return secondaryAspectRatio; } set { secondaryAspectRatio = value; } } + public virtual Vector2 SecondaryAspectRatio { get { return secondaryAspectRatio; } set { secondaryAspectRatio = value; } } protected virtual void Update() { diff --git a/Assets/Fungus/Flowchart/Scripts/Block.cs b/Assets/Fungus/Flowchart/Scripts/Block.cs index f2f9f80c..8d3f8fb3 100644 --- a/Assets/Fungus/Flowchart/Scripts/Block.cs +++ b/Assets/Fungus/Flowchart/Scripts/Block.cs @@ -27,13 +27,13 @@ namespace Fungus /// The execution state of the Block. /// protected ExecutionState executionState; - public ExecutionState State { get { return executionState; } } + public virtual ExecutionState State { get { return executionState; } } /// /// Unique identifier for the Block. /// [SerializeField] protected int itemId = -1; // Invalid flowchart item id - public int ItemId { get { return itemId; } set { itemId = value; } } + public virtual int ItemId { get { return itemId; } set { itemId = value; } } /// /// The name of the block node as displayed in the Flowchart window. @@ -41,7 +41,7 @@ namespace Fungus [FormerlySerializedAs("sequenceName")] [Tooltip("The name of the block node as displayed in the Flowchart window")] [SerializeField] protected string blockName = "New Block"; - public string BlockName { get { return blockName; } set { blockName = value; } } + public virtual string BlockName { get { return blockName; } set { blockName = value; } } /// /// Description text to display under the block node @@ -49,33 +49,33 @@ namespace Fungus [TextArea(2, 5)] [Tooltip("Description text to display under the block node")] [SerializeField] protected string description = ""; - public string Description { get { return description; } } + public virtual string Description { get { return description; } } /// /// An optional Event Handler which can execute the block when an event occurs. /// [Tooltip("An optional Event Handler which can execute the block when an event occurs")] [SerializeField] protected EventHandler eventHandler; - public EventHandler _EventHandler { get { return eventHandler; } set { eventHandler = value; } } + public virtual EventHandler _EventHandler { get { return eventHandler; } set { eventHandler = value; } } /// /// The currently executing command. /// protected Command activeCommand; - public Command ActiveCommand { get { return activeCommand; } } + public virtual Command ActiveCommand { get { return activeCommand; } } /// // Index of last command executed before the current one. // -1 indicates no previous command. /// protected int previousActiveCommandIndex = -1; - public float ExecutingIconTimer { get; set; } + public virtual float ExecutingIconTimer { get; set; } /// /// The list of commands in the sequence. /// [SerializeField] protected List commandList = new List(); - public List CommandList { get { return commandList; } } + public virtual List CommandList { get { return commandList; } } /// /// Controls the next command to execute in the block execution coroutine. diff --git a/Assets/Fungus/Flowchart/Scripts/Command.cs b/Assets/Fungus/Flowchart/Scripts/Command.cs index 39cac7c5..d0971fb7 100644 --- a/Assets/Fungus/Flowchart/Scripts/Command.cs +++ b/Assets/Fungus/Flowchart/Scripts/Command.cs @@ -46,13 +46,13 @@ namespace Fungus [FormerlySerializedAs("commandId")] [HideInInspector] [SerializeField] protected int itemId = -1; // Invalid flowchart item id - public int ItemId { get { return itemId; } set { itemId = value; } } + public virtual int ItemId { get { return itemId; } set { itemId = value; } } /// /// Error message to display in the command inspector. /// protected string errorMessage = ""; - public string ErrorMessage { get { return errorMessage; } } + public virtual string ErrorMessage { get { return errorMessage; } } /// /// Indent depth of the current commands. @@ -60,29 +60,29 @@ namespace Fungus /// [HideInInspector] [SerializeField] protected int indentLevel; - public int IndentLevel { get { return indentLevel; } set { indentLevel = value; } } + public virtual int IndentLevel { get { return indentLevel; } set { indentLevel = value; } } /// /// Index of the command in the parent block's command list. /// - public int CommandIndex { get; set; } + public virtual int CommandIndex { get; set; } /// /// Set to true by the parent block while the command is executing. /// - public bool IsExecuting { get; set; } + public virtual bool IsExecuting { get; set; } /// /// Timer used to control appearance of executing icon in inspector. /// - public float ExecutingIconTimer { get; set; } + public virtual float ExecutingIconTimer { get; set; } /// /// Reference to the Block object that this command belongs to. /// This reference is only populated at runtime and in the editor when the /// block is selected. /// - public Block ParentBlock { get; set; } + public virtual Block ParentBlock { get; set; } /// /// Returns the Flowchart that this command belongs to. diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/End.cs b/Assets/Fungus/Flowchart/Scripts/Commands/End.cs index baa28034..890f20ed 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/End.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/End.cs @@ -14,7 +14,7 @@ namespace Fungus [AddComponentMenu("")] public class End : Command { - public bool Loop { get; set; } + public virtual bool Loop { get; set; } public override void OnEnter() { diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/InvokeMethod.cs b/Assets/Fungus/Flowchart/Scripts/Commands/InvokeMethod.cs index 998bbaa5..81ad628a 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/InvokeMethod.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/InvokeMethod.cs @@ -21,8 +21,7 @@ namespace Fungus { [Tooltip("GameObject containing the component method to be invoked")] [SerializeField] protected GameObject targetObject; - - public GameObject TargetObject { get { return targetObject; } } + public virtual GameObject TargetObject { get { return targetObject; } } [HideInInspector] [Tooltip("Name of assembly containing the target component")] diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/Label.cs b/Assets/Fungus/Flowchart/Scripts/Commands/Label.cs index af363adc..b4aaa1b2 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/Label.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/Label.cs @@ -16,8 +16,7 @@ namespace Fungus { [Tooltip("Display name for the label")] [SerializeField] protected string key = ""; - - public string Key { get { return key; } } + public virtual string Key { get { return key; } } public override void OnEnter() { diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/SetVariable.cs b/Assets/Fungus/Flowchart/Scripts/Commands/SetVariable.cs index 09b8314c..9c4dcd93 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/SetVariable.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/SetVariable.cs @@ -33,7 +33,7 @@ namespace Fungus [Tooltip("The type of math operation to be performed")] [SerializeField] protected SetOperator setOperator; - public SetOperator _SetOperator { get { return setOperator; } } + public virtual SetOperator _SetOperator { get { return setOperator; } } [Tooltip("Boolean value to set with")] [SerializeField] protected BooleanData booleanData; diff --git a/Assets/Fungus/Flowchart/Scripts/EventHandler.cs b/Assets/Fungus/Flowchart/Scripts/EventHandler.cs index f15c59a1..31b86201 100644 --- a/Assets/Fungus/Flowchart/Scripts/EventHandler.cs +++ b/Assets/Fungus/Flowchart/Scripts/EventHandler.cs @@ -44,7 +44,7 @@ namespace Fungus [HideInInspector] [FormerlySerializedAs("parentSequence")] [SerializeField] protected Block parentBlock; - public Block ParentBlock { get { return parentBlock; } set { parentBlock = value; } } + public virtual Block ParentBlock { get { return parentBlock; } set { parentBlock = value; } } /// /// The Event Handler should call this method when the event is detected. diff --git a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs index c8a28ea4..7c602897 100644 --- a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs +++ b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs @@ -51,42 +51,42 @@ namespace Fungus /// [HideInInspector] [SerializeField] protected Vector2 scrollPos; - public Vector2 ScrollPos { get { return scrollPos; } set { scrollPos = value; } } + public virtual Vector2 ScrollPos { get { return scrollPos; } set { scrollPos = value; } } /// /// Scroll position of Flowchart variables window. /// [HideInInspector] [SerializeField] protected Vector2 variablesScrollPos; - public Vector2 VariablesScrollPos { get { return variablesScrollPos; } set { variablesScrollPos = value; } } + public virtual Vector2 VariablesScrollPos { get { return variablesScrollPos; } set { variablesScrollPos = value; } } /// /// Show the variables pane. /// [HideInInspector] [SerializeField] protected bool variablesExpanded = true; - public bool VariablesExpanded { get { return variablesExpanded; } set { variablesExpanded = value; } } + public virtual bool VariablesExpanded { get { return variablesExpanded; } set { variablesExpanded = value; } } /// /// Height of command block view in inspector. /// [HideInInspector] [SerializeField] protected float blockViewHeight = 400; - public float BlockViewHeight { get { return blockViewHeight; } set { blockViewHeight = value; } } + public virtual float BlockViewHeight { get { return blockViewHeight; } set { blockViewHeight = value; } } /// /// Zoom level of Flowchart editor window. /// [HideInInspector] [SerializeField] protected float zoom = 1f; - public float Zoom { get { return zoom; } set { zoom = value; } } + public virtual float Zoom { get { return zoom; } set { zoom = value; } } /// /// Scrollable area for Flowchart editor window. /// [HideInInspector] [SerializeField] protected Rect scrollViewRect; - public Rect ScrollViewRect { get { return scrollViewRect; } set { scrollViewRect = value; } } + public virtual Rect ScrollViewRect { get { return scrollViewRect; } set { scrollViewRect = value; } } /// /// Currently selected block in the Flowchart editor. @@ -94,21 +94,21 @@ namespace Fungus [HideInInspector] [FormerlySerializedAs("selectedSequence")] [SerializeField] protected Block selectedBlock; - public Block SelectedBlock { get { return selectedBlock; } set { selectedBlock = value; } } + public virtual Block SelectedBlock { get { return selectedBlock; } set { selectedBlock = value; } } /// /// Currently selected command in the Flowchart editor. /// [HideInInspector] [SerializeField] protected List selectedCommands = new List(); - public List SelectedCommands { get { return selectedCommands; } } + public virtual List SelectedCommands { get { return selectedCommands; } } /// /// The list of variables that can be accessed by the Flowchart. /// [HideInInspector] [SerializeField] protected List variables = new List(); - public List Variables { get { return variables; } } + public virtual List Variables { get { return variables; } } /// /// Description text displayed in the Flowchart editor window @@ -116,7 +116,7 @@ namespace Fungus [TextArea(3, 5)] [Tooltip("Description text displayed in the Flowchart editor window")] [SerializeField] protected string description = ""; - public string Description { get { return description; } } + public virtual string Description { get { return description; } } /// /// Slow down execution in the editor to make it easier to visualise program flow. @@ -124,14 +124,14 @@ namespace Fungus [Range(0f, 5f)] [Tooltip("Adds a pause after each execution step to make it easier to visualise program flow. Editor only, has no effect in platform builds.")] [SerializeField] protected float stepPause = 0f; - public float StepPause { get { return stepPause; } } + public virtual float StepPause { get { return stepPause; } } /// /// Use command color when displaying the command list in the inspector. /// [Tooltip("Use command color when displaying the command list in the Fungus Editor window")] [SerializeField] protected bool colorCommands = true; - public bool ColorCommands { get { return colorCommands; } } + public virtual bool ColorCommands { get { return colorCommands; } } /// /// Hides the Flowchart block and command components in the inspector. @@ -145,21 +145,21 @@ namespace Fungus /// [Tooltip("Saves the selected block and commands when saving the scene. Helps avoid version control conflicts if you've only changed the active selection.")] [SerializeField] protected bool saveSelection = true; - public bool SaveSelection { get { return saveSelection; } } + public virtual bool SaveSelection { get { return saveSelection; } } /// /// Unique identifier for identifying this flowchart in localized string keys. /// [Tooltip("Unique identifier for this flowchart in localized string keys. If no id is specified then the name of the Flowchart object will be used.")] [SerializeField] protected string localizationId = ""; - public string LocalizationId { get { return localizationId; } } + public virtual string LocalizationId { get { return localizationId; } } /// /// Display line numbers in the command list in the Block inspector. /// [Tooltip("Display line numbers in the command list in the Block inspector.")] [SerializeField] protected bool showLineNumbers = false; - public bool ShowLineNumbers { get { return showLineNumbers; } } + public virtual bool ShowLineNumbers { get { return showLineNumbers; } } /// /// List of commands to hide in the Add Command menu. Use this to restrict the set of commands available when editing a Flowchart. @@ -172,19 +172,19 @@ namespace Fungus /// [Tooltip("Lua Environment to be used by default for all Execute Lua commands in this Flowchart")] [SerializeField] protected LuaEnvironment luaEnvironment; - public LuaEnvironment _LuaEnvironment { get { return luaEnvironment; } } + public virtual LuaEnvironment _LuaEnvironment { get { return luaEnvironment; } } /// /// The ExecuteLua command adds a global Lua variable with this name bound to the flowchart prior to executing. /// [Tooltip("The ExecuteLua command adds a global Lua variable with this name bound to the flowchart prior to executing.")] [SerializeField] protected string luaBindingName = "flowchart"; - public string LuaBindingName { get { return luaBindingName; } } + public virtual string LuaBindingName { get { return luaBindingName; } } /// /// Position in the center of all blocks in the flowchart. /// - public Vector2 CenterPosition { set; get; } + public virtual Vector2 CenterPosition { set; get; } /// /// Cached list of flowchart objects in the scene for fast lookup. diff --git a/Assets/Fungus/Flowchart/Scripts/FungusState.cs b/Assets/Fungus/Flowchart/Scripts/FungusState.cs index fa68f95c..65438659 100644 --- a/Assets/Fungus/Flowchart/Scripts/FungusState.cs +++ b/Assets/Fungus/Flowchart/Scripts/FungusState.cs @@ -13,6 +13,6 @@ namespace Fungus public class FungusState : MonoBehaviour { [SerializeField] protected Flowchart selectedFlowchart; - public Flowchart SelectedFlowchart { get { return selectedFlowchart; } set { selectedFlowchart = value; } } + public virtual Flowchart SelectedFlowchart { get { return selectedFlowchart; } set { selectedFlowchart = value; } } } } \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/Node.cs b/Assets/Fungus/Flowchart/Scripts/Node.cs index ad5221f3..27fac885 100644 --- a/Assets/Fungus/Flowchart/Scripts/Node.cs +++ b/Assets/Fungus/Flowchart/Scripts/Node.cs @@ -12,6 +12,6 @@ namespace Fungus public class Node : MonoBehaviour { [SerializeField] protected Rect nodeRect = new Rect(0, 0, 120, 30); - public Rect _NodeRect { get { return nodeRect; } set { nodeRect = value; } } + public virtual Rect _NodeRect { get { return nodeRect; } set { nodeRect = value; } } } } \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/Variable.cs b/Assets/Fungus/Flowchart/Scripts/Variable.cs index 27dbf92d..899d005c 100644 --- a/Assets/Fungus/Flowchart/Scripts/Variable.cs +++ b/Assets/Fungus/Flowchart/Scripts/Variable.cs @@ -50,7 +50,7 @@ namespace Fungus public String defaultText = ""; - public System.Type[] VariableTypes { get; set; } + public Type[] VariableTypes { get; set; } } /// @@ -60,10 +60,10 @@ namespace Fungus public abstract class Variable : MonoBehaviour { [SerializeField] protected VariableScope scope; - public VariableScope Scope { get { return scope; } } + public virtual VariableScope Scope { get { return scope; } } [SerializeField] protected string key = ""; - public string Key { get { return key; } set { key = value; } } + public virtual string Key { get { return key; } set { key = value; } } public abstract void OnReset(); } @@ -74,7 +74,7 @@ namespace Fungus public abstract class VariableBase : Variable { [SerializeField] protected T value; - public T Value { get { return this.value; } set { this.value = value; } } + public virtual T Value { get { return this.value; } set { this.value = value; } } protected T startValue; diff --git a/Assets/Fungus/Narrative/Scripts/Character.cs b/Assets/Fungus/Narrative/Scripts/Character.cs index 03a1fa5e..2212c9b1 100644 --- a/Assets/Fungus/Narrative/Scripts/Character.cs +++ b/Assets/Fungus/Narrative/Scripts/Character.cs @@ -16,29 +16,29 @@ namespace Fungus public class Character : MonoBehaviour, ILocalizable { [SerializeField] protected string nameText; // We need a separate name as the object name is used for character variations (e.g. "Smurf Happy", "Smurf Sad") - public string NameText { get { return nameText; } } + public virtual string NameText { get { return nameText; } } [SerializeField] protected Color nameColor = Color.white; - public Color NameColor { get { return nameColor; } } + public virtual Color NameColor { get { return nameColor; } } [SerializeField] protected AudioClip soundEffect; - public AudioClip SoundEffect { get { return soundEffect; } } + public virtual AudioClip SoundEffect { get { return soundEffect; } } [SerializeField] protected Sprite profileSprite; - public Sprite ProfileSprite { get { return profileSprite; } set { profileSprite = value; } } + public virtual Sprite ProfileSprite { get { return profileSprite; } set { profileSprite = value; } } [SerializeField] protected List portraits; - public List Portraits { get { return portraits; } } + public virtual List Portraits { get { return portraits; } } [SerializeField] protected FacingDirection portraitsFace; - public FacingDirection PortraitsFace { get { return portraitsFace; } } + public virtual FacingDirection PortraitsFace { get { return portraitsFace; } } [SerializeField] protected PortraitState state = new PortraitState(); - public PortraitState State { get { return state; } } + public virtual PortraitState State { get { return state; } } [Tooltip("Sets the active Say dialog with a reference to a Say Dialog object in the scene. All story text will now display using this Say Dialog.")] [SerializeField] protected SayDialog setSayDialog; - public SayDialog SetSayDialog { get { return setSayDialog; } } + public virtual SayDialog SetSayDialog { get { return setSayDialog; } } [FormerlySerializedAs("notes")] [TextArea(5,10)] diff --git a/Assets/Fungus/Narrative/Scripts/Commands/ControlStage.cs b/Assets/Fungus/Narrative/Scripts/Commands/ControlStage.cs index f3fabc73..d0c43dbd 100644 --- a/Assets/Fungus/Narrative/Scripts/Commands/ControlStage.cs +++ b/Assets/Fungus/Narrative/Scripts/Commands/ControlStage.cs @@ -31,14 +31,14 @@ namespace Fungus { [Tooltip("Stage to display characters on")] [SerializeField] protected Stage stage; - public Stage _Stage { get { return stage; } } + public virtual Stage _Stage { get { return stage; } } [Tooltip("Stage to swap with")] [SerializeField] protected Stage replacedStage; [Tooltip("Use Default Settings")] [SerializeField] protected bool useDefaultSettings = true; - public bool UseDefaultSettings { get { return useDefaultSettings; } } + public virtual bool UseDefaultSettings { get { return useDefaultSettings; } } [Tooltip("Fade Duration")] [SerializeField] protected float fadeDuration; diff --git a/Assets/Fungus/Narrative/Scripts/Commands/ControlWithDisplay.cs b/Assets/Fungus/Narrative/Scripts/Commands/ControlWithDisplay.cs index c0d3ed47..cb993733 100644 --- a/Assets/Fungus/Narrative/Scripts/Commands/ControlWithDisplay.cs +++ b/Assets/Fungus/Narrative/Scripts/Commands/ControlWithDisplay.cs @@ -11,7 +11,7 @@ namespace Fungus [Tooltip("Display type")] [SerializeField] protected TDisplayEnum display; - public TDisplayEnum Display { get { return display; } } + public virtual TDisplayEnum Display { get { return display; } } protected bool IsDisplayNone(TEnum enumValue) { diff --git a/Assets/Fungus/Narrative/Scripts/Commands/Portrait.cs b/Assets/Fungus/Narrative/Scripts/Commands/Portrait.cs index 27e3fba4..4e119220 100644 --- a/Assets/Fungus/Narrative/Scripts/Commands/Portrait.cs +++ b/Assets/Fungus/Narrative/Scripts/Commands/Portrait.cs @@ -15,38 +15,38 @@ namespace Fungus { [Tooltip("Stage to display portrait on")] [SerializeField] protected Stage stage; - public Stage _Stage { get { return stage; } set { stage = value; } } + public virtual Stage _Stage { get { return stage; } set { stage = value; } } [Tooltip("Character to display")] [SerializeField] protected Character character; - public Character _Character { get { return character; } set { character = value; } } + public virtual Character _Character { get { return character; } set { character = value; } } [Tooltip("Character to swap with")] [SerializeField] protected Character replacedCharacter; [Tooltip("Portrait to display")] [SerializeField] protected Sprite portrait; - public Sprite _Portrait { get { return portrait; } set { portrait = value; } } + public virtual Sprite _Portrait { get { return portrait; } set { portrait = value; } } [Tooltip("Move the portrait from/to this offset position")] [SerializeField] protected PositionOffset offset; - public PositionOffset Offset { get { return offset; } set { offset = value; } } + public virtual PositionOffset Offset { get { return offset; } set { offset = value; } } [Tooltip("Move the portrait from this position")] [SerializeField] protected RectTransform fromPosition; - public RectTransform FromPosition { get { return fromPosition; } set { fromPosition = value;} } + public virtual RectTransform FromPosition { get { return fromPosition; } set { fromPosition = value;} } [Tooltip("Move the portrait to this positoin")] [SerializeField] protected RectTransform toPosition; - public RectTransform ToPosition { get { return toPosition; } set { toPosition = value;} } + public virtual RectTransform ToPosition { get { return toPosition; } set { toPosition = value;} } [Tooltip("Direction character is facing")] [SerializeField] protected FacingDirection facing; - public FacingDirection Facing { get { return facing; } set { facing = value; } } + public virtual FacingDirection Facing { get { return facing; } set { facing = value; } } [Tooltip("Use Default Settings")] [SerializeField] protected bool useDefaultSettings = true; - public bool UseDefaultSettings { get { return useDefaultSettings; } set { useDefaultSettings = value; } } + public virtual bool UseDefaultSettings { get { return useDefaultSettings; } set { useDefaultSettings = value; } } [Tooltip("Fade Duration")] [SerializeField] protected float fadeDuration = 0.5f; @@ -59,11 +59,11 @@ namespace Fungus [Tooltip("Move")] [SerializeField] protected bool move; - public bool Move { get { return move; } set { move = value; } } + public virtual bool Move { get { return move; } set { move = value; } } [Tooltip("Start from offset")] [SerializeField] protected bool shiftIntoPlace; - public bool ShiftIntoPlace { get { return shiftIntoPlace; } set { shiftIntoPlace = value; } } + public virtual bool ShiftIntoPlace { get { return shiftIntoPlace; } set { shiftIntoPlace = value; } } [Tooltip("Wait until the tween has finished before executing the next command")] [SerializeField] protected bool waitUntilFinished = false; diff --git a/Assets/Fungus/Narrative/Scripts/Commands/Say.cs b/Assets/Fungus/Narrative/Scripts/Commands/Say.cs index af16d0da..17d073d0 100644 --- a/Assets/Fungus/Narrative/Scripts/Commands/Say.cs +++ b/Assets/Fungus/Narrative/Scripts/Commands/Say.cs @@ -23,11 +23,11 @@ namespace Fungus [Tooltip("Character that is speaking")] [SerializeField] protected Character character; - public Character _Character { get { return character; } } + public virtual Character _Character { get { return character; } } [Tooltip("Portrait that represents speaking character")] [SerializeField] protected Sprite portrait; - public Sprite Portrait { get { return portrait; } set { portrait = value; } } + public virtual Sprite Portrait { get { return portrait; } set { portrait = value; } } [Tooltip("Voiceover audio to play when writing the text")] [SerializeField] protected AudioClip voiceOverClip; @@ -40,7 +40,7 @@ namespace Fungus [Tooltip("Type this text in the previous dialog box.")] [SerializeField] protected bool extendPrevious = false; - public bool ExtendPrevious { get { return extendPrevious; } } + public virtual bool ExtendPrevious { get { return extendPrevious; } } [Tooltip("Fade out the dialog box when writing has finished and not waiting for input.")] [SerializeField] protected bool fadeWhenDone = true; diff --git a/Assets/Fungus/Narrative/Scripts/CustomTag.cs b/Assets/Fungus/Narrative/Scripts/CustomTag.cs index c55f00c0..73a244df 100644 --- a/Assets/Fungus/Narrative/Scripts/CustomTag.cs +++ b/Assets/Fungus/Narrative/Scripts/CustomTag.cs @@ -13,16 +13,16 @@ namespace Fungus public class CustomTag : MonoBehaviour { [SerializeField] protected string tagStartSymbol; - public string TagStartSymbol { get { return tagStartSymbol; } } + public virtual string TagStartSymbol { get { return tagStartSymbol; } } [SerializeField] protected string tagEndSymbol; - public string TagEndSymbol { get { return tagEndSymbol; } } + public virtual string TagEndSymbol { get { return tagEndSymbol; } } [SerializeField] protected string replaceTagStartWith; - public string ReplaceTagStartWith { get { return replaceTagStartWith; } } + public virtual string ReplaceTagStartWith { get { return replaceTagStartWith; } } [SerializeField] protected string replaceTagEndWith; - public string ReplaceTagEndWith { get { return replaceTagEndWith; } } + public virtual string ReplaceTagEndWith { get { return replaceTagEndWith; } } static public List activeCustomTags = new List(); diff --git a/Assets/Fungus/Narrative/Scripts/Localization.cs b/Assets/Fungus/Narrative/Scripts/Localization.cs index fddc3f25..8ef5c28c 100644 --- a/Assets/Fungus/Narrative/Scripts/Localization.cs +++ b/Assets/Fungus/Narrative/Scripts/Localization.cs @@ -30,7 +30,7 @@ namespace Fungus /// [Tooltip("Language to use at startup, usually defined by a two letter language code (e.g DE = German)")] [SerializeField] protected string activeLanguage = ""; - public string ActiveLanguage { get { return activeLanguage; } } + public virtual string ActiveLanguage { get { return activeLanguage; } } protected static Dictionary localizedStrings = new Dictionary(); @@ -51,15 +51,13 @@ namespace Fungus /// [Tooltip("CSV file containing localization data which can be easily edited in a spreadsheet tool")] [SerializeField] protected TextAsset localizationFile; - - public TextAsset LocalizationFile { get { return localizationFile; } set { localizationFile = value; } } + public virtual TextAsset LocalizationFile { get { return localizationFile; } set { localizationFile = value; } } /// /// Stores any notification message from export / import methods. /// protected string notificationText = ""; - - public string NotificationText { get { return notificationText; } set { notificationText = value; } } + public virtual string NotificationText { get { return notificationText; } set { notificationText = value; } } protected bool initialized; diff --git a/Assets/Fungus/Narrative/Scripts/MenuDialog.cs b/Assets/Fungus/Narrative/Scripts/MenuDialog.cs index 5592a64a..6d6e5b78 100644 --- a/Assets/Fungus/Narrative/Scripts/MenuDialog.cs +++ b/Assets/Fungus/Narrative/Scripts/MenuDialog.cs @@ -21,10 +21,10 @@ namespace Fungus [SerializeField] protected bool autoSelectFirstButton = false; protected Button[] cachedButtons; - public Button[] CachedButtons { get { return cachedButtons; } } + public virtual Button[] CachedButtons { get { return cachedButtons; } } protected Slider cachedSlider; - public Slider CachedSlider { get { return cachedSlider; } } + public virtual Slider CachedSlider { get { return cachedSlider; } } public static MenuDialog GetMenuDialog() { @@ -156,7 +156,7 @@ namespace Fungus return addedOption; } - public int DisplayedOptionsCount + public virtual int DisplayedOptionsCount { get { int count = 0; diff --git a/Assets/Fungus/Narrative/Scripts/SayDialog.cs b/Assets/Fungus/Narrative/Scripts/SayDialog.cs index c276ec1c..125fdecb 100644 --- a/Assets/Fungus/Narrative/Scripts/SayDialog.cs +++ b/Assets/Fungus/Narrative/Scripts/SayDialog.cs @@ -33,11 +33,11 @@ namespace Fungus [Tooltip("The story text UI object")] [SerializeField] protected Text storyText; - public Text StoryText { get { return storyText; } } + public virtual Text StoryText { get { return storyText; } } [Tooltip("The character UI object")] [SerializeField] protected Image characterImage; - public Image CharacterImage { get { return characterImage; } } + public virtual Image CharacterImage { get { return characterImage; } } [Tooltip("Adjust width of story text when Character Image is displayed (to avoid overlapping)")] [SerializeField] protected bool fitTextWithImage = true; diff --git a/Assets/Fungus/Narrative/Scripts/Stage.cs b/Assets/Fungus/Narrative/Scripts/Stage.cs index 7e29a0d4..55e2e938 100644 --- a/Assets/Fungus/Narrative/Scripts/Stage.cs +++ b/Assets/Fungus/Narrative/Scripts/Stage.cs @@ -15,33 +15,33 @@ namespace Fungus public class Stage : PortraitController { [SerializeField] protected Canvas portraitCanvas; - public Canvas PortraitCanvas { get { return portraitCanvas; } } + public virtual Canvas PortraitCanvas { get { return portraitCanvas; } } [SerializeField] protected bool dimPortraits; - public bool DimPortraits { get { return dimPortraits; } set { dimPortraits = value; } } + public virtual bool DimPortraits { get { return dimPortraits; } set { dimPortraits = value; } } [SerializeField] protected float fadeDuration = 0.5f; - public float FadeDuration { get { return fadeDuration; } set { fadeDuration = value; } } + public virtual float FadeDuration { get { return fadeDuration; } set { fadeDuration = value; } } [SerializeField] protected float moveDuration = 1f; - public float MoveDuration { get { return moveDuration; } set { moveDuration = value; } } + public virtual float MoveDuration { get { return moveDuration; } set { moveDuration = value; } } [SerializeField] protected LeanTweenType fadeEaseType; - public LeanTweenType FadeEaseType { get { return fadeEaseType; } } + public virtual LeanTweenType FadeEaseType { get { return fadeEaseType; } } [SerializeField] protected Vector2 shiftOffset; - public Vector2 ShiftOffset { get { return shiftOffset; } } + public virtual Vector2 ShiftOffset { get { return shiftOffset; } } [SerializeField] protected Image defaultPosition; - public Image DefaultPosition { get { return defaultPosition; } } + public virtual Image DefaultPosition { get { return defaultPosition; } } [SerializeField] protected List positions; - public List Positions { get { return positions; } } + public virtual List Positions { get { return positions; } } [SerializeField] protected RectTransform[] cachedPositions; protected List charactersOnStage = new List(); - [SerializeField] public List CharactersOnStage { get { return charactersOnStage; } } + public virtual List CharactersOnStage { get { return charactersOnStage; } } static public List activeStages = new List(); diff --git a/Assets/Fungus/Sprite/Scripts/Draggable2D.cs b/Assets/Fungus/Sprite/Scripts/Draggable2D.cs index fd0256c3..f3456fb0 100644 --- a/Assets/Fungus/Sprite/Scripts/Draggable2D.cs +++ b/Assets/Fungus/Sprite/Scripts/Draggable2D.cs @@ -19,7 +19,7 @@ namespace Fungus { [Tooltip("Is object dragging enabled")] [SerializeField] protected bool dragEnabled = true; - public bool DragEnabled { get { return dragEnabled; } set { dragEnabled = value; } } + public virtual bool DragEnabled { get { return dragEnabled; } set { dragEnabled = value; } } [Tooltip("Move object back to its starting position when drag is cancelled")] [FormerlySerializedAs("returnToStartPos")] diff --git a/Assets/Fungus/Sprite/Scripts/EventHandlers/DragCompleted.cs b/Assets/Fungus/Sprite/Scripts/EventHandlers/DragCompleted.cs index 2c94eeb7..c0bd6a29 100644 --- a/Assets/Fungus/Sprite/Scripts/EventHandlers/DragCompleted.cs +++ b/Assets/Fungus/Sprite/Scripts/EventHandlers/DragCompleted.cs @@ -16,8 +16,7 @@ namespace Fungus { [Tooltip("Draggable object to listen for drag events on")] [SerializeField] protected Draggable2D draggableObject; - - public Draggable2D DraggableObject { get { return draggableObject; } } + public virtual Draggable2D DraggableObject { get { return draggableObject; } } [Tooltip("Drag target object to listen for drag events on")] [SerializeField] protected Collider2D targetObject; diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/ExecuteHandler.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/ExecuteHandler.cs index 638091c3..545f4b6a 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/ExecuteHandler.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/ExecuteHandler.cs @@ -48,27 +48,25 @@ namespace Fungus } [SerializeField] protected float executeAfterTime = 1f; - public float ExecuteAfterTime { get { return executeAfterTime; } set { executeAfterTime = value; } } + public virtual float ExecuteAfterTime { get { return executeAfterTime; } set { executeAfterTime = value; } } [SerializeField] protected bool repeatExecuteTime = true; - public bool RepeatExecuteTime { get { return repeatExecuteTime; } set { repeatExecuteTime = value; } } + public virtual bool RepeatExecuteTime { get { return repeatExecuteTime; } set { repeatExecuteTime = value; } } [SerializeField] protected float repeatEveryTime = 1f; - public float RepeatEveryTime { get { return repeatEveryTime; } set { repeatEveryTime = value; } } + public virtual float RepeatEveryTime { get { return repeatEveryTime; } set { repeatEveryTime = value; } } [SerializeField] protected int executeAfterFrames = 1; - public int ExecuteAfterFrames { get { return executeAfterFrames; } set { executeAfterFrames = value; } } + public virtual int ExecuteAfterFrames { get { return executeAfterFrames; } set { executeAfterFrames = value; } } [SerializeField] protected bool repeatExecuteFrame = true; - public bool RepeatExecuteFrame { get { return repeatExecuteFrame; } set { repeatExecuteFrame = value; } } + public virtual bool RepeatExecuteFrame { get { return repeatExecuteFrame; } set { repeatExecuteFrame = value; } } [SerializeField] protected int repeatEveryFrame = 1; - public int RepeatEveryFrame { get { return repeatEveryFrame; } set { repeatEveryFrame = value; } } - - [SerializeField] protected bool hasFailed; + public virtual int RepeatEveryFrame { get { return repeatEveryFrame; } set { repeatEveryFrame = value; } } [SerializeField] protected ExecuteMethod executeMethods = ExecuteMethod.Start; - public ExecuteMethod ExecuteMethods { get { return executeMethods; } set { executeMethods = value; } } + public virtual ExecuteMethod ExecuteMethods { get { return executeMethods; } set { executeMethods = value; } } [Tooltip("Name of the method on a component in this gameobject to call when executing.")] [SerializeField] protected string executeMethodName = "OnExecute"; diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaBindings.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaBindings.cs index b423420f..7ac82803 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaBindings.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaBindings.cs @@ -61,7 +61,7 @@ namespace Fungus /// [Tooltip("The list of Unity objects to be bound to make them accessible in Lua script.")] [SerializeField] protected List boundObjects = new List(); - public List BoundObjects { get { return boundObjects; } } + public virtual List BoundObjects { get { return boundObjects; } } [Tooltip("Show inherited public members.")] [SerializeField] protected bool showInherited; diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaEnvironment.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaEnvironment.cs index e3778b1b..13af721d 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaEnvironment.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaEnvironment.cs @@ -107,7 +107,7 @@ namespace Fungus /// /// The MoonSharp interpreter instance used to run Lua code. /// - public Script Interpreter { get { return interpreter; } } + public virtual Script Interpreter { get { return interpreter; } } /// /// Launches the remote Lua debugger in your browser and breaks execution at the first executed Lua command. diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaStore.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaStore.cs index 6421689e..21b1f59e 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaStore.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaStore.cs @@ -18,7 +18,7 @@ namespace Fungus /// /// A Lua table that can be shared between multiple LuaEnvironments. /// - public Table PrimeTable { get { return primeTable; } } + public virtual Table PrimeTable { get { return primeTable; } } protected bool initialized; diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaUtils.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaUtils.cs index d1dcca78..a3c20d09 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaUtils.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaUtils.cs @@ -36,7 +36,7 @@ namespace Fungus /// [Tooltip("The currently selected language in the string table. Affects variable substitution.")] [SerializeField] protected string activeLanguage = "en"; - public string ActiveLanguage { get { return activeLanguage; } set { activeLanguage = value; } } + public virtual string ActiveLanguage { get { return activeLanguage; } set { activeLanguage = value; } } /// /// Lua script file which defines the global string table used for localisation. diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/StringSubstituter.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/StringSubstituter.cs index 51154444..0be736bc 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/StringSubstituter.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/StringSubstituter.cs @@ -34,7 +34,7 @@ namespace Fungus /// This property is public to support client code optimisations. /// protected StringBuilder stringBuilder; - public StringBuilder _StringBuilder { get { return stringBuilder; } } + public virtual StringBuilder _StringBuilder { get { return stringBuilder; } } private int recursionDepth; diff --git a/Assets/Fungus/UI/Scripts/Writer.cs b/Assets/Fungus/UI/Scripts/Writer.cs index 9d5d36cd..b166d546 100644 --- a/Assets/Fungus/UI/Scripts/Writer.cs +++ b/Assets/Fungus/UI/Scripts/Writer.cs @@ -70,11 +70,11 @@ 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; } } + public virtual 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; } } + public virtual bool IsWriting { get { return isWriting; } } protected float currentWritingSpeed; protected float currentPunctuationPause; @@ -104,7 +104,7 @@ namespace Fungus protected string hiddenColorOpen = ""; protected string hiddenColorClose = ""; - public string text + public virtual string text { get {