Browse Source

Merge pull request #447 from FungusGames/unity-5-4-compatibility

Fixed Unity 5.4 beta errors & warning
master
Chris Gregan 9 years ago
parent
commit
a0e691dc88
  1. 8
      Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs
  2. 8
      Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs
  3. 8
      Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs
  4. 8
      Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs
  5. 8
      Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs
  6. 8
      Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs
  7. 8
      Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs
  8. 8
      Assets/Fungus/Flowchart/Scripts/Commands/Destroy.cs
  9. 8
      Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs
  10. 8
      Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs
  11. 8
      Assets/Fungus/Flowchart/Scripts/Commands/SetActive.cs
  12. 8
      Assets/Fungus/Flowchart/Scripts/Commands/SpawnObject.cs
  13. 8
      Assets/Fungus/Flowchart/Scripts/Commands/Wait.cs
  14. 18
      Assets/Fungus/Flowchart/Scripts/Flowchart.cs
  15. 8
      Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs
  16. 8
      Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs
  17. 14
      Assets/Fungus/Narrative/Scripts/Localization.cs
  18. 8
      Assets/Fungus/Sprite/Scripts/Commands/FadeSprite.cs
  19. 8
      Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs
  20. 16
      Assets/Fungus/Thirdparty/LeanTween/LeanTween.cs
  21. 10
      Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs
  22. 10
      Assets/Fungus/iTween/Scripts/Commands/LookTo.cs
  23. 10
      Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs
  24. 10
      Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs
  25. 10
      Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs
  26. 10
      Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs
  27. 10
      Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs
  28. 10
      Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs
  29. 10
      Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs
  30. 10
      Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs
  31. 10
      Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs
  32. 10
      Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs
  33. 10
      Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs
  34. 10
      Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs
  35. 10
      Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs
  36. 10
      Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs
  37. 10
      Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs
  38. 8
      Assets/Fungus/iTween/Scripts/Commands/StopTween.cs
  39. 10
      Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs
  40. 6
      Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunner.cs

8
Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs

