From 0087d8c482d2d7091793c7a572c6a589c60e5e0d Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Wed, 2 Mar 2016 12:53:56 +0000 Subject: [PATCH 01/24] Improved Flowchart UpdateVersion system --- .../Flowchart/Editor/FlowchartMenuItems.cs | 7 ++ Assets/Fungus/Flowchart/Scripts/Flowchart.cs | 65 +++++++++++-------- 2 files changed, 45 insertions(+), 27 deletions(-) diff --git a/Assets/Fungus/Flowchart/Editor/FlowchartMenuItems.cs b/Assets/Fungus/Flowchart/Editor/FlowchartMenuItems.cs index 85ee3fc3..b2fb9452 100644 --- a/Assets/Fungus/Flowchart/Editor/FlowchartMenuItems.cs +++ b/Assets/Fungus/Flowchart/Editor/FlowchartMenuItems.cs @@ -14,6 +14,13 @@ namespace Fungus GameObject go = SpawnPrefab("Flowchart"); go.transform.position = Vector3.zero; + // This is the latest version of Flowchart, so no need to update. + Flowchart flowchart = go.GetComponent(); + if (flowchart != null) + { + flowchart.version = Flowchart.CURRENT_VERSION; + } + // Only the first created Flowchart in the scene should have a default GameStarted block if (GameObject.FindObjectsOfType().Length > 1) { diff --git a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs index a301be4e..c7e0893a 100644 --- a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs +++ b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs @@ -9,6 +9,16 @@ using System.Text.RegularExpressions; namespace Fungus { + /** + * Interface for Flowchart components which can be updated when the + * scene loads in the editor. This is used to maintain backwards + * compatibility with earlier versions of Fungus. + */ + interface IUpdateable + { + void UpdateToVersion(int oldVersion, int newVersion); + } + /** * Visual scripting controller for the Flowchart programming language. * Flowchart objects may be edited visually using the Flowchart editor window. @@ -16,10 +26,10 @@ namespace Fungus [ExecuteInEditMode] public class Flowchart : MonoBehaviour { - /** - * Current version used to compare with the previous version so older versions can be custom-updated from previous versions. - */ - public const string CURRENT_VERSION = "1.0"; + /** + * The current version of the Flowchart. Used for updating components. + */ + public const int CURRENT_VERSION = 1; /** * The name of the initial block in a new flowchart. @@ -27,10 +37,10 @@ namespace Fungus public const string DEFAULT_BLOCK_NAME = "New Block"; /** - * Variable to track flowchart's version and if initial set up has completed. + * Variable to track flowchart's version so components can update to new versions. */ [HideInInspector] - public string version; + public int version = 0; // Default to 0 to always trigger an update for older versions of Fungus. /** * Scroll position of Flowchart editor window. @@ -209,7 +219,28 @@ namespace Fungus CheckItemIds(); CleanupComponents(); - UpdateVersion(); + UpdateVersion(); + } + + protected virtual void UpdateVersion() + { + if (version == CURRENT_VERSION) + { + // No need to update + return; + } + + // Tell all components that implement IUpdateable to update to the new version + foreach (Component component in GetComponents()) + { + IUpdateable u = component as IUpdateable; + if (u != null) + { + u.UpdateToVersion(version, CURRENT_VERSION); + } + } + + version = CURRENT_VERSION; } public virtual void OnDisable() @@ -302,26 +333,6 @@ namespace Fungus } } - private void UpdateVersion() - { - // If versions match, then we are already using the latest. - if (version == CURRENT_VERSION) return; - - switch (version) - { - // Version never set, so we are initializing on first creation or this flowchart is pre-versioning. - case null: - case "": - Initialize(); - break; - } - - version = CURRENT_VERSION; - } - - protected virtual void Initialize() - {} - protected virtual Block CreateBlockComponent(GameObject parent) { Block block = parent.AddComponent(); From 8dfd15686691aa2f3b5b3d9b3aa2bdc54059bc3a Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Wed, 2 Mar 2016 12:54:24 +0000 Subject: [PATCH 02/24] iTweenCommand.targetObject now uses GameObjectData --- .../iTween/Scripts/Commands/LookFrom.cs | 2 +- .../Fungus/iTween/Scripts/Commands/LookTo.cs | 2 +- .../Fungus/iTween/Scripts/Commands/MoveAdd.cs | 2 +- .../iTween/Scripts/Commands/MoveFrom.cs | 2 +- .../Fungus/iTween/Scripts/Commands/MoveTo.cs | 2 +- .../iTween/Scripts/Commands/PunchPosition.cs | 2 +- .../iTween/Scripts/Commands/PunchRotation.cs | 2 +- .../iTween/Scripts/Commands/PunchScale.cs | 2 +- .../iTween/Scripts/Commands/RotateAdd.cs | 2 +- .../iTween/Scripts/Commands/RotateFrom.cs | 2 +- .../iTween/Scripts/Commands/RotateTo.cs | 2 +- .../iTween/Scripts/Commands/ScaleAdd.cs | 2 +- .../iTween/Scripts/Commands/ScaleFrom.cs | 2 +- .../Fungus/iTween/Scripts/Commands/ScaleTo.cs | 2 +- .../iTween/Scripts/Commands/ShakePosition.cs | 2 +- .../iTween/Scripts/Commands/ShakeRotation.cs | 2 +- .../iTween/Scripts/Commands/ShakeScale.cs | 2 +- .../iTween/Scripts/Commands/iTweenCommand.cs | 32 +++++++++++++++---- 18 files changed, 43 insertions(+), 23 deletions(-) diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs index cee06f50..05085917 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs @@ -48,7 +48,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.LookFrom(targetObject, tweenParams); + iTween.LookFrom(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs index d1a4fae4..2bc995d5 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs @@ -48,7 +48,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.LookTo(targetObject, tweenParams); + iTween.LookTo(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs index 6d9d5b21..6c6764c4 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs @@ -27,7 +27,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.MoveAdd(targetObject, tweenParams); + iTween.MoveAdd(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs index fadb1476..8a2aa4f2 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs @@ -37,7 +37,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.MoveFrom(targetObject, tweenParams); + iTween.MoveFrom(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs index f427c9ef..ed204e59 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs @@ -37,7 +37,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.MoveTo(targetObject, tweenParams); + iTween.MoveTo(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs index 87149a9e..c52b2f14 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs @@ -27,7 +27,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.PunchPosition(targetObject, tweenParams); + iTween.PunchPosition(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs index 89ad7991..d5a2c044 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs @@ -27,7 +27,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.PunchRotation(targetObject, tweenParams); + iTween.PunchRotation(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs index e9991768..e37ddc82 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs @@ -23,7 +23,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.PunchScale(targetObject, tweenParams); + iTween.PunchScale(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs index 7cad1509..a1e2477d 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs @@ -27,7 +27,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.RotateAdd(targetObject, tweenParams); + iTween.RotateAdd(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs index 2c33c441..bb7a219e 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs @@ -37,7 +37,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.RotateFrom(targetObject, tweenParams); + iTween.RotateFrom(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs index 5f10f21d..4e2950e1 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs @@ -37,7 +37,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.RotateTo(targetObject, tweenParams); + iTween.RotateTo(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs index 2aca66aa..772239b7 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs @@ -23,7 +23,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.ScaleAdd(targetObject, tweenParams); + iTween.ScaleAdd(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs index d680d58c..1bc4eadb 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs @@ -33,7 +33,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.ScaleFrom(targetObject, tweenParams); + iTween.ScaleFrom(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs index af81d1e5..66978992 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs @@ -33,7 +33,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.ScaleTo(targetObject, tweenParams); + iTween.ScaleTo(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs index 8da68a2a..e615e957 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs @@ -42,7 +42,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.ShakePosition(targetObject, tweenParams); + iTween.ShakePosition(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs index 8950d64e..679a942a 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs @@ -27,7 +27,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.ShakeRotation(targetObject, tweenParams); + iTween.ShakeRotation(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs index d26ad140..ff0d1b46 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs @@ -23,7 +23,7 @@ namespace Fungus tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.ShakeScale(targetObject, tweenParams); + iTween.ShakeScale(_targetObject.Value, tweenParams); } } diff --git a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs index 25d715f2..04a11a9a 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs @@ -4,6 +4,7 @@ using UnityEngine.Serialization; namespace Fungus { + public enum iTweenAxis { None, @@ -12,12 +13,16 @@ namespace Fungus Z } - public abstract class iTweenCommand : Command + public abstract class iTweenCommand : Command, IUpdateable { - [Tooltip("Target game object to apply the Tween to")] + // Obsolete: Use _targetObject instead. + [HideInInspector] [FormerlySerializedAs("target")] public GameObject targetObject; + [Tooltip("Target game object to apply the Tween to")] + public GameObjectData _targetObject; + [Tooltip("An individual name useful for stopping iTweens by name")] public string tweenName; @@ -38,7 +43,7 @@ namespace Fungus public override void OnEnter() { - if (targetObject == null) + if (_targetObject.Value == null) { Continue(); return; @@ -47,7 +52,7 @@ namespace Fungus if (stopPreviousTweens) { // Force any existing iTweens on this target object to complete immediately - iTween[] tweens = targetObject.GetComponents(); + iTween[] tweens = _targetObject.Value.GetComponents(); foreach (iTween tween in tweens) { tween.time = 0; tween.SendMessage("Update"); @@ -79,18 +84,33 @@ namespace Fungus public override string GetSummary() { - if (targetObject == null) + if (_targetObject.Value == null) { return "Error: No target object selected"; } - return targetObject.name + " over " + duration + " seconds"; + return _targetObject.Value.name + " over " + duration + " seconds"; } public override Color GetButtonColor() { return new Color32(233, 163, 180, 255); } + + // + // IUpdateable implementation + // + + public virtual void UpdateToVersion(int oldVersion, int newVersion) + { + if (oldVersion == 0 && + targetObject != null) + { + _targetObject.gameObjectVal = targetObject; + _targetObject.gameObjectRef = null; + targetObject = null; + } + } } } \ No newline at end of file From ee2d85a18f01784e2c3f38137fdeeaabbe7a5053 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sun, 13 Mar 2016 18:06:59 +0000 Subject: [PATCH 03/24] Anim commands use variable datas --- .../Scripts/Commands/ResetAnimTrigger.cs | 42 ++++++++++++--- .../Animation/Scripts/Commands/SetAnimBool.cs | 42 ++++++++++++--- .../Scripts/Commands/SetAnimFloat.cs | 42 ++++++++++++--- .../Scripts/Commands/SetAnimInteger.cs | 42 ++++++++++++--- .../Scripts/Commands/SetAnimTrigger.cs | 42 ++++++++++++--- .../Fungus/Flowchart/Editor/VariableEditor.cs | 6 ++- .../Scripts/VariableTypes/AnimatorVariable.cs | 51 +++++++++++++++++++ .../VariableTypes/AnimatorVariable.cs.meta | 12 +++++ 8 files changed, 243 insertions(+), 36 deletions(-) create mode 100644 Assets/Fungus/Flowchart/Scripts/VariableTypes/AnimatorVariable.cs create mode 100644 Assets/Fungus/Flowchart/Scripts/VariableTypes/AnimatorVariable.cs.meta diff --git a/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs b/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs index a778d909..1976b7a7 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System; using System.Collections; @@ -8,19 +9,24 @@ namespace Fungus "Reset Anim Trigger", "Resets a trigger parameter on an Animator component.")] [AddComponentMenu("")] - public class ResetAnimTrigger : Command + public class ResetAnimTrigger : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; + #endregion + [Tooltip("Reference to an Animator component in a game object")] - public Animator animator; + public AnimatorData _animator; [Tooltip("Name of the trigger Animator parameter that will be reset")] - public string parameterName; + public StringData _parameterName; public override void OnEnter() { - if (animator != null) + if (_animator.Value != null) { - animator.ResetTrigger(parameterName); + _animator.Value.ResetTrigger(_parameterName); } Continue(); @@ -28,18 +34,40 @@ namespace Fungus public override string GetSummary() { - if (animator == null) + if (_animator.Value == null) { return "Error: No animator selected"; } - return animator.name + " (" + parameterName + ")"; + return _animator.Value.name + " (" + _parameterName + ")"; } public override Color GetButtonColor() { return new Color32(170, 204, 169, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != null) + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = null; + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs index 1e60682b..bd91c85a 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System; using System.Collections; @@ -8,22 +9,27 @@ namespace Fungus "Set Anim Bool", "Sets a boolean parameter on an Animator component to control a Unity animation")] [AddComponentMenu("")] - public class SetAnimBool : Command + public class SetAnimBool : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; + #endregion + [Tooltip("Reference to an Animator component in a game object")] - public Animator animator; + public AnimatorData _animator; [Tooltip("Name of the boolean Animator parameter that will have its value changed")] - public string parameterName; + public StringData _parameterName; [Tooltip("The boolean value to set the parameter to")] public BooleanData value; public override void OnEnter() { - if (animator != null) + if (_animator.Value != null) { - animator.SetBool(parameterName, value.Value); + _animator.Value.SetBool(_parameterName, value.Value); } Continue(); @@ -31,18 +37,40 @@ namespace Fungus public override string GetSummary() { - if (animator == null) + if (_animator.Value == null) { return "Error: No animator selected"; } - return animator.name + " (" + parameterName + ")"; + return _animator.Value.name + " (" + _parameterName + ")"; } public override Color GetButtonColor() { return new Color32(170, 204, 169, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != null) + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = null; + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs index 86473f17..c0cf9fe8 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System; using System.Collections; @@ -8,22 +9,27 @@ namespace Fungus "Set Anim Float", "Sets a float parameter on an Animator component to control a Unity animation")] [AddComponentMenu("")] - public class SetAnimFloat : Command + public class SetAnimFloat : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; + #endregion + [Tooltip("Reference to an Animator component in a game object")] - public Animator animator; + public AnimatorData _animator; [Tooltip("Name of the float Animator parameter that will have its value changed")] - public string parameterName; + public StringData _parameterName; [Tooltip("The float value to set the parameter to")] public FloatData value; public override void OnEnter() { - if (animator != null) + if (_animator.Value != null) { - animator.SetFloat(parameterName, value.Value); + _animator.Value.SetFloat(_parameterName.Value, value.Value); } Continue(); @@ -31,18 +37,40 @@ namespace Fungus public override string GetSummary() { - if (animator == null) + if (_animator.Value == null) { return "Error: No animator selected"; } - return animator.name + " (" + parameterName + ")"; + return _animator.Value.name + " (" + _parameterName.Value + ")"; } public override Color GetButtonColor() { return new Color32(170, 204, 169, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != null) + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = null; + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs index 1b1f6292..307a8374 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System; using System.Collections; @@ -8,22 +9,27 @@ namespace Fungus "Set Anim Integer", "Sets an integer parameter on an Animator component to control a Unity animation")] [AddComponentMenu("")] - public class SetAnimInteger : Command + public class SetAnimInteger : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; + #endregion + [Tooltip("Reference to an Animator component in a game object")] - public Animator animator; + public AnimatorData _animator; [Tooltip("Name of the integer Animator parameter that will have its value changed")] - public string parameterName; + public StringData _parameterName; [Tooltip("The integer value to set the parameter to")] public IntegerData value; public override void OnEnter() { - if (animator != null) + if (_animator.Value != null) { - animator.SetInteger(parameterName, value.Value); + _animator.Value.SetInteger(_parameterName.Value, value.Value); } Continue(); @@ -31,18 +37,40 @@ namespace Fungus public override string GetSummary() { - if (animator == null) + if (_animator.Value == null) { return "Error: No animator selected"; } - return animator.name + " (" + parameterName + ")"; + return _animator.Value.name + " (" + _parameterName.Value + ")"; } public override Color GetButtonColor() { return new Color32(170, 204, 169, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != null) + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = null; + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs index 52555254..e2a73909 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System; using System.Collections; @@ -8,19 +9,24 @@ namespace Fungus "Set Anim Trigger", "Sets a trigger parameter on an Animator component to control a Unity animation")] [AddComponentMenu("")] - public class SetAnimTrigger : Command + public class SetAnimTrigger : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; + #endregion + [Tooltip("Reference to an Animator component in a game object")] - public Animator animator; + public AnimatorData _animator; [Tooltip("Name of the trigger Animator parameter that will have its value changed")] - public string parameterName; + public StringData _parameterName; public override void OnEnter() { - if (animator != null) + if (_animator.Value != null) { - animator.SetTrigger(parameterName); + _animator.Value.SetTrigger(_parameterName.Value); } Continue(); @@ -28,18 +34,40 @@ namespace Fungus public override string GetSummary() { - if (animator == null) + if (_animator.Value == null) { return "Error: No animator selected"; } - return animator.name + " (" + parameterName + ")"; + return _animator.Value.name + " (" + _parameterName.Value + ")"; } public override Color GetButtonColor() { return new Color32(170, 204, 169, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != null) + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = null; + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Editor/VariableEditor.cs b/Assets/Fungus/Flowchart/Editor/VariableEditor.cs index bf10888b..c0f324f0 100644 --- a/Assets/Fungus/Flowchart/Editor/VariableEditor.cs +++ b/Assets/Fungus/Flowchart/Editor/VariableEditor.cs @@ -209,7 +209,7 @@ namespace Fungus protected virtual void DrawSingleLineProperty(Rect rect, GUIContent label, SerializedProperty referenceProp, SerializedProperty valueProp, Flowchart flowchart) { - const int popupWidth = 100; + const int popupWidth = 60; Rect controlRect = EditorGUI.PrefixLabel(rect, label); Rect valueRect = controlRect; @@ -319,4 +319,8 @@ namespace Fungus [CustomPropertyDrawer (typeof(ObjectData))] public class ObjectDataDrawer : VariableDataDrawer {} + + [CustomPropertyDrawer (typeof(AnimatorData))] + public class AnimatorDataDrawer : VariableDataDrawer + {} } \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/VariableTypes/AnimatorVariable.cs b/Assets/Fungus/Flowchart/Scripts/VariableTypes/AnimatorVariable.cs new file mode 100644 index 00000000..b233d5b7 --- /dev/null +++ b/Assets/Fungus/Flowchart/Scripts/VariableTypes/AnimatorVariable.cs @@ -0,0 +1,51 @@ +using UnityEngine; +using System.Collections; + +namespace Fungus +{ + [VariableInfo("Other", "Animator")] + [AddComponentMenu("")] + public class AnimatorVariable : VariableBase + {} + + [System.Serializable] + public struct AnimatorData + { + [SerializeField] + [VariableProperty("", typeof(AnimatorVariable))] + public AnimatorVariable animatorRef; + + [SerializeField] + public Animator animatorVal; + + public AnimatorData(Animator v) + { + animatorVal = v; + animatorRef = null; + } + + public static implicit operator Animator(AnimatorData animatorData) + { + return animatorData.Value; + } + + public Animator Value + { + get { return (animatorRef == null) ? animatorVal : animatorRef.value; } + set { if (animatorRef == null) { animatorVal = value; } else { animatorRef.value = value; } } + } + + public string GetDescription() + { + if (animatorRef == null) + { + return animatorVal.ToString(); + } + else + { + return animatorRef.key; + } + } + } + +} \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/VariableTypes/AnimatorVariable.cs.meta b/Assets/Fungus/Flowchart/Scripts/VariableTypes/AnimatorVariable.cs.meta new file mode 100644 index 00000000..c507f7e9 --- /dev/null +++ b/Assets/Fungus/Flowchart/Scripts/VariableTypes/AnimatorVariable.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8cbd0c93fbe0e46f78685c33d82bcc7b +timeCreated: 1457886300 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 1f510f37af64d3537feac7232b9aed9abd14098a Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sun, 13 Mar 2016 18:21:20 +0000 Subject: [PATCH 04/24] iTween target object --- .../iTween/Scripts/Commands/LookFrom.cs | 2 +- .../Fungus/iTween/Scripts/Commands/LookTo.cs | 2 +- .../Fungus/iTween/Scripts/Commands/MoveAdd.cs | 2 +- .../iTween/Scripts/Commands/MoveFrom.cs | 2 +- .../Fungus/iTween/Scripts/Commands/MoveTo.cs | 2 +- .../iTween/Scripts/Commands/PunchPosition.cs | 2 +- .../iTween/Scripts/Commands/PunchRotation.cs | 2 +- .../iTween/Scripts/Commands/PunchScale.cs | 2 +- .../iTween/Scripts/Commands/RotateAdd.cs | 2 +- .../iTween/Scripts/Commands/RotateFrom.cs | 2 +- .../iTween/Scripts/Commands/RotateTo.cs | 2 +- .../iTween/Scripts/Commands/ScaleAdd.cs | 2 +- .../iTween/Scripts/Commands/ScaleFrom.cs | 2 +- .../Fungus/iTween/Scripts/Commands/ScaleTo.cs | 2 +- .../iTween/Scripts/Commands/ShakePosition.cs | 2 +- .../iTween/Scripts/Commands/ShakeRotation.cs | 2 +- .../iTween/Scripts/Commands/ShakeScale.cs | 2 +- .../iTween/Scripts/Commands/iTweenCommand.cs | 29 +- Assets/FungusExamples/iTween/iTween.unity | 533 ++++++++++++------ 19 files changed, 398 insertions(+), 198 deletions(-) diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs index 05085917..02378b59 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs @@ -21,7 +21,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); if (fromTransform == null) { tweenParams.Add("looktarget", fromPosition); diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs index 2bc995d5..a94ff629 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs @@ -21,7 +21,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); if (toTransform == null) { tweenParams.Add("looktarget", toPosition); diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs index 6c6764c4..5555db41 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs @@ -18,7 +18,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", offset); tweenParams.Add("space", space); tweenParams.Add("time", duration); diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs index 8a2aa4f2..c8383e51 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs @@ -21,7 +21,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); if (fromTransform == null) { tweenParams.Add("position", fromPosition); diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs index ed204e59..854f2473 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs @@ -21,7 +21,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); if (toTransform == null) { tweenParams.Add("position", toPosition); diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs index c52b2f14..42314d76 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs @@ -18,7 +18,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", amount); tweenParams.Add("space", space); tweenParams.Add("time", duration); diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs index d5a2c044..faa82159 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs @@ -18,7 +18,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", amount); tweenParams.Add("space", space); tweenParams.Add("time", duration); diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs index e37ddc82..365dbf98 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs @@ -15,7 +15,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", amount); tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs index a1e2477d..362fd8de 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs @@ -18,7 +18,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", offset); tweenParams.Add("space", space); tweenParams.Add("time", duration); diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs index bb7a219e..8004f018 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs @@ -21,7 +21,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); if (fromTransform == null) { tweenParams.Add("rotation", fromRotation); diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs index 4e2950e1..2853d289 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs @@ -21,7 +21,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); if (toTransform == null) { tweenParams.Add("rotation", toRotation); diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs index 772239b7..9be89ac9 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs @@ -15,7 +15,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", offset); tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs index 1bc4eadb..54741150 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs @@ -18,7 +18,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); if (fromTransform == null) { tweenParams.Add("scale", fromScale); diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs index 66978992..21b6f183 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs @@ -18,7 +18,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); if (toTransform == null) { tweenParams.Add("scale", toScale); diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs index e615e957..ab2ebdad 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs @@ -21,7 +21,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", amount); switch (axis) { diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs index 679a942a..466c90df 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs @@ -18,7 +18,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", amount); tweenParams.Add("space", space); tweenParams.Add("time", duration); diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs index ff0d1b46..8cd2f53f 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs @@ -15,7 +15,7 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); + tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", amount); tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); diff --git a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs index 04a11a9a..bf77eee7 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs @@ -1,6 +1,6 @@ using UnityEngine; -using System.Collections; using UnityEngine.Serialization; +using System.Collections; namespace Fungus { @@ -13,18 +13,18 @@ namespace Fungus Z } - public abstract class iTweenCommand : Command, IUpdateable + public abstract class iTweenCommand : Command, ISerializationCallbackReceiver { - // Obsolete: Use _targetObject instead. - [HideInInspector] - [FormerlySerializedAs("target")] - public GameObject targetObject; + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("target")] [FormerlySerializedAs("targetObject")] public GameObject targetObjectOLD; + [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD; + #endregion [Tooltip("Target game object to apply the Tween to")] public GameObjectData _targetObject; [Tooltip("An individual name useful for stopping iTweens by name")] - public string tweenName; + public StringData _tweenName; [Tooltip("The time in seconds the animation will take to complete")] public float duration = 1f; @@ -98,17 +98,18 @@ namespace Fungus } // - // IUpdateable implementation + // ISerializationCallbackReceiver implementation // - public virtual void UpdateToVersion(int oldVersion, int newVersion) + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() { - if (oldVersion == 0 && - targetObject != null) + if (targetObjectOLD != null) { - _targetObject.gameObjectVal = targetObject; - _targetObject.gameObjectRef = null; - targetObject = null; + _targetObject.Value = targetObjectOLD; + targetObjectOLD = null; } } } diff --git a/Assets/FungusExamples/iTween/iTween.unity b/Assets/FungusExamples/iTween/iTween.unity index bb0184d4..00e74a7b 100644 --- a/Assets/FungusExamples/iTween/iTween.unity +++ b/Assets/FungusExamples/iTween/iTween.unity @@ -8,25 +8,25 @@ SceneSettings: m_PVSPortalsArray: [] m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 serializedVersion: 6 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 m_SkyboxMaterial: {fileID: 0} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,13 +37,10 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} ---- !u!127 &3 -LevelGameManager: - m_ObjectHideFlags: 0 --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 6 m_GIWorkflowMode: 1 m_LightmapsMode: 1 m_GISettings: @@ -68,7 +65,8 @@ LightmapSettings: m_TextureCompression: 0 m_FinalGather: 0 m_FinalGatherRayCount: 1024 - m_LightmapSnapshot: {fileID: 0} + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} m_RuntimeCPUUsage: 25 --- !u!196 &5 NavMeshSettings: @@ -76,15 +74,15 @@ NavMeshSettings: m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 + cellSize: 0.16666666 manualCellSize: 0 m_NavMeshData: {fileID: 0} --- !u!1 &131346341 @@ -136,14 +134,14 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 - m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 60 orthographic: 1 @@ -155,10 +153,12 @@ Camera: m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 + m_TargetEye: 3 m_HDR: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 --- !u!4 &131346346 Transform: m_ObjectHideFlags: 0 @@ -202,14 +202,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 598f181ee459641a9b0a5849fbc3240c, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 0 + itemId: 0 errorMessage: indentLevel: 0 - targetObject: {fileID: 470391086} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 470391086} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 3 easeType: 2 loopType: 2 + stopPreviousTweens: 0 waitUntilFinished: 1 offset: {x: 7, y: 0, z: 0} space: 1 @@ -224,7 +231,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2d7d417659cd54a6787f70f763950c34, type: 3} m_Name: m_EditorClassIdentifier: - parentSequence: {fileID: 470391089} + parentBlock: {fileID: 470391089} message: StartMoving --- !u!114 &470391089 MonoBehaviour: @@ -243,9 +250,9 @@ MonoBehaviour: y: 122 width: 120 height: 30 - sequenceName: Do Tween + itemId: 1 + blockName: Do Tween description: - runSlowInEditor: 1 eventHandler: {fileID: 470391088} commandList: - {fileID: 470391087} @@ -260,10 +267,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Name: m_EditorClassIdentifier: + version: 1 scrollPos: {x: 0, y: 0} variablesScrollPos: {x: 0, y: 0} variablesExpanded: 1 - sequenceViewHeight: 400 + blockViewHeight: 400 zoom: 1 scrollViewRect: serializedVersion: 2 @@ -271,16 +279,17 @@ MonoBehaviour: y: -350 width: 1213 height: 902 - selectedSequence: {fileID: 470391089} + selectedBlock: {fileID: 470391089} selectedCommands: - {fileID: 470391087} variables: [] description: - runSlowDuration: .25 + stepPause: 0 colorCommands: 1 hideComponents: 1 saveSelection: 1 - nextCommandId: 1 + localizationId: + hideCommands: [] --- !u!212 &470391091 SpriteRenderer: m_ObjectHideFlags: 0 @@ -299,14 +308,18 @@ SpriteRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingOrder: 0 m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 --- !u!4 &470391092 Transform: m_ObjectHideFlags: 0 @@ -314,12 +327,12 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 470391086} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -3.61409998, y: -1.94229996, z: 0} - m_LocalScale: {x: .456456065, y: .456456065, z: .456456065} + m_LocalPosition: {x: -3.6141, y: -1.9423, z: 0} + m_LocalScale: {x: 0.45645607, y: 0.45645607, z: 0.45645607} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 ---- !u!114 &497781872 + m_RootOrder: 7 +--- !u!114 &497781872 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11400000, guid: e0d427add844a4d9faf970a3afa07583, type: 2} @@ -357,10 +370,7 @@ GameObject: - 114: {fileID: 868139013} - 114: {fileID: 868139014} - 114: {fileID: 868139016} - - 114: {fileID: 868139015} - 114: {fileID: 868139017} - - 114: {fileID: 868139021} - - 114: {fileID: 868139019} m_Layer: 0 m_Name: Flowchart m_TagString: Untagged @@ -379,14 +389,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 445c07472dafe4e0ead0e88c4b757401, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 0 + itemId: 0 errorMessage: indentLevel: 0 - targetObject: {fileID: 1090256565} - tweenName: MoveIt + targetObjectOLD: {fileID: 0} + tweenNameOLD: MoveIt + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1090256565} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 0 toTransform: {fileID: 1621124270} toPosition: {x: 0, y: 0, z: 0} @@ -408,9 +425,9 @@ MonoBehaviour: y: 193 width: 120 height: 40 - sequenceName: Test iTween + itemId: 23 + blockName: Test iTween description: - runSlowInEditor: 1 eventHandler: {fileID: 868139016} commandList: - {fileID: 868138995} @@ -446,10 +463,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Name: m_EditorClassIdentifier: + version: 1 scrollPos: {x: 133, y: -117} variablesScrollPos: {x: 0, y: 0} variablesExpanded: 1 - sequenceViewHeight: 400 + blockViewHeight: 400 zoom: 1 scrollViewRect: serializedVersion: 2 @@ -457,17 +475,19 @@ MonoBehaviour: y: -350 width: 1213 height: 1284 - selectedSequence: {fileID: 868138992} - selectedCommands: [] + selectedBlock: {fileID: 868138992} + selectedCommands: + - {fileID: 868139009} variables: [] description: 'This scene shows how to use the iTween commands to apply simple animation effects to objects' - runSlowDuration: .25 + stepPause: 0 colorCommands: 1 hideComponents: 1 saveSelection: 1 - nextCommandId: 23 + localizationId: + hideCommands: [] --- !u!4 &868138994 Transform: m_ObjectHideFlags: 0 @@ -479,7 +499,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 2 --- !u!114 &868138995 MonoBehaviour: m_ObjectHideFlags: 2 @@ -491,14 +511,16 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 437f9a4e3dbc647f9bdce95308418bff, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 1 + itemId: 1 errorMessage: indentLevel: 0 duration: 1 + fadeOut: 1 targetView: {fileID: 497781872} waitUntilFinished: 1 fadeColor: {r: 0, g: 0, b: 0, a: 1} fadeTexture: {fileID: 0} + targetCamera: {fileID: 0} --- !u!114 &868138996 MonoBehaviour: m_ObjectHideFlags: 2 @@ -510,14 +532,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 445c07472dafe4e0ead0e88c4b757401, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 2 + itemId: 2 errorMessage: indentLevel: 0 - targetObject: {fileID: 1621124268} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1621124268} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 toTransform: {fileID: 1090256567} toPosition: {x: 0, y: 0, z: 0} @@ -533,16 +562,23 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ea4591c01defd496586e9b7237c966c5, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 4 + itemId: 4 errorMessage: indentLevel: 0 - targetObject: {fileID: 1621124268} - tweenName: - duration: .5 + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1621124268} + _tweenName: + stringRef: {fileID: 0} + stringVal: + duration: 0.5 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 0 - amount: {x: .200000003, y: .200000003, z: 0} + amount: {x: 0.2, y: 0.2, z: 0} --- !u!114 &868138998 MonoBehaviour: m_ObjectHideFlags: 2 @@ -554,16 +590,23 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 720f059c883c4402c89fcc507d5f7e0d, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 3 + itemId: 3 errorMessage: indentLevel: 0 - targetObject: {fileID: 1090256565} - tweenName: - duration: .5 + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1090256565} + _tweenName: + stringRef: {fileID: 0} + stringVal: + duration: 0.5 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 0 - amount: {x: .5, y: .5, z: 0} + amount: {x: 0.5, y: 0.5, z: 0} space: 1 --- !u!114 &868138999 MonoBehaviour: @@ -576,14 +619,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d2dd111db90064d2cb85e3370cdfe3ac, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 6 + itemId: 6 errorMessage: indentLevel: 0 - targetObject: {fileID: 1621124268} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1621124268} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 toTransform: {fileID: 1090256567} toRotation: {x: 0, y: 0, z: 0} @@ -599,14 +649,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d2dd111db90064d2cb85e3370cdfe3ac, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 5 + itemId: 5 errorMessage: indentLevel: 0 - targetObject: {fileID: 1090256565} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1090256565} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 toTransform: {fileID: 0} toRotation: {x: 0, y: 0, z: 45} @@ -622,17 +679,24 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 665e8847cab3749f597622c6c52997ad, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 8 + itemId: 8 errorMessage: indentLevel: 0 - targetObject: {fileID: 1621124268} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1621124268} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 toTransform: {fileID: 1090256567} - toScale: {x: .5, y: .5, z: 0} + toScale: {x: 0.5, y: 0.5, z: 0} --- !u!114 &868139002 MonoBehaviour: m_ObjectHideFlags: 2 @@ -644,17 +708,24 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 665e8847cab3749f597622c6c52997ad, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 7 + itemId: 7 errorMessage: indentLevel: 0 - targetObject: {fileID: 1090256565} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1090256565} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 toTransform: {fileID: 0} - toScale: {x: .5, y: .5, z: 0} + toScale: {x: 0.5, y: 0.5, z: 0} --- !u!114 &868139003 MonoBehaviour: m_ObjectHideFlags: 2 @@ -666,14 +737,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 0d47cc719ae0d4d62a30b3cfa72b5785, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 11 + itemId: 11 errorMessage: indentLevel: 0 - targetObject: {fileID: 1955612099} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1955612099} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 fromTransform: {fileID: 0} fromScale: {x: 2, y: 1, z: 0} @@ -688,14 +766,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6cfc8560cbecd48adb3950b9dd7f2b82, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 10 + itemId: 10 errorMessage: indentLevel: 0 - targetObject: {fileID: 1621124268} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1621124268} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 fromTransform: {fileID: 0} fromRotation: {x: 0, y: 0, z: 180} @@ -711,14 +796,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d5ca001b90bd14834b7268b48a44c6de, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 9 + itemId: 9 errorMessage: indentLevel: 0 - targetObject: {fileID: 1090256565} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1090256565} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 fromTransform: {fileID: 0} fromPosition: {x: 0, y: 1, z: 0} @@ -734,14 +826,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 433657382cf894ff2973ee118eed40ea, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 13 + itemId: 13 errorMessage: indentLevel: 0 - targetObject: {fileID: 1621124268} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1621124268} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 fromTransform: {fileID: 1090256567} fromPosition: {x: 0, y: 0, z: 0} @@ -757,14 +856,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3ec82c445301b4e9fb9b89cb2eb6a666, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 12 + itemId: 12 errorMessage: indentLevel: 0 - targetObject: {fileID: 1090256565} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1090256565} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 toTransform: {fileID: 1955612100} toPosition: {x: 0, y: 0, z: 0} @@ -780,14 +886,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 358f65040c3ef4327b70b2813cc197c7, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 14 + itemId: 14 errorMessage: indentLevel: 0 - targetObject: {fileID: 1090256565} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1090256565} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 amount: {x: 1, y: 1, z: 0} isLocal: 0 @@ -803,14 +916,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 82c753a90aa184bd88472f4589167f0b, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 15 + itemId: 15 errorMessage: indentLevel: 0 - targetObject: {fileID: 1621124268} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1621124268} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 amount: {x: 0, y: 0, z: 45} space: 1 @@ -825,16 +945,23 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: e61780d2ea956492a8f59308dae6f12c, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 16 + itemId: 16 errorMessage: indentLevel: 0 - targetObject: {fileID: 1955612099} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1955612099} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 - amount: {x: .5, y: .5, z: 0} + amount: {x: 0.5, y: 0.5, z: 0} --- !u!114 &868139011 MonoBehaviour: m_ObjectHideFlags: 2 @@ -846,14 +973,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 720f059c883c4402c89fcc507d5f7e0d, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 17 + itemId: 17 errorMessage: indentLevel: 0 - targetObject: {fileID: 1090256565} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1090256565} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 amount: {x: 0, y: 1, z: 0} space: 1 @@ -868,14 +1002,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ea1bc1400ac79424ba3c1aca77fb5d42, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 18 + itemId: 18 errorMessage: indentLevel: 0 - targetObject: {fileID: 1621124268} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1621124268} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 amount: {x: 0, y: 0, z: 45} space: 1 @@ -890,14 +1031,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ea4591c01defd496586e9b7237c966c5, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 19 + itemId: 19 errorMessage: indentLevel: 0 - targetObject: {fileID: 1955612099} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1955612099} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 amount: {x: 1, y: 1, z: 0} --- !u!114 &868139014 @@ -911,34 +1059,25 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 433657382cf894ff2973ee118eed40ea, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 20 + itemId: 20 errorMessage: indentLevel: 0 - targetObject: {fileID: 1955612099} - tweenName: + targetObjectOLD: {fileID: 0} + tweenNameOLD: + _targetObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1955612099} + _tweenName: + stringRef: {fileID: 0} + stringVal: duration: 1 easeType: 2 loopType: 0 + stopPreviousTweens: 0 waitUntilFinished: 1 fromTransform: {fileID: 1090256567} fromPosition: {x: 0, y: 0, z: 0} axis: 3 ---- !u!114 &868139015 -MonoBehaviour: - m_ObjectHideFlags: 2 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 868138990} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c43743931d28f43f89eced820d907351, type: 3} - m_Name: - m_EditorClassIdentifier: - commandId: 21 - errorMessage: - indentLevel: 0 - messageTarget: 0 - message: --- !u!114 &868139016 MonoBehaviour: m_ObjectHideFlags: 2 @@ -950,7 +1089,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3} m_Name: m_EditorClassIdentifier: - parentSequence: {fileID: 868138992} + parentBlock: {fileID: 868138992} --- !u!114 &868139017 MonoBehaviour: m_ObjectHideFlags: 2 @@ -962,37 +1101,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c43743931d28f43f89eced820d907351, type: 3} m_Name: m_EditorClassIdentifier: - commandId: 22 + itemId: 22 errorMessage: indentLevel: 0 messageTarget: 1 message: StartMoving ---- !u!114 &868139019 -MonoBehaviour: - m_ObjectHideFlags: 2 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 868138990} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2d7d417659cd54a6787f70f763950c34, type: 3} - m_Name: - m_EditorClassIdentifier: - parentSequence: {fileID: 0} - message: StartMoving ---- !u!114 &868139021 -MonoBehaviour: - m_ObjectHideFlags: 2 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 868138990} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2d7d417659cd54a6787f70f763950c34, type: 3} - m_Name: - m_EditorClassIdentifier: - parentSequence: {fileID: 0} - message: --- !u!1 &1090256565 GameObject: m_ObjectHideFlags: 0 @@ -1027,14 +1140,18 @@ SpriteRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingOrder: 0 m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 --- !u!4 &1090256567 Transform: m_ObjectHideFlags: 0 @@ -1042,11 +1159,11 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1090256565} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -2.02740002, y: -.0844760016, z: 0} + m_LocalPosition: {x: -2.0274, y: -0.084476, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 3 --- !u!1001 &1288462056 Prefab: m_ObjectHideFlags: 0 @@ -1127,14 +1244,18 @@ SpriteRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingOrder: 0 m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 --- !u!4 &1621124270 Transform: m_ObjectHideFlags: 0 @@ -1142,11 +1263,85 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1621124268} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2.15409994, y: -.0422369987, z: 0} + m_LocalPosition: {x: 2.1541, y: -0.042237, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 4 +--- !u!1 &1749438602 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1749438606} + - 114: {fileID: 1749438605} + - 114: {fileID: 1749438604} + - 114: {fileID: 1749438603} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1749438603 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1749438602} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ForceModuleActive: 0 +--- !u!114 &1749438604 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1749438602} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &1749438605 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1749438602} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 5 +--- !u!4 &1749438606 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1749438602} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 --- !u!1 &1955612099 GameObject: m_ObjectHideFlags: 0 @@ -1170,11 +1365,11 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1955612099} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -.119999997, y: 2.32999992, z: 0} - m_LocalScale: {x: .456456065, y: .456456065, z: .456456065} + m_LocalPosition: {x: -0.12, y: 2.33, z: 0} + m_LocalScale: {x: 0.45645607, y: 0.45645607, z: 0.45645607} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 5 --- !u!212 &1955612101 SpriteRenderer: m_ObjectHideFlags: 0 @@ -1193,14 +1388,18 @@ SpriteRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingOrder: 0 m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 --- !u!1 &1971204863 GameObject: m_ObjectHideFlags: 1 @@ -1240,4 +1439,4 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 + m_RootOrder: 1 From 9788021f2c31e35cd039de01e0a0a83af10a136f Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sun, 13 Mar 2016 19:28:48 +0000 Subject: [PATCH 05/24] iTween properties accept variables --- .../Fungus/Flowchart/Editor/VariableEditor.cs | 4 ++ .../VariableTypes/TransformVariable.cs | 51 +++++++++++++++++++ .../VariableTypes/TransformVariable.cs.meta | 12 +++++ .../iTween/Scripts/Commands/LookFrom.cs | 42 ++++++++++++--- .../Fungus/iTween/Scripts/Commands/LookTo.cs | 42 ++++++++++++--- .../Fungus/iTween/Scripts/Commands/MoveAdd.cs | 27 ++++++++-- .../iTween/Scripts/Commands/MoveFrom.cs | 42 ++++++++++++--- .../Fungus/iTween/Scripts/Commands/MoveTo.cs | 42 ++++++++++++--- .../iTween/Scripts/Commands/PunchPosition.cs | 27 ++++++++-- .../iTween/Scripts/Commands/PunchRotation.cs | 27 ++++++++-- .../iTween/Scripts/Commands/PunchScale.cs | 27 ++++++++-- .../iTween/Scripts/Commands/RotateAdd.cs | 27 ++++++++-- .../iTween/Scripts/Commands/RotateFrom.cs | 42 ++++++++++++--- .../iTween/Scripts/Commands/RotateTo.cs | 42 ++++++++++++--- .../iTween/Scripts/Commands/ScaleAdd.cs | 27 ++++++++-- .../iTween/Scripts/Commands/ScaleFrom.cs | 42 ++++++++++++--- .../Fungus/iTween/Scripts/Commands/ScaleTo.cs | 42 ++++++++++++--- .../iTween/Scripts/Commands/ShakePosition.cs | 29 +++++++++-- .../iTween/Scripts/Commands/ShakeRotation.cs | 29 +++++++++-- .../iTween/Scripts/Commands/ShakeScale.cs | 29 +++++++++-- .../iTween/Scripts/Commands/StopTween.cs | 27 ++++++++-- .../iTween/Scripts/Commands/StopTweens.cs | 2 +- 22 files changed, 591 insertions(+), 90 deletions(-) create mode 100644 Assets/Fungus/Flowchart/Scripts/VariableTypes/TransformVariable.cs create mode 100644 Assets/Fungus/Flowchart/Scripts/VariableTypes/TransformVariable.cs.meta diff --git a/Assets/Fungus/Flowchart/Editor/VariableEditor.cs b/Assets/Fungus/Flowchart/Editor/VariableEditor.cs index c0f324f0..bf0f8e0e 100644 --- a/Assets/Fungus/Flowchart/Editor/VariableEditor.cs +++ b/Assets/Fungus/Flowchart/Editor/VariableEditor.cs @@ -323,4 +323,8 @@ namespace Fungus [CustomPropertyDrawer (typeof(AnimatorData))] public class AnimatorDataDrawer : VariableDataDrawer {} + + [CustomPropertyDrawer (typeof(TransformData))] + public class TransformDataDrawer : VariableDataDrawer + {} } \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/VariableTypes/TransformVariable.cs b/Assets/Fungus/Flowchart/Scripts/VariableTypes/TransformVariable.cs new file mode 100644 index 00000000..5a541c50 --- /dev/null +++ b/Assets/Fungus/Flowchart/Scripts/VariableTypes/TransformVariable.cs @@ -0,0 +1,51 @@ +using UnityEngine; +using System.Collections; + +namespace Fungus +{ + [VariableInfo("Other", "Transform")] + [AddComponentMenu("")] + public class TransformVariable : VariableBase + {} + + [System.Serializable] + public struct TransformData + { + [SerializeField] + [VariableProperty("", typeof(TransformVariable))] + public TransformVariable transformRef; + + [SerializeField] + public Transform transformVal; + + public TransformData(Transform v) + { + transformVal = v; + transformRef = null; + } + + public static implicit operator Transform(TransformData vector3Data) + { + return vector3Data.Value; + } + + public Transform Value + { + get { return (transformRef == null) ? transformVal : transformRef.value; } + set { if (transformRef == null) { transformVal = value; } else { transformRef.value = value; } } + } + + public string GetDescription() + { + if (transformRef == null) + { + return transformVal.ToString(); + } + else + { + return transformRef.key; + } + } + } + +} \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/VariableTypes/TransformVariable.cs.meta b/Assets/Fungus/Flowchart/Scripts/VariableTypes/TransformVariable.cs.meta new file mode 100644 index 00000000..d17780de --- /dev/null +++ b/Assets/Fungus/Flowchart/Scripts/VariableTypes/TransformVariable.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 633bea14077b44e19956e8113fbac7a4 +timeCreated: 1457893486 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs index 02378b59..6e570a18 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,13 +8,18 @@ namespace Fungus "Look From", "Instantly rotates a GameObject to look at the supplied Vector3 then returns it to it's starting rotation over time.")] [AddComponentMenu("")] - public class LookFrom : iTweenCommand + public class LookFrom : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD; + #endregion + [Tooltip("Target transform that the GameObject will look at")] - public Transform fromTransform; + public TransformData _fromTransform; [Tooltip("Target world position that the GameObject will look at, if no From Transform is set")] - public Vector3 fromPosition; + public Vector3Data _fromPosition; [Tooltip("Restricts rotation to the supplied axis only")] public iTweenAxis axis; @@ -22,13 +28,13 @@ namespace Fungus { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - if (fromTransform == null) + if (_fromTransform.Value == null) { - tweenParams.Add("looktarget", fromPosition); + tweenParams.Add("looktarget", _fromPosition.Value); } else { - tweenParams.Add("looktarget", fromTransform); + tweenParams.Add("looktarget", _fromTransform.Value); } switch (axis) { @@ -49,7 +55,29 @@ namespace Fungus tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); iTween.LookFrom(_targetObject.Value, tweenParams); - } + } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (fromTransformOLD != null) + { + _fromTransform.Value = fromTransformOLD; + fromTransformOLD = null; + } + + if (fromPositionOLD != default(Vector3)) + { + _fromPosition.Value = fromPositionOLD; + fromPositionOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs index a94ff629..bc7a035f 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,13 +8,18 @@ namespace Fungus "Look To", "Rotates a GameObject to look at a supplied Transform or Vector3 over time.")] [AddComponentMenu("")] - public class LookTo : iTweenCommand + public class LookTo : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD; + #endregion + [Tooltip("Target transform that the GameObject will look at")] - public Transform toTransform; + public TransformData _toTransform; [Tooltip("Target world position that the GameObject will look at, if no From Transform is set")] - public Vector3 toPosition; + public Vector3Data _toPosition; [Tooltip("Restricts rotation to the supplied axis only")] public iTweenAxis axis; @@ -22,13 +28,13 @@ namespace Fungus { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - if (toTransform == null) + if (_toTransform.Value == null) { - tweenParams.Add("looktarget", toPosition); + tweenParams.Add("looktarget", _toPosition.Value); } else { - tweenParams.Add("looktarget", toTransform); + tweenParams.Add("looktarget", _toTransform.Value); } switch (axis) { @@ -49,7 +55,29 @@ namespace Fungus tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); iTween.LookTo(_targetObject.Value, tweenParams); - } + } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (toTransformOLD != null) + { + _toTransform.Value = toTransformOLD; + toTransformOLD = null; + } + + if (toPositionOLD != default(Vector3)) + { + _toPosition.Value = toPositionOLD; + toPositionOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs index 5555db41..1d3a6a4f 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,10 +8,14 @@ namespace Fungus "Move Add", "Moves a game object by a specified offset over time.")] [AddComponentMenu("")] - public class MoveAdd : iTweenCommand + public class MoveAdd : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; + #endregion + [Tooltip("A translation offset in space the GameObject will animate to")] - public Vector3 offset; + public Vector3Data _offset; [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] public Space space = Space.Self; @@ -19,7 +24,7 @@ namespace Fungus { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - tweenParams.Add("amount", offset); + tweenParams.Add("amount", _offset.Value); tweenParams.Add("space", space); tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); @@ -29,6 +34,22 @@ namespace Fungus tweenParams.Add("oncompleteparams", this); iTween.MoveAdd(_targetObject.Value, tweenParams); } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (offsetOLD != default(Vector3)) + { + _offset.Value = offsetOLD; + offsetOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs index c8383e51..027646c5 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,13 +8,18 @@ namespace Fungus "Move From", "Moves a game object from a specified position back to its starting position over time. The position can be defined by a transform in another object (using To Transform) or by setting an absolute position (using To Position, if To Transform is set to None).")] [AddComponentMenu("")] - public class MoveFrom : iTweenCommand + public class MoveFrom : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD; + #endregion + [Tooltip("Target transform that the GameObject will move from")] - public Transform fromTransform; + public TransformData _fromTransform; [Tooltip("Target world position that the GameObject will move from, if no From Transform is set")] - public Vector3 fromPosition; + public Vector3Data _fromPosition; [Tooltip("Whether to animate in world space or relative to the parent. False by default.")] public bool isLocal; @@ -22,13 +28,13 @@ namespace Fungus { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - if (fromTransform == null) + if (_fromTransform.Value == null) { - tweenParams.Add("position", fromPosition); + tweenParams.Add("position", _fromPosition.Value); } else { - tweenParams.Add("position", fromTransform); + tweenParams.Add("position", _fromTransform.Value); } tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); @@ -38,7 +44,29 @@ namespace Fungus tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); iTween.MoveFrom(_targetObject.Value, tweenParams); - } + } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (fromTransformOLD != null) + { + _fromTransform.Value = fromTransformOLD; + fromTransformOLD = null; + } + + if (fromPositionOLD != default(Vector3)) + { + _fromPosition.Value = fromPositionOLD; + fromPositionOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs index 854f2473..b8163caa 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,13 +8,18 @@ namespace Fungus "Move To", "Moves a game object to a specified position over time. The position can be defined by a transform in another object (using To Transform) or by setting an absolute position (using To Position, if To Transform is set to None).")] [AddComponentMenu("")] - public class MoveTo : iTweenCommand + public class MoveTo : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD; + #endregion + [Tooltip("Target transform that the GameObject will move to")] - public Transform toTransform; + public TransformData _toTransform; [Tooltip("Target world position that the GameObject will move to, if no From Transform is set")] - public Vector3 toPosition; + public Vector3Data _toPosition; [Tooltip("Whether to animate in world space or relative to the parent. False by default.")] public bool isLocal; @@ -22,13 +28,13 @@ namespace Fungus { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - if (toTransform == null) + if (_toTransform.Value == null) { - tweenParams.Add("position", toPosition); + tweenParams.Add("position", _toPosition.Value); } else { - tweenParams.Add("position", toTransform); + tweenParams.Add("position", _toTransform.Value); } tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); @@ -38,7 +44,29 @@ namespace Fungus tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); iTween.MoveTo(_targetObject.Value, tweenParams); - } + } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (toTransformOLD != null) + { + _toTransform.Value = toTransformOLD; + toTransformOLD = null; + } + + if (toPositionOLD != default(Vector3)) + { + _toPosition.Value = toPositionOLD; + toPositionOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs index 42314d76..3b16d4dd 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,10 +8,14 @@ namespace Fungus "Punch Position", "Applies a jolt of force to a GameObject's position and wobbles it back to its initial position.")] [AddComponentMenu("")] - public class PunchPosition : iTweenCommand + public class PunchPosition : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + #endregion + [Tooltip("A translation offset in space the GameObject will animate to")] - public Vector3 amount; + public Vector3Data _amount; [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] public Space space = Space.Self; @@ -19,7 +24,7 @@ namespace Fungus { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - tweenParams.Add("amount", amount); + tweenParams.Add("amount", _amount.Value); tweenParams.Add("space", space); tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); @@ -29,6 +34,22 @@ namespace Fungus tweenParams.Add("oncompleteparams", this); iTween.PunchPosition(_targetObject.Value, tweenParams); } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + amountOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs index faa82159..7dc61581 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,10 +8,14 @@ namespace Fungus "Punch Rotation", "Applies a jolt of force to a GameObject's rotation and wobbles it back to its initial rotation.")] [AddComponentMenu("")] - public class PunchRotation : iTweenCommand + public class PunchRotation : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + #endregion + [Tooltip("A rotation offset in space the GameObject will animate to")] - public Vector3 amount; + public Vector3Data _amount; [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] public Space space = Space.Self; @@ -19,7 +24,7 @@ namespace Fungus { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - tweenParams.Add("amount", amount); + tweenParams.Add("amount", _amount.Value); tweenParams.Add("space", space); tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); @@ -29,6 +34,22 @@ namespace Fungus tweenParams.Add("oncompleteparams", this); iTween.PunchRotation(_targetObject.Value, tweenParams); } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + amountOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs index 365dbf98..f3e9002e 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,16 +8,20 @@ namespace Fungus "Punch Scale", "Applies a jolt of force to a GameObject's scale and wobbles it back to its initial scale.")] [AddComponentMenu("")] - public class PunchScale : iTweenCommand + public class PunchScale : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + #endregion + [Tooltip("A scale offset in space the GameObject will animate to")] - public Vector3 amount; + public Vector3Data _amount; public override void DoTween() { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - tweenParams.Add("amount", amount); + tweenParams.Add("amount", _amount.Value); tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); @@ -25,6 +30,22 @@ namespace Fungus tweenParams.Add("oncompleteparams", this); iTween.PunchScale(_targetObject.Value, tweenParams); } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + amountOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs index 362fd8de..ab18e756 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,10 +8,14 @@ namespace Fungus "Rotate Add", "Rotates a game object by the specified angles over time.")] [AddComponentMenu("")] - public class RotateAdd : iTweenCommand + public class RotateAdd : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; + #endregion + [Tooltip("A rotation offset in space the GameObject will animate to")] - public Vector3 offset; + public Vector3Data _offset; [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] public Space space = Space.Self; @@ -19,7 +24,7 @@ namespace Fungus { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - tweenParams.Add("amount", offset); + tweenParams.Add("amount", _offset.Value); tweenParams.Add("space", space); tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); @@ -29,6 +34,22 @@ namespace Fungus tweenParams.Add("oncompleteparams", this); iTween.RotateAdd(_targetObject.Value, tweenParams); } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (offsetOLD != default(Vector3)) + { + _offset.Value = offsetOLD; + offsetOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs index 8004f018..4b4561e3 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,13 +8,18 @@ namespace Fungus "Rotate From", "Rotates a game object from the specified angles back to its starting orientation over time.")] [AddComponentMenu("")] - public class RotateFrom : iTweenCommand + public class RotateFrom : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromRotation")] public Vector3 fromRotationOLD; + #endregion + [Tooltip("Target transform that the GameObject will rotate from")] - public Transform fromTransform; + public TransformData _fromTransform; [Tooltip("Target rotation that the GameObject will rotate from, if no From Transform is set")] - public Vector3 fromRotation; + public Vector3Data _fromRotation; [Tooltip("Whether to animate in world space or relative to the parent. False by default.")] public bool isLocal; @@ -22,13 +28,13 @@ namespace Fungus { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - if (fromTransform == null) + if (_fromTransform.Value == null) { - tweenParams.Add("rotation", fromRotation); + tweenParams.Add("rotation", _fromRotation.Value); } else { - tweenParams.Add("rotation", fromTransform); + tweenParams.Add("rotation", _fromTransform.Value); } tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); @@ -38,7 +44,29 @@ namespace Fungus tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); iTween.RotateFrom(_targetObject.Value, tweenParams); - } + } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (fromTransformOLD != null) + { + _fromTransform.Value = fromTransformOLD; + fromTransformOLD = null; + } + + if (fromRotationOLD != default(Vector3)) + { + _fromRotation.Value = fromRotationOLD; + fromRotationOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs index 2853d289..8b91b402 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,13 +8,18 @@ namespace Fungus "Rotate To", "Rotates a game object to the specified angles over time.")] [AddComponentMenu("")] - public class RotateTo : iTweenCommand + public class RotateTo : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toRotation")] public Vector3 toRotationOLD; + #endregion + [Tooltip("Target transform that the GameObject will rotate to")] - public Transform toTransform; + public TransformData _toTransform; [Tooltip("Target rotation that the GameObject will rotate to, if no To Transform is set")] - public Vector3 toRotation; + public Vector3Data _toRotation; [Tooltip("Whether to animate in world space or relative to the parent. False by default.")] public bool isLocal; @@ -22,13 +28,13 @@ namespace Fungus { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - if (toTransform == null) + if (_toTransform.Value == null) { - tweenParams.Add("rotation", toRotation); + tweenParams.Add("rotation", _toRotation.Value); } else { - tweenParams.Add("rotation", toTransform); + tweenParams.Add("rotation", _toTransform.Value); } tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); @@ -38,7 +44,29 @@ namespace Fungus tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); iTween.RotateTo(_targetObject.Value, tweenParams); - } + } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (toTransformOLD != null) + { + _toTransform.Value = toTransformOLD; + toTransformOLD = null; + } + + if (toRotationOLD != default(Vector3)) + { + _toRotation.Value = toRotationOLD; + toRotationOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs index 9be89ac9..5be57f33 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,16 +8,20 @@ namespace Fungus "Scale Add", "Changes a game object's scale by a specified offset over time.")] [AddComponentMenu("")] - public class ScaleAdd : iTweenCommand + public class ScaleAdd : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; + #endregion + [Tooltip("A scale offset in space the GameObject will animate to")] - public Vector3 offset; + public Vector3Data _offset; public override void DoTween() { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - tweenParams.Add("amount", offset); + tweenParams.Add("amount", _offset.Value); tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); @@ -25,6 +30,22 @@ namespace Fungus tweenParams.Add("oncompleteparams", this); iTween.ScaleAdd(_targetObject.Value, tweenParams); } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (offsetOLD != default(Vector3)) + { + _offset.Value = offsetOLD; + offsetOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs index 54741150..d167364f 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,25 +8,30 @@ namespace Fungus "Scale From", "Changes a game object's scale to the specified value and back to its original scale over time.")] [AddComponentMenu("")] - public class ScaleFrom : iTweenCommand + public class ScaleFrom : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromScale")] public Vector3 fromScaleOLD; + #endregion + [Tooltip("Target transform that the GameObject will scale from")] - public Transform fromTransform; + public TransformData _fromTransform; [Tooltip("Target scale that the GameObject will scale from, if no From Transform is set")] - public Vector3 fromScale; + public Vector3Data _fromScale; public override void DoTween() { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - if (fromTransform == null) + if (_fromTransform.Value == null) { - tweenParams.Add("scale", fromScale); + tweenParams.Add("scale", _fromScale.Value); } else { - tweenParams.Add("scale", fromTransform); + tweenParams.Add("scale", _fromTransform.Value); } tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); @@ -34,7 +40,29 @@ namespace Fungus tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); iTween.ScaleFrom(_targetObject.Value, tweenParams); - } + } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (fromTransformOLD != null) + { + _fromTransform.Value = fromTransformOLD; + fromTransformOLD = null; + } + + if (fromScaleOLD != default(Vector3)) + { + _fromScale.Value = fromScaleOLD; + fromScaleOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs index 21b6f183..f33de0a2 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,25 +8,30 @@ namespace Fungus "Scale To", "Changes a game object's scale to a specified value over time.")] [AddComponentMenu("")] - public class ScaleTo : iTweenCommand + public class ScaleTo : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toScale")] public Vector3 toScaleOLD; + #endregion + [Tooltip("Target transform that the GameObject will scale to")] - public Transform toTransform; + public TransformData _toTransform; [Tooltip("Target scale that the GameObject will scale to, if no To Transform is set")] - public Vector3 toScale = new Vector3(1f, 1f, 1f); + public Vector3Data _toScale = new Vector3Data(Vector3.one); public override void DoTween() { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - if (toTransform == null) + if (_toTransform.Value == null) { - tweenParams.Add("scale", toScale); + tweenParams.Add("scale", _toScale.Value); } else { - tweenParams.Add("scale", toTransform); + tweenParams.Add("scale", _toTransform.Value); } tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); @@ -34,7 +40,29 @@ namespace Fungus tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); iTween.ScaleTo(_targetObject.Value, tweenParams); - } + } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (toTransformOLD != null) + { + _toTransform.Value = toTransformOLD; + toTransformOLD = null; + } + + if (toScaleOLD != default(Vector3)) + { + _toScale.Value = toScaleOLD; + toScaleOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs index ab2ebdad..e1f06af9 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,10 +8,14 @@ namespace Fungus "Shake Position", "Randomly shakes a GameObject's position by a diminishing amount over time.")] [AddComponentMenu("")] - public class ShakePosition : iTweenCommand + public class ShakePosition : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + #endregion + [Tooltip("A translation offset in space the GameObject will animate to")] - public Vector3 amount; + public Vector3Data _amount; [Tooltip("Whether to animate in world space or relative to the parent. False by default.")] public bool isLocal; @@ -22,7 +27,7 @@ namespace Fungus { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - tweenParams.Add("amount", amount); + tweenParams.Add("amount", _amount.Value); switch (axis) { case iTweenAxis.X: @@ -43,7 +48,23 @@ namespace Fungus tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); iTween.ShakePosition(_targetObject.Value, tweenParams); - } + } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + amountOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs index 466c90df..59443e2e 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,10 +8,14 @@ namespace Fungus "Shake Rotation", "Randomly shakes a GameObject's rotation by a diminishing amount over time.")] [AddComponentMenu("")] - public class ShakeRotation : iTweenCommand + public class ShakeRotation : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + #endregion + [Tooltip("A rotation offset in space the GameObject will animate to")] - public Vector3 amount; + public Vector3Data _amount; [Tooltip("Apply the transformation in either the world coordinate or local cordinate system")] public Space space = Space.Self; @@ -19,7 +24,7 @@ namespace Fungus { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - tweenParams.Add("amount", amount); + tweenParams.Add("amount", _amount.Value); tweenParams.Add("space", space); tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); @@ -28,7 +33,23 @@ namespace Fungus tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); iTween.ShakeRotation(_targetObject.Value, tweenParams); - } + } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + amountOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs index 8cd2f53f..92c9477d 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,16 +8,20 @@ namespace Fungus "Shake Scale", "Randomly shakes a GameObject's rotation by a diminishing amount over time.")] [AddComponentMenu("")] - public class ShakeScale : iTweenCommand + public class ShakeScale : iTweenCommand, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + #endregion + [Tooltip("A scale offset in space the GameObject will animate to")] - public Vector3 amount; + public Vector3Data _amount; public override void DoTween() { Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); - tweenParams.Add("amount", amount); + tweenParams.Add("amount", _amount.Value); tweenParams.Add("time", duration); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); @@ -24,7 +29,23 @@ namespace Fungus tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); iTween.ShakeScale(_targetObject.Value, tweenParams); - } + } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + amountOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs b/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs index c2622ed1..eeda68f2 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,16 +8,36 @@ namespace Fungus "Stop Tween", "Stops an active iTween by name.")] [AddComponentMenu("")] - public class StopTween : Command + public class StopTween : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD; + #endregion + [Tooltip("Stop and destroy any Tweens in current scene with the supplied name")] - public string tweenName; + public StringData _tweenName; public override void OnEnter() { - iTween.StopByName(tweenName); + iTween.StopByName(_tweenName.Value); Continue(); } + + // + // ISerializationCallbackReceiver implementation + // + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (tweenNameOLD != "") + { + _tweenName.Value = tweenNameOLD; + tweenNameOLD = ""; + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/StopTweens.cs b/Assets/Fungus/iTween/Scripts/Commands/StopTweens.cs index 362c2f88..3e323ca2 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/StopTweens.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/StopTweens.cs @@ -7,7 +7,7 @@ namespace Fungus "Stop Tweens", "Stop all active iTweens in the current scene.")] [AddComponentMenu("")] - public class StopTweens : Command + public class StopTweens : Command { public override void OnEnter() { From 10f6bc7f2c3d3afc7256ec1e0fd3ab5992c3613d Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sun, 13 Mar 2016 19:43:22 +0000 Subject: [PATCH 06/24] iTween duration can be a variable --- Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs | 8 +++++--- Assets/Fungus/iTween/Scripts/Commands/LookTo.cs | 8 +++++--- Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs | 8 +++++--- Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs | 8 +++++--- Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs | 8 +++++--- .../iTween/Scripts/Commands/PunchPosition.cs | 8 +++++--- .../iTween/Scripts/Commands/PunchRotation.cs | 8 +++++--- .../Fungus/iTween/Scripts/Commands/PunchScale.cs | 8 +++++--- .../Fungus/iTween/Scripts/Commands/RotateAdd.cs | 8 +++++--- .../Fungus/iTween/Scripts/Commands/RotateFrom.cs | 8 +++++--- Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs | 8 +++++--- Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs | 8 +++++--- .../Fungus/iTween/Scripts/Commands/ScaleFrom.cs | 8 +++++--- Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs | 8 +++++--- .../iTween/Scripts/Commands/ShakePosition.cs | 8 +++++--- .../iTween/Scripts/Commands/ShakeRotation.cs | 8 +++++--- .../Fungus/iTween/Scripts/Commands/ShakeScale.cs | 8 +++++--- .../Fungus/iTween/Scripts/Commands/StopTween.cs | 4 ++-- .../iTween/Scripts/Commands/iTweenCommand.cs | 15 +++++++++++---- 19 files changed, 98 insertions(+), 57 deletions(-) diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs index 6e570a18..2e84e721 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs @@ -48,7 +48,7 @@ namespace Fungus tweenParams.Add("axis", "z"); break; } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -61,11 +61,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (fromTransformOLD != null) { _fromTransform.Value = fromTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs index bc7a035f..bc9e5834 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs @@ -48,7 +48,7 @@ namespace Fungus tweenParams.Add("axis", "z"); break; } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -61,11 +61,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (toTransformOLD != null) { _toTransform.Value = toTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs index 1d3a6a4f..04d217e5 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs @@ -26,7 +26,7 @@ namespace Fungus tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _offset.Value); tweenParams.Add("space", space); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -39,11 +39,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (offsetOLD != default(Vector3)) { _offset.Value = offsetOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs index 027646c5..72d2df28 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs @@ -36,7 +36,7 @@ namespace Fungus { tweenParams.Add("position", _fromTransform.Value); } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); @@ -50,11 +50,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (fromTransformOLD != null) { _fromTransform.Value = fromTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs index b8163caa..13ad4b48 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs @@ -36,7 +36,7 @@ namespace Fungus { tweenParams.Add("position", _toTransform.Value); } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); @@ -50,11 +50,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (toTransformOLD != null) { _toTransform.Value = toTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs index 3b16d4dd..94b61567 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs @@ -26,7 +26,7 @@ namespace Fungus tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _amount.Value); tweenParams.Add("space", space); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -39,11 +39,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (amountOLD != default(Vector3)) { _amount.Value = amountOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs index 7dc61581..0071edda 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs @@ -26,7 +26,7 @@ namespace Fungus tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _amount.Value); tweenParams.Add("space", space); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -39,11 +39,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (amountOLD != default(Vector3)) { _amount.Value = amountOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs index f3e9002e..040200fd 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs @@ -22,7 +22,7 @@ namespace Fungus Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _amount.Value); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -35,11 +35,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (amountOLD != default(Vector3)) { _amount.Value = amountOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs index ab18e756..2c1401e5 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs @@ -26,7 +26,7 @@ namespace Fungus tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _offset.Value); tweenParams.Add("space", space); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -39,11 +39,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (offsetOLD != default(Vector3)) { _offset.Value = offsetOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs index 4b4561e3..cb4898bf 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs @@ -36,7 +36,7 @@ namespace Fungus { tweenParams.Add("rotation", _fromTransform.Value); } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); @@ -50,11 +50,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (fromTransformOLD != null) { _fromTransform.Value = fromTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs index 8b91b402..926d62b5 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs @@ -36,7 +36,7 @@ namespace Fungus { tweenParams.Add("rotation", _toTransform.Value); } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); @@ -50,11 +50,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (toTransformOLD != null) { _toTransform.Value = toTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs index 5be57f33..0ddfcc5b 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs @@ -22,7 +22,7 @@ namespace Fungus Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _offset.Value); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -35,11 +35,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (offsetOLD != default(Vector3)) { _offset.Value = offsetOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs index d167364f..1d1f7eba 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs @@ -33,7 +33,7 @@ namespace Fungus { tweenParams.Add("scale", _fromTransform.Value); } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -46,11 +46,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (fromTransformOLD != null) { _fromTransform.Value = fromTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs index f33de0a2..84108c97 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs @@ -33,7 +33,7 @@ namespace Fungus { tweenParams.Add("scale", _toTransform.Value); } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -46,11 +46,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (toTransformOLD != null) { _toTransform.Value = toTransformOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs index e1f06af9..89d8760b 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs @@ -40,7 +40,7 @@ namespace Fungus tweenParams.Add("axis", "z"); break; } - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); @@ -54,11 +54,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (amountOLD != default(Vector3)) { _amount.Value = amountOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs index 59443e2e..d57f7f74 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs @@ -26,7 +26,7 @@ namespace Fungus tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _amount.Value); tweenParams.Add("space", space); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -39,11 +39,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (amountOLD != default(Vector3)) { _amount.Value = amountOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs index 92c9477d..b88f9bbc 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs @@ -22,7 +22,7 @@ namespace Fungus Hashtable tweenParams = new Hashtable(); tweenParams.Add("name", _tweenName.Value); tweenParams.Add("amount", _amount.Value); - tweenParams.Add("time", duration); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); @@ -35,11 +35,13 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public override void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public override void OnAfterDeserialize() { + base.OnAfterDeserialize(); + if (amountOLD != default(Vector3)) { _amount.Value = amountOLD; diff --git a/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs b/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs index eeda68f2..0f79ec37 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs @@ -27,10 +27,10 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public virtual void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public virtual void OnAfterDeserialize() { if (tweenNameOLD != "") { diff --git a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs index bf77eee7..dc142018 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs @@ -18,6 +18,7 @@ namespace Fungus #region Obsolete Properties [HideInInspector] [FormerlySerializedAs("target")] [FormerlySerializedAs("targetObject")] public GameObject targetObjectOLD; [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD; + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; #endregion [Tooltip("Target game object to apply the Tween to")] @@ -27,7 +28,7 @@ namespace Fungus public StringData _tweenName; [Tooltip("The time in seconds the animation will take to complete")] - public float duration = 1f; + public FloatData _duration = new FloatData(1f); [Tooltip("The shape of the easing curve applied to the animation")] public iTween.EaseType easeType = iTween.EaseType.easeInOutQuad; @@ -89,7 +90,7 @@ namespace Fungus return "Error: No target object selected"; } - return _targetObject.Value.name + " over " + duration + " seconds"; + return _targetObject.Value.name + " over " + _duration.Value + " seconds"; } public override Color GetButtonColor() @@ -101,16 +102,22 @@ namespace Fungus // ISerializationCallbackReceiver implementation // - public void OnBeforeSerialize() + public virtual void OnBeforeSerialize() {} - public void OnAfterDeserialize() + public virtual void OnAfterDeserialize() { if (targetObjectOLD != null) { _targetObject.Value = targetObjectOLD; targetObjectOLD = null; } + + if (durationOLD == default(float)) + { + _duration.Value = durationOLD; + durationOLD = default(float); + } } } From f937aed6cb46443162bb13ff381103e1784f77dc Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sun, 13 Mar 2016 22:56:57 +0000 Subject: [PATCH 07/24] Audio commands can use variables in properties --- .../Fungus/Audio/Editor/ControlAudioEditor.cs | 2 +- .../Audio/Scripts/Commands/ControlAudio.cs | 80 ++++++++++++------- .../Audio/Scripts/Commands/PlayUsfxrSound.cs | 36 +++++++-- .../Fungus/Flowchart/Editor/VariableEditor.cs | 4 + .../VariableTypes/AudioSourceVariable.cs | 51 ++++++++++++ .../VariableTypes/AudioSourceVariable.cs.meta | 12 +++ 6 files changed, 148 insertions(+), 37 deletions(-) create mode 100644 Assets/Fungus/Flowchart/Scripts/VariableTypes/AudioSourceVariable.cs create mode 100644 Assets/Fungus/Flowchart/Scripts/VariableTypes/AudioSourceVariable.cs.meta diff --git a/Assets/Fungus/Audio/Editor/ControlAudioEditor.cs b/Assets/Fungus/Audio/Editor/ControlAudioEditor.cs index a2f96c9a..5b13f995 100644 --- a/Assets/Fungus/Audio/Editor/ControlAudioEditor.cs +++ b/Assets/Fungus/Audio/Editor/ControlAudioEditor.cs @@ -28,7 +28,7 @@ namespace Fungus return; controlProp = serializedObject.FindProperty("control"); - audioSourceProp = serializedObject.FindProperty("audioSource"); + audioSourceProp = serializedObject.FindProperty("_audioSource"); startVolumeProp = serializedObject.FindProperty("startVolume"); endVolumeProp = serializedObject.FindProperty("endVolume"); fadeDurationProp = serializedObject.FindProperty("fadeDuration"); diff --git a/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs b/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs index 3a12aebe..e1a17011 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -6,8 +7,12 @@ namespace Fungus [CommandInfo("Audio", "Control Audio", "Plays, loops, or stops an audiosource. Any AudioSources with the same tag as the target Audio Source will automatically be stoped.")] - public class ControlAudio : Command + public class ControlAudio : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("audioSource")] public AudioSource audioSourceOLD; + #endregion + public enum controlType { PlayOnce, @@ -21,7 +26,7 @@ namespace Fungus public controlType control; [Tooltip("Audio clip to play")] - public AudioSource audioSource; + public AudioSourceData _audioSource; [Range(0,1)] [Tooltip("Start audio at this volume")] @@ -39,13 +44,13 @@ namespace Fungus public override void OnEnter() { - if (audioSource == null) + if (_audioSource.Value == null) { Continue(); return; } - audioSource.volume = endVolume; + _audioSource.Value.volume = endVolume; switch(control) { case controlType.PlayOnce: @@ -60,7 +65,7 @@ namespace Fungus PauseLoop(); break; case controlType.StopLoop: - StopLoop(audioSource); + StopLoop(_audioSource.Value); break; case controlType.ChangeVolume: ChangeVolume(); @@ -79,7 +84,8 @@ namespace Fungus protected void StopAudioWithSameTag() { // Don't stop audio if there's no tag assigned - if (audioSource.tag == "Untagged") + if (_audioSource.Value == null || + _audioSource.Value.tag == "Untagged") { return; } @@ -87,7 +93,7 @@ namespace Fungus AudioSource[] audioSources = GameObject.FindObjectsOfType(); foreach (AudioSource a in audioSources) { - if ((a.GetComponent() != audioSource) && (a.tag == audioSource.tag)) + if ((a.GetComponent() != _audioSource.Value) && (a.tag == _audioSource.Value.tag)) { StopLoop(a.GetComponent()); } @@ -99,17 +105,17 @@ namespace Fungus if (fadeDuration > 0) { // Fade volume in - LeanTween.value(audioSource.gameObject, - audioSource.volume, + LeanTween.value(_audioSource.Value.gameObject, + _audioSource.Value.volume, endVolume, fadeDuration ).setOnUpdate( (float updateVolume)=>{ - audioSource.volume = updateVolume; + _audioSource.Value.volume = updateVolume; }); } - audioSource.PlayOneShot(audioSource.clip); + _audioSource.Value.PlayOneShot(_audioSource.Value.clip); if (waitUntilFinished) { @@ -121,7 +127,7 @@ namespace Fungus { // Poll the audiosource until playing has finished // This allows for things like effects added to the audiosource. - while (audioSource.isPlaying) + while (_audioSource.Value.isPlaying) { yield return null; } @@ -133,13 +139,13 @@ namespace Fungus { if (fadeDuration > 0) { - audioSource.volume = 0; - audioSource.loop = true; - audioSource.GetComponent().Play(); - LeanTween.value(audioSource.gameObject,0,endVolume,fadeDuration + _audioSource.Value.volume = 0; + _audioSource.Value.loop = true; + _audioSource.Value.GetComponent().Play(); + LeanTween.value(_audioSource.Value.gameObject,0,endVolume,fadeDuration ).setOnUpdate( (float updateVolume)=>{ - audioSource.volume = updateVolume; + _audioSource.Value.volume = updateVolume; } ).setOnComplete( ()=>{ @@ -152,9 +158,9 @@ namespace Fungus } else { - audioSource.volume = 1; - audioSource.loop = true; - audioSource.GetComponent().Play(); + _audioSource.Value.volume = 1; + _audioSource.Value.loop = true; + _audioSource.Value.GetComponent().Play(); } } @@ -162,15 +168,15 @@ namespace Fungus { if (fadeDuration > 0) { - LeanTween.value(audioSource.gameObject,audioSource.volume,0,fadeDuration + LeanTween.value(_audioSource.Value.gameObject,_audioSource.Value.volume,0,fadeDuration ).setOnUpdate( (float updateVolume)=>{ - audioSource.volume = updateVolume; + _audioSource.Value.volume = updateVolume; } ).setOnComplete( ()=>{ - audioSource.GetComponent().Pause(); + _audioSource.Value.GetComponent().Pause(); if (waitUntilFinished) { Continue(); @@ -180,7 +186,7 @@ namespace Fungus } else { - audioSource.GetComponent().Pause(); + _audioSource.Value.GetComponent().Pause(); } } @@ -188,7 +194,7 @@ namespace Fungus { if (fadeDuration > 0) { - LeanTween.value(source.gameObject,audioSource.volume,0,fadeDuration + LeanTween.value(source.gameObject,_audioSource.Value.volume,0,fadeDuration ).setOnUpdate( (float updateVolume)=>{ source.volume = updateVolume; @@ -212,10 +218,10 @@ namespace Fungus protected void ChangeVolume() { - LeanTween.value(audioSource.gameObject,audioSource.volume,endVolume,fadeDuration + LeanTween.value(_audioSource.Value.gameObject,_audioSource.Value.volume,endVolume,fadeDuration ).setOnUpdate( (float updateVolume)=>{ - audioSource.volume = updateVolume; + _audioSource.Value.volume = updateVolume; } ); } @@ -230,7 +236,7 @@ namespace Fungus public override string GetSummary() { - if (audioSource == null) + if (_audioSource.Value == null) { return "Error: No sound clip selected"; } @@ -248,13 +254,29 @@ namespace Fungus } fadeType += " over " + fadeDuration + " seconds."; } - return control.ToString() + " \"" + audioSource.name + "\"" + fadeType; + return control.ToString() + " \"" + _audioSource.Value.name + "\"" + fadeType; } public override Color GetButtonColor() { return new Color32(242, 209, 176, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (audioSourceOLD != null) + { + _audioSource.Value = audioSourceOLD; + audioSourceOLD = null; + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs b/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs index 8f3c6733..cff75f29 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs @@ -1,28 +1,33 @@ namespace Fungus { using System; using UnityEngine; + using UnityEngine.Serialization; [CommandInfo("Audio", "Play Usfxr Sound", "Plays a usfxr synth sound. Use the usfxr editor [Tools > Fungus > Utilities > Generate usfxr Sound Effects] to create the SettingsString. Set a ParentTransform if using positional sound. See https://github.com/zeh/usfxr for more information about usfxr.")] [AddComponentMenu("")] - public class PlayUsfxrSound : Command + public class PlayUsfxrSound : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("SettingsString")] public String SettingsStringOLD; + #endregion + protected SfxrSynth _synth = new SfxrSynth(); [Tooltip("Transform to use for positional audio")] public Transform ParentTransform = null; [Tooltip("Settings string which describes the audio")] - public String SettingsString = ""; + public StringData _SettingsString = new StringData(""); [Tooltip("Time to wait before executing the next command")] public float waitDuration = 0; //Call this if the settings have changed protected void UpdateCache() { - if (SettingsString != null) { - _synth.parameters.SetSettingsString(SettingsString); + if (_SettingsString.Value != null) { + _synth.parameters.SetSettingsString(_SettingsString.Value); _synth.CacheSound(); } } @@ -51,17 +56,34 @@ } public override string GetSummary() { - if (String.IsNullOrEmpty(SettingsString)) { + if (String.IsNullOrEmpty(_SettingsString.Value)) { return "Settings String hasn't been set!"; } if (ParentTransform != null) { - return "" + ParentTransform.name + ": " + SettingsString; + return "" + ParentTransform.name + ": " + _SettingsString.Value; } - return "Camera.main: " + SettingsString; + return "Camera.main: " + _SettingsString.Value; } public override Color GetButtonColor() { return new Color32(128, 200, 200, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (SettingsStringOLD != "") + { + _SettingsString.Value = SettingsStringOLD; + SettingsStringOLD = ""; + } + } + } } diff --git a/Assets/Fungus/Flowchart/Editor/VariableEditor.cs b/Assets/Fungus/Flowchart/Editor/VariableEditor.cs index bf0f8e0e..935bf295 100644 --- a/Assets/Fungus/Flowchart/Editor/VariableEditor.cs +++ b/Assets/Fungus/Flowchart/Editor/VariableEditor.cs @@ -327,4 +327,8 @@ namespace Fungus [CustomPropertyDrawer (typeof(TransformData))] public class TransformDataDrawer : VariableDataDrawer {} + + [CustomPropertyDrawer (typeof(AudioSourceData))] + public class AudioSourceDrawer : VariableDataDrawer + {} } \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/VariableTypes/AudioSourceVariable.cs b/Assets/Fungus/Flowchart/Scripts/VariableTypes/AudioSourceVariable.cs new file mode 100644 index 00000000..1dc14994 --- /dev/null +++ b/Assets/Fungus/Flowchart/Scripts/VariableTypes/AudioSourceVariable.cs @@ -0,0 +1,51 @@ +using UnityEngine; +using System.Collections; + +namespace Fungus +{ + [VariableInfo("Other", "AudioSource")] + [AddComponentMenu("")] + public class AudioSourceVariable : VariableBase + {} + + [System.Serializable] + public struct AudioSourceData + { + [SerializeField] + [VariableProperty("", typeof(AudioSourceVariable))] + public AudioSourceVariable audioSourceRef; + + [SerializeField] + public AudioSource audioSourceVal; + + public AudioSourceData(AudioSource v) + { + audioSourceVal = v; + audioSourceRef = null; + } + + public static implicit operator AudioSource(AudioSourceData audioSourceData) + { + return audioSourceData.Value; + } + + public AudioSource Value + { + get { return (audioSourceRef == null) ? audioSourceVal : audioSourceRef.value; } + set { if (audioSourceRef == null) { audioSourceVal = value; } else { audioSourceRef.value = value; } } + } + + public string GetDescription() + { + if (audioSourceRef == null) + { + return audioSourceVal.ToString(); + } + else + { + return audioSourceRef.key; + } + } + } + +} \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/VariableTypes/AudioSourceVariable.cs.meta b/Assets/Fungus/Flowchart/Scripts/VariableTypes/AudioSourceVariable.cs.meta new file mode 100644 index 00000000..47854598 --- /dev/null +++ b/Assets/Fungus/Flowchart/Scripts/VariableTypes/AudioSourceVariable.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fe0d9dc5080b040bd8daff067b407916 +timeCreated: 1457892188 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From f05b9bcef1bade4c1359b6e954022bb5a0c2cd77 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 19 Mar 2016 01:23:16 -0700 Subject: [PATCH 08/24] Destroy command can use variable --- .../Flowchart/Scripts/Commands/Destroy.cs | 33 +- .../Libs/Mono.Cecil.dll.meta | 4 + Assets/UpdatePropTest.unity | 740 ++++++++++++++++++ Assets/UpdatePropTest.unity.meta | 8 + 4 files changed, 779 insertions(+), 6 deletions(-) create mode 100644 Assets/UpdatePropTest.unity create mode 100644 Assets/UpdatePropTest.unity.meta diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/Destroy.cs b/Assets/Fungus/Flowchart/Scripts/Commands/Destroy.cs index 5685a969..bb8d145f 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/Destroy.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/Destroy.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; using System.Collections.Generic; @@ -8,16 +9,20 @@ namespace Fungus "Destroy", "Destroys a specified game object in the scene.")] [AddComponentMenu("")] - public class Destroy : Command + public class Destroy : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD; + #endregion + [Tooltip("Reference to game object to destroy")] - public GameObject targetGameObject; + public GameObjectData _targetGameObject; public override void OnEnter() { - if (targetGameObject != null) + if (_targetGameObject.Value != null) { - Destroy(targetGameObject); + Destroy(_targetGameObject.Value); } Continue(); @@ -25,18 +30,34 @@ namespace Fungus public override string GetSummary() { - if (targetGameObject == null) + if (_targetGameObject.Value == null) { return "Error: No game object selected"; } - return targetGameObject.name; + return _targetGameObject.Value.name; } public override Color GetButtonColor() { return new Color32(235, 191, 217, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (targetGameObjectOLD != null) + { + _targetGameObject.Value = targetGameObjectOLD; + targetGameObjectOLD = null; + } + } } } \ No newline at end of file diff --git a/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.dll.meta b/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.dll.meta index 1123a8ae..88805bdd 100644 --- a/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.dll.meta +++ b/Assets/UnityTestTools/IntegrationTestsFramework/Libs/Mono.Cecil.dll.meta @@ -15,6 +15,10 @@ PluginImporter: enabled: 1 settings: DefaultValueInitialized: true + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU userData: assetBundleName: assetBundleVariant: diff --git a/Assets/UpdatePropTest.unity b/Assets/UpdatePropTest.unity new file mode 100644 index 00000000..e38faf4a --- /dev/null +++ b/Assets/UpdatePropTest.unity @@ -0,0 +1,740 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 1 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &2638155 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 2638157} + - 114: {fileID: 2638156} + m_Layer: 0 + m_Name: _FungusState + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2638156 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2638155} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} + m_Name: + m_EditorClassIdentifier: + selectedFlowchart: {fileID: 979963239} +--- !u!4 &2638157 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2638155} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 +--- !u!1 &453390534 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 453390538} + - 114: {fileID: 453390537} + - 114: {fileID: 453390536} + - 114: {fileID: 453390535} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &453390535 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 453390534} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ForceModuleActive: 0 +--- !u!114 &453390536 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 453390534} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &453390537 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 453390534} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 5 +--- !u!4 &453390538 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 453390534} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 +--- !u!1 &837453083 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 837453088} + - 20: {fileID: 837453087} + - 92: {fileID: 837453086} + - 124: {fileID: 837453085} + - 81: {fileID: 837453084} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &837453084 +AudioListener: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 837453083} + m_Enabled: 1 +--- !u!124 &837453085 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 837453083} + m_Enabled: 1 +--- !u!92 &837453086 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 837453083} + m_Enabled: 1 +--- !u!20 &837453087 +Camera: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 837453083} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 +--- !u!4 &837453088 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 837453083} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 +--- !u!1 &979963238 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 979963243} + - 114: {fileID: 979963239} + - 114: {fileID: 979963241} + - 114: {fileID: 979963242} + - 114: {fileID: 979963240} + - 114: {fileID: 979963244} + - 114: {fileID: 979963246} + - 114: {fileID: 979963245} + - 114: {fileID: 979963247} + - 114: {fileID: 979963248} + - 114: {fileID: 979963249} + - 114: {fileID: 979963250} + - 114: {fileID: 979963251} + m_Layer: 0 + m_Name: Flowchart + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &979963239 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1 + scrollPos: {x: 0, y: 0} + variablesScrollPos: {x: 0, y: 0} + variablesExpanded: 1 + blockViewHeight: 400 + zoom: 1 + scrollViewRect: + serializedVersion: 2 + x: -343 + y: -340 + width: 1114 + height: 859 + selectedBlock: {fileID: 979963241} + selectedCommands: [] + variables: + - {fileID: 979963244} + description: + stepPause: 0 + colorCommands: 1 + hideComponents: 1 + saveSelection: 1 + localizationId: + hideCommands: [] +--- !u!114 &979963240 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee63e642958494f1ebed8116ae4b1103, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 1 + errorMessage: + indentLevel: 0 + animatorOLD: {fileID: 0} + parameterNameOLD: + _animator: + animatorRef: {fileID: 0} + animatorVal: {fileID: 1766204519} + _parameterName: + stringRef: {fileID: 0} + stringVal: + value: + booleanRef: {fileID: 0} + booleanVal: 1 +--- !u!114 &979963241 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11433304, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Name: + m_EditorClassIdentifier: + nodeRect: + serializedVersion: 2 + x: 67 + y: 69 + width: 120 + height: 40 + itemId: 0 + blockName: Start + description: + eventHandler: {fileID: 979963242} + commandList: + - {fileID: 979963240} + - {fileID: 979963246} + - {fileID: 979963245} + - {fileID: 979963247} + - {fileID: 979963249} + - {fileID: 979963248} + - {fileID: 979963250} + - {fileID: 979963251} +--- !u!114 &979963242 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11462346, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3} + m_Name: + m_EditorClassIdentifier: + parentBlock: {fileID: 979963241} +--- !u!4 &979963243 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 +--- !u!114 &979963244 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8cbd0c93fbe0e46f78685c33d82bcc7b, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: Var + value: {fileID: 1766204519} +--- !u!114 &979963245 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76641c2c16481448eb6c0c1184fcdebe, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 3 + errorMessage: + indentLevel: 0 + animatorOLD: {fileID: 0} + parameterNameOLD: + _animator: + animatorRef: {fileID: 0} + animatorVal: {fileID: 1766204519} + _parameterName: + stringRef: {fileID: 0} + stringVal: + value: + integerRef: {fileID: 0} + integerVal: 0 +--- !u!114 &979963246 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fb1f6a369ef8c40bda77241018ab6bd6, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 2 + errorMessage: + indentLevel: 0 + animatorOLD: {fileID: 0} + parameterNameOLD: + _animator: + animatorRef: {fileID: 0} + animatorVal: {fileID: 1766204519} + _parameterName: + stringRef: {fileID: 0} + stringVal: + value: + floatRef: {fileID: 0} + floatVal: 10 +--- !u!114 &979963247 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0729d4f369e6a4241a6e7e3b8b9c1933, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 4 + errorMessage: + indentLevel: 0 + animatorOLD: {fileID: 0} + parameterNameOLD: + _animator: + animatorRef: {fileID: 0} + animatorVal: {fileID: 1766204519} + _parameterName: + stringRef: {fileID: 0} + stringVal: +--- !u!114 &979963248 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a3ff412ad89846a47a70a620a222cbf8, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 5 + errorMessage: + indentLevel: 0 + SettingsStringOLD: + ParentTransform: {fileID: 837453088} + _SettingsString: + stringRef: {fileID: 0} + stringVal: blergh + waitDuration: 5 +--- !u!114 &979963249 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bc30c92f7ffe3d746ac76cd528d616e5, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 6 + errorMessage: + indentLevel: 0 + audioSourceOLD: {fileID: 0} + control: 0 + _audioSource: + audioSourceRef: {fileID: 0} + audioSourceVal: {fileID: 1197120974} + startVolume: 1 + endVolume: 1 + fadeDuration: 1 + waitUntilFinished: 0 +--- !u!114 &979963250 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d81be3d7e84da460788dccea95a3313a, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 7 + errorMessage: + indentLevel: 0 + targetGameObjectOLD: {fileID: 0} + _targetGameObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1197120973} +--- !u!114 &979963251 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae67a23cb4aa74793b41258ae40bf321, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 8 + errorMessage: + indentLevel: 0 + stopParentFlowchart: 0 + targetFlowcharts: [] +--- !u!1 &1197120973 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1197120975} + - 82: {fileID: 1197120974} + m_Layer: 0 + m_Name: Audio Source + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!82 &1197120974 +AudioSource: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1197120973} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 +--- !u!4 &1197120975 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1197120973} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.44973594, y: -1.4485286, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 +--- !u!1 &1766204518 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1766204520} + - 95: {fileID: 1766204519} + m_Layer: 0 + m_Name: Animator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!95 &1766204519 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1766204518} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 0} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 +--- !u!4 &1766204520 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1766204518} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.44973594, y: -1.4485286, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 diff --git a/Assets/UpdatePropTest.unity.meta b/Assets/UpdatePropTest.unity.meta new file mode 100644 index 00000000..346da839 --- /dev/null +++ b/Assets/UpdatePropTest.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4e74bd9b121c140d080875fc1eb3d999 +timeCreated: 1457889073 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: From 2536ae43519eddece6869b7237e2d805eb0e1dc3 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 19 Mar 2016 01:46:47 -0700 Subject: [PATCH 09/24] Reduced width of variable popup --- Assets/Fungus/Flowchart/Editor/VariableEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Fungus/Flowchart/Editor/VariableEditor.cs b/Assets/Fungus/Flowchart/Editor/VariableEditor.cs index 935bf295..3daea4ed 100644 --- a/Assets/Fungus/Flowchart/Editor/VariableEditor.cs +++ b/Assets/Fungus/Flowchart/Editor/VariableEditor.cs @@ -209,7 +209,7 @@ namespace Fungus protected virtual void DrawSingleLineProperty(Rect rect, GUIContent label, SerializedProperty referenceProp, SerializedProperty valueProp, Flowchart flowchart) { - const int popupWidth = 60; + const int popupWidth = 17; Rect controlRect = EditorGUI.PrefixLabel(rect, label); Rect valueRect = controlRect; From 26393281c3400edd7c8ce4e574c5ed4d225bcffb Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 19 Mar 2016 01:46:58 -0700 Subject: [PATCH 10/24] Updated test scene --- Assets/UpdatePropTest.unity | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Assets/UpdatePropTest.unity b/Assets/UpdatePropTest.unity index e38faf4a..70052c24 100644 --- a/Assets/UpdatePropTest.unity +++ b/Assets/UpdatePropTest.unity @@ -305,6 +305,7 @@ GameObject: - 114: {fileID: 979963249} - 114: {fileID: 979963250} - 114: {fileID: 979963251} + - 114: {fileID: 979963252} m_Layer: 0 m_Name: Flowchart m_TagString: Untagged @@ -337,9 +338,11 @@ MonoBehaviour: width: 1114 height: 859 selectedBlock: {fileID: 979963241} - selectedCommands: [] + selectedCommands: + - {fileID: 979963250} variables: - {fileID: 979963244} + - {fileID: 979963252} description: stepPause: 0 colorCommands: 1 @@ -591,6 +594,20 @@ MonoBehaviour: indentLevel: 0 stopParentFlowchart: 0 targetFlowcharts: [] +--- !u!114 &979963252 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1941e052c0ed4280b25507cd2e6ad8f, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: Var1 + value: {fileID: 0} --- !u!1 &1197120973 GameObject: m_ObjectHideFlags: 0 From 13235abdc0c73ccc693448dd8c519fd3ae46fe19 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 19 Mar 2016 01:57:55 -0700 Subject: [PATCH 11/24] LoadScene uses variables --- .../Flowchart/Scripts/Commands/LoadScene.cs | 41 ++++++++++++++----- .../Flowchart/Scripts/Commands/OpenURL.cs | 6 +-- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs b/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs index 8fe57f47..864ead5c 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs @@ -1,43 +1,64 @@ using UnityEngine; +using UnityEngine.Serialization; using System; using System.Collections; namespace Fungus { [CommandInfo("Flow", - "Load Scene", - "Loads a new Unity scene and displays an optional loading image. This is useful " + - "for splitting a large game across multiple scene files to reduce peak memory " + - "usage. Previously loaded assets will be released before loading the scene to free up memory." + - "The scene to be loaded must be added to the scene list in Build Settings.")] + "Load Scene", + "Loads a new Unity scene and displays an optional loading image. This is useful " + + "for splitting a large game across multiple scene files to reduce peak memory " + + "usage. Previously loaded assets will be released before loading the scene to free up memory." + + "The scene to be loaded must be added to the scene list in Build Settings.")] [AddComponentMenu("")] - public class LoadScene : Command + public class LoadScene : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("sceneName")] public string sceneNameOLD; + #endregion + [Tooltip("Name of the scene to load. The scene must also be added to the build settings.")] - public string sceneName = ""; + public StringData _sceneName = new StringData(""); [Tooltip("Image to display while loading the scene")] public Texture2D loadingImage; public override void OnEnter() { - SceneLoader.LoadScene(sceneName, loadingImage); + SceneLoader.LoadScene(_sceneName.Value, loadingImage); } public override string GetSummary() { - if (sceneName.Length == 0) + if (_sceneName.Value.Length == 0) { return "Error: No scene name selected"; } - return sceneName; + return _sceneName; } public override Color GetButtonColor() { return new Color32(235, 191, 217, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (sceneNameOLD != default(string)) + { + _sceneName.Value = sceneNameOLD; + sceneNameOLD = default(string); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/OpenURL.cs b/Assets/Fungus/Flowchart/Scripts/Commands/OpenURL.cs index 2ebc8cdd..b92acf5f 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/OpenURL.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/OpenURL.cs @@ -11,18 +11,18 @@ namespace Fungus public class LinkToWebsite : Command { [Tooltip("URL to open in the browser")] - public string url; + public StringData url = new StringData(); public override void OnEnter() { - Application.OpenURL(url); + Application.OpenURL(url.Value); Continue(); } public override string GetSummary() { - return url; + return url.Value; } public override Color GetButtonColor() From 590c2c704d0a45e131cf8f03409fe3d09b94cb37 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 19 Mar 2016 02:05:12 -0700 Subject: [PATCH 12/24] SendMessage can use variable --- .../Flowchart/Scripts/Commands/SendMessage.cs | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs b/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs index 976db87f..cbb8e0fb 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,8 +8,12 @@ namespace Fungus "Send Message", "Sends a message to either the owner Flowchart or all Flowcharts in the scene. Blocks can listen for this message using a Message Received event handler.")] [AddComponentMenu("")] - public class SendMessage : Command + public class SendMessage : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("message")] public string messageOLD; + #endregion + public enum MessageTarget { SameFlowchart, @@ -19,11 +24,11 @@ namespace Fungus public MessageTarget messageTarget; [Tooltip("Name of the message to send")] - public string message = ""; + public StringData _message = new StringData(""); public override void OnEnter() { - if (message.Length == 0) + if (_message.Value.Length == 0) { Continue(); return; @@ -45,7 +50,7 @@ namespace Fungus { foreach (MessageReceived receiver in receivers) { - receiver.OnSendFungusMessage(message); + receiver.OnSendFungusMessage(_message); } } @@ -54,18 +59,34 @@ namespace Fungus public override string GetSummary() { - if (message.Length == 0) + if (_message.Value.Length == 0) { return "Error: No message specified"; } - return message; + return _message; } public override Color GetButtonColor() { return new Color32(235, 191, 217, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (messageOLD != default(string)) + { + _message.Value = messageOLD; + messageOLD = default(string); + } + } } } \ No newline at end of file From ccef8585c2805a696af257367a0a0d09fac39fae Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 19 Mar 2016 02:10:37 -0700 Subject: [PATCH 13/24] SetActive can sue a variable --- .../Flowchart/Scripts/Commands/SetActive.cs | 35 ++++++++-- Assets/UpdatePropTest.unity | 69 ++++++++++++++++++- 2 files changed, 95 insertions(+), 9 deletions(-) diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/SetActive.cs b/Assets/Fungus/Flowchart/Scripts/Commands/SetActive.cs index 69ad01b7..9116185a 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/SetActive.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/SetActive.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; using System.Collections.Generic; @@ -8,19 +9,23 @@ namespace Fungus "Set Active", "Sets a game object in the scene to be active / inactive.")] [AddComponentMenu("")] - public class SetActive : Command - { + public class SetActive : Command, ISerializationCallbackReceiver + { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD; + #endregion + [Tooltip("Reference to game object to enable / disable")] - public GameObject targetGameObject; + public GameObjectData _targetGameObject; [Tooltip("Set to true to enable the game object")] public BooleanData activeState; public override void OnEnter() { - if (targetGameObject != null) + if (_targetGameObject.Value != null) { - targetGameObject.SetActive(activeState.Value); + _targetGameObject.Value.SetActive(activeState.Value); } Continue(); @@ -28,18 +33,34 @@ namespace Fungus public override string GetSummary() { - if (targetGameObject == null) + if (_targetGameObject.Value == null) { return "Error: No game object selected"; } - return targetGameObject.name + " = " + activeState.GetDescription(); + return _targetGameObject.Value.name + " = " + activeState.GetDescription(); } public override Color GetButtonColor() { return new Color32(235, 191, 217, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (targetGameObjectOLD != null) + { + _targetGameObject.Value = targetGameObjectOLD; + targetGameObjectOLD = null; + } + } } } \ No newline at end of file diff --git a/Assets/UpdatePropTest.unity b/Assets/UpdatePropTest.unity index 70052c24..19c7b431 100644 --- a/Assets/UpdatePropTest.unity +++ b/Assets/UpdatePropTest.unity @@ -306,6 +306,9 @@ GameObject: - 114: {fileID: 979963250} - 114: {fileID: 979963251} - 114: {fileID: 979963252} + - 114: {fileID: 979963255} + - 114: {fileID: 979963254} + - 114: {fileID: 979963253} m_Layer: 0 m_Name: Flowchart m_TagString: Untagged @@ -339,7 +342,7 @@ MonoBehaviour: height: 859 selectedBlock: {fileID: 979963241} selectedCommands: - - {fileID: 979963250} + - {fileID: 979963253} variables: - {fileID: 979963244} - {fileID: 979963252} @@ -405,7 +408,10 @@ MonoBehaviour: - {fileID: 979963249} - {fileID: 979963248} - {fileID: 979963250} + - {fileID: 979963255} - {fileID: 979963251} + - {fileID: 979963254} + - {fileID: 979963253} --- !u!114 &979963242 MonoBehaviour: m_ObjectHideFlags: 2 @@ -607,7 +613,66 @@ MonoBehaviour: m_EditorClassIdentifier: scope: 0 key: Var1 - value: {fileID: 0} + value: {fileID: 1766204518} +--- !u!114 &979963253 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dbd8c931f22994b9d90e2037fffaa770, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 11 + errorMessage: + indentLevel: 0 + targetGameObjectOLD: {fileID: 0} + _targetGameObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 837453083} + activeState: + booleanRef: {fileID: 0} + booleanVal: 0 +--- !u!114 &979963254 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c43743931d28f43f89eced820d907351, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 10 + errorMessage: + indentLevel: 0 + messageOLD: + messageTarget: 0 + _message: + stringRef: {fileID: 0} + stringVal: +--- !u!114 &979963255 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 00d03ae0919f04264b018681ed534177, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 9 + errorMessage: + indentLevel: 0 + sceneNameOLD: + _sceneName: + stringRef: {fileID: 0} + stringVal: + loadingImage: {fileID: 0} --- !u!1 &1197120973 GameObject: m_ObjectHideFlags: 0 From d6f71ab4e57c4f943cedf7fed9ef38968b994a21 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 19 Mar 2016 02:21:45 -0700 Subject: [PATCH 14/24] Spawn Object can use variables --- .../Flowchart/Scripts/Commands/SpawnObject.cs | 65 +++++++++++++++---- Assets/UpdatePropTest.unity | 34 +++++++++- 2 files changed, 85 insertions(+), 14 deletions(-) diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/SpawnObject.cs b/Assets/Fungus/Flowchart/Scripts/Commands/SpawnObject.cs index a1360b91..5d22988c 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/SpawnObject.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/SpawnObject.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -10,54 +11,92 @@ namespace Fungus "Spawn Object", "Spawns a new object based on a reference to a scene or prefab game object.")] [AddComponentMenu("")] - public class SpawnObject : Command + public class SpawnObject : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("sourceObject")] public GameObject sourceObjectOLD; + [HideInInspector] [FormerlySerializedAs("parentTransform")] public Transform parentTransformOLD; + [HideInInspector] [FormerlySerializedAs("spawnPosition")] public Vector3 spawnPositionOLD; + [HideInInspector] [FormerlySerializedAs("spawnRotation")] public Vector3 spawnRotationOLD; + #endregion + [Tooltip("Game object to copy when spawning. Can be a scene object or a prefab.")] - public GameObject sourceObject; + public GameObjectData _sourceObject; [Tooltip("Transform to use for position of newly spawned object.")] - public Transform parentTransform; + public TransformData _parentTransform; [Tooltip("Local position of newly spawned object.")] - public Vector3 spawnPosition; + public Vector3Data _spawnPosition; [Tooltip("Local rotation of newly spawned object.")] - public Vector3 spawnRotation; + public Vector3Data _spawnRotation; public override void OnEnter() { - if (sourceObject == null) + if (_sourceObject.Value == null) { Continue(); return; } - GameObject newObject = GameObject.Instantiate(sourceObject); - if (parentTransform != null) + GameObject newObject = GameObject.Instantiate(_sourceObject.Value); + if (_parentTransform.Value != null) { - newObject.transform.parent = parentTransform; + newObject.transform.parent = _parentTransform.Value; } - newObject.transform.localPosition = spawnPosition; - newObject.transform.localRotation = Quaternion.Euler(spawnRotation); + newObject.transform.localPosition = _spawnPosition.Value; + newObject.transform.localRotation = Quaternion.Euler(_spawnRotation.Value); Continue(); } public override string GetSummary() { - if (sourceObject == null) + if (_sourceObject.Value == null) { return "Error: No source GameObject specified"; } - return sourceObject.name; + return _sourceObject.Value.name; } public override Color GetButtonColor() { return new Color32(235, 191, 217, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (sourceObjectOLD != null) + { + _sourceObject.Value = sourceObjectOLD; + sourceObjectOLD = null; + } + if (parentTransformOLD != null) + { + _parentTransform.Value = parentTransformOLD; + parentTransformOLD = null; + } + if (spawnPositionOLD != default(Vector3)) + { + _spawnPosition.Value = spawnPositionOLD; + spawnPositionOLD = default(Vector3); + } + if (spawnRotationOLD != default(Vector3)) + { + _spawnRotation.Value = spawnRotationOLD; + spawnRotationOLD = default(Vector3); + } + } } } \ No newline at end of file diff --git a/Assets/UpdatePropTest.unity b/Assets/UpdatePropTest.unity index 19c7b431..e2fda5f3 100644 --- a/Assets/UpdatePropTest.unity +++ b/Assets/UpdatePropTest.unity @@ -309,6 +309,7 @@ GameObject: - 114: {fileID: 979963255} - 114: {fileID: 979963254} - 114: {fileID: 979963253} + - 114: {fileID: 979963256} m_Layer: 0 m_Name: Flowchart m_TagString: Untagged @@ -342,7 +343,7 @@ MonoBehaviour: height: 859 selectedBlock: {fileID: 979963241} selectedCommands: - - {fileID: 979963253} + - {fileID: 979963256} variables: - {fileID: 979963244} - {fileID: 979963252} @@ -412,6 +413,7 @@ MonoBehaviour: - {fileID: 979963251} - {fileID: 979963254} - {fileID: 979963253} + - {fileID: 979963256} --- !u!114 &979963242 MonoBehaviour: m_ObjectHideFlags: 2 @@ -673,6 +675,36 @@ MonoBehaviour: stringRef: {fileID: 0} stringVal: loadingImage: {fileID: 0} +--- !u!114 &979963256 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bb3e86f556e074b84af1cc7eb8f8e5e7, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 12 + errorMessage: + indentLevel: 0 + sourceObjectOLD: {fileID: 0} + parentTransformOLD: {fileID: 0} + spawnPositionOLD: {x: 0, y: 0, z: 0} + spawnRotationOLD: {x: 0, y: 0, z: 0} + _sourceObject: + gameObjectRef: {fileID: 0} + gameObjectVal: {fileID: 1197120973} + _parentTransform: + transformRef: {fileID: 0} + transformVal: {fileID: 837453088} + _spawnPosition: + vector3Ref: {fileID: 0} + vector3Val: {x: 5, y: 2, z: 1} + _spawnRotation: + vector3Ref: {fileID: 0} + vector3Val: {x: 3, y: 2, z: 4} --- !u!1 &1197120973 GameObject: m_ObjectHideFlags: 0 From 4fbd677820a56afb89a381436203eadcadf1f700 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 19 Mar 2016 02:27:14 -0700 Subject: [PATCH 15/24] Wait command can use a variable --- .../Fungus/Flowchart/Scripts/Commands/Wait.cs | 30 +++++++++++++++---- Assets/UpdatePropTest.unity | 19 +++++++++++- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/Wait.cs b/Assets/Fungus/Flowchart/Scripts/Commands/Wait.cs index 35989a7b..6b906e46 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/Wait.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/Wait.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System; using System.Collections; @@ -7,16 +8,19 @@ namespace Fungus [CommandInfo("Flow", "Wait", "Waits for period of time before executing the next command in the block.")] - [AddComponentMenu("")] - public class Wait : Command + public class Wait : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; + #endregion + [Tooltip("Duration to wait for")] - public float duration = 1; + public FloatData _duration = new FloatData(1); public override void OnEnter() { - Invoke ("OnWaitComplete", duration); + Invoke ("OnWaitComplete", _duration.Value); } void OnWaitComplete() @@ -26,13 +30,29 @@ namespace Fungus public override string GetSummary() { - return duration.ToString() + " seconds"; + return _duration.Value.ToString() + " seconds"; } public override Color GetButtonColor() { return new Color32(235, 191, 217, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (durationOLD != default(float)) + { + _duration.Value = durationOLD; + durationOLD = default(float); + } + } } } \ No newline at end of file diff --git a/Assets/UpdatePropTest.unity b/Assets/UpdatePropTest.unity index e2fda5f3..ab3c9b74 100644 --- a/Assets/UpdatePropTest.unity +++ b/Assets/UpdatePropTest.unity @@ -310,6 +310,7 @@ GameObject: - 114: {fileID: 979963254} - 114: {fileID: 979963253} - 114: {fileID: 979963256} + - 114: {fileID: 979963257} m_Layer: 0 m_Name: Flowchart m_TagString: Untagged @@ -343,7 +344,7 @@ MonoBehaviour: height: 859 selectedBlock: {fileID: 979963241} selectedCommands: - - {fileID: 979963256} + - {fileID: 979963257} variables: - {fileID: 979963244} - {fileID: 979963252} @@ -414,6 +415,7 @@ MonoBehaviour: - {fileID: 979963254} - {fileID: 979963253} - {fileID: 979963256} + - {fileID: 979963257} --- !u!114 &979963242 MonoBehaviour: m_ObjectHideFlags: 2 @@ -705,6 +707,21 @@ MonoBehaviour: _spawnRotation: vector3Ref: {fileID: 0} vector3Val: {x: 3, y: 2, z: 4} +--- !u!114 &979963257 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3315ad2ebb85443909a1203d56d9344e, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 13 + errorMessage: + indentLevel: 0 + duration: 5 --- !u!1 &1197120973 GameObject: m_ObjectHideFlags: 0 From 42c77d899b5d99b6607b47fbacd23b295f539eb2 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 19 Mar 2016 02:44:23 -0700 Subject: [PATCH 16/24] MenuTimer can now use a variable --- .../Narrative/Editor/MenuTimerEditor.cs | 2 +- .../Narrative/Scripts/Commands/MenuTimer.cs | 26 ++++++++++++++++--- Assets/UpdatePropTest.unity | 25 ++++++++++++++++-- 3 files changed, 47 insertions(+), 6 deletions(-) diff --git a/Assets/Fungus/Narrative/Editor/MenuTimerEditor.cs b/Assets/Fungus/Narrative/Editor/MenuTimerEditor.cs index 4c94911f..666c55aa 100644 --- a/Assets/Fungus/Narrative/Editor/MenuTimerEditor.cs +++ b/Assets/Fungus/Narrative/Editor/MenuTimerEditor.cs @@ -17,7 +17,7 @@ namespace Fungus if (NullTargetCheck()) // Check for an orphaned editor instance return; - durationProp = serializedObject.FindProperty("duration"); + durationProp = serializedObject.FindProperty("_duration"); targetBlockProp = serializedObject.FindProperty("targetBlock"); } diff --git a/Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs b/Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs index dbee1b84..09066563 100644 --- a/Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs +++ b/Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs @@ -11,10 +11,14 @@ namespace Fungus "Menu Timer", "Displays a timer bar and executes a target block if the player fails to select a menu option in time.")] [AddComponentMenu("")] - public class MenuTimer : Command + public class MenuTimer : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; + #endregion + [Tooltip("Length of time to display the timer for")] - public float duration; + public FloatData _duration = new FloatData(1); [FormerlySerializedAs("targetSequence")] [Tooltip("Block to execute when the timer expires")] @@ -27,7 +31,7 @@ namespace Fungus if (menuDialog != null && targetBlock != null) { - menuDialog.ShowTimer(duration, targetBlock); + menuDialog.ShowTimer(_duration.Value, targetBlock); } Continue(); @@ -55,6 +59,22 @@ namespace Fungus { return new Color32(184, 210, 235, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (durationOLD != default(float)) + { + _duration.Value = durationOLD; + durationOLD = default(float); + } + } } } \ No newline at end of file diff --git a/Assets/UpdatePropTest.unity b/Assets/UpdatePropTest.unity index ab3c9b74..e18423d2 100644 --- a/Assets/UpdatePropTest.unity +++ b/Assets/UpdatePropTest.unity @@ -311,6 +311,7 @@ GameObject: - 114: {fileID: 979963253} - 114: {fileID: 979963256} - 114: {fileID: 979963257} + - 114: {fileID: 979963258} m_Layer: 0 m_Name: Flowchart m_TagString: Untagged @@ -344,7 +345,7 @@ MonoBehaviour: height: 859 selectedBlock: {fileID: 979963241} selectedCommands: - - {fileID: 979963257} + - {fileID: 979963258} variables: - {fileID: 979963244} - {fileID: 979963252} @@ -416,6 +417,7 @@ MonoBehaviour: - {fileID: 979963253} - {fileID: 979963256} - {fileID: 979963257} + - {fileID: 979963258} --- !u!114 &979963242 MonoBehaviour: m_ObjectHideFlags: 2 @@ -721,7 +723,26 @@ MonoBehaviour: itemId: 13 errorMessage: indentLevel: 0 - duration: 5 + durationOLD: 0 + _duration: + floatRef: {fileID: 0} + floatVal: 5 +--- !u!114 &979963258 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ab54728d981544842843ba6609b9a80a, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 14 + errorMessage: + indentLevel: 0 + duration: 6 + targetBlock: {fileID: 979963241} --- !u!1 &1197120973 GameObject: m_ObjectHideFlags: 0 From c600a4847597ece18d2e6a42a99dc7360fd210f3 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 19 Mar 2016 02:54:20 -0700 Subject: [PATCH 17/24] SetLanguage can use a variable --- .../Narrative/Scripts/Commands/SetLanguage.cs | 31 ++++++++++++++++--- Assets/UpdatePropTest.unity | 27 ++++++++++++++-- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs b/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs index 22d91709..1d835292 100644 --- a/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs +++ b/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System.Collections; namespace Fungus @@ -7,10 +8,14 @@ namespace Fungus "Set Language", "Set the active language for the scene. A Localization object with a localization file must be present in the scene.")] [AddComponentMenu("")] - public class SetLanguage : Command + public class SetLanguage : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("languageCode")] public string languageCodeOLD; + #endregion + [Tooltip("Code of the language to set. e.g. ES, DE, JA")] - public string languageCode; + public StringData _languageCode = new StringData(); public static string mostRecentLanguage = ""; @@ -19,11 +24,11 @@ namespace Fungus Localization localization = GameObject.FindObjectOfType(); if (localization != null) { - localization.SetActiveLanguage(languageCode, true); + localization.SetActiveLanguage(_languageCode.Value, true); // Cache the most recently set language code so we can continue to // use the same language in subsequent scenes. - mostRecentLanguage = languageCode; + mostRecentLanguage = _languageCode.Value; } Continue(); @@ -31,12 +36,28 @@ namespace Fungus public override string GetSummary() { - return languageCode; + return _languageCode.Value; } public override Color GetButtonColor() { return new Color32(184, 210, 235, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (languageCodeOLD != default(string)) + { + _languageCode.Value = languageCodeOLD; + languageCodeOLD = default(string); + } + } } } \ No newline at end of file diff --git a/Assets/UpdatePropTest.unity b/Assets/UpdatePropTest.unity index e18423d2..a936e51d 100644 --- a/Assets/UpdatePropTest.unity +++ b/Assets/UpdatePropTest.unity @@ -312,6 +312,7 @@ GameObject: - 114: {fileID: 979963256} - 114: {fileID: 979963257} - 114: {fileID: 979963258} + - 114: {fileID: 979963259} m_Layer: 0 m_Name: Flowchart m_TagString: Untagged @@ -345,7 +346,7 @@ MonoBehaviour: height: 859 selectedBlock: {fileID: 979963241} selectedCommands: - - {fileID: 979963258} + - {fileID: 979963259} variables: - {fileID: 979963244} - {fileID: 979963252} @@ -418,6 +419,7 @@ MonoBehaviour: - {fileID: 979963256} - {fileID: 979963257} - {fileID: 979963258} + - {fileID: 979963259} --- !u!114 &979963242 MonoBehaviour: m_ObjectHideFlags: 2 @@ -741,8 +743,29 @@ MonoBehaviour: itemId: 14 errorMessage: indentLevel: 0 - duration: 6 + durationOLD: 0 + _duration: + floatRef: {fileID: 0} + floatVal: 6 targetBlock: {fileID: 979963241} +--- !u!114 &979963259 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3fc625e237d6048bf86f34835d8266d9, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 15 + errorMessage: + indentLevel: 0 + languageCodeOLD: + _languageCode: + stringRef: {fileID: 0} + stringVal: ES --- !u!1 &1197120973 GameObject: m_ObjectHideFlags: 0 From e30072ce6b19196b1a138c94cbd0ca9639af9c7d Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 19 Mar 2016 03:03:38 -0700 Subject: [PATCH 18/24] FadeSprite can use variables --- .../Sprite/Scripts/Commands/FadeSprite.cs | 37 ++++++++++++++++--- .../Sprite/Scripts/Commands/ShowSprite.cs | 1 + 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/Assets/Fungus/Sprite/Scripts/Commands/FadeSprite.cs b/Assets/Fungus/Sprite/Scripts/Commands/FadeSprite.cs index e5647529..6a008ee6 100644 --- a/Assets/Fungus/Sprite/Scripts/Commands/FadeSprite.cs +++ b/Assets/Fungus/Sprite/Scripts/Commands/FadeSprite.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System; using System.Collections; @@ -8,16 +9,21 @@ namespace Fungus "Fade Sprite", "Fades a sprite to a target color over a period of time.")] [AddComponentMenu("")] - public class FadeSprite : Command + public class FadeSprite : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; + [HideInInspector] [FormerlySerializedAs("targetColor")] public Color targetColorOLD; + #endregion + [Tooltip("Sprite object to be faded")] public SpriteRenderer spriteRenderer; [Tooltip("Length of time to perform the fade")] - public float duration = 1f; + public FloatData _duration = new FloatData(1f); [Tooltip("Target color to fade to. To only fade transparency level, set the color to white and set the alpha to required transparency.")] - public Color targetColor = Color.white; + public ColorData _targetColor = new ColorData(Color.white); [Tooltip("Wait until the fade has finished before executing the next command")] public bool waitUntilFinished = true; @@ -37,7 +43,7 @@ namespace Fungus cameraController.waiting = true; } - SpriteFader.FadeSprite(spriteRenderer, targetColor, duration, Vector2.zero, delegate { + SpriteFader.FadeSprite(spriteRenderer, _targetColor.Value, _duration.Value, Vector2.zero, delegate { if (waitUntilFinished) { cameraController.waiting = false; @@ -58,13 +64,34 @@ namespace Fungus return "Error: No sprite renderer selected"; } - return spriteRenderer.name + " to " + targetColor.ToString(); + return spriteRenderer.name + " to " + _targetColor.Value.ToString(); } public override Color GetButtonColor() { return new Color32(221, 184, 169, 255); } + + // + // ISerializationCallbackReceiver implementation + // + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (durationOLD != default(float)) + { + _duration.Value = durationOLD; + durationOLD = default(float); + } + if (targetColorOLD != default(Color)) + { + _targetColor.Value = targetColorOLD; + targetColorOLD = default(Color); + } + } } } \ No newline at end of file diff --git a/Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs b/Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs index bdeca0ef..f0c42980 100644 --- a/Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs +++ b/Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs @@ -16,6 +16,7 @@ namespace Fungus [Tooltip("Make the sprite visible or invisible")] public bool visible = true; + [Tooltip("Affect the visibility of child sprites")] public bool affectChildren = true; public override void OnEnter() From 73a44489a70753e55cad4e18e80e36b9f2865746 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 19 Mar 2016 03:13:24 -0700 Subject: [PATCH 19/24] ShowSprite can use a variable --- .../Sprite/Scripts/Commands/ShowSprite.cs | 32 ++++++++++-- Assets/UpdatePropTest.unity | 49 ++++++++++++++++++- 2 files changed, 74 insertions(+), 7 deletions(-) diff --git a/Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs b/Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs index f0c42980..68472dd0 100644 --- a/Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs +++ b/Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.Serialization; using System; using System.Collections; @@ -8,13 +9,17 @@ namespace Fungus "Show Sprite", "Makes a sprite visible / invisible by setting the color alpha.")] [AddComponentMenu("")] - public class ShowSprite : Command + public class ShowSprite : Command, ISerializationCallbackReceiver { + #region Obsolete Properties + [HideInInspector] [FormerlySerializedAs("visible")] public bool visibleOLD; + #endregion + [Tooltip("Sprite object to be made visible / invisible")] public SpriteRenderer spriteRenderer; [Tooltip("Make the sprite visible or invisible")] - public bool visible = true; + public BooleanData _visible = new BooleanData(false); [Tooltip("Affect the visibility of child sprites")] public bool affectChildren = true; @@ -28,12 +33,12 @@ namespace Fungus SpriteRenderer[] children = spriteRenderer.gameObject.GetComponentsInChildren(); foreach (SpriteRenderer sr in children) { - SetSpriteAlpha(sr, visible); + SetSpriteAlpha(sr, _visible.Value); } } else { - SetSpriteAlpha(spriteRenderer, visible); + SetSpriteAlpha(spriteRenderer, _visible.Value); } } @@ -54,13 +59,30 @@ namespace Fungus return "Error: No sprite renderer selected"; } - return spriteRenderer.name + " to " + (visible ? "visible" : "invisible"); + return spriteRenderer.name + " to " + (_visible.Value ? "visible" : "invisible"); } public override Color GetButtonColor() { return new Color32(221, 184, 169, 255); } + + + // + // ISerializationCallbackReceiver implementation + // + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (visibleOLD != default(bool)) + { + _visible.Value = visibleOLD; + visibleOLD = default(bool); + } + } } } \ No newline at end of file diff --git a/Assets/UpdatePropTest.unity b/Assets/UpdatePropTest.unity index a936e51d..b8ed0a43 100644 --- a/Assets/UpdatePropTest.unity +++ b/Assets/UpdatePropTest.unity @@ -313,6 +313,8 @@ GameObject: - 114: {fileID: 979963257} - 114: {fileID: 979963258} - 114: {fileID: 979963259} + - 114: {fileID: 979963261} + - 114: {fileID: 979963260} m_Layer: 0 m_Name: Flowchart m_TagString: Untagged @@ -346,7 +348,7 @@ MonoBehaviour: height: 859 selectedBlock: {fileID: 979963241} selectedCommands: - - {fileID: 979963259} + - {fileID: 979963260} variables: - {fileID: 979963244} - {fileID: 979963252} @@ -420,6 +422,8 @@ MonoBehaviour: - {fileID: 979963257} - {fileID: 979963258} - {fileID: 979963259} + - {fileID: 979963261} + - {fileID: 979963260} --- !u!114 &979963242 MonoBehaviour: m_ObjectHideFlags: 2 @@ -765,7 +769,48 @@ MonoBehaviour: languageCodeOLD: _languageCode: stringRef: {fileID: 0} - stringVal: ES + stringVal: +--- !u!114 &979963260 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 10cd462c89cb047158ccfb8a8df3f60a, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 17 + errorMessage: + indentLevel: 0 + spriteRenderer: {fileID: 0} + visible: 0 + affectChildren: 1 +--- !u!114 &979963261 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 979963238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: accc065c3e9a6457496f075b1bd49adc, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 16 + errorMessage: + indentLevel: 0 + durationOLD: 0 + targetColorOLD: {r: 0, g: 0, b: 0, a: 0} + spriteRenderer: {fileID: 0} + _duration: + floatRef: {fileID: 0} + floatVal: 5 + _targetColor: + colorRef: {fileID: 0} + colorVal: {r: 0.7205882, g: 0.10067042, b: 0.10067042, a: 1} + waitUntilFinished: 1 --- !u!1 &1197120973 GameObject: m_ObjectHideFlags: 0 From 9ee98e5b4276f3a57519e7f5b2dd12db63a601d4 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 22 Mar 2016 12:09:06 +0000 Subject: [PATCH 20/24] Moved Backwards compatibility region to bottom of source files --- .../Scripts/Commands/ResetAnimTrigger.cs | 14 ++++++-------- .../Animation/Scripts/Commands/SetAnimBool.cs | 14 ++++++-------- .../Animation/Scripts/Commands/SetAnimFloat.cs | 14 ++++++-------- .../Scripts/Commands/SetAnimInteger.cs | 14 ++++++-------- .../Scripts/Commands/SetAnimTrigger.cs | 14 ++++++-------- .../Audio/Scripts/Commands/ControlAudio.cs | 12 +++++------- .../Audio/Scripts/Commands/PlayUsfxrSound.cs | 11 ++++------- .../Flowchart/Scripts/Commands/Destroy.cs | 12 +++++------- .../Flowchart/Scripts/Commands/LoadScene.cs | 12 +++++------- .../Flowchart/Scripts/Commands/SendMessage.cs | 12 +++++------- .../Flowchart/Scripts/Commands/SetActive.cs | 12 +++++------- .../Flowchart/Scripts/Commands/SpawnObject.cs | 18 ++++++++---------- .../Fungus/Flowchart/Scripts/Commands/Wait.cs | 12 +++++------- .../Narrative/Scripts/Commands/MenuTimer.cs | 14 ++++++-------- .../Narrative/Scripts/Commands/SetLanguage.cs | 12 +++++------- .../Sprite/Scripts/Commands/FadeSprite.cs | 14 ++++++-------- .../Sprite/Scripts/Commands/ShowSprite.cs | 11 ++++------- .../Fungus/iTween/Scripts/Commands/LookFrom.cs | 14 ++++++-------- .../Fungus/iTween/Scripts/Commands/LookTo.cs | 14 ++++++-------- .../Fungus/iTween/Scripts/Commands/MoveAdd.cs | 12 +++++------- .../Fungus/iTween/Scripts/Commands/MoveFrom.cs | 14 ++++++-------- .../Fungus/iTween/Scripts/Commands/MoveTo.cs | 14 ++++++-------- .../iTween/Scripts/Commands/PunchPosition.cs | 12 +++++------- .../iTween/Scripts/Commands/PunchRotation.cs | 12 +++++------- .../iTween/Scripts/Commands/PunchScale.cs | 12 +++++------- .../iTween/Scripts/Commands/RotateAdd.cs | 12 +++++------- .../iTween/Scripts/Commands/RotateFrom.cs | 14 ++++++-------- .../Fungus/iTween/Scripts/Commands/RotateTo.cs | 14 ++++++-------- .../Fungus/iTween/Scripts/Commands/ScaleAdd.cs | 12 +++++------- .../iTween/Scripts/Commands/ScaleFrom.cs | 14 ++++++-------- .../Fungus/iTween/Scripts/Commands/ScaleTo.cs | 14 ++++++-------- .../iTween/Scripts/Commands/ShakePosition.cs | 12 +++++------- .../iTween/Scripts/Commands/ShakeRotation.cs | 12 +++++------- .../iTween/Scripts/Commands/ShakeScale.cs | 12 +++++------- .../iTween/Scripts/Commands/StopTween.cs | 12 +++++------- .../iTween/Scripts/Commands/iTweenCommand.cs | 16 +++++++--------- 36 files changed, 198 insertions(+), 272 deletions(-) diff --git a/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs b/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs index 1976b7a7..9bdc1834 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs @@ -11,11 +11,6 @@ namespace Fungus [AddComponentMenu("")] public class ResetAnimTrigger : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; - [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; - #endregion - [Tooltip("Reference to an Animator component in a game object")] public AnimatorData _animator; @@ -47,9 +42,10 @@ namespace Fungus return new Color32(170, 204, 169, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; public void OnBeforeSerialize() {} @@ -68,6 +64,8 @@ namespace Fungus parameterNameOLD = null; } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs index bd91c85a..2cbd6642 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs @@ -11,11 +11,6 @@ namespace Fungus [AddComponentMenu("")] public class SetAnimBool : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; - [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; - #endregion - [Tooltip("Reference to an Animator component in a game object")] public AnimatorData _animator; @@ -50,9 +45,10 @@ namespace Fungus return new Color32(170, 204, 169, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; public void OnBeforeSerialize() {} @@ -71,6 +67,8 @@ namespace Fungus parameterNameOLD = null; } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs index c0cf9fe8..096954f5 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs @@ -11,11 +11,6 @@ namespace Fungus [AddComponentMenu("")] public class SetAnimFloat : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; - [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; - #endregion - [Tooltip("Reference to an Animator component in a game object")] public AnimatorData _animator; @@ -50,9 +45,10 @@ namespace Fungus return new Color32(170, 204, 169, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; public void OnBeforeSerialize() {} @@ -71,6 +67,8 @@ namespace Fungus parameterNameOLD = null; } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs index 307a8374..29add857 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs @@ -11,11 +11,6 @@ namespace Fungus [AddComponentMenu("")] public class SetAnimInteger : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; - [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; - #endregion - [Tooltip("Reference to an Animator component in a game object")] public AnimatorData _animator; @@ -50,9 +45,10 @@ namespace Fungus return new Color32(170, 204, 169, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; public void OnBeforeSerialize() {} @@ -71,6 +67,8 @@ namespace Fungus parameterNameOLD = null; } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs index e2a73909..935973bf 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs @@ -11,11 +11,6 @@ namespace Fungus [AddComponentMenu("")] public class SetAnimTrigger : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; - [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; - #endregion - [Tooltip("Reference to an Animator component in a game object")] public AnimatorData _animator; @@ -47,9 +42,10 @@ namespace Fungus return new Color32(170, 204, 169, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; public void OnBeforeSerialize() {} @@ -68,6 +64,8 @@ namespace Fungus parameterNameOLD = null; } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs b/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs index e1a17011..e7ae9263 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs @@ -9,10 +9,6 @@ namespace Fungus "Plays, loops, or stops an audiosource. Any AudioSources with the same tag as the target Audio Source will automatically be stoped.")] public class ControlAudio : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("audioSource")] public AudioSource audioSourceOLD; - #endregion - public enum controlType { PlayOnce, @@ -262,9 +258,9 @@ namespace Fungus return new Color32(242, 209, 176, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("audioSource")] public AudioSource audioSourceOLD; public virtual void OnBeforeSerialize() {} @@ -277,6 +273,8 @@ namespace Fungus audioSourceOLD = null; } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs b/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs index cff75f29..6f1f7eb5 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs @@ -9,10 +9,6 @@ [AddComponentMenu("")] public class PlayUsfxrSound : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("SettingsString")] public String SettingsStringOLD; - #endregion - protected SfxrSynth _synth = new SfxrSynth(); [Tooltip("Transform to use for positional audio")] @@ -69,9 +65,9 @@ return new Color32(128, 200, 200, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("SettingsString")] public String SettingsStringOLD; public virtual void OnBeforeSerialize() {} @@ -85,5 +81,6 @@ } } + #endregion } } diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/Destroy.cs b/Assets/Fungus/Flowchart/Scripts/Commands/Destroy.cs index bb8d145f..783efa68 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/Destroy.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/Destroy.cs @@ -11,10 +11,6 @@ namespace Fungus [AddComponentMenu("")] public class Destroy : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD; - #endregion - [Tooltip("Reference to game object to destroy")] public GameObjectData _targetGameObject; @@ -43,9 +39,9 @@ namespace Fungus return new Color32(235, 191, 217, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD; public virtual void OnBeforeSerialize() {} @@ -58,6 +54,8 @@ namespace Fungus targetGameObjectOLD = null; } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs b/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs index 864ead5c..4dc19f24 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs @@ -14,10 +14,6 @@ namespace Fungus [AddComponentMenu("")] public class LoadScene : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("sceneName")] public string sceneNameOLD; - #endregion - [Tooltip("Name of the scene to load. The scene must also be added to the build settings.")] public StringData _sceneName = new StringData(""); @@ -44,9 +40,9 @@ namespace Fungus return new Color32(235, 191, 217, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("sceneName")] public string sceneNameOLD; public virtual void OnBeforeSerialize() {} @@ -59,6 +55,8 @@ namespace Fungus sceneNameOLD = default(string); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs b/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs index cbb8e0fb..35708df8 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs @@ -10,10 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class SendMessage : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("message")] public string messageOLD; - #endregion - public enum MessageTarget { SameFlowchart, @@ -72,9 +68,9 @@ namespace Fungus return new Color32(235, 191, 217, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("message")] public string messageOLD; public virtual void OnBeforeSerialize() {} @@ -87,6 +83,8 @@ namespace Fungus messageOLD = default(string); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/SetActive.cs b/Assets/Fungus/Flowchart/Scripts/Commands/SetActive.cs index 9116185a..4e0c4a5d 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/SetActive.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/SetActive.cs @@ -11,10 +11,6 @@ namespace Fungus [AddComponentMenu("")] public class SetActive : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD; - #endregion - [Tooltip("Reference to game object to enable / disable")] public GameObjectData _targetGameObject; @@ -46,9 +42,9 @@ namespace Fungus return new Color32(235, 191, 217, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD; public virtual void OnBeforeSerialize() {} @@ -61,6 +57,8 @@ namespace Fungus targetGameObjectOLD = null; } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/SpawnObject.cs b/Assets/Fungus/Flowchart/Scripts/Commands/SpawnObject.cs index 5d22988c..6fc6f947 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/SpawnObject.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/SpawnObject.cs @@ -13,13 +13,6 @@ namespace Fungus [AddComponentMenu("")] public class SpawnObject : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("sourceObject")] public GameObject sourceObjectOLD; - [HideInInspector] [FormerlySerializedAs("parentTransform")] public Transform parentTransformOLD; - [HideInInspector] [FormerlySerializedAs("spawnPosition")] public Vector3 spawnPositionOLD; - [HideInInspector] [FormerlySerializedAs("spawnRotation")] public Vector3 spawnRotationOLD; - #endregion - [Tooltip("Game object to copy when spawning. Can be a scene object or a prefab.")] public GameObjectData _sourceObject; @@ -67,9 +60,12 @@ namespace Fungus return new Color32(235, 191, 217, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("sourceObject")] public GameObject sourceObjectOLD; + [HideInInspector] [FormerlySerializedAs("parentTransform")] public Transform parentTransformOLD; + [HideInInspector] [FormerlySerializedAs("spawnPosition")] public Vector3 spawnPositionOLD; + [HideInInspector] [FormerlySerializedAs("spawnRotation")] public Vector3 spawnRotationOLD; public virtual void OnBeforeSerialize() {} @@ -97,6 +93,8 @@ namespace Fungus spawnRotationOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/Wait.cs b/Assets/Fungus/Flowchart/Scripts/Commands/Wait.cs index 6b906e46..700afd85 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/Wait.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/Wait.cs @@ -11,10 +11,6 @@ namespace Fungus [AddComponentMenu("")] public class Wait : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; - #endregion - [Tooltip("Duration to wait for")] public FloatData _duration = new FloatData(1); @@ -38,9 +34,9 @@ namespace Fungus return new Color32(235, 191, 217, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; public virtual void OnBeforeSerialize() {} @@ -53,6 +49,8 @@ namespace Fungus durationOLD = default(float); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs b/Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs index 09066563..66924f78 100644 --- a/Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs +++ b/Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs @@ -12,11 +12,7 @@ namespace Fungus "Displays a timer bar and executes a target block if the player fails to select a menu option in time.")] [AddComponentMenu("")] public class MenuTimer : Command, ISerializationCallbackReceiver - { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; - #endregion - + { [Tooltip("Length of time to display the timer for")] public FloatData _duration = new FloatData(1); @@ -60,9 +56,9 @@ namespace Fungus return new Color32(184, 210, 235, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; public virtual void OnBeforeSerialize() {} @@ -75,6 +71,8 @@ namespace Fungus durationOLD = default(float); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs b/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs index 1d835292..32262544 100644 --- a/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs +++ b/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs @@ -10,10 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class SetLanguage : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("languageCode")] public string languageCodeOLD; - #endregion - [Tooltip("Code of the language to set. e.g. ES, DE, JA")] public StringData _languageCode = new StringData(); @@ -44,9 +40,9 @@ namespace Fungus return new Color32(184, 210, 235, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("languageCode")] public string languageCodeOLD; public virtual void OnBeforeSerialize() {} @@ -59,5 +55,7 @@ namespace Fungus languageCodeOLD = default(string); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Sprite/Scripts/Commands/FadeSprite.cs b/Assets/Fungus/Sprite/Scripts/Commands/FadeSprite.cs index 6a008ee6..900964a5 100644 --- a/Assets/Fungus/Sprite/Scripts/Commands/FadeSprite.cs +++ b/Assets/Fungus/Sprite/Scripts/Commands/FadeSprite.cs @@ -11,11 +11,6 @@ namespace Fungus [AddComponentMenu("")] public class FadeSprite : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; - [HideInInspector] [FormerlySerializedAs("targetColor")] public Color targetColorOLD; - #endregion - [Tooltip("Sprite object to be faded")] public SpriteRenderer spriteRenderer; @@ -72,9 +67,10 @@ namespace Fungus return new Color32(221, 184, 169, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; + [HideInInspector] [FormerlySerializedAs("targetColor")] public Color targetColorOLD; public virtual void OnBeforeSerialize() {} @@ -92,6 +88,8 @@ namespace Fungus targetColorOLD = default(Color); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs b/Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs index 68472dd0..41c369ae 100644 --- a/Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs +++ b/Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs @@ -11,10 +11,6 @@ namespace Fungus [AddComponentMenu("")] public class ShowSprite : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("visible")] public bool visibleOLD; - #endregion - [Tooltip("Sprite object to be made visible / invisible")] public SpriteRenderer spriteRenderer; @@ -67,10 +63,9 @@ namespace Fungus return new Color32(221, 184, 169, 255); } + #region Backwards compatibility - // - // ISerializationCallbackReceiver implementation - // + [HideInInspector] [FormerlySerializedAs("visible")] public bool visibleOLD; public virtual void OnBeforeSerialize() {} @@ -83,6 +78,8 @@ namespace Fungus visibleOLD = default(bool); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs index 2e84e721..afd16d4c 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs @@ -10,11 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class LookFrom : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; - [HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD; - #endregion - [Tooltip("Target transform that the GameObject will look at")] public TransformData _fromTransform; @@ -57,9 +52,10 @@ namespace Fungus iTween.LookFrom(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD; public override void OnBeforeSerialize() {} @@ -80,6 +76,8 @@ namespace Fungus fromPositionOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs index bc9e5834..3a2d743c 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/LookTo.cs @@ -10,11 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class LookTo : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; - [HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD; - #endregion - [Tooltip("Target transform that the GameObject will look at")] public TransformData _toTransform; @@ -57,9 +52,10 @@ namespace Fungus iTween.LookTo(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD; public override void OnBeforeSerialize() {} @@ -80,6 +76,8 @@ namespace Fungus toPositionOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs index 04d217e5..a03a778c 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs @@ -10,10 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class MoveAdd : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; - #endregion - [Tooltip("A translation offset in space the GameObject will animate to")] public Vector3Data _offset; @@ -35,9 +31,9 @@ namespace Fungus iTween.MoveAdd(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; public override void OnBeforeSerialize() {} @@ -52,6 +48,8 @@ namespace Fungus offsetOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs index 72d2df28..34d5b4d0 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs @@ -10,11 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class MoveFrom : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; - [HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD; - #endregion - [Tooltip("Target transform that the GameObject will move from")] public TransformData _fromTransform; @@ -46,9 +41,10 @@ namespace Fungus iTween.MoveFrom(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD; public override void OnBeforeSerialize() {} @@ -69,6 +65,8 @@ namespace Fungus fromPositionOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs index 13ad4b48..45e90864 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs @@ -10,11 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class MoveTo : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; - [HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD; - #endregion - [Tooltip("Target transform that the GameObject will move to")] public TransformData _toTransform; @@ -46,9 +41,10 @@ namespace Fungus iTween.MoveTo(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD; public override void OnBeforeSerialize() {} @@ -69,6 +65,8 @@ namespace Fungus toPositionOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs index 94b61567..af66015e 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs @@ -10,10 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class PunchPosition : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; - #endregion - [Tooltip("A translation offset in space the GameObject will animate to")] public Vector3Data _amount; @@ -35,9 +31,9 @@ namespace Fungus iTween.PunchPosition(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; public override void OnBeforeSerialize() {} @@ -52,6 +48,8 @@ namespace Fungus amountOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs index 0071edda..38612bdd 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs @@ -10,10 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class PunchRotation : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; - #endregion - [Tooltip("A rotation offset in space the GameObject will animate to")] public Vector3Data _amount; @@ -35,9 +31,9 @@ namespace Fungus iTween.PunchRotation(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; public override void OnBeforeSerialize() {} @@ -52,6 +48,8 @@ namespace Fungus amountOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs index 040200fd..0bd3d4f9 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs @@ -10,10 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class PunchScale : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; - #endregion - [Tooltip("A scale offset in space the GameObject will animate to")] public Vector3Data _amount; @@ -31,9 +27,9 @@ namespace Fungus iTween.PunchScale(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; public override void OnBeforeSerialize() {} @@ -48,6 +44,8 @@ namespace Fungus amountOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs index 2c1401e5..f69939db 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs @@ -10,10 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class RotateAdd : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; - #endregion - [Tooltip("A rotation offset in space the GameObject will animate to")] public Vector3Data _offset; @@ -35,9 +31,9 @@ namespace Fungus iTween.RotateAdd(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; public override void OnBeforeSerialize() {} @@ -52,6 +48,8 @@ namespace Fungus offsetOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs index cb4898bf..c87df6bd 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs @@ -10,11 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class RotateFrom : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; - [HideInInspector] [FormerlySerializedAs("fromRotation")] public Vector3 fromRotationOLD; - #endregion - [Tooltip("Target transform that the GameObject will rotate from")] public TransformData _fromTransform; @@ -46,9 +41,10 @@ namespace Fungus iTween.RotateFrom(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromRotation")] public Vector3 fromRotationOLD; public override void OnBeforeSerialize() {} @@ -69,6 +65,8 @@ namespace Fungus fromRotationOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs index 926d62b5..9f516b8c 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs @@ -10,11 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class RotateTo : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; - [HideInInspector] [FormerlySerializedAs("toRotation")] public Vector3 toRotationOLD; - #endregion - [Tooltip("Target transform that the GameObject will rotate to")] public TransformData _toTransform; @@ -46,9 +41,10 @@ namespace Fungus iTween.RotateTo(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toRotation")] public Vector3 toRotationOLD; public override void OnBeforeSerialize() {} @@ -69,6 +65,8 @@ namespace Fungus toRotationOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs index 0ddfcc5b..53ac135a 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs @@ -10,10 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class ScaleAdd : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; - #endregion - [Tooltip("A scale offset in space the GameObject will animate to")] public Vector3Data _offset; @@ -31,9 +27,9 @@ namespace Fungus iTween.ScaleAdd(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; public override void OnBeforeSerialize() {} @@ -48,6 +44,8 @@ namespace Fungus offsetOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs index 1d1f7eba..beea48bf 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs @@ -10,11 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class ScaleFrom : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; - [HideInInspector] [FormerlySerializedAs("fromScale")] public Vector3 fromScaleOLD; - #endregion - [Tooltip("Target transform that the GameObject will scale from")] public TransformData _fromTransform; @@ -42,9 +37,10 @@ namespace Fungus iTween.ScaleFrom(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromScale")] public Vector3 fromScaleOLD; public override void OnBeforeSerialize() {} @@ -65,6 +61,8 @@ namespace Fungus fromScaleOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs index 84108c97..2a414f29 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs @@ -10,11 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class ScaleTo : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; - [HideInInspector] [FormerlySerializedAs("toScale")] public Vector3 toScaleOLD; - #endregion - [Tooltip("Target transform that the GameObject will scale to")] public TransformData _toTransform; @@ -42,9 +37,10 @@ namespace Fungus iTween.ScaleTo(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toScale")] public Vector3 toScaleOLD; public override void OnBeforeSerialize() {} @@ -65,6 +61,8 @@ namespace Fungus toScaleOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs index 89d8760b..658f29f2 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs @@ -10,10 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class ShakePosition : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; - #endregion - [Tooltip("A translation offset in space the GameObject will animate to")] public Vector3Data _amount; @@ -50,9 +46,9 @@ namespace Fungus iTween.ShakePosition(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; public override void OnBeforeSerialize() {} @@ -67,6 +63,8 @@ namespace Fungus amountOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs index d57f7f74..38dcefa9 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs @@ -10,10 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class ShakeRotation : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; - #endregion - [Tooltip("A rotation offset in space the GameObject will animate to")] public Vector3Data _amount; @@ -35,9 +31,9 @@ namespace Fungus iTween.ShakeRotation(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; public override void OnBeforeSerialize() {} @@ -52,6 +48,8 @@ namespace Fungus amountOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs index b88f9bbc..b32248cd 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs @@ -10,10 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class ShakeScale : iTweenCommand, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; - #endregion - [Tooltip("A scale offset in space the GameObject will animate to")] public Vector3Data _amount; @@ -31,9 +27,9 @@ namespace Fungus iTween.ShakeScale(_targetObject.Value, tweenParams); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; public override void OnBeforeSerialize() {} @@ -48,6 +44,8 @@ namespace Fungus amountOLD = default(Vector3); } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs b/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs index 0f79ec37..9b47d702 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/StopTween.cs @@ -10,10 +10,6 @@ namespace Fungus [AddComponentMenu("")] public class StopTween : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD; - #endregion - [Tooltip("Stop and destroy any Tweens in current scene with the supplied name")] public StringData _tweenName; @@ -23,9 +19,9 @@ namespace Fungus Continue(); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD; public virtual void OnBeforeSerialize() {} @@ -38,6 +34,8 @@ namespace Fungus tweenNameOLD = ""; } } + + #endregion } } \ No newline at end of file diff --git a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs index dc142018..6035d267 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs @@ -15,12 +15,6 @@ namespace Fungus public abstract class iTweenCommand : Command, ISerializationCallbackReceiver { - #region Obsolete Properties - [HideInInspector] [FormerlySerializedAs("target")] [FormerlySerializedAs("targetObject")] public GameObject targetObjectOLD; - [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD; - [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; - #endregion - [Tooltip("Target game object to apply the Tween to")] public GameObjectData _targetObject; @@ -98,9 +92,11 @@ namespace Fungus return new Color32(233, 163, 180, 255); } - // - // ISerializationCallbackReceiver implementation - // + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("target")] [FormerlySerializedAs("targetObject")] public GameObject targetObjectOLD; + [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD; + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; public virtual void OnBeforeSerialize() {} @@ -119,6 +115,8 @@ namespace Fungus durationOLD = default(float); } } + + #endregion } } \ No newline at end of file From 6a486a37fa85d7d503efb597abd8034c9af6e7fd Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 22 Mar 2016 12:32:59 +0000 Subject: [PATCH 21/24] Fixed string serialisation bug --- Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs | 4 ++-- Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs | 8 ++++---- Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs b/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs index 4dc19f24..7c737ca5 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs @@ -49,10 +49,10 @@ namespace Fungus public virtual void OnAfterDeserialize() { - if (sceneNameOLD != default(string)) + if (sceneNameOLD != "") { _sceneName.Value = sceneNameOLD; - sceneNameOLD = default(string); + sceneNameOLD = ""; } } diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs b/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs index 35708df8..13bc4902 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs @@ -46,7 +46,7 @@ namespace Fungus { foreach (MessageReceived receiver in receivers) { - receiver.OnSendFungusMessage(_message); + receiver.OnSendFungusMessage(_message.Value); } } @@ -60,7 +60,7 @@ namespace Fungus return "Error: No message specified"; } - return _message; + return _message.Value; } public override Color GetButtonColor() @@ -77,10 +77,10 @@ namespace Fungus public virtual void OnAfterDeserialize() { - if (messageOLD != default(string)) + if (messageOLD != "") { _message.Value = messageOLD; - messageOLD = default(string); + messageOLD = ""; } } diff --git a/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs b/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs index 32262544..633f88ae 100644 --- a/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs +++ b/Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs @@ -49,10 +49,10 @@ namespace Fungus public virtual void OnAfterDeserialize() { - if (languageCodeOLD != default(string)) + if (languageCodeOLD != "") { _languageCode.Value = languageCodeOLD; - languageCodeOLD = default(string); + languageCodeOLD = ""; } } From b393b859501f98611698bce067782dee2822f83b Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 22 Mar 2016 12:33:28 +0000 Subject: [PATCH 22/24] Text types faster --- .../TheFacility/TheFacility.unity | 195 ++++++++++-------- 1 file changed, 107 insertions(+), 88 deletions(-) diff --git a/Assets/FungusExamples/TheFacility/TheFacility.unity b/Assets/FungusExamples/TheFacility/TheFacility.unity index fc853d4f..29ded472 100644 --- a/Assets/FungusExamples/TheFacility/TheFacility.unity +++ b/Assets/FungusExamples/TheFacility/TheFacility.unity @@ -8,25 +8,25 @@ SceneSettings: m_PVSPortalsArray: [] m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 serializedVersion: 6 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 m_SkyboxMaterial: {fileID: 0} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -40,7 +40,7 @@ RenderSettings: --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 6 m_GIWorkflowMode: 1 m_LightmapsMode: 1 m_GISettings: @@ -66,7 +66,7 @@ LightmapSettings: m_FinalGather: 0 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 - m_LightmapSnapshot: {fileID: 0} + m_LightingDataAsset: {fileID: 0} m_RuntimeCPUUsage: 25 --- !u!196 &5 NavMeshSettings: @@ -74,15 +74,15 @@ NavMeshSettings: m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 + cellSize: 0.16666666 manualCellSize: 0 m_NavMeshData: {fileID: 0} --- !u!1 &31932611 @@ -234,11 +234,11 @@ RectTransform: m_Children: [] m_Father: {fileID: 31932612} m_RootOrder: 0 - m_AnchorMin: {x: .0907797143, y: .125833333} - m_AnchorMax: {x: .911751449, y: .872500062} + m_AnchorMin: {x: 0.090779714, y: 0.12583333} + m_AnchorMax: {x: 0.91175145, y: 0.87250006} m_AnchoredPosition: {x: 0, y: -1} m_SizeDelta: {x: 12, y: -3} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &88347146 MonoBehaviour: m_ObjectHideFlags: 0 @@ -267,6 +267,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 50 m_Alignment: 0 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -302,7 +303,7 @@ MonoBehaviour: m_Script: {fileID: -900027084, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_EffectColor: {r: 0, g: 0, b: 0, a: .5} + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} m_EffectDistance: {x: 2, y: 2} m_UseGraphicAlpha: 1 --- !u!222 &88347149 @@ -346,7 +347,7 @@ RectTransform: m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &235686027 MonoBehaviour: m_ObjectHideFlags: 0 @@ -360,7 +361,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -375,6 +376,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 4 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -428,6 +430,7 @@ MonoBehaviour: shiftKeyEnabled: 1 nextClickDelay: 0 keyList: 0900000020000000 + ignoreMenuClicks: 1 --- !u!224 &243104469 RectTransform: m_ObjectHideFlags: 0 @@ -441,7 +444,7 @@ RectTransform: m_Children: - {fileID: 31932612} m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 6 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -488,6 +491,7 @@ AudioSource: tangentMode: 0 m_PreInfinity: 2 m_PostInfinity: 2 + m_RotationOrder: 4 panLevelCustomCurve: serializedVersion: 2 m_Curve: @@ -498,6 +502,7 @@ AudioSource: tangentMode: 0 m_PreInfinity: 2 m_PostInfinity: 2 + m_RotationOrder: 0 spreadCustomCurve: serializedVersion: 2 m_Curve: @@ -508,6 +513,7 @@ AudioSource: tangentMode: 0 m_PreInfinity: 2 m_PostInfinity: 2 + m_RotationOrder: 4 reverbZoneMixCustomCurve: serializedVersion: 2 m_Curve: @@ -518,6 +524,7 @@ AudioSource: tangentMode: 0 m_PreInfinity: 2 m_PostInfinity: 2 + m_RotationOrder: 0 --- !u!114 &243104471 MonoBehaviour: m_ObjectHideFlags: 0 @@ -553,10 +560,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: targetTextObject: {fileID: 88347144} - writingSpeed: 60 - punctuationPause: .25 + punchObject: {fileID: 0} + writingSpeed: 100 + punctuationPause: 0.25 hiddenTextColor: {r: 1, g: 1, b: 1, a: 0} writeWholeWords: 0 + forceRichText: 1 + instantComplete: 1 --- !u!114 &243104473 MonoBehaviour: m_ObjectHideFlags: 0 @@ -624,8 +634,10 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 m_SortingLayerID: 0 m_SortingOrder: 1 + m_TargetDisplay: 0 --- !u!114 &428153884 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11400000, guid: e0d427add844a4d9faf970a3afa07583, @@ -671,11 +683,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -754,9 +766,9 @@ RectTransform: m_RootOrder: 1 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 1888.90002, y: 212} + m_AnchoredPosition: {x: 1888.9, y: 212} m_SizeDelta: {x: 123, y: 121} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &552372303 GameObject: m_ObjectHideFlags: 1 @@ -809,14 +821,13 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 3a0bbe22c246e4c78ad8e9816cbae9d5, type: 3} m_Name: m_EditorClassIdentifier: - fadeDuration: .25 + fadeDuration: 0.25 continueButton: {fileID: 510870838} dialogCanvas: {fileID: 243104476} nameText: {fileID: 0} storyText: {fileID: 88347146} characterImage: {fileID: 0} fitTextWithImage: 1 - textWidthScale: .800000012 --- !u!1001 &768791691 Prefab: m_ObjectHideFlags: 0 @@ -1001,21 +1012,21 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Name: m_EditorClassIdentifier: - version: 1.0 - scrollPos: {x: -313.13031, y: 97.234314} + version: 1 + scrollPos: {x: -313.1303, y: 97.234314} variablesScrollPos: {x: 0, y: 0} variablesExpanded: 1 blockViewHeight: 400 zoom: 1 scrollViewRect: serializedVersion: 2 - x: -1118.14856 - y: -610.734985 - width: 3324.20264 - height: 2227.35059 - selectedBlock: {fileID: 771014151} + x: -1118.1486 + y: -610.735 + width: 3324.2026 + height: 2227.3506 + selectedBlock: {fileID: 771014104} selectedCommands: - - {fileID: 771014162} + - {fileID: 771014167} variables: - {fileID: 771014103} description: 'This is a simple Choose Your Own Adventure @@ -1028,6 +1039,7 @@ MonoBehaviour: hideComponents: 1 saveSelection: 1 localizationId: + hideCommands: [] --- !u!4 &771014101 Transform: m_ObjectHideFlags: 0 @@ -1039,7 +1051,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 2 --- !u!114 &771014102 MonoBehaviour: m_ObjectHideFlags: 2 @@ -1053,8 +1065,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 623.054199 - y: -16.7798004 + x: 623.0542 + y: -16.7798 width: 120 height: 40 itemId: 92 @@ -1091,7 +1103,7 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 471.814453 + x: 471.81445 y: -52.946228 width: 120 height: 40 @@ -1138,8 +1150,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 780.351135 - y: -53.5572128 + x: 780.35114 + y: -53.557213 width: 128 height: 40 itemId: 83 @@ -1210,8 +1222,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 983.054199 - y: -53.7798004 + x: 983.0542 + y: -53.7798 width: 120 height: 40 itemId: 95 @@ -1301,7 +1313,7 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 984.054199 + x: 984.0542 y: -116.7798 width: 139 height: 40 @@ -1401,7 +1413,7 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 984.054199 + x: 984.0542 y: -183.7798 width: 120 height: 40 @@ -1447,8 +1459,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 983.223145 - y: 15.7090759 + x: 983.22314 + y: 15.709076 width: 120 height: 40 itemId: 84 @@ -1475,7 +1487,7 @@ MonoBehaviour: nodeRect: serializedVersion: 2 x: 1181.0542 - y: 75.2201996 + y: 75.2202 width: 120 height: 40 itemId: 98 @@ -1515,8 +1527,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 1371.35596 - y: 36.5333862 + x: 1371.356 + y: 36.533386 width: 120 height: 40 itemId: 85 @@ -1734,8 +1746,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 1369.75391 - y: 240.239777 + x: 1369.7539 + y: 240.23978 width: 124 height: 40 itemId: 103 @@ -1961,8 +1973,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 1147.18604 - y: 253.534271 + x: 1147.186 + y: 253.53427 width: 120 height: 40 itemId: 105 @@ -1985,8 +1997,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 1368.09448 - y: 159.214813 + x: 1368.0945 + y: 159.21481 width: 120 height: 40 itemId: 86 @@ -2065,8 +2077,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 1145.28809 - y: 163.344482 + x: 1145.2881 + y: 163.34448 width: 125 height: 40 itemId: 87 @@ -2114,8 +2126,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 940.753906 - y: 244.239777 + x: 940.7539 + y: 244.23978 width: 120 height: 40 itemId: 104 @@ -2155,8 +2167,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 935.837646 - y: 119.663513 + x: 935.83765 + y: 119.66351 width: 120 height: 40 itemId: 88 @@ -2225,8 +2237,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 746.804199 - y: 227.472015 + x: 746.8042 + y: 227.47202 width: 120 height: 40 itemId: 89 @@ -2272,7 +2284,7 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 740.978638 + x: 740.97864 y: 121.01593 width: 130 height: 40 @@ -2373,8 +2385,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 737.102661 - y: 60.294899 + x: 737.10266 + y: 60.2949 width: 159 height: 40 itemId: 106 @@ -2641,8 +2653,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 625.054199 - y: -97.7798004 + x: 625.0542 + y: -97.7798 width: 120 height: 40 itemId: 91 @@ -2957,7 +2969,7 @@ MonoBehaviour: nodeRect: serializedVersion: 2 x: 1514.0542 - y: -33.7797852 + y: -33.779785 width: 120 height: 40 itemId: 99 @@ -3143,7 +3155,7 @@ MonoBehaviour: nodeRect: serializedVersion: 2 x: 1185.0542 - y: 13.2201996 + y: 13.2202 width: 120 height: 40 itemId: 97 @@ -3274,7 +3286,7 @@ MonoBehaviour: nodeRect: serializedVersion: 2 x: 1185.0542 - y: -41.7798004 + y: -41.7798 width: 120 height: 40 itemId: 96 @@ -3446,7 +3458,7 @@ MonoBehaviour: nodeRect: serializedVersion: 2 x: 1517.0542 - y: 173.220215 + y: 173.22021 width: 120 height: 40 itemId: 102 @@ -3614,7 +3626,7 @@ MonoBehaviour: nodeRect: serializedVersion: 2 x: 1529.0542 - y: 36.2202148 + y: 36.220215 width: 120 height: 40 itemId: 100 @@ -3723,6 +3735,8 @@ MonoBehaviour: indentLevel: 0 musicClip: {fileID: 8300000, guid: 8f2a44f9988c2445aa82bed59f677134, type: 3} atTime: 0 + loop: 1 + fadeDuration: 1 --- !u!114 &771014226 MonoBehaviour: m_ObjectHideFlags: 2 @@ -3737,12 +3751,13 @@ MonoBehaviour: itemId: 0 errorMessage: indentLevel: 0 - duration: .5 + duration: 0.5 fadeOut: 1 targetView: {fileID: 428153884} waitUntilFinished: 1 fadeColor: {r: 0, g: 0, b: 0, a: 1} fadeTexture: {fileID: 0} + targetCamera: {fileID: 0} --- !u!114 &771014228 MonoBehaviour: m_ObjectHideFlags: 2 @@ -3814,8 +3829,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 553.554871 - y: 60.0247955 + x: 553.5549 + y: 60.024796 width: 120 height: 40 itemId: 90 @@ -3881,14 +3896,14 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 - m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 60 orthographic: 1 @@ -3904,7 +3919,7 @@ Camera: m_HDR: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 m_StereoMirrorMode: 0 --- !u!4 &1020378998 Transform: @@ -3913,11 +3928,11 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1020378993} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -19.8929996, y: .701359987, z: -10} + m_LocalPosition: {x: -19.893, y: 0.70136, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 + m_RootOrder: 1 --- !u!1 &1033075835 GameObject: m_ObjectHideFlags: 0 @@ -3964,7 +3979,7 @@ MonoBehaviour: m_SubmitButton: Submit m_CancelButton: Cancel m_InputActionsPerSecond: 10 - m_RepeatDelay: .5 + m_RepeatDelay: 0.5 m_ForceModuleActive: 0 --- !u!114 &1033075838 MonoBehaviour: @@ -3991,7 +4006,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 7 --- !u!1 &1176957117 GameObject: m_ObjectHideFlags: 0 @@ -4026,14 +4041,18 @@ SpriteRenderer: m_ProbeAnchor: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 - m_AutoUVMaxDistance: .5 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingOrder: 0 m_Sprite: {fileID: 21300000, guid: 252b5a6bfbbc64f5184461a9150031bf, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 --- !u!4 &1176957119 Transform: m_ObjectHideFlags: 0 @@ -4045,7 +4064,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 4 --- !u!1001 &1660535032 Prefab: m_ObjectHideFlags: 0 From 484baa6186b84e1c89d5e83131b3e52db61824fc Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 22 Mar 2016 12:33:42 +0000 Subject: [PATCH 23/24] Updated project settings --- ProjectSettings/ProjectVersion.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index bb60c067..c4684cd5 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 5.3.2f1 +m_EditorVersion: 5.3.4f1 m_StandardAssetsVersion: 0 From af067c553e297be00181d3ff68d7d0b26daca30a Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 22 Mar 2016 12:34:21 +0000 Subject: [PATCH 24/24] Removed prop test scene --- Assets/UpdatePropTest.unity | 960 ------------------------------- Assets/UpdatePropTest.unity.meta | 8 - 2 files changed, 968 deletions(-) delete mode 100644 Assets/UpdatePropTest.unity delete mode 100644 Assets/UpdatePropTest.unity.meta diff --git a/Assets/UpdatePropTest.unity b/Assets/UpdatePropTest.unity deleted file mode 100644 index b8ed0a43..00000000 --- a/Assets/UpdatePropTest.unity +++ /dev/null @@ -1,960 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -SceneSettings: - m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 6 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 3 - m_SkyboxMaterial: {fileID: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 6 - m_GIWorkflowMode: 1 - m_LightmapsMode: 1 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 0 - m_EnableRealtimeLightmaps: 0 - m_LightmapEditorSettings: - serializedVersion: 3 - m_Resolution: 2 - m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 - m_AOMaxDistance: 1 - m_Padding: 2 - m_CompAOExponent: 0 - m_LightmapParameters: {fileID: 0} - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherRayCount: 1024 - m_ReflectionCompression: 2 - m_LightingDataAsset: {fileID: 0} - m_RuntimeCPUUsage: 25 ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - accuratePlacement: 0 - minRegionArea: 2 - cellSize: 0.16666667 - manualCellSize: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &2638155 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 2638157} - - 114: {fileID: 2638156} - m_Layer: 0 - m_Name: _FungusState - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &2638156 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2638155} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} - m_Name: - m_EditorClassIdentifier: - selectedFlowchart: {fileID: 979963239} ---- !u!4 &2638157 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2638155} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 4 ---- !u!1 &453390534 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 453390538} - - 114: {fileID: 453390537} - - 114: {fileID: 453390536} - - 114: {fileID: 453390535} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &453390535 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 453390534} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_ForceModuleActive: 0 ---- !u!114 &453390536 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 453390534} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 ---- !u!114 &453390537 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 453390534} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 - m_DragThreshold: 5 ---- !u!4 &453390538 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 453390534} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 ---- !u!1 &837453083 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 837453088} - - 20: {fileID: 837453087} - - 92: {fileID: 837453086} - - 124: {fileID: 837453085} - - 81: {fileID: 837453084} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &837453084 -AudioListener: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 837453083} - m_Enabled: 1 ---- !u!124 &837453085 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 837453083} - m_Enabled: 1 ---- !u!92 &837453086 -Behaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 837453083} - m_Enabled: 1 ---- !u!20 &837453087 -Camera: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 837453083} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 1 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 - m_StereoMirrorMode: 0 ---- !u!4 &837453088 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 837453083} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 ---- !u!1 &979963238 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 979963243} - - 114: {fileID: 979963239} - - 114: {fileID: 979963241} - - 114: {fileID: 979963242} - - 114: {fileID: 979963240} - - 114: {fileID: 979963244} - - 114: {fileID: 979963246} - - 114: {fileID: 979963245} - - 114: {fileID: 979963247} - - 114: {fileID: 979963248} - - 114: {fileID: 979963249} - - 114: {fileID: 979963250} - - 114: {fileID: 979963251} - - 114: {fileID: 979963252} - - 114: {fileID: 979963255} - - 114: {fileID: 979963254} - - 114: {fileID: 979963253} - - 114: {fileID: 979963256} - - 114: {fileID: 979963257} - - 114: {fileID: 979963258} - - 114: {fileID: 979963259} - - 114: {fileID: 979963261} - - 114: {fileID: 979963260} - m_Layer: 0 - m_Name: Flowchart - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &979963239 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} - m_Name: - m_EditorClassIdentifier: - version: 1 - scrollPos: {x: 0, y: 0} - variablesScrollPos: {x: 0, y: 0} - variablesExpanded: 1 - blockViewHeight: 400 - zoom: 1 - scrollViewRect: - serializedVersion: 2 - x: -343 - y: -340 - width: 1114 - height: 859 - selectedBlock: {fileID: 979963241} - selectedCommands: - - {fileID: 979963260} - variables: - - {fileID: 979963244} - - {fileID: 979963252} - description: - stepPause: 0 - colorCommands: 1 - hideComponents: 1 - saveSelection: 1 - localizationId: - hideCommands: [] ---- !u!114 &979963240 -MonoBehaviour: - m_ObjectHideFlags: 2 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ee63e642958494f1ebed8116ae4b1103, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 1 - errorMessage: - indentLevel: 0 - animatorOLD: {fileID: 0} - parameterNameOLD: - _animator: - animatorRef: {fileID: 0} - animatorVal: {fileID: 1766204519} - _parameterName: - stringRef: {fileID: 0} - stringVal: - value: - booleanRef: {fileID: 0} - booleanVal: 1 ---- !u!114 &979963241 -MonoBehaviour: - m_ObjectHideFlags: 2 - m_PrefabParentObject: {fileID: 11433304, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} - m_Name: - m_EditorClassIdentifier: - nodeRect: - serializedVersion: 2 - x: 67 - y: 69 - width: 120 - height: 40 - itemId: 0 - blockName: Start - description: - eventHandler: {fileID: 979963242} - commandList: - - {fileID: 979963240} - - {fileID: 979963246} - - {fileID: 979963245} - - {fileID: 979963247} - - {fileID: 979963249} - - {fileID: 979963248} - - {fileID: 979963250} - - {fileID: 979963255} - - {fileID: 979963251} - - {fileID: 979963254} - - {fileID: 979963253} - - {fileID: 979963256} - - {fileID: 979963257} - - {fileID: 979963258} - - {fileID: 979963259} - - {fileID: 979963261} - - {fileID: 979963260} ---- !u!114 &979963242 -MonoBehaviour: - m_ObjectHideFlags: 2 - m_PrefabParentObject: {fileID: 11462346, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, - type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3} - m_Name: - m_EditorClassIdentifier: - parentBlock: {fileID: 979963241} ---- !u!4 &979963243 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 ---- !u!114 &979963244 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8cbd0c93fbe0e46f78685c33d82bcc7b, type: 3} - m_Name: - m_EditorClassIdentifier: - scope: 0 - key: Var - value: {fileID: 1766204519} ---- !u!114 &979963245 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 76641c2c16481448eb6c0c1184fcdebe, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 3 - errorMessage: - indentLevel: 0 - animatorOLD: {fileID: 0} - parameterNameOLD: - _animator: - animatorRef: {fileID: 0} - animatorVal: {fileID: 1766204519} - _parameterName: - stringRef: {fileID: 0} - stringVal: - value: - integerRef: {fileID: 0} - integerVal: 0 ---- !u!114 &979963246 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fb1f6a369ef8c40bda77241018ab6bd6, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 2 - errorMessage: - indentLevel: 0 - animatorOLD: {fileID: 0} - parameterNameOLD: - _animator: - animatorRef: {fileID: 0} - animatorVal: {fileID: 1766204519} - _parameterName: - stringRef: {fileID: 0} - stringVal: - value: - floatRef: {fileID: 0} - floatVal: 10 ---- !u!114 &979963247 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0729d4f369e6a4241a6e7e3b8b9c1933, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 4 - errorMessage: - indentLevel: 0 - animatorOLD: {fileID: 0} - parameterNameOLD: - _animator: - animatorRef: {fileID: 0} - animatorVal: {fileID: 1766204519} - _parameterName: - stringRef: {fileID: 0} - stringVal: ---- !u!114 &979963248 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a3ff412ad89846a47a70a620a222cbf8, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 5 - errorMessage: - indentLevel: 0 - SettingsStringOLD: - ParentTransform: {fileID: 837453088} - _SettingsString: - stringRef: {fileID: 0} - stringVal: blergh - waitDuration: 5 ---- !u!114 &979963249 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: bc30c92f7ffe3d746ac76cd528d616e5, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 6 - errorMessage: - indentLevel: 0 - audioSourceOLD: {fileID: 0} - control: 0 - _audioSource: - audioSourceRef: {fileID: 0} - audioSourceVal: {fileID: 1197120974} - startVolume: 1 - endVolume: 1 - fadeDuration: 1 - waitUntilFinished: 0 ---- !u!114 &979963250 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d81be3d7e84da460788dccea95a3313a, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 7 - errorMessage: - indentLevel: 0 - targetGameObjectOLD: {fileID: 0} - _targetGameObject: - gameObjectRef: {fileID: 0} - gameObjectVal: {fileID: 1197120973} ---- !u!114 &979963251 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ae67a23cb4aa74793b41258ae40bf321, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 8 - errorMessage: - indentLevel: 0 - stopParentFlowchart: 0 - targetFlowcharts: [] ---- !u!114 &979963252 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b1941e052c0ed4280b25507cd2e6ad8f, type: 3} - m_Name: - m_EditorClassIdentifier: - scope: 0 - key: Var1 - value: {fileID: 1766204518} ---- !u!114 &979963253 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dbd8c931f22994b9d90e2037fffaa770, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 11 - errorMessage: - indentLevel: 0 - targetGameObjectOLD: {fileID: 0} - _targetGameObject: - gameObjectRef: {fileID: 0} - gameObjectVal: {fileID: 837453083} - activeState: - booleanRef: {fileID: 0} - booleanVal: 0 ---- !u!114 &979963254 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: c43743931d28f43f89eced820d907351, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 10 - errorMessage: - indentLevel: 0 - messageOLD: - messageTarget: 0 - _message: - stringRef: {fileID: 0} - stringVal: ---- !u!114 &979963255 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 00d03ae0919f04264b018681ed534177, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 9 - errorMessage: - indentLevel: 0 - sceneNameOLD: - _sceneName: - stringRef: {fileID: 0} - stringVal: - loadingImage: {fileID: 0} ---- !u!114 &979963256 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: bb3e86f556e074b84af1cc7eb8f8e5e7, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 12 - errorMessage: - indentLevel: 0 - sourceObjectOLD: {fileID: 0} - parentTransformOLD: {fileID: 0} - spawnPositionOLD: {x: 0, y: 0, z: 0} - spawnRotationOLD: {x: 0, y: 0, z: 0} - _sourceObject: - gameObjectRef: {fileID: 0} - gameObjectVal: {fileID: 1197120973} - _parentTransform: - transformRef: {fileID: 0} - transformVal: {fileID: 837453088} - _spawnPosition: - vector3Ref: {fileID: 0} - vector3Val: {x: 5, y: 2, z: 1} - _spawnRotation: - vector3Ref: {fileID: 0} - vector3Val: {x: 3, y: 2, z: 4} ---- !u!114 &979963257 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3315ad2ebb85443909a1203d56d9344e, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 13 - errorMessage: - indentLevel: 0 - durationOLD: 0 - _duration: - floatRef: {fileID: 0} - floatVal: 5 ---- !u!114 &979963258 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ab54728d981544842843ba6609b9a80a, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 14 - errorMessage: - indentLevel: 0 - durationOLD: 0 - _duration: - floatRef: {fileID: 0} - floatVal: 6 - targetBlock: {fileID: 979963241} ---- !u!114 &979963259 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3fc625e237d6048bf86f34835d8266d9, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 15 - errorMessage: - indentLevel: 0 - languageCodeOLD: - _languageCode: - stringRef: {fileID: 0} - stringVal: ---- !u!114 &979963260 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 10cd462c89cb047158ccfb8a8df3f60a, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 17 - errorMessage: - indentLevel: 0 - spriteRenderer: {fileID: 0} - visible: 0 - affectChildren: 1 ---- !u!114 &979963261 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 979963238} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: accc065c3e9a6457496f075b1bd49adc, type: 3} - m_Name: - m_EditorClassIdentifier: - itemId: 16 - errorMessage: - indentLevel: 0 - durationOLD: 0 - targetColorOLD: {r: 0, g: 0, b: 0, a: 0} - spriteRenderer: {fileID: 0} - _duration: - floatRef: {fileID: 0} - floatVal: 5 - _targetColor: - colorRef: {fileID: 0} - colorVal: {r: 0.7205882, g: 0.10067042, b: 0.10067042, a: 1} - waitUntilFinished: 1 ---- !u!1 &1197120973 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1197120975} - - 82: {fileID: 1197120974} - m_Layer: 0 - m_Name: Audio Source - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!82 &1197120974 -AudioSource: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1197120973} - m_Enabled: 1 - serializedVersion: 4 - OutputAudioMixerGroup: {fileID: 0} - m_audioClip: {fileID: 0} - m_PlayOnAwake: 1 - m_Volume: 1 - m_Pitch: 1 - Loop: 0 - Mute: 0 - Spatialize: 0 - Priority: 128 - DopplerLevel: 1 - MinDistance: 1 - MaxDistance: 500 - Pan2D: 0 - rolloffMode: 0 - BypassEffects: 0 - BypassListenerEffects: 0 - BypassReverbZones: 0 - rolloffCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - - time: 1 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - panLevelCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 0 - spreadCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - reverbZoneMixCustomCurve: - serializedVersion: 2 - m_Curve: - - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 0 ---- !u!4 &1197120975 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1197120973} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.44973594, y: -1.4485286, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 5 ---- !u!1 &1766204518 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 1766204520} - - 95: {fileID: 1766204519} - m_Layer: 0 - m_Name: Animator - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!95 &1766204519 -Animator: - serializedVersion: 3 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1766204518} - m_Enabled: 1 - m_Avatar: {fileID: 0} - m_Controller: {fileID: 0} - m_CullingMode: 0 - m_UpdateMode: 0 - m_ApplyRootMotion: 0 - m_LinearVelocityBlending: 0 - m_WarningMessage: - m_HasTransformHierarchy: 1 - m_AllowConstantClipSamplingOptimization: 1 ---- !u!4 &1766204520 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1766204518} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.44973594, y: -1.4485286, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 3 diff --git a/Assets/UpdatePropTest.unity.meta b/Assets/UpdatePropTest.unity.meta deleted file mode 100644 index 346da839..00000000 --- a/Assets/UpdatePropTest.unity.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4e74bd9b121c140d080875fc1eb3d999 -timeCreated: 1457889073 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: