diff --git a/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs b/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs index a778d909..9bdc1834 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,19 @@ namespace Fungus "Reset Anim Trigger", "Resets a trigger parameter on an Animator component.")] [AddComponentMenu("")] - public class ResetAnimTrigger : Command + public class ResetAnimTrigger : Command, ISerializationCallbackReceiver { [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 +29,43 @@ 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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != null) + { + _parameterName.Value = parameterNameOLD; + 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 1e60682b..2cbd6642 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,22 @@ 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 { [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 +32,43 @@ 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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != null) + { + _parameterName.Value = parameterNameOLD; + 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 86473f17..096954f5 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,22 @@ 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 { [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 +32,43 @@ 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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != null) + { + _parameterName.Value = parameterNameOLD; + 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 1b1f6292..29add857 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,22 @@ 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 { [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 +32,43 @@ 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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != null) + { + _parameterName.Value = parameterNameOLD; + 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 52555254..935973bf 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,19 @@ 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 { [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 +29,43 @@ 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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; + + public void OnBeforeSerialize() + {} + + public void OnAfterDeserialize() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } + + if (parameterNameOLD != null) + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = null; + } + } + + #endregion } } \ No newline at end of file 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..e7ae9263 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,7 +7,7 @@ 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 { public enum controlType { @@ -21,7 +22,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 +40,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 +61,7 @@ namespace Fungus PauseLoop(); break; case controlType.StopLoop: - StopLoop(audioSource); + StopLoop(_audioSource.Value); break; case controlType.ChangeVolume: ChangeVolume(); @@ -79,7 +80,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 +89,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 +101,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 +123,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 +135,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 +154,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 +164,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 +182,7 @@ namespace Fungus } else { - audioSource.GetComponent().Pause(); + _audioSource.Value.GetComponent().Pause(); } } @@ -188,7 +190,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 +214,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 +232,7 @@ namespace Fungus public override string GetSummary() { - if (audioSource == null) + if (_audioSource.Value == null) { return "Error: No sound clip selected"; } @@ -248,13 +250,31 @@ 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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("audioSource")] public AudioSource audioSourceOLD; + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (audioSourceOLD != null) + { + _audioSource.Value = audioSourceOLD; + 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 8f3c6733..6f1f7eb5 100644 --- a/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs +++ b/Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs @@ -1,12 +1,13 @@ 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 { protected SfxrSynth _synth = new SfxrSynth(); @@ -14,15 +15,15 @@ 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 +52,35 @@ } 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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("SettingsString")] public String SettingsStringOLD; + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (SettingsStringOLD != "") + { + _SettingsString.Value = SettingsStringOLD; + SettingsStringOLD = ""; + } + } + + #endregion } } 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/Editor/VariableEditor.cs b/Assets/Fungus/Flowchart/Editor/VariableEditor.cs index bf10888b..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 = 100; + const int popupWidth = 17; Rect controlRect = EditorGUI.PrefixLabel(rect, label); Rect valueRect = controlRect; @@ -319,4 +319,16 @@ namespace Fungus [CustomPropertyDrawer (typeof(ObjectData))] public class ObjectDataDrawer : VariableDataDrawer {} + + [CustomPropertyDrawer (typeof(AnimatorData))] + public class AnimatorDataDrawer : VariableDataDrawer + {} + + [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/Commands/Destroy.cs b/Assets/Fungus/Flowchart/Scripts/Commands/Destroy.cs index 5685a969..783efa68 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,16 @@ namespace Fungus "Destroy", "Destroys a specified game object in the scene.")] [AddComponentMenu("")] - public class Destroy : Command + public class Destroy : Command, ISerializationCallbackReceiver { [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 +26,36 @@ 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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD; + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (targetGameObjectOLD != null) + { + _targetGameObject.Value = targetGameObjectOLD; + 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 8fe57f47..7c737ca5 100644 --- a/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs @@ -1,43 +1,62 @@ 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 { [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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("sceneName")] public string sceneNameOLD; + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (sceneNameOLD != "") + { + _sceneName.Value = sceneNameOLD; + sceneNameOLD = ""; + } + } + + #endregion } } \ 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() diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs b/Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs index 976db87f..13bc4902 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,7 +8,7 @@ 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 { public enum MessageTarget { @@ -19,11 +20,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 +46,7 @@ namespace Fungus { foreach (MessageReceived receiver in receivers) { - receiver.OnSendFungusMessage(message); + receiver.OnSendFungusMessage(_message.Value); } } @@ -54,18 +55,36 @@ namespace Fungus public override string GetSummary() { - if (message.Length == 0) + if (_message.Value.Length == 0) { return "Error: No message specified"; } - return message; + return _message.Value; } public override Color GetButtonColor() { return new Color32(235, 191, 217, 255); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("message")] public string messageOLD; + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (messageOLD != "") + { + _message.Value = messageOLD; + messageOLD = ""; + } + } + + #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 69ad01b7..4e0c4a5d 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,19 @@ 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 + { [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 +29,36 @@ 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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD; + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (targetGameObjectOLD != null) + { + _targetGameObject.Value = targetGameObjectOLD; + 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 a1360b91..6fc6f947 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,90 @@ 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 { [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); } + + #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() + {} + + 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); + } + } + + #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 35989a7b..700afd85 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,15 @@ 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 { [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 +26,31 @@ 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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (durationOLD != default(float)) + { + _duration.Value = durationOLD; + durationOLD = default(float); + } + } + + #endregion } } \ No newline at end of file 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(); 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: 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: 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/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..66924f78 100644 --- a/Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs +++ b/Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs @@ -11,10 +11,10 @@ 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 + { [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 +27,7 @@ namespace Fungus if (menuDialog != null && targetBlock != null) { - menuDialog.ShowTimer(duration, targetBlock); + menuDialog.ShowTimer(_duration.Value, targetBlock); } Continue(); @@ -55,6 +55,24 @@ namespace Fungus { return new Color32(184, 210, 235, 255); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (durationOLD != default(float)) + { + _duration.Value = durationOLD; + 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 22d91709..633f88ae 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,10 @@ 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 { [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 +20,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 +32,30 @@ namespace Fungus public override string GetSummary() { - return languageCode; + return _languageCode.Value; } public override Color GetButtonColor() { return new Color32(184, 210, 235, 255); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("languageCode")] public string languageCodeOLD; + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (languageCodeOLD != "") + { + _languageCode.Value = languageCodeOLD; + languageCodeOLD = ""; + } + } + + #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 e5647529..900964a5 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,16 @@ 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 { [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 +38,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 +59,37 @@ 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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; + [HideInInspector] [FormerlySerializedAs("targetColor")] public Color targetColorOLD; + + 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); + } + } + + #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 bdeca0ef..41c369ae 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,14 +9,15 @@ namespace Fungus "Show Sprite", "Makes a sprite visible / invisible by setting the color alpha.")] [AddComponentMenu("")] - public class ShowSprite : Command + public class ShowSprite : Command, ISerializationCallbackReceiver { [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; public override void OnEnter() @@ -27,12 +29,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); } } @@ -53,13 +55,31 @@ 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); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("visible")] public bool visibleOLD; + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (visibleOLD != default(bool)) + { + _visible.Value = visibleOLD; + 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 cee06f50..afd16d4c 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,13 @@ 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 { [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; @@ -21,14 +22,14 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); - if (fromTransform == null) + tweenParams.Add("name", _tweenName.Value); + 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) { @@ -42,14 +43,41 @@ 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"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.LookFrom(targetObject, tweenParams); - } + iTween.LookFrom(_targetObject.Value, tweenParams); + } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (fromTransformOLD != null) + { + _fromTransform.Value = fromTransformOLD; + fromTransformOLD = null; + } + + if (fromPositionOLD != default(Vector3)) + { + _fromPosition.Value = fromPositionOLD; + 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 d1a4fae4..3a2d743c 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,13 @@ 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 { [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; @@ -21,14 +22,14 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); - if (toTransform == null) + tweenParams.Add("name", _tweenName.Value); + 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) { @@ -42,14 +43,41 @@ 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"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.LookTo(targetObject, tweenParams); - } + iTween.LookTo(_targetObject.Value, tweenParams); + } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (toTransformOLD != null) + { + _toTransform.Value = toTransformOLD; + toTransformOLD = null; + } + + if (toPositionOLD != default(Vector3)) + { + _toPosition.Value = toPositionOLD; + 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 6d9d5b21..a03a778c 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,10 @@ namespace Fungus "Move Add", "Moves a game object by a specified offset over time.")] [AddComponentMenu("")] - public class MoveAdd : iTweenCommand + public class MoveAdd : iTweenCommand, ISerializationCallbackReceiver { [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; @@ -18,17 +19,37 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); - tweenParams.Add("amount", offset); + 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"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.MoveAdd(targetObject, tweenParams); + iTween.MoveAdd(_targetObject.Value, tweenParams); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (offsetOLD != default(Vector3)) + { + _offset.Value = offsetOLD; + 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 fadb1476..34d5b4d0 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,13 @@ 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 { [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; @@ -21,24 +22,51 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); - if (fromTransform == null) + tweenParams.Add("name", _tweenName.Value); + 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("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.MoveFrom(targetObject, tweenParams); - } + iTween.MoveFrom(_targetObject.Value, tweenParams); + } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (fromTransformOLD != null) + { + _fromTransform.Value = fromTransformOLD; + fromTransformOLD = null; + } + + if (fromPositionOLD != default(Vector3)) + { + _fromPosition.Value = fromPositionOLD; + 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 f427c9ef..45e90864 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,13 @@ 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 { [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; @@ -21,24 +22,51 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); - if (toTransform == null) + tweenParams.Add("name", _tweenName.Value); + 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("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.MoveTo(targetObject, tweenParams); - } + iTween.MoveTo(_targetObject.Value, tweenParams); + } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (toTransformOLD != null) + { + _toTransform.Value = toTransformOLD; + toTransformOLD = null; + } + + if (toPositionOLD != default(Vector3)) + { + _toPosition.Value = toPositionOLD; + 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 87149a9e..af66015e 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,10 @@ 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 { [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; @@ -18,17 +19,37 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); - tweenParams.Add("amount", amount); + 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"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.PunchPosition(targetObject, tweenParams); + iTween.PunchPosition(_targetObject.Value, tweenParams); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + 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 89ad7991..38612bdd 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,10 @@ 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 { [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; @@ -18,17 +19,37 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); - tweenParams.Add("amount", amount); + 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"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.PunchRotation(targetObject, tweenParams); + iTween.PunchRotation(_targetObject.Value, tweenParams); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + 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 e9991768..0bd3d4f9 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,24 +8,44 @@ 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 { [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); - tweenParams.Add("amount", amount); - tweenParams.Add("time", duration); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _amount.Value); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.PunchScale(targetObject, tweenParams); + iTween.PunchScale(_targetObject.Value, tweenParams); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + 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 7cad1509..f69939db 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,10 @@ namespace Fungus "Rotate Add", "Rotates a game object by the specified angles over time.")] [AddComponentMenu("")] - public class RotateAdd : iTweenCommand + public class RotateAdd : iTweenCommand, ISerializationCallbackReceiver { [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; @@ -18,17 +19,37 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); - tweenParams.Add("amount", offset); + 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"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.RotateAdd(targetObject, tweenParams); + iTween.RotateAdd(_targetObject.Value, tweenParams); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (offsetOLD != default(Vector3)) + { + _offset.Value = offsetOLD; + 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 2c33c441..c87df6bd 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,13 @@ 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 { [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; @@ -21,24 +22,51 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); - if (fromTransform == null) + tweenParams.Add("name", _tweenName.Value); + 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("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.RotateFrom(targetObject, tweenParams); - } + iTween.RotateFrom(_targetObject.Value, tweenParams); + } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromRotation")] public Vector3 fromRotationOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (fromTransformOLD != null) + { + _fromTransform.Value = fromTransformOLD; + fromTransformOLD = null; + } + + if (fromRotationOLD != default(Vector3)) + { + _fromRotation.Value = fromRotationOLD; + 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 5f10f21d..9f516b8c 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,13 @@ namespace Fungus "Rotate To", "Rotates a game object to the specified angles over time.")] [AddComponentMenu("")] - public class RotateTo : iTweenCommand + public class RotateTo : iTweenCommand, ISerializationCallbackReceiver { [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; @@ -21,24 +22,51 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); - if (toTransform == null) + tweenParams.Add("name", _tweenName.Value); + 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("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("isLocal", isLocal); tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.RotateTo(targetObject, tweenParams); - } + iTween.RotateTo(_targetObject.Value, tweenParams); + } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toRotation")] public Vector3 toRotationOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (toTransformOLD != null) + { + _toTransform.Value = toTransformOLD; + toTransformOLD = null; + } + + if (toRotationOLD != default(Vector3)) + { + _toRotation.Value = toRotationOLD; + 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 2aca66aa..53ac135a 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,24 +8,44 @@ 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 { [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); - tweenParams.Add("amount", offset); - tweenParams.Add("time", duration); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _offset.Value); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.ScaleAdd(targetObject, tweenParams); + iTween.ScaleAdd(_targetObject.Value, tweenParams); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (offsetOLD != default(Vector3)) + { + _offset.Value = offsetOLD; + 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 d680d58c..beea48bf 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,34 +8,61 @@ 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 { [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); - if (fromTransform == null) + tweenParams.Add("name", _tweenName.Value); + 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("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.ScaleFrom(targetObject, tweenParams); - } + iTween.ScaleFrom(_targetObject.Value, tweenParams); + } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; + [HideInInspector] [FormerlySerializedAs("fromScale")] public Vector3 fromScaleOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (fromTransformOLD != null) + { + _fromTransform.Value = fromTransformOLD; + fromTransformOLD = null; + } + + if (fromScaleOLD != default(Vector3)) + { + _fromScale.Value = fromScaleOLD; + 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 af81d1e5..2a414f29 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,34 +8,61 @@ 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 { [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); - if (toTransform == null) + tweenParams.Add("name", _tweenName.Value); + 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("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.ScaleTo(targetObject, tweenParams); - } + iTween.ScaleTo(_targetObject.Value, tweenParams); + } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; + [HideInInspector] [FormerlySerializedAs("toScale")] public Vector3 toScaleOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (toTransformOLD != null) + { + _toTransform.Value = toTransformOLD; + toTransformOLD = null; + } + + if (toScaleOLD != default(Vector3)) + { + _toScale.Value = toScaleOLD; + 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 8da68a2a..658f29f2 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,10 @@ 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 { [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; @@ -21,8 +22,8 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); - tweenParams.Add("amount", amount); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _amount.Value); switch (axis) { case iTweenAxis.X: @@ -35,15 +36,35 @@ 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); tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.ShakePosition(targetObject, tweenParams); - } + iTween.ShakePosition(_targetObject.Value, tweenParams); + } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + 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 8950d64e..38dcefa9 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,10 @@ 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 { [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; @@ -18,17 +19,37 @@ namespace Fungus public override void DoTween() { Hashtable tweenParams = new Hashtable(); - tweenParams.Add("name", tweenName); - tweenParams.Add("amount", amount); + 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"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.ShakeRotation(targetObject, tweenParams); - } + iTween.ShakeRotation(_targetObject.Value, tweenParams); + } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + 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 d26ad140..b32248cd 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,24 +8,44 @@ 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 { [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); - tweenParams.Add("amount", amount); - tweenParams.Add("time", duration); + tweenParams.Add("name", _tweenName.Value); + tweenParams.Add("amount", _amount.Value); + tweenParams.Add("time", _duration.Value); tweenParams.Add("easetype", easeType); tweenParams.Add("looptype", loopType); tweenParams.Add("oncomplete", "OniTweenComplete"); tweenParams.Add("oncompletetarget", gameObject); tweenParams.Add("oncompleteparams", this); - iTween.ShakeScale(targetObject, tweenParams); - } + iTween.ShakeScale(_targetObject.Value, tweenParams); + } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; + + public override void OnBeforeSerialize() + {} + + public override void OnAfterDeserialize() + { + base.OnAfterDeserialize(); + + if (amountOLD != default(Vector3)) + { + _amount.Value = amountOLD; + 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 c2622ed1..9b47d702 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,34 @@ namespace Fungus "Stop Tween", "Stops an active iTween by name.")] [AddComponentMenu("")] - public class StopTween : Command + public class StopTween : Command, ISerializationCallbackReceiver { [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(); } + + #region Backwards compatibility + + [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD; + + public virtual void OnBeforeSerialize() + {} + + public virtual void OnAfterDeserialize() + { + if (tweenNameOLD != "") + { + _tweenName.Value = tweenNameOLD; + tweenNameOLD = ""; + } + } + + #endregion } } \ 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() { diff --git a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs index 25d715f2..6035d267 100644 --- a/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs +++ b/Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs @@ -1,9 +1,10 @@ using UnityEngine; -using System.Collections; using UnityEngine.Serialization; +using System.Collections; namespace Fungus { + public enum iTweenAxis { None, @@ -12,17 +13,16 @@ namespace Fungus Z } - public abstract class iTweenCommand : Command + public abstract class iTweenCommand : Command, ISerializationCallbackReceiver { [Tooltip("Target game object to apply the Tween to")] - [FormerlySerializedAs("target")] - public GameObject targetObject; + 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; + public FloatData _duration = new FloatData(1f); [Tooltip("The shape of the easing curve applied to the animation")] public iTween.EaseType easeType = iTween.EaseType.easeInOutQuad; @@ -38,7 +38,7 @@ namespace Fungus public override void OnEnter() { - if (targetObject == null) + if (_targetObject.Value == null) { Continue(); return; @@ -47,7 +47,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 +79,44 @@ 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.Value + " seconds"; } public override Color GetButtonColor() { return new Color32(233, 163, 180, 255); } + + #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() + {} + + public virtual void OnAfterDeserialize() + { + if (targetObjectOLD != null) + { + _targetObject.Value = targetObjectOLD; + targetObjectOLD = null; + } + + if (durationOLD == default(float)) + { + _duration.Value = durationOLD; + durationOLD = default(float); + } + } + + #endregion } } \ No newline at end of file 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 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 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