@ -9,7 +9,8 @@ namespace Fungus
"Reset Anim Trigger", "Reset Anim Trigger",
"Resets a trigger parameter on an Animator component.")] "Resets a trigger parameter on an Animator component.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class ResetAnimTrigger : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class ResetAnimTrigger : Command
{ {
[Tooltip("Reference to an Animator component in a game object")] [Tooltip("Reference to an Animator component in a game object")]
public AnimatorData _animator; public AnimatorData _animator;
@ -47,10 +48,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD;
[HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD;
public void OnBeforeSerialize() protected virtual void OnEnable()
{}
public void OnAfterDeserialize()
{ {
if (animatorOLD != null) if (animatorOLD != null)
{ {

8
Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs

@ -9,7 +9,8 @@ namespace Fungus
"Set Anim Bool", "Set Anim Bool",
"Sets a boolean parameter on an Animator component to control a Unity animation")] "Sets a boolean parameter on an Animator component to control a Unity animation")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class SetAnimBool : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class SetAnimBool : Command
{ {
[Tooltip("Reference to an Animator component in a game object")] [Tooltip("Reference to an Animator component in a game object")]
public AnimatorData _animator; public AnimatorData _animator;
@ -50,10 +51,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD;
[HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD;
public void OnBeforeSerialize() protected virtual void OnEnable()
{}
public void OnAfterDeserialize()
{ {
if (animatorOLD != null) if (animatorOLD != null)
{ {

8
Assets/Fungus/Animation/Scripts/Commands/SetAnimFloat.cs

@ -9,7 +9,8 @@ namespace Fungus
"Set Anim Float", "Set Anim Float",
"Sets a float parameter on an Animator component to control a Unity animation")] "Sets a float parameter on an Animator component to control a Unity animation")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class SetAnimFloat : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class SetAnimFloat : Command
{ {
[Tooltip("Reference to an Animator component in a game object")] [Tooltip("Reference to an Animator component in a game object")]
public AnimatorData _animator; public AnimatorData _animator;
@ -50,10 +51,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD;
[HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD;
public void OnBeforeSerialize() protected virtual void OnEnable()
{}
public void OnAfterDeserialize()
{ {
if (animatorOLD != null) if (animatorOLD != null)
{ {

8
Assets/Fungus/Animation/Scripts/Commands/SetAnimInteger.cs

@ -9,7 +9,8 @@ namespace Fungus
"Set Anim Integer", "Set Anim Integer",
"Sets an integer parameter on an Animator component to control a Unity animation")] "Sets an integer parameter on an Animator component to control a Unity animation")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class SetAnimInteger : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class SetAnimInteger : Command
{ {
[Tooltip("Reference to an Animator component in a game object")] [Tooltip("Reference to an Animator component in a game object")]
public AnimatorData _animator; public AnimatorData _animator;
@ -50,10 +51,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD;
[HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD;
public void OnBeforeSerialize() protected virtual void OnEnable()
{}
public void OnAfterDeserialize()
{ {
if (animatorOLD != null) if (animatorOLD != null)
{ {

8
Assets/Fungus/Animation/Scripts/Commands/SetAnimTrigger.cs

@ -9,7 +9,8 @@ namespace Fungus
"Set Anim Trigger", "Set Anim Trigger",
"Sets a trigger parameter on an Animator component to control a Unity animation")] "Sets a trigger parameter on an Animator component to control a Unity animation")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class SetAnimTrigger : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class SetAnimTrigger : Command
{ {
[Tooltip("Reference to an Animator component in a game object")] [Tooltip("Reference to an Animator component in a game object")]
public AnimatorData _animator; public AnimatorData _animator;
@ -47,10 +48,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD;
[HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD; [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD;
public void OnBeforeSerialize() protected virtual void OnEnable()
{}
public void OnAfterDeserialize()
{ {
if (animatorOLD != null) if (animatorOLD != null)
{ {

8
Assets/Fungus/Audio/Scripts/Commands/ControlAudio.cs

@ -7,7 +7,8 @@ namespace Fungus
[CommandInfo("Audio", [CommandInfo("Audio",
"Control Audio", "Control Audio",
"Plays, loops, or stops an audiosource. Any AudioSources with the same tag as the target Audio Source will automatically be stoped.")] "Plays, loops, or stops an audiosource. Any AudioSources with the same tag as the target Audio Source will automatically be stoped.")]
public class ControlAudio : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class ControlAudio : Command
{ {
public enum controlType public enum controlType
{ {
@ -262,10 +263,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("audioSource")] public AudioSource audioSourceOLD; [HideInInspector] [FormerlySerializedAs("audioSource")] public AudioSource audioSourceOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (audioSourceOLD != null) if (audioSourceOLD != null)
{ {

8
Assets/Fungus/Audio/Scripts/Commands/PlayUsfxrSound.cs

@ -7,7 +7,8 @@
"Play Usfxr Sound", "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.")] "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("")] [AddComponentMenu("")]
public class PlayUsfxrSound : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class PlayUsfxrSound : Command
{ {
protected SfxrSynth _synth = new SfxrSynth(); protected SfxrSynth _synth = new SfxrSynth();
@ -69,10 +70,7 @@
[HideInInspector] [FormerlySerializedAs("SettingsString")] public String SettingsStringOLD; [HideInInspector] [FormerlySerializedAs("SettingsString")] public String SettingsStringOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (SettingsStringOLD != "") if (SettingsStringOLD != "")
{ {

8
Assets/Fungus/Flowchart/Scripts/Commands/Destroy.cs

@ -9,7 +9,8 @@ namespace Fungus
"Destroy", "Destroy",
"Destroys a specified game object in the scene.")] "Destroys a specified game object in the scene.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class Destroy : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class Destroy : Command
{ {
[Tooltip("Reference to game object to destroy")] [Tooltip("Reference to game object to destroy")]
public GameObjectData _targetGameObject; public GameObjectData _targetGameObject;
@ -43,10 +44,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD; [HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (targetGameObjectOLD != null) if (targetGameObjectOLD != null)
{ {

8
Assets/Fungus/Flowchart/Scripts/Commands/LoadScene.cs

@ -12,7 +12,8 @@ namespace Fungus
"usage. Previously loaded assets will be released before loading the scene to free up 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.")] "The scene to be loaded must be added to the scene list in Build Settings.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class LoadScene : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class LoadScene : Command
{ {
[Tooltip("Name of the scene to load. The scene must also be added to the build settings.")] [Tooltip("Name of the scene to load. The scene must also be added to the build settings.")]
public StringData _sceneName = new StringData(""); public StringData _sceneName = new StringData("");
@ -44,10 +45,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("sceneName")] public string sceneNameOLD; [HideInInspector] [FormerlySerializedAs("sceneName")] public string sceneNameOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (sceneNameOLD != "") if (sceneNameOLD != "")
{ {

8
Assets/Fungus/Flowchart/Scripts/Commands/SendMessage.cs

@ -8,7 +8,8 @@ namespace Fungus
"Send Message", "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.")] "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("")] [AddComponentMenu("")]
public class SendMessage : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class SendMessage : Command
{ {
public enum MessageTarget public enum MessageTarget
{ {
@ -72,10 +73,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("message")] public string messageOLD; [HideInInspector] [FormerlySerializedAs("message")] public string messageOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (messageOLD != "") if (messageOLD != "")
{ {

8
Assets/Fungus/Flowchart/Scripts/Commands/SetActive.cs

@ -9,7 +9,8 @@ namespace Fungus
"Set Active", "Set Active",
"Sets a game object in the scene to be active / inactive.")] "Sets a game object in the scene to be active / inactive.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class SetActive : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class SetActive : Command
{ {
[Tooltip("Reference to game object to enable / disable")] [Tooltip("Reference to game object to enable / disable")]
public GameObjectData _targetGameObject; public GameObjectData _targetGameObject;
@ -46,10 +47,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD; [HideInInspector] [FormerlySerializedAs("targetGameObject")] public GameObject targetGameObjectOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (targetGameObjectOLD != null) if (targetGameObjectOLD != null)
{ {

8
Assets/Fungus/Flowchart/Scripts/Commands/SpawnObject.cs

@ -11,7 +11,8 @@ namespace Fungus
"Spawn Object", "Spawn Object",
"Spawns a new object based on a reference to a scene or prefab game object.")] "Spawns a new object based on a reference to a scene or prefab game object.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class SpawnObject : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class SpawnObject : Command
{ {
[Tooltip("Game object to copy when spawning. Can be a scene object or a prefab.")] [Tooltip("Game object to copy when spawning. Can be a scene object or a prefab.")]
public GameObjectData _sourceObject; public GameObjectData _sourceObject;
@ -67,10 +68,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("spawnPosition")] public Vector3 spawnPositionOLD; [HideInInspector] [FormerlySerializedAs("spawnPosition")] public Vector3 spawnPositionOLD;
[HideInInspector] [FormerlySerializedAs("spawnRotation")] public Vector3 spawnRotationOLD; [HideInInspector] [FormerlySerializedAs("spawnRotation")] public Vector3 spawnRotationOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (sourceObjectOLD != null) if (sourceObjectOLD != null)
{ {

8
Assets/Fungus/Flowchart/Scripts/Commands/Wait.cs

@ -9,7 +9,8 @@ namespace Fungus
"Wait", "Wait",
"Waits for period of time before executing the next command in the block.")] "Waits for period of time before executing the next command in the block.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class Wait : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class Wait : Command
{ {
[Tooltip("Duration to wait for")] [Tooltip("Duration to wait for")]
public FloatData _duration = new FloatData(1); public FloatData _duration = new FloatData(1);
@ -38,10 +39,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (durationOLD != default(float)) if (durationOLD != default(float))
{ {

18
Assets/Fungus/Flowchart/Scripts/Flowchart.cs

@ -183,12 +183,26 @@ namespace Fungus
return maxId + 1; return maxId + 1;
} }
protected virtual void OnLevelWasLoaded(int level) #if UNITY_5_4_OR_NEWER
protected virtual void Awake()
{
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += (A, B) => {
LevelWasLoaded();
};
}
#else
public virtual void OnLevelWasLoaded(int level)
{
LevelWasLoaded();
}
#endif
protected virtual void LevelWasLoaded()
{ {
// Reset the flag for checking for an event system as there may not be one in the newly loaded scene. // Reset the flag for checking for an event system as there may not be one in the newly loaded scene.
eventSystemPresent = false; eventSystemPresent = false;
} }
protected virtual void Start() protected virtual void Start()
{ {
CheckEventSystem(); CheckEventSystem();

8
Assets/Fungus/Narrative/Scripts/Commands/MenuTimer.cs

@ -11,7 +11,8 @@ namespace Fungus
"Menu Timer", "Menu Timer",
"Displays a timer bar and executes a target block if the player fails to select a menu option in time.")] "Displays a timer bar and executes a target block if the player fails to select a menu option in time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class MenuTimer : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class MenuTimer : Command
{ {
[Tooltip("Length of time to display the timer for")] [Tooltip("Length of time to display the timer for")]
public FloatData _duration = new FloatData(1); public FloatData _duration = new FloatData(1);
@ -60,10 +61,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (durationOLD != default(float)) if (durationOLD != default(float))
{ {

8
Assets/Fungus/Narrative/Scripts/Commands/SetLanguage.cs

@ -8,7 +8,8 @@ namespace Fungus
"Set Language", "Set Language",
"Set the active language for the scene. A Localization object with a localization file must be present in the scene.")] "Set the active language for the scene. A Localization object with a localization file must be present in the scene.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class SetLanguage : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class SetLanguage : Command
{ {
[Tooltip("Code of the language to set. e.g. ES, DE, JA")] [Tooltip("Code of the language to set. e.g. ES, DE, JA")]
public StringData _languageCode = new StringData(); public StringData _languageCode = new StringData();
@ -44,10 +45,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("languageCode")] public string languageCodeOLD; [HideInInspector] [FormerlySerializedAs("languageCode")] public string languageCodeOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (languageCodeOLD != "") if (languageCodeOLD != "")
{ {

14
Assets/Fungus/Narrative/Scripts/Localization.cs

@ -59,7 +59,21 @@ namespace Fungus
protected bool initialized; protected bool initialized;
#if UNITY_5_4_OR_NEWER
protected virtual void Awake()
{
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += (A, B) => {
LevelWasLoaded();
};
}
#else
public virtual void OnLevelWasLoaded(int level) public virtual void OnLevelWasLoaded(int level)
{
LevelWasLoaded();
}
#endif
protected virtual void LevelWasLoaded()
{ {
// Check if a language has been selected using the Set Language command in a previous scene. // Check if a language has been selected using the Set Language command in a previous scene.
if (SetLanguage.mostRecentLanguage != "") if (SetLanguage.mostRecentLanguage != "")

8
Assets/Fungus/Sprite/Scripts/Commands/FadeSprite.cs

@ -9,7 +9,8 @@ namespace Fungus
"Fade Sprite", "Fade Sprite",
"Fades a sprite to a target color over a period of time.")] "Fades a sprite to a target color over a period of time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class FadeSprite : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class FadeSprite : Command
{ {
[Tooltip("Sprite object to be faded")] [Tooltip("Sprite object to be faded")]
public SpriteRenderer spriteRenderer; public SpriteRenderer spriteRenderer;
@ -72,10 +73,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD;
[HideInInspector] [FormerlySerializedAs("targetColor")] public Color targetColorOLD; [HideInInspector] [FormerlySerializedAs("targetColor")] public Color targetColorOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (durationOLD != default(float)) if (durationOLD != default(float))
{ {

8
Assets/Fungus/Sprite/Scripts/Commands/ShowSprite.cs

@ -9,7 +9,8 @@ namespace Fungus
"Show Sprite", "Show Sprite",
"Makes a sprite visible / invisible by setting the color alpha.")] "Makes a sprite visible / invisible by setting the color alpha.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class ShowSprite : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class ShowSprite : Command
{ {
[Tooltip("Sprite object to be made visible / invisible")] [Tooltip("Sprite object to be made visible / invisible")]
public SpriteRenderer spriteRenderer; public SpriteRenderer spriteRenderer;
@ -67,10 +68,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("visible")] public bool visibleOLD; [HideInInspector] [FormerlySerializedAs("visible")] public bool visibleOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (visibleOLD != default(bool)) if (visibleOLD != default(bool))
{ {

16
Assets/Fungus/Thirdparty/LeanTween/LeanTween.cs vendored

@ -1346,7 +1346,21 @@ public void Update(){
LeanTween.update(); LeanTween.update();
} }
public void OnLevelWasLoaded( int lvl ){ #if UNITY_5_4_OR_NEWER
protected void Awake()
{
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += (A, B) => {
LevelWasLoaded();
};
}
#else
protected void OnLevelWasLoaded(int level)
{
LevelWasLoaded();
}
#endif
public void LevelWasLoaded(){
// Debug.Log("reseting gui"); // Debug.Log("reseting gui");
LTGUI.reset(); LTGUI.reset();
} }

10
Assets/Fungus/iTween/Scripts/Commands/LookFrom.cs

@ -8,7 +8,8 @@ namespace Fungus
"Look From", "Look From",
"Instantly rotates a GameObject to look at the supplied Vector3 then returns it to it's starting rotation over time.")] "Instantly rotates a GameObject to look at the supplied Vector3 then returns it to it's starting rotation over time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class LookFrom : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class LookFrom : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will look at")] [Tooltip("Target transform that the GameObject will look at")]
public TransformData _fromTransform; public TransformData _fromTransform;
@ -57,12 +58,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD;
[HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD; [HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (fromTransformOLD != null) if (fromTransformOLD != null)
{ {

10
Assets/Fungus/iTween/Scripts/Commands/LookTo.cs

@ -8,7 +8,8 @@ namespace Fungus
"Look To", "Look To",
"Rotates a GameObject to look at a supplied Transform or Vector3 over time.")] "Rotates a GameObject to look at a supplied Transform or Vector3 over time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class LookTo : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class LookTo : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will look at")] [Tooltip("Target transform that the GameObject will look at")]
public TransformData _toTransform; public TransformData _toTransform;
@ -57,12 +58,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD;
[HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD; [HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (toTransformOLD != null) if (toTransformOLD != null)
{ {

10
Assets/Fungus/iTween/Scripts/Commands/MoveAdd.cs

@ -8,7 +8,8 @@ namespace Fungus
"Move Add", "Move Add",
"Moves a game object by a specified offset over time.")] "Moves a game object by a specified offset over time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class MoveAdd : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class MoveAdd : iTweenCommand
{ {
[Tooltip("A translation offset in space the GameObject will animate to")] [Tooltip("A translation offset in space the GameObject will animate to")]
public Vector3Data _offset; public Vector3Data _offset;
@ -35,12 +36,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (offsetOLD != default(Vector3)) if (offsetOLD != default(Vector3))
{ {

10
Assets/Fungus/iTween/Scripts/Commands/MoveFrom.cs

@ -8,7 +8,8 @@ namespace Fungus
"Move From", "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).")] "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("")] [AddComponentMenu("")]
public class MoveFrom : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class MoveFrom : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will move from")] [Tooltip("Target transform that the GameObject will move from")]
public TransformData _fromTransform; public TransformData _fromTransform;
@ -46,12 +47,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD;
[HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD; [HideInInspector] [FormerlySerializedAs("fromPosition")] public Vector3 fromPositionOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (fromTransformOLD != null) if (fromTransformOLD != null)
{ {

10
Assets/Fungus/iTween/Scripts/Commands/MoveTo.cs

@ -8,7 +8,8 @@ namespace Fungus
"Move To", "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).")] "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("")] [AddComponentMenu("")]
public class MoveTo : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class MoveTo : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will move to")] [Tooltip("Target transform that the GameObject will move to")]
public TransformData _toTransform; public TransformData _toTransform;
@ -46,12 +47,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD;
[HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD; [HideInInspector] [FormerlySerializedAs("toPosition")] public Vector3 toPositionOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (toTransformOLD != null) if (toTransformOLD != null)
{ {

10
Assets/Fungus/iTween/Scripts/Commands/PunchPosition.cs

@ -8,7 +8,8 @@ namespace Fungus
"Punch Position", "Punch Position",
"Applies a jolt of force to a GameObject's position and wobbles it back to its initial position.")] "Applies a jolt of force to a GameObject's position and wobbles it back to its initial position.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class PunchPosition : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class PunchPosition : iTweenCommand
{ {
[Tooltip("A translation offset in space the GameObject will animate to")] [Tooltip("A translation offset in space the GameObject will animate to")]
public Vector3Data _amount; public Vector3Data _amount;
@ -35,12 +36,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (amountOLD != default(Vector3)) if (amountOLD != default(Vector3))
{ {

10
Assets/Fungus/iTween/Scripts/Commands/PunchRotation.cs

@ -8,7 +8,8 @@ namespace Fungus
"Punch Rotation", "Punch Rotation",
"Applies a jolt of force to a GameObject's rotation and wobbles it back to its initial rotation.")] "Applies a jolt of force to a GameObject's rotation and wobbles it back to its initial rotation.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class PunchRotation : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class PunchRotation : iTweenCommand
{ {
[Tooltip("A rotation offset in space the GameObject will animate to")] [Tooltip("A rotation offset in space the GameObject will animate to")]
public Vector3Data _amount; public Vector3Data _amount;
@ -35,12 +36,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (amountOLD != default(Vector3)) if (amountOLD != default(Vector3))
{ {

10
Assets/Fungus/iTween/Scripts/Commands/PunchScale.cs

@ -8,7 +8,8 @@ namespace Fungus
"Punch Scale", "Punch Scale",
"Applies a jolt of force to a GameObject's scale and wobbles it back to its initial scale.")] "Applies a jolt of force to a GameObject's scale and wobbles it back to its initial scale.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class PunchScale : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class PunchScale : iTweenCommand
{ {
[Tooltip("A scale offset in space the GameObject will animate to")] [Tooltip("A scale offset in space the GameObject will animate to")]
public Vector3Data _amount; public Vector3Data _amount;
@ -31,12 +32,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (amountOLD != default(Vector3)) if (amountOLD != default(Vector3))
{ {

10
Assets/Fungus/iTween/Scripts/Commands/RotateAdd.cs

@ -8,7 +8,8 @@ namespace Fungus
"Rotate Add", "Rotate Add",
"Rotates a game object by the specified angles over time.")] "Rotates a game object by the specified angles over time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class RotateAdd : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class RotateAdd : iTweenCommand
{ {
[Tooltip("A rotation offset in space the GameObject will animate to")] [Tooltip("A rotation offset in space the GameObject will animate to")]
public Vector3Data _offset; public Vector3Data _offset;
@ -35,12 +36,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (offsetOLD != default(Vector3)) if (offsetOLD != default(Vector3))
{ {

10
Assets/Fungus/iTween/Scripts/Commands/RotateFrom.cs

@ -8,7 +8,8 @@ namespace Fungus
"Rotate From", "Rotate From",
"Rotates a game object from the specified angles back to its starting orientation over time.")] "Rotates a game object from the specified angles back to its starting orientation over time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class RotateFrom : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class RotateFrom : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will rotate from")] [Tooltip("Target transform that the GameObject will rotate from")]
public TransformData _fromTransform; public TransformData _fromTransform;
@ -46,12 +47,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD;
[HideInInspector] [FormerlySerializedAs("fromRotation")] public Vector3 fromRotationOLD; [HideInInspector] [FormerlySerializedAs("fromRotation")] public Vector3 fromRotationOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (fromTransformOLD != null) if (fromTransformOLD != null)
{ {

10
Assets/Fungus/iTween/Scripts/Commands/RotateTo.cs

@ -8,7 +8,8 @@ namespace Fungus
"Rotate To", "Rotate To",
"Rotates a game object to the specified angles over time.")] "Rotates a game object to the specified angles over time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class RotateTo : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class RotateTo : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will rotate to")] [Tooltip("Target transform that the GameObject will rotate to")]
public TransformData _toTransform; public TransformData _toTransform;
@ -46,12 +47,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD;
[HideInInspector] [FormerlySerializedAs("toRotation")] public Vector3 toRotationOLD; [HideInInspector] [FormerlySerializedAs("toRotation")] public Vector3 toRotationOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (toTransformOLD != null) if (toTransformOLD != null)
{ {

10
Assets/Fungus/iTween/Scripts/Commands/ScaleAdd.cs

@ -8,7 +8,8 @@ namespace Fungus
"Scale Add", "Scale Add",
"Changes a game object's scale by a specified offset over time.")] "Changes a game object's scale by a specified offset over time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class ScaleAdd : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class ScaleAdd : iTweenCommand
{ {
[Tooltip("A scale offset in space the GameObject will animate to")] [Tooltip("A scale offset in space the GameObject will animate to")]
public Vector3Data _offset; public Vector3Data _offset;
@ -31,12 +32,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD; [HideInInspector] [FormerlySerializedAs("offset")] public Vector3 offsetOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (offsetOLD != default(Vector3)) if (offsetOLD != default(Vector3))
{ {

10
Assets/Fungus/iTween/Scripts/Commands/ScaleFrom.cs

@ -8,7 +8,8 @@ namespace Fungus
"Scale From", "Scale From",
"Changes a game object's scale to the specified value and back to its original scale over time.")] "Changes a game object's scale to the specified value and back to its original scale over time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class ScaleFrom : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class ScaleFrom : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will scale from")] [Tooltip("Target transform that the GameObject will scale from")]
public TransformData _fromTransform; public TransformData _fromTransform;
@ -42,12 +43,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD; [HideInInspector] [FormerlySerializedAs("fromTransform")] public Transform fromTransformOLD;
[HideInInspector] [FormerlySerializedAs("fromScale")] public Vector3 fromScaleOLD; [HideInInspector] [FormerlySerializedAs("fromScale")] public Vector3 fromScaleOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (fromTransformOLD != null) if (fromTransformOLD != null)
{ {

10
Assets/Fungus/iTween/Scripts/Commands/ScaleTo.cs

@ -8,7 +8,8 @@ namespace Fungus
"Scale To", "Scale To",
"Changes a game object's scale to a specified value over time.")] "Changes a game object's scale to a specified value over time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class ScaleTo : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class ScaleTo : iTweenCommand
{ {
[Tooltip("Target transform that the GameObject will scale to")] [Tooltip("Target transform that the GameObject will scale to")]
public TransformData _toTransform; public TransformData _toTransform;
@ -42,12 +43,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD; [HideInInspector] [FormerlySerializedAs("toTransform")] public Transform toTransformOLD;
[HideInInspector] [FormerlySerializedAs("toScale")] public Vector3 toScaleOLD; [HideInInspector] [FormerlySerializedAs("toScale")] public Vector3 toScaleOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (toTransformOLD != null) if (toTransformOLD != null)
{ {

10
Assets/Fungus/iTween/Scripts/Commands/ShakePosition.cs

@ -8,7 +8,8 @@ namespace Fungus
"Shake Position", "Shake Position",
"Randomly shakes a GameObject's position by a diminishing amount over time.")] "Randomly shakes a GameObject's position by a diminishing amount over time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class ShakePosition : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class ShakePosition : iTweenCommand
{ {
[Tooltip("A translation offset in space the GameObject will animate to")] [Tooltip("A translation offset in space the GameObject will animate to")]
public Vector3Data _amount; public Vector3Data _amount;
@ -50,12 +51,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (amountOLD != default(Vector3)) if (amountOLD != default(Vector3))
{ {

10
Assets/Fungus/iTween/Scripts/Commands/ShakeRotation.cs

@ -8,7 +8,8 @@ namespace Fungus
"Shake Rotation", "Shake Rotation",
"Randomly shakes a GameObject's rotation by a diminishing amount over time.")] "Randomly shakes a GameObject's rotation by a diminishing amount over time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class ShakeRotation : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class ShakeRotation : iTweenCommand
{ {
[Tooltip("A rotation offset in space the GameObject will animate to")] [Tooltip("A rotation offset in space the GameObject will animate to")]
public Vector3Data _amount; public Vector3Data _amount;
@ -35,12 +36,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (amountOLD != default(Vector3)) if (amountOLD != default(Vector3))
{ {

10
Assets/Fungus/iTween/Scripts/Commands/ShakeScale.cs

@ -8,7 +8,8 @@ namespace Fungus
"Shake Scale", "Shake Scale",
"Randomly shakes a GameObject's rotation by a diminishing amount over time.")] "Randomly shakes a GameObject's rotation by a diminishing amount over time.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class ShakeScale : iTweenCommand, ISerializationCallbackReceiver [ExecuteInEditMode]
public class ShakeScale : iTweenCommand
{ {
[Tooltip("A scale offset in space the GameObject will animate to")] [Tooltip("A scale offset in space the GameObject will animate to")]
public Vector3Data _amount; public Vector3Data _amount;
@ -31,12 +32,9 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD; [HideInInspector] [FormerlySerializedAs("amount")] public Vector3 amountOLD;
public override void OnBeforeSerialize() protected override void OnEnable()
{}
public override void OnAfterDeserialize()
{ {
base.OnAfterDeserialize(); base.OnEnable();
if (amountOLD != default(Vector3)) if (amountOLD != default(Vector3))
{ {

8
Assets/Fungus/iTween/Scripts/Commands/StopTween.cs

@ -8,7 +8,8 @@ namespace Fungus
"Stop Tween", "Stop Tween",
"Stops an active iTween by name.")] "Stops an active iTween by name.")]
[AddComponentMenu("")] [AddComponentMenu("")]
public class StopTween : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public class StopTween : Command
{ {
[Tooltip("Stop and destroy any Tweens in current scene with the supplied name")] [Tooltip("Stop and destroy any Tweens in current scene with the supplied name")]
public StringData _tweenName; public StringData _tweenName;
@ -23,10 +24,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD; [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (tweenNameOLD != "") if (tweenNameOLD != "")
{ {

10
Assets/Fungus/iTween/Scripts/Commands/iTweenCommand.cs

@ -13,7 +13,8 @@ namespace Fungus
Z Z
} }
public abstract class iTweenCommand : Command, ISerializationCallbackReceiver [ExecuteInEditMode]
public abstract class iTweenCommand : Command
{ {
[Tooltip("Target game object to apply the Tween to")] [Tooltip("Target game object to apply the Tween to")]
public GameObjectData _targetObject; public GameObjectData _targetObject;
@ -98,10 +99,7 @@ namespace Fungus
[HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD; [HideInInspector] [FormerlySerializedAs("tweenName")] public string tweenNameOLD;
[HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD; [HideInInspector] [FormerlySerializedAs("duration")] public float durationOLD;
public virtual void OnBeforeSerialize() protected virtual void OnEnable()
{}
public virtual void OnAfterDeserialize()
{ {
if (targetObjectOLD != null) if (targetObjectOLD != null)
{ {
@ -113,7 +111,7 @@ namespace Fungus
{ {
_duration.Value = durationOLD; _duration.Value = durationOLD;
durationOLD = default(float); durationOLD = default(float);
} }
} }
#endregion #endregion

6
Assets/UnityTestTools/IntegrationTestsFramework/TestRunner/Editor/PlatformRunner/PlatformRunner.cs

@ -109,8 +109,10 @@ namespace UnityTest.IntegrationTests
{ {
case BuildTargetGroup.Android: case BuildTargetGroup.Android:
return BuildTarget.Android; return BuildTarget.Android;
#if !UNITY_5_4_OR_NEWER
case BuildTargetGroup.WebPlayer: case BuildTargetGroup.WebPlayer:
return BuildTarget.WebPlayer; return BuildTarget.WebPlayer;
#endif
default: default:
{ {
switch (Application.platform) switch (Application.platform)
@ -122,7 +124,11 @@ namespace UnityTest.IntegrationTests
case RuntimePlatform.LinuxPlayer: case RuntimePlatform.LinuxPlayer:
return BuildTarget.StandaloneLinux; return BuildTarget.StandaloneLinux;
} }
#if UNITY_5_4_OR_NEWER
return BuildTarget.WebGL;
#else
return BuildTarget.WebPlayer; return BuildTarget.WebPlayer;
#endif
} }
} }
} }

Loading…
Cancel
Save