蓝色星空 преди 1 година
родител
ревизия
39c98126cf
променени са 100 файла, в които са добавени 5817 реда и са изтрити 6203 реда
  1. 11 0
      .gitignore
  2. 0 26
      Assembly-CSharp-Editor-firstpass.csproj
  3. 0 26
      Assembly-CSharp-Editor.csproj
  4. 0 26
      Assembly-CSharp-firstpass.csproj
  5. 0 26
      Assembly-CSharp.csproj
  6. 1901 1901
      Assets/DefaultPlayables/Editor/TimelinePlayableWizard.cs
  7. 12 12
      Assets/DefaultPlayables/Editor/TimelinePlayableWizard.cs.meta
  8. 33 33
      Assets/DefaultPlayables/LightControl/Editor/LightControlDrawer.cs
  9. 12 12
      Assets/DefaultPlayables/LightControl/Editor/LightControlDrawer.cs.meta
  10. 13 13
      Assets/DefaultPlayables/LightControl/LightControlBehaviour.cs
  11. 12 12
      Assets/DefaultPlayables/LightControl/LightControlBehaviour.cs.meta
  12. 20 20
      Assets/DefaultPlayables/LightControl/LightControlClip.cs
  13. 12 12
      Assets/DefaultPlayables/LightControl/LightControlClip.cs.meta
  14. 81 81
      Assets/DefaultPlayables/LightControl/LightControlMixerBehaviour.cs
  15. 12 12
      Assets/DefaultPlayables/LightControl/LightControlMixerBehaviour.cs.meta
  16. 29 29
      Assets/DefaultPlayables/LightControl/LightControlTrack.cs
  17. 12 12
      Assets/DefaultPlayables/LightControl/LightControlTrack.cs.meta
  18. 16 16
      Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlBehaviour.cs
  19. 12 12
      Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlBehaviour.cs.meta
  20. 25 25
      Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlClip.cs
  21. 12 12
      Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlClip.cs.meta
  22. 34 34
      Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlMixerBehaviour.cs
  23. 12 12
      Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlMixerBehaviour.cs.meta
  24. 15 15
      Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlTrack.cs
  25. 12 12
      Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlTrack.cs.meta
  26. 22 22
      Assets/DefaultPlayables/ScreenFader/Editor/ScreenFaderDrawer.cs
  27. 12 12
      Assets/DefaultPlayables/ScreenFader/Editor/ScreenFaderDrawer.cs.meta
  28. 11 11
      Assets/DefaultPlayables/ScreenFader/ScreenFaderBehaviour.cs
  29. 12 12
      Assets/DefaultPlayables/ScreenFader/ScreenFaderBehaviour.cs.meta
  30. 20 20
      Assets/DefaultPlayables/ScreenFader/ScreenFaderClip.cs
  31. 12 12
      Assets/DefaultPlayables/ScreenFader/ScreenFaderClip.cs.meta
  32. 64 64
      Assets/DefaultPlayables/ScreenFader/ScreenFaderMixerBehaviour.cs
  33. 12 12
      Assets/DefaultPlayables/ScreenFader/ScreenFaderMixerBehaviour.cs.meta
  34. 36 36
      Assets/DefaultPlayables/ScreenFader/ScreenFaderTrack.cs
  35. 12 12
      Assets/DefaultPlayables/ScreenFader/ScreenFaderTrack.cs.meta
  36. 30 30
      Assets/DefaultPlayables/TextSwitcher/Editor/TextSwitcherDrawer.cs
  37. 12 12
      Assets/DefaultPlayables/TextSwitcher/Editor/TextSwitcherDrawer.cs.meta
  38. 13 13
      Assets/DefaultPlayables/TextSwitcher/TextSwitcherBehaviour.cs
  39. 12 12
      Assets/DefaultPlayables/TextSwitcher/TextSwitcherBehaviour.cs.meta
  40. 20 20
      Assets/DefaultPlayables/TextSwitcher/TextSwitcherClip.cs
  41. 12 12
      Assets/DefaultPlayables/TextSwitcher/TextSwitcherClip.cs.meta
  42. 78 78
      Assets/DefaultPlayables/TextSwitcher/TextSwitcherMixerBehaviour.cs
  43. 12 12
      Assets/DefaultPlayables/TextSwitcher/TextSwitcherMixerBehaviour.cs.meta
  44. 36 36
      Assets/DefaultPlayables/TextSwitcher/TextSwitcherTrack.cs
  45. 12 12
      Assets/DefaultPlayables/TextSwitcher/TextSwitcherTrack.cs.meta
  46. 20 20
      Assets/DefaultPlayables/TimeDilation/Editor/TimeDilationDrawer.cs
  47. 12 12
      Assets/DefaultPlayables/TimeDilation/Editor/TimeDilationDrawer.cs.meta
  48. 10 10
      Assets/DefaultPlayables/TimeDilation/TimeDilationBehaviour.cs
  49. 12 12
      Assets/DefaultPlayables/TimeDilation/TimeDilationBehaviour.cs.meta
  50. 21 21
      Assets/DefaultPlayables/TimeDilation/TimeDilationClip.cs
  51. 12 12
      Assets/DefaultPlayables/TimeDilation/TimeDilationClip.cs.meta
  52. 41 41
      Assets/DefaultPlayables/TimeDilation/TimeDilationMixerBehaviour.cs
  53. 12 12
      Assets/DefaultPlayables/TimeDilation/TimeDilationMixerBehaviour.cs.meta
  54. 13 13
      Assets/DefaultPlayables/TimeDilation/TimeDilationTrack.cs
  55. 12 12
      Assets/DefaultPlayables/TimeDilation/TimeDilationTrack.cs.meta
  56. 44 44
      Assets/DefaultPlayables/TransformTween/Editor/TransformTweenDrawer.cs
  57. 12 12
      Assets/DefaultPlayables/TransformTween/Editor/TransformTweenDrawer.cs.meta
  58. 80 80
      Assets/DefaultPlayables/TransformTween/TransformTweenBehaviour.cs
  59. 12 12
      Assets/DefaultPlayables/TransformTween/TransformTweenBehaviour.cs.meta
  60. 25 25
      Assets/DefaultPlayables/TransformTween/TransformTweenClip.cs
  61. 12 12
      Assets/DefaultPlayables/TransformTween/TransformTweenClip.cs.meta
  62. 118 118
      Assets/DefaultPlayables/TransformTween/TransformTweenMixerBehaviour.cs
  63. 12 12
      Assets/DefaultPlayables/TransformTween/TransformTweenMixerBehaviour.cs.meta
  64. 32 32
      Assets/DefaultPlayables/TransformTween/TransformTweenTrack.cs
  65. 12 12
      Assets/DefaultPlayables/TransformTween/TransformTweenTrack.cs.meta
  66. 176 176
      Assets/DefaultPlayables/Video/VideoPlayableBehaviour.cs
  67. 12 12
      Assets/DefaultPlayables/Video/VideoPlayableBehaviour.cs.meta
  68. 52 52
      Assets/DefaultPlayables/Video/VideoSchedulerPlayableBehaviour.cs
  69. 12 12
      Assets/DefaultPlayables/Video/VideoSchedulerPlayableBehaviour.cs.meta
  70. 45 45
      Assets/DefaultPlayables/Video/VideoScriptPlayableAsset.cs
  71. 12 12
      Assets/DefaultPlayables/Video/VideoScriptPlayableAsset.cs.meta
  72. 34 34
      Assets/DefaultPlayables/Video/VideoScriptPlayableTrack.cs
  73. 12 12
      Assets/DefaultPlayables/Video/VideoScriptPlayableTrack.cs.meta
  74. 60 60
      Assets/DrawingAir/DrawListManager.cs
  75. 85 85
      Assets/DrawingAir/Paint.cs
  76. 152 152
      Assets/DrawingAir/PaintBoard.cs
  77. 57 57
      Assets/DrawingAir/Painter.cs
  78. 0 96
      Assets/FT_MagicEffects_Vol01/Model/FTME01_sphere01.obj.meta
  79. 0 96
      Assets/FT_MagicEffects_Vol01/Model/FTME01_sphere02.obj.meta
  80. 0 101
      Assets/Hard Surface Pro/Shared/Props/Candles/CandleLow.OBJ.meta
  81. 36 36
      Assets/MaterializeFX/MaterializationFX/Scripts/ShaderParameterSetter.cs
  82. 40 40
      Assets/MaterializeFX/MaterializationFX/Scripts/Utils/DemoPrefabController.cs
  83. 58 58
      Assets/MaterializeFX/MaterializationFX/Scripts/Utils/MouseOrbitController.cs
  84. 30 30
      Assets/MathClass/Scripts/Line.cs
  85. 52 52
      Assets/MathClass/Scripts/MethodExtensionForUnity.cs
  86. 59 59
      Assets/MathClass/Scripts/Play.cs
  87. 54 54
      Assets/MathClass/Scripts/PolygonDrawer.cs
  88. 120 120
      Assets/MathClass/Scripts/Triangulator.cs
  89. 9 9
      Assets/MathClass/Scripts/test.cs
  90. 100 100
      Assets/Mirza Beig/Demos/The Last Particle/Scripts/AudioPitchAndVolumeByVelocity.cs
  91. 369 369
      Assets/Mirza Beig/Demos/The Last Particle/Scripts/CameraController.cs
  92. 95 95
      Assets/Mirza Beig/Demos/The Last Particle/Scripts/Collectable.cs
  93. 106 106
      Assets/Mirza Beig/Demos/The Last Particle/Scripts/CollectableSpawner.cs
  94. 79 79
      Assets/Mirza Beig/Demos/The Last Particle/Scripts/Damping.cs
  95. 83 83
      Assets/Mirza Beig/Demos/The Last Particle/Scripts/DestroyOnAudioStop.cs
  96. 78 78
      Assets/Mirza Beig/Demos/The Last Particle/Scripts/InstantiatePrefabOnCollisionEnter.cs
  97. 77 77
      Assets/Mirza Beig/Demos/The Last Particle/Scripts/OnTriggerEvents.cs
  98. 186 186
      Assets/Mirza Beig/Demos/The Last Particle/Scripts/Player.cs
  99. 105 105
      Assets/Mirza Beig/Demos/The Last Particle/Scripts/RandomInvoke.cs
  100. 100 100
      Assets/Mirza Beig/Demos/The Last Particle/Scripts/RandomInvoke_EmitParticle.cs

+ 11 - 0
.gitignore

@@ -0,0 +1,11 @@
+/*.csproj
+/Library
+/Temp
+/obj
+/UserSettings
+/.vsconfig
+/*.apk
+/QCAR
+/*.sln
+/.vs
+/.vscode 

Файловите разлики са ограничени, защото са твърде много
+ 0 - 26
Assembly-CSharp-Editor-firstpass.csproj


Файловите разлики са ограничени, защото са твърде много
+ 0 - 26
Assembly-CSharp-Editor.csproj


Файловите разлики са ограничени, защото са твърде много
+ 0 - 26
Assembly-CSharp-firstpass.csproj


Файловите разлики са ограничени, защото са твърде много
+ 0 - 26
Assembly-CSharp.csproj


+ 1901 - 1901
Assets/DefaultPlayables/Editor/TimelinePlayableWizard.cs

@@ -1,1901 +1,1901 @@
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Linq;
-using System.CodeDom.Compiler;
-using System.Reflection;
-using UnityEditor;
-using UnityEngine;
-using UnityEngine.Timeline;
-
-public class TimelinePlayableWizard : EditorWindow
-{
-    public class Variable : IComparable
-    {
-        public string name;
-        public UsableType usableType;
-
-        int m_TypeIndex;
-        
-        public Variable (string name, UsableType usableType)
-        {
-            this.name = name;
-            this.usableType = usableType;
-        }
-
-        public bool GUI (UsableType[] usableTypes)
-        {
-            bool removeThis = false;
-            EditorGUILayout.BeginHorizontal();
-            name = EditorGUILayout.TextField(name);
-            m_TypeIndex = EditorGUILayout.Popup(m_TypeIndex, UsableType.GetNamewithSortingArray (usableTypes));
-            usableType = usableTypes[m_TypeIndex];
-            if (GUILayout.Button("Remove", GUILayout.Width(60f)))
-            {
-                removeThis = true;
-            }
-            EditorGUILayout.EndHorizontal();
-
-            return removeThis;
-        }
-
-        public int CompareTo (object obj)
-        {
-            if (obj == null)
-                return 1;
-
-            UsableType other = (UsableType)obj;
-
-            if (other == null)
-                throw new ArgumentException("This object is not a Variable.");
-
-            return name.ToLower().CompareTo(other.name.ToLower());
-        }
-
-        public static UsableType[] GetUsableTypesFromVariableArray (Variable[] variables)
-        {
-            UsableType[] usableTypes = new UsableType[variables.Length];
-            for (int i = 0; i < usableTypes.Length; i++)
-            {
-                usableTypes[i] = variables[i].usableType;
-            }
-            return usableTypes;
-        }
-    }
-
-
-    public class UsableType : IComparable
-    {
-        public readonly string name;
-        public readonly string nameWithSorting;
-        public readonly string additionalNamespace;
-        public readonly GUIContent guiContentWithSorting;
-        public readonly Type type;
-
-        public readonly string[] unrequiredNamespaces =
-        {
-            "UnityEngine",
-            "UnityEngine.Timeline",
-            "UnityEngine.Playables"
-        };
-        public const string blankAdditionalNamespace = "";
-
-        const string k_NameForNullType = "None";
-
-        public UsableType (Type usableType)
-        {
-            type = usableType;
-
-            if (type != null)
-            {
-                name = usableType.Name;
-                nameWithSorting = name.ToUpper ()[0] + "/" + name;
-                additionalNamespace = unrequiredNamespaces.All (t => usableType.Namespace != t) ? usableType.Namespace : blankAdditionalNamespace;
-            }
-            else
-            {
-                name = k_NameForNullType;
-                nameWithSorting = k_NameForNullType;
-                additionalNamespace = blankAdditionalNamespace;
-            }
-
-            guiContentWithSorting = new GUIContent(nameWithSorting);
-        }
-
-        public UsableType (string name)
-        {
-            this.name = name;
-            nameWithSorting = name.ToUpper()[0] + "/" + name;
-            additionalNamespace = blankAdditionalNamespace;
-            guiContentWithSorting = new GUIContent(nameWithSorting);
-        }
-
-        public int CompareTo (object obj)
-        {
-            if (obj == null)
-                return 1;
-
-            UsableType other = (UsableType)obj;
-            
-            if(other == null)
-                throw new ArgumentException("This object is not a UsableType.");
-
-            return name.ToLower().CompareTo (other.name.ToLower());
-        }
-
-        public static UsableType[] GetUsableTypeArray (Type[] types, params UsableType[] additionalUsableTypes)
-        {
-            List<UsableType> usableTypeList = new List<UsableType> ();
-            for (int i = 0; i < types.Length; i++)
-            {
-                usableTypeList.Add (new UsableType (types[i]));
-            }
-            usableTypeList.AddRange (additionalUsableTypes);
-            return usableTypeList.ToArray ();
-        }
-
-        public static UsableType[] AmalgamateUsableTypes (UsableType[] usableTypeArray, params UsableType[] usableTypes)
-        {
-            List<UsableType> usableTypeList = new List<UsableType> ();
-            for (int i = 0; i < usableTypes.Length; i++)
-            {
-                usableTypeList.Add (usableTypes[i]);
-            }
-            usableTypeList.AddRange(usableTypeArray);
-            return usableTypeList.ToArray();
-        }
-
-        public static string[] GetNamewithSortingArray(UsableType[] usableTypes)
-        {
-            if (usableTypes == null || usableTypes.Length == 0)
-                return new string[0];
-
-            string[] displayNames = new string[usableTypes.Length];
-            for (int i = 0; i < displayNames.Length; i++)
-            {
-                displayNames[i] = usableTypes[i].nameWithSorting;
-            }
-            return displayNames;
-        }
-
-        public static GUIContent[] GetGUIContentWithSortingArray (UsableType[] usableTypes)
-        {
-            if(usableTypes == null || usableTypes.Length == 0)
-                return new GUIContent[0];
-
-            GUIContent[] guiContents = new GUIContent[usableTypes.Length];
-            for (int i = 0; i < guiContents.Length; i++)
-            {
-                guiContents[i] = usableTypes[i].guiContentWithSorting;
-            }
-            return guiContents;
-        }
-
-        public static string[] GetDistinctAdditionalNamespaces (UsableType[] usableTypes)
-        {
-            if (usableTypes == null || usableTypes.Length == 0)
-                return new string[0];
-
-            string[] namespaceArray = new string[usableTypes.Length];
-            for (int i = 0; i < namespaceArray.Length; i++)
-            {
-                namespaceArray[i] = usableTypes[i].additionalNamespace;
-            }
-            return namespaceArray.Distinct().ToArray();
-        }
-    }
-
-
-    public class UsableProperty : IComparable
-    {
-        public enum Usability
-        {
-            Blendable, Assignable, Not
-        }
-        
-        public enum UsablePropertyType
-        {
-            Property, Field
-        }
-        
-        public string type;
-        public string name;
-        public string defaultValue;
-        public Usability usability;
-        public UsablePropertyType usablePropertyType;
-        public PropertyInfo propertyInfo;
-        public FieldInfo fieldInfo;
-
-        int m_TypeIndex;
-        
-        public string NameWithCaptial
-        {
-            get { return name.First().ToString().ToUpper() + name.Substring(1); }
-        }
-
-        public string NameAsPrivate
-        {
-            get { return "m_" + NameWithCaptial; }
-        }
-
-        public string NameAsPrivateDefault
-        {
-            get { return "m_Default" + NameWithCaptial; }
-        }
-
-        public string NameAsPrivateAssigned
-        {
-            get { return "m_Assigned" + NameWithCaptial; }
-        }
-
-        public string NameAsLocalBlended
-        {
-            get { return "blended" + NameWithCaptial; }
-        }
-
-        public string NameAsLocalSerializedProperty
-        {
-            get { return name + "Prop"; }
-        }
-        
-        public UsableProperty (PropertyInfo propertyInfo)
-        {
-            usablePropertyType = UsablePropertyType.Property;
-            this.propertyInfo = propertyInfo;
-
-            if (propertyInfo.PropertyType.Name == "Single")
-                type = "float";
-            else if (propertyInfo.PropertyType.Name == "Int32")
-                type = "int";
-            else if (propertyInfo.PropertyType.Name == "Double")
-                type = "double";
-            else if (propertyInfo.PropertyType.Name == "Boolean")
-                type = "bool";
-            else if (propertyInfo.PropertyType.Name == "String")
-                type = "string";
-            else
-                type = propertyInfo.PropertyType.Name;
-
-            name = propertyInfo.Name;
-
-            if (IsTypeBlendable(propertyInfo.PropertyType))
-                usability = Usability.Blendable;
-            else if (IsTypeAssignable(propertyInfo.PropertyType))
-                usability = Usability.Assignable;
-            else
-                usability = Usability.Not;
-        }
-
-        public UsableProperty (FieldInfo fieldInfo)
-        {
-            usablePropertyType = UsablePropertyType.Field;
-            this.fieldInfo = fieldInfo;
-            
-            if (fieldInfo.FieldType.Name == "Single")
-                type = "float";
-            else if (fieldInfo.FieldType.Name == "Int32")
-                type = "int";
-            else if (fieldInfo.FieldType.Name == "Double")
-                type = "double";
-            else if (fieldInfo.FieldType.Name == "Boolean")
-                type = "bool";
-            else if (fieldInfo.FieldType.Name == "String")
-                type = "string";
-            else
-                type = fieldInfo.FieldType.Name;
-
-            name = fieldInfo.Name;
-            
-            if (IsTypeBlendable(fieldInfo.FieldType))
-                usability = Usability.Blendable;
-            else if (IsTypeAssignable(fieldInfo.FieldType))
-                usability = Usability.Assignable;
-            else
-                usability = Usability.Not;
-        }
-
-        public string ZeroValueAsString ()
-        {
-            if(usability != Usability.Blendable)
-                throw new UnityException("UsableType is not blendable, shouldn't be looking for zero value as string.");
-
-            switch (type)
-            {
-                case "float":
-                    return "0f";
-                case "int":
-                    return "0";
-                case "double":
-                    return "0.0";
-                case "Vector2":
-                    return "Vector2.zero";
-                case "Vector3":
-                    return "Vector3.zero";
-                case "Color":
-                    return "Color.clear";
-            }
-            return "";
-        }
-
-        public void CreateSettingDefaultValueString (Component defaultValuesComponent)
-        {
-            if (defaultValuesComponent == null)
-            {
-                defaultValue = "";
-                return;
-            }
-            
-            object defaultValueObj = usablePropertyType == UsablePropertyType.Property ? propertyInfo.GetValue (defaultValuesComponent, null) : fieldInfo.GetValue (defaultValuesComponent);
-            
-            switch (type)
-            {
-                case "float":
-                    float defaultFloatValue = (float)defaultValueObj;
-                    defaultValue = defaultFloatValue + "f";
-                    break;
-                case "int":
-                    int defaultIntValue = (int)defaultValueObj;
-                    defaultValue = defaultIntValue.ToString();
-                    break;
-                case "double":
-                    double defaultDoubleValue = (double)defaultValueObj;
-                    defaultValue = defaultDoubleValue.ToString();
-                    break;
-                case "Vector2":
-                    Vector2 defaultVector2Value = (Vector2)defaultValueObj;
-                    defaultValue = "new Vector2(" + defaultVector2Value.x + "f, " + defaultVector2Value.y + "f)";
-                    break;
-                case "Vector3":
-                    Vector3 defaultVector3Value = (Vector3)defaultValueObj;
-                    defaultValue = "new Vector3(" + defaultVector3Value.x + "f, " + defaultVector3Value.y + "f, " + defaultVector3Value.z + "f)";
-                    break;
-                case "Color":
-                    Color defaultColorValue = (Color)defaultValueObj;
-                    defaultValue = "new Color(" + defaultColorValue.r + "f, " + defaultColorValue.g + "f, " + defaultColorValue.b + "f, " + defaultColorValue.a + "f)";
-                    break;
-                case "string":
-                    defaultValue = "\"" + defaultValueObj + "\"";
-                    break;
-                case "bool":
-                    bool defaultBoolValue = (bool)defaultValueObj;
-                    defaultValue = defaultBoolValue.ToString ().ToLower();
-                    break;
-                default:
-                    Enum defaultEnumValue = (Enum)defaultValueObj;
-                    Type enumSystemType = defaultEnumValue.GetType ();
-                    string[] splits = enumSystemType.ToString().Split('+');
-                    string enumType = splits[splits.Length - 1];
-                    string enumConstantName = Enum.GetName (enumSystemType, defaultEnumValue);
-                    defaultValue = enumType + "." + enumConstantName;
-                    break;
-            }
-        }
-
-        public bool GUI (List<UsableProperty> allUsableProperties)
-        {
-            bool removeThis = false;
-            EditorGUILayout.BeginHorizontal();
-            m_TypeIndex = EditorGUILayout.Popup(m_TypeIndex, GetNameWithSortingArray (allUsableProperties));
-            type = allUsableProperties[m_TypeIndex].type;
-            name = allUsableProperties[m_TypeIndex].name;
-            usablePropertyType = allUsableProperties[m_TypeIndex].usablePropertyType;
-            propertyInfo = allUsableProperties[m_TypeIndex].propertyInfo;
-            fieldInfo = allUsableProperties[m_TypeIndex].fieldInfo;
-            usability = allUsableProperties[m_TypeIndex].usability;
-            if (GUILayout.Button("Remove", GUILayout.Width(60f)))
-            {
-                removeThis = true;
-            }
-            EditorGUILayout.EndHorizontal();
-            return removeThis;
-        }
-
-        public int CompareTo(object obj)
-        {
-            if (obj == null)
-                return 1;
-
-            UsableType other = (UsableType)obj;
-
-            if (other == null)
-                throw new ArgumentException("This object is not a UsableProperty.");
-
-            return name.ToLower().CompareTo(other.name.ToLower());
-        }
-
-        public static string[] GetNameWithSortingArray (List<UsableProperty> usableProperties)
-        {
-            string[] returnVal = new string[usableProperties.Count];
-            for (int i = 0; i < returnVal.Length; i++)
-            {
-                returnVal[i] = usableProperties[i].name;
-            }
-            return returnVal;
-        }
-
-        public UsableProperty GetDuplicate ()
-        {
-            UsableProperty duplicate = usablePropertyType == UsablePropertyType.Property ? new UsableProperty (propertyInfo) : new UsableProperty (fieldInfo);
-            duplicate.defaultValue = defaultValue;
-            return duplicate;
-        }
-    }
-
-    public enum CreationError
-    {
-        NoError,
-        PlayableAssetAlreadyExists,
-        PlayableBehaviourAlreadyExists,
-        PlayableBehaviourMixerAlreadyExists,
-        TrackAssetAlreadyExists,
-        PlayableDrawerAlreadyExists,
-    }
-
-
-    public bool showHelpBoxes = true;
-    public string playableName = "";
-    public bool isStandardBlendPlayable;
-    public UsableType trackBinding;
-    public Component defaultValuesComponent;
-    public List<Variable> exposedReferences = new List<Variable> ();
-    public List<Variable> playableBehaviourVariables = new List<Variable> ();
-    public List<UsableProperty> standardBlendPlayableProperties = new List<UsableProperty> ();
-    public ClipCaps clipCaps;
-    /*public bool setClipDefaults;
-    public float clipDefaultDurationSeconds = 5f;
-    public float clipDefaultEaseInSeconds;
-    public float clipDefaultEaseOutSeconds;
-    public float clipDefaultClipInSeconds;
-    public float clipDefaultSpeedMultiplier = 1f;*/
-    public Color trackColor = new Color(0.855f, 0.8623f, 0.870f);
-
-    int m_TrackBindingTypeIndex;
-    int m_ComponentBindingTypeIndex;
-    PropertyInfo[] m_TrackBindingProperties;
-    FieldInfo[] m_TrackBindingFields;
-    List<UsableProperty> m_TrackBindingUsableProperties = new List<UsableProperty> ();
-    bool m_CreateDrawer;
-    bool m_CreateButtonPressed;
-    Vector2 m_ScrollViewPos;
-    CreationError m_CreationError;
-    
-    readonly GUIContent m_ShowHelpBoxesContent = new GUIContent("Show Help", "Do you want to see the help boxes as part of this wizard?");
-    readonly GUIContent m_PlayableNameContent = new GUIContent("Playable Name", "This is the name that will represent the playable.  E.G. TransformTween.  It will be the basis for the class names so it is best not to use the postfixes: 'Clip', 'Behaviour', 'MixerBehaviour' or 'Drawer'.");
-    readonly GUIContent m_StandardBlendPlayableContent = new GUIContent("Standard Blend Playable", "Often when creating a playable it's intended purpose is just to briefly override the properties of a component for the playable's duration and then blend back to the defaults.  For example a playable that changes the color of a Light but changes it back.  To make a playable with this functionality, check this box.");
-    readonly GUIContent m_TrackBindingTypeContent = new GUIContent("Track Binding Type", "This is the type of object the Playable will affect.  E.G. To affect the position choose Transform.");
-    readonly GUIContent m_DefaultValuesComponentContent = new GUIContent("Default Values", "When the scripts are created, each of the selected properties are assigned a default from the selected Component.  If this is left blank no defaults will be used.");
-    readonly GUIContent m_ExposedReferencesContent = new GUIContent("Exposed References", "Exposed References are references to objects in a scene that your Playable needs. For example, if you want to tween between two Transforms, they will need to be Exposed References.");
-    readonly GUIContent m_BehaviourVariablesContent = new GUIContent("Behaviour Variables", "Behaviour Variables are all the variables you wish to use in your playable that do NOT need a reference to something in a scene.  For example a float for speed.");
-    readonly GUIContent m_TrackColorContent = new GUIContent("Track Color", "Timeline tracks have a colored outline, use this to select that color for your track.");
-    readonly GUIContent m_CreateDrawerContent = new GUIContent("Create Drawer?", "Checking this box will enable the creation of a PropertyDrawer for your playable.  Having this script will make it easier to customise how your playable appears in the inspector.");
-    readonly GUIContent m_StandardBlendPlayablePropertiesContent = new GUIContent("Standard Blend Playable Properties", "Having already selected a Track Binding type, you can select the properties of the bound component you want the playable to affect.  For example, if your playable is bound to a Transform, you can affect the position property.  Note that changing the component binding will clear the list of properties.");
-    readonly GUIContent m_ClipCapsContent = new GUIContent("Clip Caps", "Clip Caps are used to change the way Timelines work with your playables.  For example, enabling Blending will mean that your playables can blend when they overlap and have ease in and out durations.  To find out a little about each hover the cursor over the options.  For details, please see the documentation.");
-    readonly GUIContent m_CCNoneContent = new GUIContent("None", "Your playable supports none of the features below.");
-    readonly GUIContent m_CCLoopingContent = new GUIContent("Looping", "Your playable has a specified time that it takes and will start again after it finishes until the clip's duration has played.");
-    readonly GUIContent m_CCExtrapolationContent = new GUIContent("Extrapolation", "Your playable will persist beyond its end time and its results will continue until the next clip is encountered.");
-    readonly GUIContent m_CCClipInContent = new GUIContent("Clip In", "Your playable need not be at the start of the Timeline.");
-    readonly GUIContent m_CCSpeedMultiplierContent = new GUIContent("Speed Multiplier", "Your playable supports changes to the time scale.");
-    readonly GUIContent m_CCBlendingContent = new GUIContent("Blending", "Your playable supports overlapping of clips to blend between them.");
-    readonly GUIContent m_CCAllContent = new GUIContent("All", "Your playable supports all of the above features.");
-    /*readonly GUIContent m_SetClipDefaultsContent = new GUIContent("Set Clip Defaults", "Do you want to set the default timings and other settings for clips when they are first created?");
-    readonly GUIContent m_ClipDefaultsContent = new GUIContent("Clip Defaults");
-    readonly GUIContent m_CDClipTimingContent = new GUIContent("Clip Timing", "Various settings that affect the durations over which the playable will be active.");
-    readonly GUIContent m_CDDurationContent = new GUIContent("Duration", "The default length of the clip in seconds.");
-    readonly GUIContent m_CDEaseInContent = new GUIContent("Ease In Duration", "The default duration over which the clip's weight increases to one.  When clips are overlapped, this is controlled by their overlap.  A clip requires the Blending ClipCap to support this.");
-    readonly GUIContent m_CDEaseOutContent = new GUIContent("Ease Out Duration", "The default duration over which the clip's weight decreases to zero.  When clips are overlapped, this is controlled by their overlap.  A clip requires the Blending ClipCap to support this.");
-    readonly GUIContent m_CDClipInContent = new GUIContent("Clip In", "The length of time after the start that the clip should start.  A clip requires the ClipIn ClipCap to support this.");
-    readonly GUIContent m_CDSpeedMultiplierContent = new GUIContent("Speed Multiplier", "The amount a clip's time dependent aspects will speed up or slow down by.  A clip requires the SpeedMultiplier ClipCap to support this.");
-    */
-    const string k_Tab = "    ";
-    const string k_ShowHelpBoxesKey = "TimelinePlayableWizard_ShowHelpBoxes";
-    const string k_TimelineClipAssetSuffix = "Clip";
-    const string k_TimelineClipBehaviourSuffix = "Behaviour";
-    const string k_PlayableBehaviourMixerSuffix = "MixerBehaviour";
-    const string k_TrackAssetSuffix = "Track";
-    const string k_PropertyDrawerSuffix = "Drawer";
-    const int k_PlayableNameCharLimit = 64;
-    const float k_WindowWidth = 500f;
-    const float k_MaxWindowHeight = 800f;
-    const float k_ScreenSizeWindowBuffer = 50f;
-
-    static UsableType[] s_ComponentTypes;
-    static UsableType[] s_TrackBindingTypes;
-    static UsableType[] s_ExposedReferenceTypes;
-    static UsableType[] s_BehaviourVariableTypes;
-    static Type[] s_BlendableTypes =
-    {
-        typeof(float), typeof(int), typeof(double), typeof(Vector2), typeof(Vector3), typeof(Color), 
-    };
-    static Type[] s_AssignableTypes =
-    {
-        typeof(string), typeof(bool)
-    };
-    static string[] s_DisallowedPropertyNames =
-    {
-        "name",
-    };
-
-    [MenuItem("Window/Timeline Playable Wizard...")]
-    static void CreateWindow ()
-    {
-        TimelinePlayableWizard wizard = GetWindow<TimelinePlayableWizard>(true, "Timeline Playable Wizard", true);
-        
-        Vector2 position = Vector2.zero;
-        SceneView sceneView = SceneView.lastActiveSceneView;
-        if (sceneView != null)
-            position = new Vector2(sceneView.position.x, sceneView.position.y);
-        wizard.position = new Rect(position.x + k_ScreenSizeWindowBuffer, position.y + k_ScreenSizeWindowBuffer, k_WindowWidth, Mathf.Min(Screen.currentResolution.height - k_ScreenSizeWindowBuffer, k_MaxWindowHeight));
-        
-        wizard.showHelpBoxes = EditorPrefs.GetBool (k_ShowHelpBoxesKey);
-        wizard.Show();
-        
-        Init ();
-    }
-
-    static void Init ()
-    {
-        Type[] componentTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes()).Where(t => typeof(Component).IsAssignableFrom(t)).Where (t => t.IsPublic).ToArray();
-        
-        List<UsableType> componentUsableTypesList = UsableType.GetUsableTypeArray(componentTypes).ToList();
-        componentUsableTypesList.Sort();
-        s_ComponentTypes = componentUsableTypesList.ToArray ();
-
-        UsableType gameObjectUsableType = new UsableType(typeof(GameObject));
-        UsableType[] defaultUsableTypes = UsableType.GetUsableTypeArray(componentTypes, gameObjectUsableType);
-
-        List<UsableType> exposedRefTypeList = defaultUsableTypes.ToList ();
-        exposedRefTypeList.Sort();
-        s_ExposedReferenceTypes = exposedRefTypeList.ToArray();
-
-        UsableType noneType = new UsableType((Type)null);
-        s_TrackBindingTypes = UsableType.AmalgamateUsableTypes(s_ExposedReferenceTypes, noneType);
-
-        s_BehaviourVariableTypes = UsableType.AmalgamateUsableTypes
-            (
-                s_ExposedReferenceTypes,
-                new UsableType("int"),
-                new UsableType("bool"),
-                new UsableType("float"),
-                new UsableType("Color"),
-                new UsableType("double"),
-                new UsableType("string"),
-                new UsableType("Vector2"),
-                new UsableType("Vector3"),
-                new UsableType("AudioClip"),
-                new UsableType("AnimationCurve")
-            );
-        List<UsableType> scriptVariableTypeList = s_BehaviourVariableTypes.ToList();
-        scriptVariableTypeList.Sort();
-        s_BehaviourVariableTypes = scriptVariableTypeList.ToArray();
-    }
-
-    void OnGUI ()
-    {
-        if(s_ComponentTypes == null || s_TrackBindingTypes == null || s_ExposedReferenceTypes == null || s_BehaviourVariableTypes == null)
-            Init ();
-
-        if (s_ComponentTypes == null || s_TrackBindingTypes == null || s_ExposedReferenceTypes == null || s_BehaviourVariableTypes == null)
-        {
-            EditorGUILayout.HelpBox ("Failed to initialise.", MessageType.Error);
-            return;
-        }
-
-        m_ScrollViewPos = EditorGUILayout.BeginScrollView (m_ScrollViewPos);
-
-        bool oldShowHelpBoxes = showHelpBoxes;
-        showHelpBoxes = EditorGUILayout.Toggle (m_ShowHelpBoxesContent, showHelpBoxes);
-        if (oldShowHelpBoxes != showHelpBoxes)
-        {
-            EditorPrefs.SetBool (k_ShowHelpBoxesKey, showHelpBoxes);
-            EditorGUILayout.Space ();
-        }
-
-        if (showHelpBoxes)
-        {
-            EditorGUILayout.HelpBox("This wizard is used to create the basics of a custom playable for the Timeline. "
-                               + "It will create 4 scripts that you can then edit to complete their functionality. "
-                               + "The purpose is to setup the boilerplate code for you.  If you are already familiar "
-                               + "with playables and the Timeline, you may wish to create your own scripts instead.", MessageType.None);
-            EditorGUILayout.Space();
-        }
-
-        EditorGUILayout.Space ();
-        EditorGUILayout.Space();
-
-        EditorGUILayout.BeginVertical (GUI.skin.box);
-        if (showHelpBoxes)
-        {
-            EditorGUILayout.HelpBox(m_PlayableNameContent.tooltip, MessageType.Info);
-            EditorGUILayout.Space();
-        }
-        playableName = EditorGUILayout.TextField (m_PlayableNameContent, playableName);
-
-        bool playableNameNotEmpty = !string.IsNullOrEmpty (playableName);
-        bool playableNameFormatted = CodeGenerator.IsValidLanguageIndependentIdentifier(playableName);
-        if (!playableNameNotEmpty || !playableNameFormatted)
-        {
-            EditorGUILayout.HelpBox ("The Playable needs a name which starts with a capital letter and contains no spaces or special characters.", MessageType.Error);
-        }
-        bool playableNameTooLong = playableName.Length > k_PlayableNameCharLimit;
-        if (playableNameTooLong)
-        {
-            EditorGUILayout.HelpBox ("The Playable needs a name which is fewer than " + k_PlayableNameCharLimit + " characters long.", MessageType.Error);
-        }
-        EditorGUILayout.EndVertical ();
-
-        EditorGUILayout.Space();
-        EditorGUILayout.Space();
-
-        EditorGUILayout.BeginVertical(GUI.skin.box);
-        if(showHelpBoxes)
-        {
-            EditorGUILayout.HelpBox(m_StandardBlendPlayableContent.tooltip, MessageType.Info);
-            EditorGUILayout.Space();
-        }
-        bool oldStandardBlendPlayable = isStandardBlendPlayable;
-        isStandardBlendPlayable = EditorGUILayout.Toggle (m_StandardBlendPlayableContent, isStandardBlendPlayable);
-        EditorGUILayout.EndVertical ();
-
-        EditorGUILayout.Space();
-        EditorGUILayout.Space();
-
-        EditorGUILayout.BeginVertical(GUI.skin.box);
-        if(showHelpBoxes)
-        {
-            EditorGUILayout.HelpBox(m_TrackBindingTypeContent.tooltip, MessageType.Info);
-            EditorGUILayout.Space();
-        }
-        int oldIndex = -1;
-        if (isStandardBlendPlayable)
-        {
-            oldIndex = m_ComponentBindingTypeIndex;
-
-            m_ComponentBindingTypeIndex = EditorGUILayout.Popup (m_TrackBindingTypeContent, m_ComponentBindingTypeIndex, UsableType.GetGUIContentWithSortingArray (s_ComponentTypes));
-            trackBinding = s_ComponentTypes[m_ComponentBindingTypeIndex];
-
-            EditorGUILayout.Space ();
-
-            defaultValuesComponent = EditorGUILayout.ObjectField (m_DefaultValuesComponentContent, defaultValuesComponent, trackBinding.type, true) as Component;
-        }
-        else
-        {
-            m_TrackBindingTypeIndex = EditorGUILayout.Popup(m_TrackBindingTypeContent, m_TrackBindingTypeIndex, UsableType.GetGUIContentWithSortingArray(s_TrackBindingTypes));
-            trackBinding = s_TrackBindingTypes[m_TrackBindingTypeIndex];
-        }
-        EditorGUILayout.EndVertical ();
-        
-        bool exposedVariablesNamesValid = true;
-        bool scriptVariablesNamesValid = true;
-        bool allUniqueVariableNames = true;
-        
-        EditorGUILayout.Space();
-        EditorGUILayout.Space();
-
-        if (isStandardBlendPlayable)
-        {
-            StandardBlendPlayablePropertyGUI(oldIndex != m_ComponentBindingTypeIndex || oldStandardBlendPlayable != isStandardBlendPlayable);
-        }
-        else
-        {
-            exposedVariablesNamesValid = VariableListGUI(exposedReferences, s_ExposedReferenceTypes, m_ExposedReferencesContent, "newExposedReference");
-
-            EditorGUILayout.Space();
-            EditorGUILayout.Space();
-
-            scriptVariablesNamesValid = VariableListGUI(playableBehaviourVariables, s_BehaviourVariableTypes, m_BehaviourVariablesContent, "newBehaviourVariable");
-
-            EditorGUILayout.Space();
-            EditorGUILayout.Space();
-
-            allUniqueVariableNames = AllVariablesUniquelyNamed();
-            if (!allUniqueVariableNames)
-            {
-                EditorGUILayout.HelpBox("Your variables to not have unique names.  Make sure all of your Exposed References and Behaviour Variables have unique names.", MessageType.Error);
-            }
-
-            EditorGUILayout.Space();
-            EditorGUILayout.Space();
-
-            ClipCapsGUI();
-        }
-
-        EditorGUILayout.Space();
-        EditorGUILayout.Space();
-
-        /*ClipDefaultsGUI ();
-
-        EditorGUILayout.Space ();
-        EditorGUILayout.Space ();*/
-
-        EditorGUILayout.BeginVertical(GUI.skin.box);
-        if (showHelpBoxes)
-        {
-            EditorGUILayout.HelpBox(m_TrackColorContent.tooltip, MessageType.Info);
-            EditorGUILayout.Space();
-        }
-        trackColor = EditorGUILayout.ColorField(m_TrackColorContent, trackColor);
-        EditorGUILayout.EndVertical ();
-
-        if (!isStandardBlendPlayable)
-        {
-            EditorGUILayout.Space();
-            EditorGUILayout.Space();
-
-            EditorGUILayout.BeginVertical(GUI.skin.box);
-            if (showHelpBoxes)
-            {
-                EditorGUILayout.HelpBox(m_CreateDrawerContent.tooltip, MessageType.Info);
-                EditorGUILayout.Space();
-            }
-            m_CreateDrawer = EditorGUILayout.Toggle(m_CreateDrawerContent, m_CreateDrawer);
-            EditorGUILayout.EndVertical ();
-        }
-
-        EditorGUILayout.Space();
-        EditorGUILayout.Space();
-        
-        if (playableNameNotEmpty && playableNameFormatted && allUniqueVariableNames && exposedVariablesNamesValid && scriptVariablesNamesValid && !playableNameTooLong)
-        {
-            if (GUILayout.Button("Create", GUILayout.Width(60f)))
-            {
-                m_CreateButtonPressed = true;
-
-                for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-                {
-                    standardBlendPlayableProperties[i].CreateSettingDefaultValueString (defaultValuesComponent);
-                }
-
-                m_CreationError = CreateScripts();
-
-                if (m_CreationError == CreationError.NoError)
-                {
-                    Close ();
-                }
-            }
-        }
-
-        EditorGUILayout.Space();
-        EditorGUILayout.Space();
-        
-        if (m_CreateButtonPressed)
-        {
-            switch (m_CreationError)
-            {
-                case CreationError.NoError:
-                    EditorGUILayout.HelpBox ("Playable was successfully created.", MessageType.Info);
-                    break;
-                case CreationError.PlayableAssetAlreadyExists:
-                    EditorGUILayout.HelpBox ("The type " + playableName + k_TimelineClipAssetSuffix + " already exists, no files were created.", MessageType.Error);
-                    break;
-                case CreationError.PlayableBehaviourAlreadyExists:
-                    EditorGUILayout.HelpBox ("The type " + playableName + k_TimelineClipBehaviourSuffix + " already exists, no files were created.", MessageType.Error);
-                    break;
-                case CreationError.PlayableBehaviourMixerAlreadyExists:
-                    EditorGUILayout.HelpBox ("The type " + playableName + k_PlayableBehaviourMixerSuffix + " already exists, no files were created.", MessageType.Error);
-                    break;
-                case CreationError.TrackAssetAlreadyExists:
-                    EditorGUILayout.HelpBox ("The type " + playableName + k_TrackAssetSuffix + " already exists, no files were created.", MessageType.Error);
-                    break;
-                case CreationError.PlayableDrawerAlreadyExists:
-                    EditorGUILayout.HelpBox ("The type " + playableName + k_PropertyDrawerSuffix + " already exists, no files were created.", MessageType.Error);
-                    break;
-            }
-        }
-
-        if (GUILayout.Button ("Reset", GUILayout.Width (60f)))
-        {
-            ResetWindow ();
-        }
-
-        EditorGUILayout.EndScrollView ();
-    }
-
-    void StandardBlendPlayablePropertyGUI (bool findNewProperties)
-    {
-        if (findNewProperties || m_TrackBindingProperties == null && m_TrackBindingFields == null)
-        {
-            m_TrackBindingUsableProperties.Clear ();
-            
-            IEnumerable<PropertyInfo> propertyInfos = trackBinding.type.GetProperties (BindingFlags.Instance | BindingFlags.Public | BindingFlags.SetProperty | BindingFlags.GetProperty);
-            propertyInfos = propertyInfos.Where (x => IsTypeBlendable(x.PropertyType) || IsTypeAssignable(x.PropertyType));
-            propertyInfos = propertyInfos.Where (x => x.CanWrite && x.CanRead);
-            propertyInfos = propertyInfos.Where (x => HasAllowedName (x));
-            // Uncomment the below to stop Obsolete properties being selectable.
-            //propertyInfos = propertyInfos.Where (x => !Attribute.IsDefined (x, typeof(ObsoleteAttribute)));
-            m_TrackBindingProperties = propertyInfos.ToArray();
-            foreach (PropertyInfo trackBindingProperty in m_TrackBindingProperties)
-            {
-                m_TrackBindingUsableProperties.Add (new UsableProperty (trackBindingProperty));
-            }
-            
-            IEnumerable<FieldInfo> fieldInfos = trackBinding.type.GetFields (BindingFlags.Instance | BindingFlags.Public);
-            fieldInfos = fieldInfos.Where(x => IsTypeBlendable(x.FieldType) || IsTypeAssignable(x.FieldType));
-            m_TrackBindingFields = fieldInfos.ToArray ();
-            foreach (FieldInfo trackBindingField in m_TrackBindingFields)
-            {
-                m_TrackBindingUsableProperties.Add (new UsableProperty (trackBindingField));
-            }
-
-            m_TrackBindingUsableProperties = m_TrackBindingUsableProperties.OrderBy (x => x.name).ToList ();
-            standardBlendPlayableProperties.Clear ();
-        }
-
-        EditorGUILayout.BeginVertical (GUI.skin.box);
-
-        if (showHelpBoxes)
-        {
-            EditorGUILayout.HelpBox(m_StandardBlendPlayablePropertiesContent.tooltip, MessageType.Info);
-            EditorGUILayout.Space();
-        }
-
-        EditorGUILayout.LabelField(m_StandardBlendPlayablePropertiesContent);
-
-        int indexToRemove = -1;
-        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-        {
-            if (standardBlendPlayableProperties[i].GUI(m_TrackBindingUsableProperties))
-                indexToRemove = i;
-        }
-        if (indexToRemove != -1)
-            standardBlendPlayableProperties.RemoveAt(indexToRemove);
-
-        if (GUILayout.Button("Add", GUILayout.Width(40f)))
-            standardBlendPlayableProperties.Add(m_TrackBindingUsableProperties[0].GetDuplicate ());
-
-        if (standardBlendPlayableProperties.Any(IsObsolete))
-            EditorGUILayout.HelpBox ("One or more of your chosen properties are marked 'Obsolete'.  Consider changing them to avoid deprecation with future versions of Unity.", MessageType.Warning);
-
-        EditorGUILayout.EndVertical ();
-    }
-
-    static bool IsTypeBlendable (Type type)
-    {
-        for (int i = 0; i < s_BlendableTypes.Length; i++)
-        {
-            if (type == s_BlendableTypes[i])
-                return true;
-        }
-        return false;
-    }
-
-    static bool IsTypeAssignable (Type type)
-    {
-        for (int i = 0; i < s_AssignableTypes.Length; i++)
-        {
-            if (type == s_AssignableTypes[i] || type.IsEnum)
-                return true;
-        }
-        return false;
-    }
-
-    static bool HasAllowedName (PropertyInfo propertyInfo)
-    {
-        for (int i = 0; i < s_DisallowedPropertyNames.Length; i++)
-        {
-            if (propertyInfo.Name == s_DisallowedPropertyNames[i])
-                return false;
-        }
-        return true;
-    }
-
-    static bool IsObsolete (UsableProperty usableProperty)
-    {
-        if (usableProperty.usablePropertyType == UsableProperty.UsablePropertyType.Field)
-            return Attribute.IsDefined (usableProperty.fieldInfo, typeof(ObsoleteAttribute));
-        return Attribute.IsDefined (usableProperty.propertyInfo, typeof(ObsoleteAttribute));
-    }
-
-    bool VariableListGUI (List<Variable> variables, UsableType[] usableTypes, GUIContent guiContent, string newName)
-    {
-        EditorGUILayout.BeginVertical(GUI.skin.box);
-
-        if (showHelpBoxes)
-        {
-            EditorGUILayout.HelpBox(guiContent.tooltip, MessageType.Info);
-            EditorGUILayout.Space();
-        }
-
-        EditorGUILayout.LabelField(guiContent);
-
-        int indexToRemove = -1;
-        bool allNamesValid = true;
-        for (int i = 0; i < variables.Count; i++)
-        {
-            if (variables[i].GUI(usableTypes))
-                indexToRemove = i;
-
-            if (!CodeGenerator.IsValidLanguageIndependentIdentifier(variables[i].name))
-            {
-                allNamesValid = false;
-            }
-        }
-
-        if (indexToRemove != -1)
-            variables.RemoveAt(indexToRemove);
-
-        if (GUILayout.Button("Add", GUILayout.Width(40f)))
-            variables.Add(new Variable(newName, usableTypes[0]));
-
-        if (!allNamesValid)
-            EditorGUILayout.HelpBox("One of the variables has an invalid character, make sure they don't contain any spaces or special characters.", MessageType.Error);
-
-        EditorGUILayout.EndVertical();
-
-        return allNamesValid;
-    }
-
-    bool AllVariablesUniquelyNamed ()
-    {
-        for (int i = 0; i < exposedReferences.Count; i++)
-        {
-            string exposedRefName = exposedReferences[i].name;
-
-            for (int j = 0; j < exposedReferences.Count; j++)
-            {
-                if (i != j && exposedRefName == exposedReferences[j].name)
-                    return false;
-            }
-
-            for (int j = 0; j < playableBehaviourVariables.Count; j++)
-            {
-                if (exposedRefName == playableBehaviourVariables[j].name)
-                    return false;
-            }
-        }
-
-        for (int i = 0; i < playableBehaviourVariables.Count; i++)
-        {
-            string scriptPlayableVariableName = playableBehaviourVariables[i].name;
-
-            for (int j = 0; j < exposedReferences.Count; j++)
-            {
-                if (scriptPlayableVariableName == exposedReferences[j].name)
-                    return false;
-            }
-
-            for (int j = 0; j < playableBehaviourVariables.Count; j++)
-            {
-                if (i != j && scriptPlayableVariableName == playableBehaviourVariables[j].name)
-                    return false;
-            }
-        }
-        return true;
-    }
-
-    void ClipCapsGUI ()
-    {
-        EditorGUILayout.BeginVertical (GUI.skin.box);
-
-        if (showHelpBoxes)
-        {
-            EditorGUILayout.HelpBox(m_ClipCapsContent.tooltip, MessageType.Info);
-            EditorGUILayout.Space();
-        }
-
-        EditorGUILayout.LabelField (m_ClipCapsContent);
-
-        bool isLooping = (clipCaps & ClipCaps.Looping) == ClipCaps.Looping;
-        bool isExtrapolation = (clipCaps & ClipCaps.Extrapolation) == ClipCaps.Extrapolation;
-        bool isClipIn = (clipCaps & ClipCaps.ClipIn) == ClipCaps.ClipIn;
-        bool isSpeedMultiplier = (clipCaps & ClipCaps.SpeedMultiplier) == ClipCaps.SpeedMultiplier;
-        bool isBlending = (clipCaps & ClipCaps.Blending) == ClipCaps.Blending;
-
-        bool isNone = !isLooping && !isExtrapolation && !isClipIn && !isSpeedMultiplier && !isBlending;
-        bool isAll = isLooping && isExtrapolation && isClipIn && isSpeedMultiplier && isBlending;
-
-        EditorGUI.BeginChangeCheck ();
-        isNone = EditorGUILayout.ToggleLeft (m_CCNoneContent, isNone);
-        if (EditorGUI.EndChangeCheck ())
-        {
-            if (isNone)
-            {
-                isLooping = false;
-                isExtrapolation = false;
-                isClipIn = false;
-                isSpeedMultiplier = false;
-                isBlending = false;
-                isAll = false;
-            }
-        }
-
-        EditorGUI.BeginChangeCheck ();
-        isLooping = EditorGUILayout.ToggleLeft (m_CCLoopingContent, isLooping);
-        isExtrapolation = EditorGUILayout.ToggleLeft (m_CCExtrapolationContent, isExtrapolation);
-        isClipIn = EditorGUILayout.ToggleLeft (m_CCClipInContent, isClipIn);
-        isSpeedMultiplier = EditorGUILayout.ToggleLeft (m_CCSpeedMultiplierContent, isSpeedMultiplier);
-        isBlending = EditorGUILayout.ToggleLeft (m_CCBlendingContent, isBlending);
-        if (EditorGUI.EndChangeCheck ())
-        {
-            isNone = !isLooping && !isExtrapolation && !isClipIn && !isSpeedMultiplier && !isBlending;
-            isAll = isLooping && isExtrapolation && isClipIn && isSpeedMultiplier && isBlending;
-        }
-
-        EditorGUI.BeginChangeCheck ();
-        isAll = EditorGUILayout.ToggleLeft (m_CCAllContent, isAll);
-        if (EditorGUI.EndChangeCheck ())
-        {
-            if (isAll)
-            {
-                isNone = false;
-                isLooping = true;
-                isExtrapolation = true;
-                isClipIn = true;
-                isSpeedMultiplier = true;
-                isBlending = true;
-            }
-        }
-
-        EditorGUILayout.EndVertical();
-
-        clipCaps = ClipCaps.None;
-
-        if (isNone)
-            return;
-
-        if (isAll)
-        {
-            clipCaps = ClipCaps.All;
-            return;
-        }
-
-        if (isLooping)
-            clipCaps |= ClipCaps.Looping;
-
-        if (isExtrapolation)
-            clipCaps |= ClipCaps.Extrapolation;
-
-        if (isClipIn)
-            clipCaps |= ClipCaps.ClipIn;
-
-        if (isSpeedMultiplier)
-            clipCaps |= ClipCaps.SpeedMultiplier;
-
-        if (isBlending)
-            clipCaps |= ClipCaps.Blending;
-    }
-
-    /*void ClipDefaultsGUI ()
-    {
-        EditorGUILayout.BeginVertical (GUI.skin.box);
-
-        setClipDefaults = EditorGUILayout.Toggle (m_SetClipDefaultsContent, setClipDefaults);
-
-        if (!setClipDefaults)
-        {
-            EditorGUILayout.EndVertical ();
-            return;
-        }
-
-        if (showHelpBoxes)
-        {
-            EditorGUILayout.HelpBox (m_ClipDefaultsContent.tooltip, MessageType.Info);
-        }
-
-        EditorGUILayout.LabelField (m_ClipDefaultsContent);
-
-        EditorGUILayout.Space ();
-
-        EditorGUILayout.LabelField (m_CDClipTimingContent);
-        EditorGUI.indentLevel++;
-        clipDefaultDurationSeconds = EditorGUILayout.FloatField(m_CDDurationContent, clipDefaultDurationSeconds);
-        
-        EditorGUILayout.Space ();
-        
-        clipDefaultEaseInSeconds = EditorGUILayout.FloatField(m_CDEaseInContent, clipDefaultEaseInSeconds);
-        clipDefaultEaseOutSeconds = EditorGUILayout.FloatField (m_CDEaseOutContent, clipDefaultEaseOutSeconds);
-
-        if (isStandardBlendPlayable)
-        {
-            EditorGUILayout.EndVertical();
-            return;
-        }
-
-        EditorGUILayout.Space();
-        
-        clipDefaultClipInSeconds = EditorGUILayout.FloatField(m_CDClipInContent, clipDefaultClipInSeconds);
-        
-        EditorGUILayout.Space();
-        
-        clipDefaultSpeedMultiplier = EditorGUILayout.FloatField(m_CDSpeedMultiplierContent, clipDefaultSpeedMultiplier);
-        EditorGUI.indentLevel--;
-        
-        EditorGUILayout.EndVertical();
-    }*/
-
-    CreationError CreateScripts ()
-    {
-        if (ScriptAlreadyExists(playableName + k_TimelineClipAssetSuffix))
-            return CreationError.PlayableAssetAlreadyExists;
-
-        if (ScriptAlreadyExists(playableName + k_TimelineClipBehaviourSuffix))
-            return CreationError.PlayableBehaviourAlreadyExists;
-
-        if (ScriptAlreadyExists(playableName + k_PlayableBehaviourMixerSuffix))
-            return CreationError.PlayableBehaviourMixerAlreadyExists;
-
-        if (ScriptAlreadyExists(playableName + k_TrackAssetSuffix))
-            return CreationError.TrackAssetAlreadyExists;
-
-        if (m_CreateDrawer && ScriptAlreadyExists(playableName + k_PropertyDrawerSuffix))
-            return CreationError.PlayableDrawerAlreadyExists;
-
-        AssetDatabase.CreateFolder ("Assets", playableName);
-
-        if (isStandardBlendPlayable)
-        {
-            CreateScript (playableName + k_TimelineClipAssetSuffix, StandardBlendPlayableAsset());
-            CreateScript (playableName + k_TimelineClipBehaviourSuffix, StandardBlendPlayableBehaviour ());
-            CreateScript (playableName + k_PlayableBehaviourMixerSuffix, StandardBlendPlayableBehaviourMixer ());
-            CreateScript (playableName + k_TrackAssetSuffix, StandardBlendTrackAssetScript ());
-
-            AssetDatabase.CreateFolder ("Assets/" + playableName, "Editor");
-
-            string path = Application.dataPath + "/" + playableName + "/Editor/" + playableName + k_PropertyDrawerSuffix + ".cs";
-            using (StreamWriter writer = File.CreateText (path))
-            {
-                writer.Write (StandardBlendPlayableDrawer ());
-            }
-        }
-        else
-        {
-            CreateScript(playableName + k_TimelineClipAssetSuffix, PlayableAsset());
-            CreateScript(playableName + k_TimelineClipBehaviourSuffix, PlayableBehaviour());
-            CreateScript(playableName + k_PlayableBehaviourMixerSuffix, PlayableBehaviourMixer());
-            CreateScript(playableName + k_TrackAssetSuffix, TrackAssetScript());
-
-            if (m_CreateDrawer)
-            {
-                AssetDatabase.CreateFolder("Assets/" + playableName, "Editor");
-
-                string path = Application.dataPath + "/" + playableName + "/Editor/" + playableName + k_PropertyDrawerSuffix + ".cs";
-                using (StreamWriter writer = File.CreateText(path))
-                {
-                    writer.Write(PlayableDrawer());
-                }
-            }
-        }
-
-        AssetDatabase.SaveAssets ();
-        AssetDatabase.Refresh ();
-
-        return CreationError.NoError;
-    }
-
-    static bool ScriptAlreadyExists(string scriptName)
-    {
-        string[] guids = AssetDatabase.FindAssets(scriptName);
-
-        if (guids.Length == 0)
-            return false;
-
-        for (int i = 0; i < guids.Length; i++)
-        {
-            string path = AssetDatabase.GUIDToAssetPath(guids[i]);
-            Type assetType = AssetDatabase.GetMainAssetTypeAtPath(path);
-            if (assetType == typeof(MonoScript))
-                return true;
-        }
-
-        return false;
-    }
-
-    void CreateScript (string fileName, string content)
-    {
-        string path = Application.dataPath + "/" + playableName + "/" + fileName + ".cs";
-        using (StreamWriter writer = File.CreateText (path))
-            writer.Write (content);
-    }
-
-    void ResetWindow ()
-    {
-        playableName = "";
-        isStandardBlendPlayable = false;
-        trackBinding = s_TrackBindingTypes[0];
-        defaultValuesComponent = null;
-        exposedReferences = new List<Variable>();
-        playableBehaviourVariables = new List<Variable>();
-        standardBlendPlayableProperties = new List<UsableProperty>();
-        clipCaps = ClipCaps.None;
-        /*setClipDefaults = false;
-        clipDefaultDurationSeconds = 5f;
-        clipDefaultEaseInSeconds = 0f;
-        clipDefaultEaseOutSeconds = 0f;
-        clipDefaultClipInSeconds = 0f;
-        clipDefaultSpeedMultiplier = 1f;*/
-        trackColor = new Color(0.855f, 0.8623f, 0.870f);
-
-        m_TrackBindingTypeIndex = 0;
-        m_ComponentBindingTypeIndex = 0;
-        m_TrackBindingProperties = null;
-        m_TrackBindingFields = null;
-        m_TrackBindingUsableProperties = null;
-        m_CreateDrawer = false;
-    }
-
-    string TrackAssetScript ()
-    {
-        return 
-            "using UnityEngine;\n" +
-            "using UnityEngine.Playables;\n" +
-            "using UnityEngine.Timeline;\n" +
-            AdditionalNamespacesToString() + 
-            "\n" +
-            "[TrackColor(" + trackColor.r + "f, " + trackColor.g + "f, " + trackColor.b + "f)]\n" +
-            "[TrackClipType(typeof(" + playableName + k_TimelineClipAssetSuffix + "))]\n" +
-            TrackBindingToString () +
-            "public class " + playableName + k_TrackAssetSuffix + " : TrackAsset\n" +
-            "{\n" +
-            k_Tab + "public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)\n" +
-            k_Tab + "{\n" +
-            k_Tab + k_Tab + "return ScriptPlayable<" + playableName + k_PlayableBehaviourMixerSuffix + ">.Create (graph, inputCount);\n" +
-            k_Tab + "}\n" +
-            "}\n";
-    }
-
-    string PlayableAsset ()
-    {
-        return 
-            "using System;\n" +
-            "using UnityEngine;\n" +
-            "using UnityEngine.Playables;\n" +
-            "using UnityEngine.Timeline;\n" +
-            AdditionalNamespacesToString() +
-            "\n" +
-            "[Serializable]\n" +
-            "public class " + playableName + k_TimelineClipAssetSuffix + " : PlayableAsset, ITimelineClipAsset\n" +
-            "{\n" +
-            k_Tab + "public " + playableName + k_TimelineClipBehaviourSuffix + " template = new " + playableName + k_TimelineClipBehaviourSuffix + " ();\n" +
-            ExposedReferencesToString () +
-            "\n" +
-            k_Tab + "public ClipCaps clipCaps\n" +
-            k_Tab + "{\n" +
-            k_Tab + k_Tab + "get { return " + ClipCapsToString () + "; }\n" +
-            k_Tab + "}\n" +
-            "\n" +
-            k_Tab + "public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)\n" +
-            k_Tab + "{\n" +
-            k_Tab + k_Tab + "var playable = ScriptPlayable<" + playableName + k_TimelineClipBehaviourSuffix + ">.Create (graph, template);\n" +
-            ExposedReferencesResolvingToString () +
-            k_Tab + k_Tab + "return playable;\n" +
-            k_Tab + "}\n" +
-            "}\n";
-    }
-
-    string PlayableBehaviour ()
-    {
-        return 
-            "using System;\n" +
-            "using UnityEngine;\n" +
-            "using UnityEngine.Playables;\n" +
-            "using UnityEngine.Timeline;\n" +
-            AdditionalNamespacesToString() +
-            "\n" +
-            "[Serializable]\n" +
-            "public class " + playableName + k_TimelineClipBehaviourSuffix + " : PlayableBehaviour\n" +
-            "{\n" +
-            ExposedReferencesAsScriptVariablesToString () +
-            PlayableBehaviourVariablesToString () +
-            "\n" +
-            k_Tab + "public override void OnPlayableCreate (Playable playable)\n" +
-            k_Tab + "{\n" +
-            k_Tab + k_Tab + "\n" +
-            k_Tab + "}\n" +
-            "}\n";
-    }
-
-    string PlayableBehaviourMixer ()
-    {
-        return 
-            "using System;\n" +
-            "using UnityEngine;\n" +
-            "using UnityEngine.Playables;\n" +
-            "using UnityEngine.Timeline;\n" +
-            AdditionalNamespacesToString() +
-            "\n" +
-            "public class " + playableName + k_PlayableBehaviourMixerSuffix + " : PlayableBehaviour\n" +
-            "{\n" +
-            k_Tab + "// NOTE: This function is called at runtime and edit time.  Keep that in mind when setting the values of properties.\n" +
-            k_Tab + "public override void ProcessFrame(Playable playable, FrameData info, object playerData)\n" +
-            k_Tab + "{\n" +
-            MixerTrackBindingLocalVariableToString () +
-            k_Tab + k_Tab + "int inputCount = playable.GetInputCount ();\n" +
-            "\n" +
-            k_Tab + k_Tab + "for (int i = 0; i < inputCount; i++)\n" +
-            k_Tab + k_Tab + "{\n" +
-            k_Tab + k_Tab + k_Tab + "float inputWeight = playable.GetInputWeight(i);\n" +
-            k_Tab + k_Tab + k_Tab + "ScriptPlayable<" + playableName + k_TimelineClipBehaviourSuffix + "> inputPlayable = (ScriptPlayable<" + playableName + k_TimelineClipBehaviourSuffix + ">)playable.GetInput(i);\n" +
-            k_Tab + k_Tab + k_Tab + playableName + k_TimelineClipBehaviourSuffix + " input = inputPlayable.GetBehaviour ();\n" +
-            k_Tab + k_Tab + k_Tab + "\n" +
-            k_Tab + k_Tab + k_Tab + "// Use the above variables to process each frame of this playable.\n" +
-            k_Tab + k_Tab + k_Tab + "\n" +
-            k_Tab + k_Tab + "}\n" +
-            k_Tab + "}\n" +
-            "}\n";
-    }
-
-    string PlayableDrawer ()
-    {
-        return 
-            "using UnityEditor;\n" +
-            "using UnityEngine;\n" +
-            "\n" +
-            "[CustomPropertyDrawer(typeof(" + playableName + k_TimelineClipBehaviourSuffix + "))]\n" +
-            "public class " + playableName + k_PropertyDrawerSuffix + " : PropertyDrawer\n" +
-            "{\n" +
-            k_Tab + "public override float GetPropertyHeight (SerializedProperty property, GUIContent label)\n" +
-            k_Tab + "{\n" +
-            k_Tab + k_Tab + "int fieldCount = " + playableBehaviourVariables.Count +";\n" +
-            k_Tab + k_Tab + "return fieldCount * EditorGUIUtility.singleLineHeight;\n" +
-            k_Tab + "}\n" +
-            "\n" +
-            k_Tab + "public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)\n" +
-            k_Tab + "{\n" +
-            ScriptVariablesAsSerializedPropAssignmentToString () +
-            "\n" + 
-            k_Tab + k_Tab + "Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);\n" +
-            ScriptVariablesAsSerializedPropGUIToString () +
-            k_Tab + "}\n" +
-            "}\n";
-    }
-
-    string TrackBindingToString ()
-    {
-        if (m_TrackBindingTypeIndex != 0)
-            return "[TrackBindingType(typeof(" + trackBinding.name + "))]\n";
-        return "";
-    }
-
-    string AdditionalNamespacesToString ()
-    {
-        UsableType[] exposedReferenceTypes = Variable.GetUsableTypesFromVariableArray (exposedReferences.ToArray ());
-        UsableType[] behaviourVariableTypes = Variable.GetUsableTypesFromVariableArray (playableBehaviourVariables.ToArray ());
-        UsableType[] allUsedTypes = new UsableType[exposedReferenceTypes.Length + behaviourVariableTypes.Length + 1];
-        for (int i = 0; i < exposedReferenceTypes.Length; i++)
-        {
-            allUsedTypes[i] = exposedReferenceTypes[i];
-        }
-        for (int i = 0; i < behaviourVariableTypes.Length; i++)
-        {
-            allUsedTypes[i + exposedReferenceTypes.Length] = behaviourVariableTypes[i];
-        }
-        allUsedTypes[allUsedTypes.Length - 1] = trackBinding;
-
-        string[] distinctNamespaces = UsableType.GetDistinctAdditionalNamespaces (allUsedTypes).Where (x => !string.IsNullOrEmpty (x)).ToArray ();
-        string returnVal = "";
-        for (int i = 0; i < distinctNamespaces.Length; i++)
-        {
-            returnVal += "using " + distinctNamespaces[i] + ";\n";
-        }
-        return returnVal;
-    }
-
-    string ExposedReferencesToString ()
-    {
-        string expRefText = "";
-        foreach (var expRef in exposedReferences)
-            expRefText += k_Tab + "public ExposedReference<" + expRef.usableType.name + "> " + expRef.name + ";\n";
-        return expRefText;
-    }
-
-    string ExposedReferencesResolvingToString ()
-    {
-        string returnVal = "";
-        returnVal += k_Tab + k_Tab + playableName + k_TimelineClipBehaviourSuffix + " clone = playable.GetBehaviour ();\n";
-        for (int i = 0; i < exposedReferences.Count; i++)
-        {
-            returnVal += k_Tab + k_Tab + "clone." + exposedReferences[i].name + " = " + exposedReferences[i].name + ".Resolve (graph.GetResolver ());\n";
-        }
-        return returnVal;
-    }
-
-    /*string OnCreateFunctionToString ()
-    {
-        if (!setClipDefaults)
-            return "";
-
-        string returnVal = "\n";
-            returnVal += k_Tab + "public override void OnCreate ()\n";
-            returnVal += k_Tab + "{\n";
-            returnVal += k_Tab + k_Tab + "owner.duration = " + clipDefaultDurationSeconds + ";\n";
-            returnVal += k_Tab + k_Tab + "owner.easeInDuration = " + clipDefaultEaseInSeconds + ";\n";
-            returnVal += k_Tab + k_Tab + "owner.easeOutDuration = " + clipDefaultEaseOutSeconds + ";\n";
-            returnVal += k_Tab + k_Tab + "owner.clipIn = " + clipDefaultClipInSeconds + ";\n";
-            returnVal += k_Tab + k_Tab + "owner.timeScale = " + clipDefaultSpeedMultiplier + ";\n";
-            returnVal += k_Tab + "}\n";
-        return returnVal;
-    }*/
-
-    string ClipCapsToString ()
-    {
-        string message = clipCaps.ToString ();
-        string[] splits = message.Split (' ');
-
-        for (int i = 0; i < splits.Length; i++)
-        {
-            if (splits[i][splits[i].Length - 1] == ',')
-                splits[i] = splits[i].Substring (0, splits[i].Length - 1);
-        }
-
-        string returnVal = "";
-
-        for (int i = 0; i < splits.Length; i++)
-        {
-            returnVal += "ClipCaps." + splits[i];
-
-            if (i < splits.Length - 1)
-                returnVal += " | ";
-        }
-
-        return returnVal;
-    }
-
-    string ExposedReferencesAsScriptVariablesToString ()
-    {
-        string returnVal = "";
-        for (int i = 0; i < exposedReferences.Count; i++)
-        {
-            returnVal += k_Tab + "public " + exposedReferences[i].usableType.name + " " + exposedReferences[i].name + ";\n";
-        }
-        return returnVal;
-    }
-
-    string PlayableBehaviourVariablesToString ()
-    {
-        string returnVal = "";
-        for (int i = 0; i < playableBehaviourVariables.Count; i++)
-        {
-            returnVal += k_Tab + "public " + playableBehaviourVariables[i].usableType.name + " " + playableBehaviourVariables[i].name + ";\n";
-        }
-        return returnVal;
-    }
-
-    string MixerTrackBindingLocalVariableToString ()
-    {
-        if (m_TrackBindingTypeIndex != 0)
-            return
-                k_Tab + k_Tab + trackBinding.name + " trackBinding = playerData as " + trackBinding.name + ";\n\n" +
-                k_Tab + k_Tab + "if (!trackBinding)\n" +
-                k_Tab + k_Tab + k_Tab + "return;\n" +
-                "\n";
-        return "";
-    }
-
-    string ScriptVariablesAsSerializedPropAssignmentToString ()
-    {
-        string returnVal = "";
-        for (int i = 0; i < playableBehaviourVariables.Count; i++)
-        {
-            returnVal += k_Tab + k_Tab + "SerializedProperty " + playableBehaviourVariables[i].name + "Prop = property.FindPropertyRelative(\"" + playableBehaviourVariables[i].name + "\");\n";
-        }
-        return returnVal;
-    }
-
-    string ScriptVariablesAsSerializedPropGUIToString ()
-    {
-        string returnVal = "";
-        for (int i = 0; i < playableBehaviourVariables.Count; i++)
-        {
-            returnVal += k_Tab + k_Tab + "EditorGUI.PropertyField(singleFieldRect, " + playableBehaviourVariables[i].name + "Prop);\n";
-
-            if (i < playableBehaviourVariables.Count - 1)
-            {
-                returnVal += "\n";
-                returnVal += k_Tab + k_Tab + "singleFieldRect.y += EditorGUIUtility.singleLineHeight;\n";
-            }
-        }
-        return returnVal;
-    }
-
-    string StandardBlendPlayableAsset ()
-    {
-        return
-            "using System;\n" +
-            "using UnityEngine;\n" +
-            "using UnityEngine.Playables;\n" +
-            "using UnityEngine.Timeline;\n" +
-            "\n" +
-            "[Serializable]\n" +
-            "public class " + playableName + k_TimelineClipAssetSuffix + " : PlayableAsset, ITimelineClipAsset\n" +
-            "{\n" +
-            k_Tab + "public " + playableName + k_TimelineClipBehaviourSuffix + " template = new " + playableName + k_TimelineClipBehaviourSuffix + " ();\n" +
-            "\n" +
-            k_Tab + "public ClipCaps clipCaps\n" +
-            k_Tab + "{\n" +
-            k_Tab + k_Tab + "get { return ClipCaps.Blending; }\n" +
-            k_Tab + "}\n" +
-            "\n" +
-            k_Tab + "public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)\n" +
-            k_Tab + "{\n" +
-            k_Tab + k_Tab + "var playable = ScriptPlayable<" + playableName + k_TimelineClipBehaviourSuffix + ">.Create (graph, template);\n" +
-            k_Tab + k_Tab + "return playable;\n" +
-            k_Tab + "}\n" +
-            "}\n";
-    }
-
-    string StandardBlendPlayableBehaviour ()
-    {
-        return
-            "using System;\n" +
-            "using UnityEngine;\n" +
-            "using UnityEngine.Playables;\n" +
-            "using UnityEngine.Timeline;\n" +
-            AdditionalNamespacesToString() +
-            "\n" +
-            "[Serializable]\n" +
-            "public class " + playableName + k_TimelineClipBehaviourSuffix + " : PlayableBehaviour\n" +
-            "{\n" +
-            StandardBlendScriptPlayablePropertiesToString () +
-            "}\n";
-    }
-
-    string StandardBlendPlayableBehaviourMixer ()
-    {
-        return
-            "using System;\n" +
-            "using UnityEngine;\n" +
-            "using UnityEngine.Playables;\n" +
-            "using UnityEngine.Timeline;\n" +
-            AdditionalNamespacesToString() +
-            "\n" +
-            "public class " + playableName + k_PlayableBehaviourMixerSuffix + " : PlayableBehaviour\n" +
-            "{\n" +
-            StandardBlendTrackBindingPropertiesDefaultsDeclarationToString () +
-            "\n" +
-            StandardBlendTrackBindingPropertiesBlendedDeclarationToString () +
-            "\n" +
-            k_Tab + trackBinding.name + " m_TrackBinding;\n" +
-            "\n" +
-            k_Tab + "public override void ProcessFrame(Playable playable, FrameData info, object playerData)\n" +
-            k_Tab + "{\n" +
-            k_Tab + k_Tab + "m_TrackBinding = playerData as " + trackBinding.name + ";\n" +
-            "\n" +
-            k_Tab + k_Tab + "if (m_TrackBinding == null)\n" +
-            k_Tab + k_Tab + k_Tab + "return;\n" +
-            "\n" +
-            StandardBlendTrackBindingPropertiesDefaultsAssignmentToString () +
-            "\n" +
-            k_Tab + k_Tab + "int inputCount = playable.GetInputCount ();\n" +
-            "\n" +
-            StandardBlendBlendedVariablesCreationToString () +
-            k_Tab + k_Tab + "float totalWeight = 0f;\n" +
-            k_Tab + k_Tab + "float greatestWeight = 0f;\n" +
-            StandardBlendPlayableCurrentInputsDeclarationToString () +
-            "\n" +
-            k_Tab + k_Tab + "for (int i = 0; i < inputCount; i++)\n" +
-            k_Tab + k_Tab + "{\n" +
-            k_Tab + k_Tab + k_Tab + "float inputWeight = playable.GetInputWeight(i);\n" +
-            k_Tab + k_Tab + k_Tab + "ScriptPlayable<" + playableName + k_TimelineClipBehaviourSuffix + "> inputPlayable = (ScriptPlayable<" + playableName + k_TimelineClipBehaviourSuffix + ">)playable.GetInput(i);\n" +
-            k_Tab + k_Tab + k_Tab + playableName + k_TimelineClipBehaviourSuffix + " input = inputPlayable.GetBehaviour ();\n" +
-            k_Tab + k_Tab + k_Tab + "\n" +
-            StandardBlendBlendedVariablesWeightedIncrementationToString () +
-            k_Tab + k_Tab + k_Tab + "totalWeight += inputWeight;\n" +
-            "\n" +
-            StandardBlendAssignableVariablesAssignedBasedOnGreatestWeightToString () +
-            StandardBlendPlayableCurrentInputIterationToString () + 
-            k_Tab + k_Tab + "}\n" +
-            StandardBlendTrackBindingPropertiesBlendedAssignmentToString () +
-            StandardBlendTrackBindingPropertiesAssignableAssignmentToString () +
-            k_Tab + "}\n" +
-            "}\n";
-    }
-
-    string StandardBlendTrackAssetScript ()
-    {
-        return
-            "using UnityEngine;\n" +
-            "using UnityEngine.Playables;\n" +
-            "using UnityEngine.Timeline;\n" +
-            "using System.Collections.Generic;\n" +
-            AdditionalNamespacesToString() +
-            "\n" +
-            "[TrackColor(" + trackColor.r + "f, " + trackColor.g + "f, " + trackColor.b + "f)]\n" +
-            "[TrackClipType(typeof(" + playableName + k_TimelineClipAssetSuffix + "))]\n" +
-            StandardBlendComponentBindingToString () +
-            "public class " + playableName + k_TrackAssetSuffix + " : TrackAsset\n" +
-            "{\n" +
-            k_Tab + "public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)\n" +
-            k_Tab + "{\n" +
-            k_Tab + k_Tab + "return ScriptPlayable<" + playableName + k_PlayableBehaviourMixerSuffix + ">.Create (graph, inputCount);\n" +
-            k_Tab + "}\n" +
-            "\n" +
-            k_Tab + "// Please note this assumes only one component of type " + trackBinding.name + " on the same gameobject.\n" +
-            k_Tab + "public override void GatherProperties (PlayableDirector director, IPropertyCollector driver)\n" +
-            k_Tab + "{\n" +
-            "#if UNITY_EDITOR\n" +
-            k_Tab + k_Tab + trackBinding.name + " trackBinding = director.GetGenericBinding(this) as " + trackBinding.name + ";\n" +
-            k_Tab + k_Tab + "if (trackBinding == null)\n" +
-            k_Tab + k_Tab + k_Tab + "return;\n" +
-            "\n" +
-            //k_Tab + k_Tab + "var serializedObject = new UnityEditor.SerializedObject (trackBinding);\n" +
-            //k_Tab + k_Tab + "var iterator = serializedObject.GetIterator();\n" +
-            //k_Tab + k_Tab + "while (iterator.NextVisible(true))\n" +
-            //k_Tab + k_Tab + "{\n" +
-            //k_Tab + k_Tab + k_Tab + "if (iterator.hasVisibleChildren)\n" +
-            //k_Tab + k_Tab + k_Tab + k_Tab + "continue;\n" +
-            //"\n" +
-            //k_Tab + k_Tab + k_Tab + "driver.AddFromName<" + trackBinding.name + ">(trackBinding.gameObject, iterator.propertyPath);\n" +
-            //k_Tab + k_Tab + "}\n" +
-            StandardBlendPropertiesAssignedToPropertyDriverToString () +
-            "#endif\n" +
-            k_Tab + k_Tab + "base.GatherProperties (director, driver);\n" +
-            k_Tab + "}\n" +
-            "}\n";
-    }
-    
-    string StandardBlendPlayableDrawer ()
-    {
-        return
-            "using UnityEditor;\n" +
-            "using UnityEngine;\n" +
-            "using UnityEngine.Playables;\n" +
-            AdditionalNamespacesToString() +
-            "\n" +
-            "[CustomPropertyDrawer(typeof(" + playableName + k_TimelineClipBehaviourSuffix + "))]\n" +
-            "public class " + playableName + k_PropertyDrawerSuffix + " : PropertyDrawer\n" +
-            "{\n" +
-            k_Tab + "public override float GetPropertyHeight (SerializedProperty property, GUIContent label)\n" +
-            k_Tab + "{\n" +
-            k_Tab + k_Tab + "int fieldCount = " + standardBlendPlayableProperties.Count + ";\n" +
-            k_Tab + k_Tab + "return fieldCount * EditorGUIUtility.singleLineHeight;\n" +
-            k_Tab + "}\n" +
-            "\n" +
-            k_Tab + "public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)\n" +
-            k_Tab + "{\n" +
-            StandardBlendTrackBindingPropertiesAsSerializedPropsDeclarationToString () +
-            "\n" +
-            k_Tab + k_Tab + "Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);\n" +
-            StandardBlendSerializedPropertyGUIToString () +
-            k_Tab + "}\n" +
-            "}\n";
-    }
-    
-    string StandardBlendScriptPlayablePropertiesToString ()
-    {
-        string returnVal = "";
-        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-        {
-            UsableProperty prop = standardBlendPlayableProperties[i];
-            if(prop.defaultValue == "")
-                returnVal += k_Tab + "public " + prop.type + " " + prop.name + ";\n";
-            else
-            {
-                returnVal += k_Tab + "public " + prop.type + " " + prop.name + " = " + prop.defaultValue + ";\n";
-            }
-        }
-        return returnVal;
-    }
-
-    string StandardBlendTrackBindingPropertiesDefaultsDeclarationToString ()
-    {
-        string returnVal = "";
-        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-        {
-            UsableProperty prop = standardBlendPlayableProperties[i];
-            returnVal += k_Tab + prop.type + " " + prop.NameAsPrivateDefault + ";\n";
-        }
-        return returnVal;
-    }
-
-    string StandardBlendTrackBindingPropertiesBlendedDeclarationToString ()
-    {
-        string returnVal = "";
-        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-        {
-            UsableProperty prop = standardBlendPlayableProperties[i];
-            
-            returnVal += k_Tab + prop.type + " " + prop.NameAsPrivateAssigned + ";\n";
-        }
-        return returnVal;
-    }
-
-    string StandardBlendTrackBindingPropertiesDefaultsAssignmentToString ()
-    {
-        string returnVal = "";
-        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-        {
-            UsableProperty prop = standardBlendPlayableProperties[i];
-
-            switch (prop.type)
-            {
-                case "float":
-                    returnVal += k_Tab + k_Tab + "if (!Mathf.Approximately(m_TrackBinding." + prop.name + ", " + prop.NameAsPrivateAssigned + "))\n";
-                    returnVal += k_Tab + k_Tab + k_Tab + prop.NameAsPrivateDefault + " = m_TrackBinding." + prop.name + ";\n";
-                    break;
-                case "double":
-                    returnVal += k_Tab + k_Tab + "if (!Mathf.Approximately((float)m_TrackBinding." + prop.name + ", (float)" + prop.NameAsPrivateAssigned + "))\n";
-                    returnVal += k_Tab + k_Tab + k_Tab + prop.NameAsPrivateDefault + " = m_TrackBinding." + prop.name + ";\n";
-                    break;
-                default:
-                    returnVal += k_Tab + k_Tab + "if (m_TrackBinding." + prop.name + " != " + prop.NameAsPrivateAssigned + ")\n";
-                    returnVal += k_Tab + k_Tab + k_Tab + prop.NameAsPrivateDefault + " = m_TrackBinding." + prop.name + ";\n";
-                    break;
-            }
-        }
-        return returnVal;
-    }
-
-    string StandardBlendBlendedVariablesCreationToString ()
-    {
-        string returnVal = "";
-        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-        {
-            UsableProperty prop = standardBlendPlayableProperties[i];
-            
-            if(prop.usability != UsableProperty.Usability.Blendable)
-                continue;
-            
-            string type = prop.type == "int" ? "float" : prop.type;
-            string zeroVal = prop.type == "int" ? "0f" : prop.ZeroValueAsString ();
-            returnVal += k_Tab + k_Tab + type + " " + prop.NameAsLocalBlended + " = " + zeroVal + ";\n";
-        }
-        return returnVal;
-    }
-
-    string StandardBlendPlayableCurrentInputsDeclarationToString ()
-    {
-        if (standardBlendPlayableProperties.Any (x => x.usability == UsableProperty.Usability.Assignable))
-        {
-            return k_Tab + k_Tab + "int currentInputs = 0;\n";
-        }
-        return "";
-    }
-
-    string StandardBlendBlendedVariablesWeightedIncrementationToString ()
-    {
-        string returnVal = "";
-        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-        {
-            UsableProperty prop = standardBlendPlayableProperties[i];
-            
-            if (prop.usability == UsableProperty.Usability.Blendable)
-                returnVal += k_Tab + k_Tab + k_Tab + prop.NameAsLocalBlended + " += input." + prop.name + " * inputWeight;\n";
-            
-        }
-        return returnVal;
-    }
-
-    string StandardBlendAssignableVariablesAssignedBasedOnGreatestWeightToString ()
-    {
-        if (standardBlendPlayableProperties.Count == 0)
-            return "";
-
-        string returnVal = k_Tab + k_Tab + k_Tab + "if (inputWeight > greatestWeight)\n";
-        returnVal += k_Tab + k_Tab + k_Tab + "{\n";
-        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-        {
-            UsableProperty prop = standardBlendPlayableProperties[i];
-            if (prop.usability == UsableProperty.Usability.Assignable)
-            {
-                returnVal += k_Tab + k_Tab + k_Tab + k_Tab + prop.NameAsPrivateAssigned + " = input." + prop.name + ";\n";
-                returnVal += k_Tab + k_Tab + k_Tab + k_Tab + "m_TrackBinding." + prop.name + " = " + prop.NameAsPrivateAssigned + ";\n";
-            }
-        }
-        returnVal += k_Tab + k_Tab + k_Tab + k_Tab + "greatestWeight = inputWeight;\n";
-        returnVal += k_Tab + k_Tab + k_Tab + "}\n";
-        return returnVal;
-    }
-
-    string StandardBlendPlayableCurrentInputIterationToString ()
-    {
-        if (standardBlendPlayableProperties.Any (x => x.usability == UsableProperty.Usability.Assignable))
-        {
-            string returnVal = "\n";
-            returnVal += k_Tab + k_Tab + k_Tab + "if (!Mathf.Approximately (inputWeight, 0f))\n";
-            returnVal += k_Tab + k_Tab + k_Tab + k_Tab + "currentInputs++;\n";
-            return returnVal;
-        }
-        return "";
-    }
-
-    string StandardBlendTrackBindingPropertiesBlendedAssignmentToString ()
-    {
-        string returnVal = "";
-        bool firstNewLine = false;
-        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-        {
-            UsableProperty prop = standardBlendPlayableProperties[i];
-            if (prop.usability != UsableProperty.Usability.Blendable)
-                continue;
-
-            if (!firstNewLine)
-            {
-                firstNewLine = true;
-                returnVal += "\n";
-            }
-            
-            if (prop.type == "int")
-                returnVal += k_Tab + k_Tab + prop.NameAsPrivateAssigned + " = Mathf.RoundToInt (" + prop.NameAsLocalBlended + " + " + prop.NameAsPrivateDefault + " * (1f - totalWeight));\n";
-            else
-                returnVal += k_Tab + k_Tab + prop.NameAsPrivateAssigned + " = " + prop.NameAsLocalBlended + " + " + prop.NameAsPrivateDefault + " * (1f - totalWeight);\n";
-
-            returnVal += k_Tab + k_Tab + "m_TrackBinding." + prop.name + " = " + prop.NameAsPrivateAssigned + ";\n";
-        }
-        return returnVal;
-    }
-
-    string StandardBlendTrackBindingPropertiesAssignableAssignmentToString ()
-    {
-        if (standardBlendPlayableProperties.Count == 0)
-            return "";
-
-        if (standardBlendPlayableProperties.Any (x => x.usability == UsableProperty.Usability.Assignable))
-        {
-            string returnVal = "\n" + k_Tab + k_Tab + "if (currentInputs != 1 && 1f - totalWeight > greatestWeight)\n";
-            returnVal += k_Tab + k_Tab + "{\n";
-            for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-            {
-                UsableProperty prop = standardBlendPlayableProperties[i];
-                if (prop.usability != UsableProperty.Usability.Assignable)
-                    continue;
-
-                returnVal += k_Tab + k_Tab + k_Tab + "m_TrackBinding." + prop.name + " = " + prop.NameAsPrivateDefault + ";\n";
-            }
-            returnVal += k_Tab + k_Tab + "}\n";
-            return returnVal;
-        }
-
-        return "";
-    }
-
-    string StandardBlendComponentBindingToString ()
-    {
-        return "[TrackBindingType(typeof(" + trackBinding.name + "))]\n";
-    }
-
-    string StandardBlendPropertiesAssignedToPropertyDriverToString ()
-    {
-        if (standardBlendPlayableProperties.Count == 0)
-            return "";
-
-        string returnVal = k_Tab + k_Tab + "// These field names are procedurally generated estimations based on the associated property names.\n";
-        returnVal += k_Tab + k_Tab + "// If any of the names are incorrect you will get a DrivenPropertyManager error saying it has failed to register the name.\n";
-        returnVal += k_Tab + k_Tab + "// In this case you will need to find the correct backing field name.\n";
-        returnVal += k_Tab + k_Tab + "// The suggested way of finding the field name is to:\n";
-        returnVal += k_Tab + k_Tab + "// 1. Make sure your scene is serialized to text.\n";
-        returnVal += k_Tab + k_Tab + "// 2. Search the text for the track binding component type.\n";
-        returnVal += k_Tab + k_Tab + "// 3. Look through the field names until you see one that looks correct.\n";
-
-        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-        {
-            UsableProperty prop = standardBlendPlayableProperties[i];
-
-            if (prop.usablePropertyType == UsableProperty.UsablePropertyType.Field)
-            {
-                returnVal += k_Tab + k_Tab + "driver.AddFromName<" + trackBinding.name + ">(trackBinding.gameObject, \"" + prop.name + "\");\n";
-            }
-            else
-            {
-                returnVal += k_Tab + k_Tab + "driver.AddFromName<" + trackBinding.name + ">(trackBinding.gameObject, \"" + prop.NameAsPrivate + "\");\n";
-            }
-        }
-
-        return returnVal;
-    }
-
-    string StandardBlendTrackBindingPropertiesAsSerializedPropsDeclarationToString ()
-    {
-        string returnVal = "";
-        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-        {
-            UsableProperty prop = standardBlendPlayableProperties[i];
-            returnVal += k_Tab + k_Tab + "SerializedProperty " + prop.NameAsLocalSerializedProperty + " = property.FindPropertyRelative(\"" + prop.name + "\");\n";
-        }
-        return returnVal;
-    }
-
-    string StandardBlendSerializedPropertyGUIToString ()
-    {
-        string returnVal = "";
-        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
-        {
-            if (i != 0)
-            {
-                returnVal += "\n";
-                returnVal += k_Tab + k_Tab + "singleFieldRect.y += EditorGUIUtility.singleLineHeight;\n";
-            }
-
-            returnVal += k_Tab + k_Tab + "EditorGUI.PropertyField(singleFieldRect, " + standardBlendPlayableProperties[i].NameAsLocalSerializedProperty + ");\n";
-        }
-        return returnVal;
-    }
-}
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Linq;
+using System.CodeDom.Compiler;
+using System.Reflection;
+using UnityEditor;
+using UnityEngine;
+using UnityEngine.Timeline;
+
+public class TimelinePlayableWizard : EditorWindow
+{
+    public class Variable : IComparable
+    {
+        public string name;
+        public UsableType usableType;
+
+        int m_TypeIndex;
+        
+        public Variable (string name, UsableType usableType)
+        {
+            this.name = name;
+            this.usableType = usableType;
+        }
+
+        public bool GUI (UsableType[] usableTypes)
+        {
+            bool removeThis = false;
+            EditorGUILayout.BeginHorizontal();
+            name = EditorGUILayout.TextField(name);
+            m_TypeIndex = EditorGUILayout.Popup(m_TypeIndex, UsableType.GetNamewithSortingArray (usableTypes));
+            usableType = usableTypes[m_TypeIndex];
+            if (GUILayout.Button("Remove", GUILayout.Width(60f)))
+            {
+                removeThis = true;
+            }
+            EditorGUILayout.EndHorizontal();
+
+            return removeThis;
+        }
+
+        public int CompareTo (object obj)
+        {
+            if (obj == null)
+                return 1;
+
+            UsableType other = (UsableType)obj;
+
+            if (other == null)
+                throw new ArgumentException("This object is not a Variable.");
+
+            return name.ToLower().CompareTo(other.name.ToLower());
+        }
+
+        public static UsableType[] GetUsableTypesFromVariableArray (Variable[] variables)
+        {
+            UsableType[] usableTypes = new UsableType[variables.Length];
+            for (int i = 0; i < usableTypes.Length; i++)
+            {
+                usableTypes[i] = variables[i].usableType;
+            }
+            return usableTypes;
+        }
+    }
+
+
+    public class UsableType : IComparable
+    {
+        public readonly string name;
+        public readonly string nameWithSorting;
+        public readonly string additionalNamespace;
+        public readonly GUIContent guiContentWithSorting;
+        public readonly Type type;
+
+        public readonly string[] unrequiredNamespaces =
+        {
+            "UnityEngine",
+            "UnityEngine.Timeline",
+            "UnityEngine.Playables"
+        };
+        public const string blankAdditionalNamespace = "";
+
+        const string k_NameForNullType = "None";
+
+        public UsableType (Type usableType)
+        {
+            type = usableType;
+
+            if (type != null)
+            {
+                name = usableType.Name;
+                nameWithSorting = name.ToUpper ()[0] + "/" + name;
+                additionalNamespace = unrequiredNamespaces.All (t => usableType.Namespace != t) ? usableType.Namespace : blankAdditionalNamespace;
+            }
+            else
+            {
+                name = k_NameForNullType;
+                nameWithSorting = k_NameForNullType;
+                additionalNamespace = blankAdditionalNamespace;
+            }
+
+            guiContentWithSorting = new GUIContent(nameWithSorting);
+        }
+
+        public UsableType (string name)
+        {
+            this.name = name;
+            nameWithSorting = name.ToUpper()[0] + "/" + name;
+            additionalNamespace = blankAdditionalNamespace;
+            guiContentWithSorting = new GUIContent(nameWithSorting);
+        }
+
+        public int CompareTo (object obj)
+        {
+            if (obj == null)
+                return 1;
+
+            UsableType other = (UsableType)obj;
+            
+            if(other == null)
+                throw new ArgumentException("This object is not a UsableType.");
+
+            return name.ToLower().CompareTo (other.name.ToLower());
+        }
+
+        public static UsableType[] GetUsableTypeArray (Type[] types, params UsableType[] additionalUsableTypes)
+        {
+            List<UsableType> usableTypeList = new List<UsableType> ();
+            for (int i = 0; i < types.Length; i++)
+            {
+                usableTypeList.Add (new UsableType (types[i]));
+            }
+            usableTypeList.AddRange (additionalUsableTypes);
+            return usableTypeList.ToArray ();
+        }
+
+        public static UsableType[] AmalgamateUsableTypes (UsableType[] usableTypeArray, params UsableType[] usableTypes)
+        {
+            List<UsableType> usableTypeList = new List<UsableType> ();
+            for (int i = 0; i < usableTypes.Length; i++)
+            {
+                usableTypeList.Add (usableTypes[i]);
+            }
+            usableTypeList.AddRange(usableTypeArray);
+            return usableTypeList.ToArray();
+        }
+
+        public static string[] GetNamewithSortingArray(UsableType[] usableTypes)
+        {
+            if (usableTypes == null || usableTypes.Length == 0)
+                return new string[0];
+
+            string[] displayNames = new string[usableTypes.Length];
+            for (int i = 0; i < displayNames.Length; i++)
+            {
+                displayNames[i] = usableTypes[i].nameWithSorting;
+            }
+            return displayNames;
+        }
+
+        public static GUIContent[] GetGUIContentWithSortingArray (UsableType[] usableTypes)
+        {
+            if(usableTypes == null || usableTypes.Length == 0)
+                return new GUIContent[0];
+
+            GUIContent[] guiContents = new GUIContent[usableTypes.Length];
+            for (int i = 0; i < guiContents.Length; i++)
+            {
+                guiContents[i] = usableTypes[i].guiContentWithSorting;
+            }
+            return guiContents;
+        }
+
+        public static string[] GetDistinctAdditionalNamespaces (UsableType[] usableTypes)
+        {
+            if (usableTypes == null || usableTypes.Length == 0)
+                return new string[0];
+
+            string[] namespaceArray = new string[usableTypes.Length];
+            for (int i = 0; i < namespaceArray.Length; i++)
+            {
+                namespaceArray[i] = usableTypes[i].additionalNamespace;
+            }
+            return namespaceArray.Distinct().ToArray();
+        }
+    }
+
+
+    public class UsableProperty : IComparable
+    {
+        public enum Usability
+        {
+            Blendable, Assignable, Not
+        }
+        
+        public enum UsablePropertyType
+        {
+            Property, Field
+        }
+        
+        public string type;
+        public string name;
+        public string defaultValue;
+        public Usability usability;
+        public UsablePropertyType usablePropertyType;
+        public PropertyInfo propertyInfo;
+        public FieldInfo fieldInfo;
+
+        int m_TypeIndex;
+        
+        public string NameWithCaptial
+        {
+            get { return name.First().ToString().ToUpper() + name.Substring(1); }
+        }
+
+        public string NameAsPrivate
+        {
+            get { return "m_" + NameWithCaptial; }
+        }
+
+        public string NameAsPrivateDefault
+        {
+            get { return "m_Default" + NameWithCaptial; }
+        }
+
+        public string NameAsPrivateAssigned
+        {
+            get { return "m_Assigned" + NameWithCaptial; }
+        }
+
+        public string NameAsLocalBlended
+        {
+            get { return "blended" + NameWithCaptial; }
+        }
+
+        public string NameAsLocalSerializedProperty
+        {
+            get { return name + "Prop"; }
+        }
+        
+        public UsableProperty (PropertyInfo propertyInfo)
+        {
+            usablePropertyType = UsablePropertyType.Property;
+            this.propertyInfo = propertyInfo;
+
+            if (propertyInfo.PropertyType.Name == "Single")
+                type = "float";
+            else if (propertyInfo.PropertyType.Name == "Int32")
+                type = "int";
+            else if (propertyInfo.PropertyType.Name == "Double")
+                type = "double";
+            else if (propertyInfo.PropertyType.Name == "Boolean")
+                type = "bool";
+            else if (propertyInfo.PropertyType.Name == "String")
+                type = "string";
+            else
+                type = propertyInfo.PropertyType.Name;
+
+            name = propertyInfo.Name;
+
+            if (IsTypeBlendable(propertyInfo.PropertyType))
+                usability = Usability.Blendable;
+            else if (IsTypeAssignable(propertyInfo.PropertyType))
+                usability = Usability.Assignable;
+            else
+                usability = Usability.Not;
+        }
+
+        public UsableProperty (FieldInfo fieldInfo)
+        {
+            usablePropertyType = UsablePropertyType.Field;
+            this.fieldInfo = fieldInfo;
+            
+            if (fieldInfo.FieldType.Name == "Single")
+                type = "float";
+            else if (fieldInfo.FieldType.Name == "Int32")
+                type = "int";
+            else if (fieldInfo.FieldType.Name == "Double")
+                type = "double";
+            else if (fieldInfo.FieldType.Name == "Boolean")
+                type = "bool";
+            else if (fieldInfo.FieldType.Name == "String")
+                type = "string";
+            else
+                type = fieldInfo.FieldType.Name;
+
+            name = fieldInfo.Name;
+            
+            if (IsTypeBlendable(fieldInfo.FieldType))
+                usability = Usability.Blendable;
+            else if (IsTypeAssignable(fieldInfo.FieldType))
+                usability = Usability.Assignable;
+            else
+                usability = Usability.Not;
+        }
+
+        public string ZeroValueAsString ()
+        {
+            if(usability != Usability.Blendable)
+                throw new UnityException("UsableType is not blendable, shouldn't be looking for zero value as string.");
+
+            switch (type)
+            {
+                case "float":
+                    return "0f";
+                case "int":
+                    return "0";
+                case "double":
+                    return "0.0";
+                case "Vector2":
+                    return "Vector2.zero";
+                case "Vector3":
+                    return "Vector3.zero";
+                case "Color":
+                    return "Color.clear";
+            }
+            return "";
+        }
+
+        public void CreateSettingDefaultValueString (Component defaultValuesComponent)
+        {
+            if (defaultValuesComponent == null)
+            {
+                defaultValue = "";
+                return;
+            }
+            
+            object defaultValueObj = usablePropertyType == UsablePropertyType.Property ? propertyInfo.GetValue (defaultValuesComponent, null) : fieldInfo.GetValue (defaultValuesComponent);
+            
+            switch (type)
+            {
+                case "float":
+                    float defaultFloatValue = (float)defaultValueObj;
+                    defaultValue = defaultFloatValue + "f";
+                    break;
+                case "int":
+                    int defaultIntValue = (int)defaultValueObj;
+                    defaultValue = defaultIntValue.ToString();
+                    break;
+                case "double":
+                    double defaultDoubleValue = (double)defaultValueObj;
+                    defaultValue = defaultDoubleValue.ToString();
+                    break;
+                case "Vector2":
+                    Vector2 defaultVector2Value = (Vector2)defaultValueObj;
+                    defaultValue = "new Vector2(" + defaultVector2Value.x + "f, " + defaultVector2Value.y + "f)";
+                    break;
+                case "Vector3":
+                    Vector3 defaultVector3Value = (Vector3)defaultValueObj;
+                    defaultValue = "new Vector3(" + defaultVector3Value.x + "f, " + defaultVector3Value.y + "f, " + defaultVector3Value.z + "f)";
+                    break;
+                case "Color":
+                    Color defaultColorValue = (Color)defaultValueObj;
+                    defaultValue = "new Color(" + defaultColorValue.r + "f, " + defaultColorValue.g + "f, " + defaultColorValue.b + "f, " + defaultColorValue.a + "f)";
+                    break;
+                case "string":
+                    defaultValue = "\"" + defaultValueObj + "\"";
+                    break;
+                case "bool":
+                    bool defaultBoolValue = (bool)defaultValueObj;
+                    defaultValue = defaultBoolValue.ToString ().ToLower();
+                    break;
+                default:
+                    Enum defaultEnumValue = (Enum)defaultValueObj;
+                    Type enumSystemType = defaultEnumValue.GetType ();
+                    string[] splits = enumSystemType.ToString().Split('+');
+                    string enumType = splits[splits.Length - 1];
+                    string enumConstantName = Enum.GetName (enumSystemType, defaultEnumValue);
+                    defaultValue = enumType + "." + enumConstantName;
+                    break;
+            }
+        }
+
+        public bool GUI (List<UsableProperty> allUsableProperties)
+        {
+            bool removeThis = false;
+            EditorGUILayout.BeginHorizontal();
+            m_TypeIndex = EditorGUILayout.Popup(m_TypeIndex, GetNameWithSortingArray (allUsableProperties));
+            type = allUsableProperties[m_TypeIndex].type;
+            name = allUsableProperties[m_TypeIndex].name;
+            usablePropertyType = allUsableProperties[m_TypeIndex].usablePropertyType;
+            propertyInfo = allUsableProperties[m_TypeIndex].propertyInfo;
+            fieldInfo = allUsableProperties[m_TypeIndex].fieldInfo;
+            usability = allUsableProperties[m_TypeIndex].usability;
+            if (GUILayout.Button("Remove", GUILayout.Width(60f)))
+            {
+                removeThis = true;
+            }
+            EditorGUILayout.EndHorizontal();
+            return removeThis;
+        }
+
+        public int CompareTo(object obj)
+        {
+            if (obj == null)
+                return 1;
+
+            UsableType other = (UsableType)obj;
+
+            if (other == null)
+                throw new ArgumentException("This object is not a UsableProperty.");
+
+            return name.ToLower().CompareTo(other.name.ToLower());
+        }
+
+        public static string[] GetNameWithSortingArray (List<UsableProperty> usableProperties)
+        {
+            string[] returnVal = new string[usableProperties.Count];
+            for (int i = 0; i < returnVal.Length; i++)
+            {
+                returnVal[i] = usableProperties[i].name;
+            }
+            return returnVal;
+        }
+
+        public UsableProperty GetDuplicate ()
+        {
+            UsableProperty duplicate = usablePropertyType == UsablePropertyType.Property ? new UsableProperty (propertyInfo) : new UsableProperty (fieldInfo);
+            duplicate.defaultValue = defaultValue;
+            return duplicate;
+        }
+    }
+
+    public enum CreationError
+    {
+        NoError,
+        PlayableAssetAlreadyExists,
+        PlayableBehaviourAlreadyExists,
+        PlayableBehaviourMixerAlreadyExists,
+        TrackAssetAlreadyExists,
+        PlayableDrawerAlreadyExists,
+    }
+
+
+    public bool showHelpBoxes = true;
+    public string playableName = "";
+    public bool isStandardBlendPlayable;
+    public UsableType trackBinding;
+    public Component defaultValuesComponent;
+    public List<Variable> exposedReferences = new List<Variable> ();
+    public List<Variable> playableBehaviourVariables = new List<Variable> ();
+    public List<UsableProperty> standardBlendPlayableProperties = new List<UsableProperty> ();
+    public ClipCaps clipCaps;
+    /*public bool setClipDefaults;
+    public float clipDefaultDurationSeconds = 5f;
+    public float clipDefaultEaseInSeconds;
+    public float clipDefaultEaseOutSeconds;
+    public float clipDefaultClipInSeconds;
+    public float clipDefaultSpeedMultiplier = 1f;*/
+    public Color trackColor = new Color(0.855f, 0.8623f, 0.870f);
+
+    int m_TrackBindingTypeIndex;
+    int m_ComponentBindingTypeIndex;
+    PropertyInfo[] m_TrackBindingProperties;
+    FieldInfo[] m_TrackBindingFields;
+    List<UsableProperty> m_TrackBindingUsableProperties = new List<UsableProperty> ();
+    bool m_CreateDrawer;
+    bool m_CreateButtonPressed;
+    Vector2 m_ScrollViewPos;
+    CreationError m_CreationError;
+    
+    readonly GUIContent m_ShowHelpBoxesContent = new GUIContent("Show Help", "Do you want to see the help boxes as part of this wizard?");
+    readonly GUIContent m_PlayableNameContent = new GUIContent("Playable Name", "This is the name that will represent the playable.  E.G. TransformTween.  It will be the basis for the class names so it is best not to use the postfixes: 'Clip', 'Behaviour', 'MixerBehaviour' or 'Drawer'.");
+    readonly GUIContent m_StandardBlendPlayableContent = new GUIContent("Standard Blend Playable", "Often when creating a playable it's intended purpose is just to briefly override the properties of a component for the playable's duration and then blend back to the defaults.  For example a playable that changes the color of a Light but changes it back.  To make a playable with this functionality, check this box.");
+    readonly GUIContent m_TrackBindingTypeContent = new GUIContent("Track Binding Type", "This is the type of object the Playable will affect.  E.G. To affect the position choose Transform.");
+    readonly GUIContent m_DefaultValuesComponentContent = new GUIContent("Default Values", "When the scripts are created, each of the selected properties are assigned a default from the selected Component.  If this is left blank no defaults will be used.");
+    readonly GUIContent m_ExposedReferencesContent = new GUIContent("Exposed References", "Exposed References are references to objects in a scene that your Playable needs. For example, if you want to tween between two Transforms, they will need to be Exposed References.");
+    readonly GUIContent m_BehaviourVariablesContent = new GUIContent("Behaviour Variables", "Behaviour Variables are all the variables you wish to use in your playable that do NOT need a reference to something in a scene.  For example a float for speed.");
+    readonly GUIContent m_TrackColorContent = new GUIContent("Track Color", "Timeline tracks have a colored outline, use this to select that color for your track.");
+    readonly GUIContent m_CreateDrawerContent = new GUIContent("Create Drawer?", "Checking this box will enable the creation of a PropertyDrawer for your playable.  Having this script will make it easier to customise how your playable appears in the inspector.");
+    readonly GUIContent m_StandardBlendPlayablePropertiesContent = new GUIContent("Standard Blend Playable Properties", "Having already selected a Track Binding type, you can select the properties of the bound component you want the playable to affect.  For example, if your playable is bound to a Transform, you can affect the position property.  Note that changing the component binding will clear the list of properties.");
+    readonly GUIContent m_ClipCapsContent = new GUIContent("Clip Caps", "Clip Caps are used to change the way Timelines work with your playables.  For example, enabling Blending will mean that your playables can blend when they overlap and have ease in and out durations.  To find out a little about each hover the cursor over the options.  For details, please see the documentation.");
+    readonly GUIContent m_CCNoneContent = new GUIContent("None", "Your playable supports none of the features below.");
+    readonly GUIContent m_CCLoopingContent = new GUIContent("Looping", "Your playable has a specified time that it takes and will start again after it finishes until the clip's duration has played.");
+    readonly GUIContent m_CCExtrapolationContent = new GUIContent("Extrapolation", "Your playable will persist beyond its end time and its results will continue until the next clip is encountered.");
+    readonly GUIContent m_CCClipInContent = new GUIContent("Clip In", "Your playable need not be at the start of the Timeline.");
+    readonly GUIContent m_CCSpeedMultiplierContent = new GUIContent("Speed Multiplier", "Your playable supports changes to the time scale.");
+    readonly GUIContent m_CCBlendingContent = new GUIContent("Blending", "Your playable supports overlapping of clips to blend between them.");
+    readonly GUIContent m_CCAllContent = new GUIContent("All", "Your playable supports all of the above features.");
+    /*readonly GUIContent m_SetClipDefaultsContent = new GUIContent("Set Clip Defaults", "Do you want to set the default timings and other settings for clips when they are first created?");
+    readonly GUIContent m_ClipDefaultsContent = new GUIContent("Clip Defaults");
+    readonly GUIContent m_CDClipTimingContent = new GUIContent("Clip Timing", "Various settings that affect the durations over which the playable will be active.");
+    readonly GUIContent m_CDDurationContent = new GUIContent("Duration", "The default length of the clip in seconds.");
+    readonly GUIContent m_CDEaseInContent = new GUIContent("Ease In Duration", "The default duration over which the clip's weight increases to one.  When clips are overlapped, this is controlled by their overlap.  A clip requires the Blending ClipCap to support this.");
+    readonly GUIContent m_CDEaseOutContent = new GUIContent("Ease Out Duration", "The default duration over which the clip's weight decreases to zero.  When clips are overlapped, this is controlled by their overlap.  A clip requires the Blending ClipCap to support this.");
+    readonly GUIContent m_CDClipInContent = new GUIContent("Clip In", "The length of time after the start that the clip should start.  A clip requires the ClipIn ClipCap to support this.");
+    readonly GUIContent m_CDSpeedMultiplierContent = new GUIContent("Speed Multiplier", "The amount a clip's time dependent aspects will speed up or slow down by.  A clip requires the SpeedMultiplier ClipCap to support this.");
+    */
+    const string k_Tab = "    ";
+    const string k_ShowHelpBoxesKey = "TimelinePlayableWizard_ShowHelpBoxes";
+    const string k_TimelineClipAssetSuffix = "Clip";
+    const string k_TimelineClipBehaviourSuffix = "Behaviour";
+    const string k_PlayableBehaviourMixerSuffix = "MixerBehaviour";
+    const string k_TrackAssetSuffix = "Track";
+    const string k_PropertyDrawerSuffix = "Drawer";
+    const int k_PlayableNameCharLimit = 64;
+    const float k_WindowWidth = 500f;
+    const float k_MaxWindowHeight = 800f;
+    const float k_ScreenSizeWindowBuffer = 50f;
+
+    static UsableType[] s_ComponentTypes;
+    static UsableType[] s_TrackBindingTypes;
+    static UsableType[] s_ExposedReferenceTypes;
+    static UsableType[] s_BehaviourVariableTypes;
+    static Type[] s_BlendableTypes =
+    {
+        typeof(float), typeof(int), typeof(double), typeof(Vector2), typeof(Vector3), typeof(Color), 
+    };
+    static Type[] s_AssignableTypes =
+    {
+        typeof(string), typeof(bool)
+    };
+    static string[] s_DisallowedPropertyNames =
+    {
+        "name",
+    };
+
+    [MenuItem("Window/Timeline Playable Wizard...")]
+    static void CreateWindow ()
+    {
+        TimelinePlayableWizard wizard = GetWindow<TimelinePlayableWizard>(true, "Timeline Playable Wizard", true);
+        
+        Vector2 position = Vector2.zero;
+        SceneView sceneView = SceneView.lastActiveSceneView;
+        if (sceneView != null)
+            position = new Vector2(sceneView.position.x, sceneView.position.y);
+        wizard.position = new Rect(position.x + k_ScreenSizeWindowBuffer, position.y + k_ScreenSizeWindowBuffer, k_WindowWidth, Mathf.Min(Screen.currentResolution.height - k_ScreenSizeWindowBuffer, k_MaxWindowHeight));
+        
+        wizard.showHelpBoxes = EditorPrefs.GetBool (k_ShowHelpBoxesKey);
+        wizard.Show();
+        
+        Init ();
+    }
+
+    static void Init ()
+    {
+        Type[] componentTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes()).Where(t => typeof(Component).IsAssignableFrom(t)).Where (t => t.IsPublic).ToArray();
+        
+        List<UsableType> componentUsableTypesList = UsableType.GetUsableTypeArray(componentTypes).ToList();
+        componentUsableTypesList.Sort();
+        s_ComponentTypes = componentUsableTypesList.ToArray ();
+
+        UsableType gameObjectUsableType = new UsableType(typeof(GameObject));
+        UsableType[] defaultUsableTypes = UsableType.GetUsableTypeArray(componentTypes, gameObjectUsableType);
+
+        List<UsableType> exposedRefTypeList = defaultUsableTypes.ToList ();
+        exposedRefTypeList.Sort();
+        s_ExposedReferenceTypes = exposedRefTypeList.ToArray();
+
+        UsableType noneType = new UsableType((Type)null);
+        s_TrackBindingTypes = UsableType.AmalgamateUsableTypes(s_ExposedReferenceTypes, noneType);
+
+        s_BehaviourVariableTypes = UsableType.AmalgamateUsableTypes
+            (
+                s_ExposedReferenceTypes,
+                new UsableType("int"),
+                new UsableType("bool"),
+                new UsableType("float"),
+                new UsableType("Color"),
+                new UsableType("double"),
+                new UsableType("string"),
+                new UsableType("Vector2"),
+                new UsableType("Vector3"),
+                new UsableType("AudioClip"),
+                new UsableType("AnimationCurve")
+            );
+        List<UsableType> scriptVariableTypeList = s_BehaviourVariableTypes.ToList();
+        scriptVariableTypeList.Sort();
+        s_BehaviourVariableTypes = scriptVariableTypeList.ToArray();
+    }
+
+    void OnGUI ()
+    {
+        if(s_ComponentTypes == null || s_TrackBindingTypes == null || s_ExposedReferenceTypes == null || s_BehaviourVariableTypes == null)
+            Init ();
+
+        if (s_ComponentTypes == null || s_TrackBindingTypes == null || s_ExposedReferenceTypes == null || s_BehaviourVariableTypes == null)
+        {
+            EditorGUILayout.HelpBox ("Failed to initialise.", MessageType.Error);
+            return;
+        }
+
+        m_ScrollViewPos = EditorGUILayout.BeginScrollView (m_ScrollViewPos);
+
+        bool oldShowHelpBoxes = showHelpBoxes;
+        showHelpBoxes = EditorGUILayout.Toggle (m_ShowHelpBoxesContent, showHelpBoxes);
+        if (oldShowHelpBoxes != showHelpBoxes)
+        {
+            EditorPrefs.SetBool (k_ShowHelpBoxesKey, showHelpBoxes);
+            EditorGUILayout.Space ();
+        }
+
+        if (showHelpBoxes)
+        {
+            EditorGUILayout.HelpBox("This wizard is used to create the basics of a custom playable for the Timeline. "
+                               + "It will create 4 scripts that you can then edit to complete their functionality. "
+                               + "The purpose is to setup the boilerplate code for you.  If you are already familiar "
+                               + "with playables and the Timeline, you may wish to create your own scripts instead.", MessageType.None);
+            EditorGUILayout.Space();
+        }
+
+        EditorGUILayout.Space ();
+        EditorGUILayout.Space();
+
+        EditorGUILayout.BeginVertical (GUI.skin.box);
+        if (showHelpBoxes)
+        {
+            EditorGUILayout.HelpBox(m_PlayableNameContent.tooltip, MessageType.Info);
+            EditorGUILayout.Space();
+        }
+        playableName = EditorGUILayout.TextField (m_PlayableNameContent, playableName);
+
+        bool playableNameNotEmpty = !string.IsNullOrEmpty (playableName);
+        bool playableNameFormatted = CodeGenerator.IsValidLanguageIndependentIdentifier(playableName);
+        if (!playableNameNotEmpty || !playableNameFormatted)
+        {
+            EditorGUILayout.HelpBox ("The Playable needs a name which starts with a capital letter and contains no spaces or special characters.", MessageType.Error);
+        }
+        bool playableNameTooLong = playableName.Length > k_PlayableNameCharLimit;
+        if (playableNameTooLong)
+        {
+            EditorGUILayout.HelpBox ("The Playable needs a name which is fewer than " + k_PlayableNameCharLimit + " characters long.", MessageType.Error);
+        }
+        EditorGUILayout.EndVertical ();
+
+        EditorGUILayout.Space();
+        EditorGUILayout.Space();
+
+        EditorGUILayout.BeginVertical(GUI.skin.box);
+        if(showHelpBoxes)
+        {
+            EditorGUILayout.HelpBox(m_StandardBlendPlayableContent.tooltip, MessageType.Info);
+            EditorGUILayout.Space();
+        }
+        bool oldStandardBlendPlayable = isStandardBlendPlayable;
+        isStandardBlendPlayable = EditorGUILayout.Toggle (m_StandardBlendPlayableContent, isStandardBlendPlayable);
+        EditorGUILayout.EndVertical ();
+
+        EditorGUILayout.Space();
+        EditorGUILayout.Space();
+
+        EditorGUILayout.BeginVertical(GUI.skin.box);
+        if(showHelpBoxes)
+        {
+            EditorGUILayout.HelpBox(m_TrackBindingTypeContent.tooltip, MessageType.Info);
+            EditorGUILayout.Space();
+        }
+        int oldIndex = -1;
+        if (isStandardBlendPlayable)
+        {
+            oldIndex = m_ComponentBindingTypeIndex;
+
+            m_ComponentBindingTypeIndex = EditorGUILayout.Popup (m_TrackBindingTypeContent, m_ComponentBindingTypeIndex, UsableType.GetGUIContentWithSortingArray (s_ComponentTypes));
+            trackBinding = s_ComponentTypes[m_ComponentBindingTypeIndex];
+
+            EditorGUILayout.Space ();
+
+            defaultValuesComponent = EditorGUILayout.ObjectField (m_DefaultValuesComponentContent, defaultValuesComponent, trackBinding.type, true) as Component;
+        }
+        else
+        {
+            m_TrackBindingTypeIndex = EditorGUILayout.Popup(m_TrackBindingTypeContent, m_TrackBindingTypeIndex, UsableType.GetGUIContentWithSortingArray(s_TrackBindingTypes));
+            trackBinding = s_TrackBindingTypes[m_TrackBindingTypeIndex];
+        }
+        EditorGUILayout.EndVertical ();
+        
+        bool exposedVariablesNamesValid = true;
+        bool scriptVariablesNamesValid = true;
+        bool allUniqueVariableNames = true;
+        
+        EditorGUILayout.Space();
+        EditorGUILayout.Space();
+
+        if (isStandardBlendPlayable)
+        {
+            StandardBlendPlayablePropertyGUI(oldIndex != m_ComponentBindingTypeIndex || oldStandardBlendPlayable != isStandardBlendPlayable);
+        }
+        else
+        {
+            exposedVariablesNamesValid = VariableListGUI(exposedReferences, s_ExposedReferenceTypes, m_ExposedReferencesContent, "newExposedReference");
+
+            EditorGUILayout.Space();
+            EditorGUILayout.Space();
+
+            scriptVariablesNamesValid = VariableListGUI(playableBehaviourVariables, s_BehaviourVariableTypes, m_BehaviourVariablesContent, "newBehaviourVariable");
+
+            EditorGUILayout.Space();
+            EditorGUILayout.Space();
+
+            allUniqueVariableNames = AllVariablesUniquelyNamed();
+            if (!allUniqueVariableNames)
+            {
+                EditorGUILayout.HelpBox("Your variables to not have unique names.  Make sure all of your Exposed References and Behaviour Variables have unique names.", MessageType.Error);
+            }
+
+            EditorGUILayout.Space();
+            EditorGUILayout.Space();
+
+            ClipCapsGUI();
+        }
+
+        EditorGUILayout.Space();
+        EditorGUILayout.Space();
+
+        /*ClipDefaultsGUI ();
+
+        EditorGUILayout.Space ();
+        EditorGUILayout.Space ();*/
+
+        EditorGUILayout.BeginVertical(GUI.skin.box);
+        if (showHelpBoxes)
+        {
+            EditorGUILayout.HelpBox(m_TrackColorContent.tooltip, MessageType.Info);
+            EditorGUILayout.Space();
+        }
+        trackColor = EditorGUILayout.ColorField(m_TrackColorContent, trackColor);
+        EditorGUILayout.EndVertical ();
+
+        if (!isStandardBlendPlayable)
+        {
+            EditorGUILayout.Space();
+            EditorGUILayout.Space();
+
+            EditorGUILayout.BeginVertical(GUI.skin.box);
+            if (showHelpBoxes)
+            {
+                EditorGUILayout.HelpBox(m_CreateDrawerContent.tooltip, MessageType.Info);
+                EditorGUILayout.Space();
+            }
+            m_CreateDrawer = EditorGUILayout.Toggle(m_CreateDrawerContent, m_CreateDrawer);
+            EditorGUILayout.EndVertical ();
+        }
+
+        EditorGUILayout.Space();
+        EditorGUILayout.Space();
+        
+        if (playableNameNotEmpty && playableNameFormatted && allUniqueVariableNames && exposedVariablesNamesValid && scriptVariablesNamesValid && !playableNameTooLong)
+        {
+            if (GUILayout.Button("Create", GUILayout.Width(60f)))
+            {
+                m_CreateButtonPressed = true;
+
+                for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+                {
+                    standardBlendPlayableProperties[i].CreateSettingDefaultValueString (defaultValuesComponent);
+                }
+
+                m_CreationError = CreateScripts();
+
+                if (m_CreationError == CreationError.NoError)
+                {
+                    Close ();
+                }
+            }
+        }
+
+        EditorGUILayout.Space();
+        EditorGUILayout.Space();
+        
+        if (m_CreateButtonPressed)
+        {
+            switch (m_CreationError)
+            {
+                case CreationError.NoError:
+                    EditorGUILayout.HelpBox ("Playable was successfully created.", MessageType.Info);
+                    break;
+                case CreationError.PlayableAssetAlreadyExists:
+                    EditorGUILayout.HelpBox ("The type " + playableName + k_TimelineClipAssetSuffix + " already exists, no files were created.", MessageType.Error);
+                    break;
+                case CreationError.PlayableBehaviourAlreadyExists:
+                    EditorGUILayout.HelpBox ("The type " + playableName + k_TimelineClipBehaviourSuffix + " already exists, no files were created.", MessageType.Error);
+                    break;
+                case CreationError.PlayableBehaviourMixerAlreadyExists:
+                    EditorGUILayout.HelpBox ("The type " + playableName + k_PlayableBehaviourMixerSuffix + " already exists, no files were created.", MessageType.Error);
+                    break;
+                case CreationError.TrackAssetAlreadyExists:
+                    EditorGUILayout.HelpBox ("The type " + playableName + k_TrackAssetSuffix + " already exists, no files were created.", MessageType.Error);
+                    break;
+                case CreationError.PlayableDrawerAlreadyExists:
+                    EditorGUILayout.HelpBox ("The type " + playableName + k_PropertyDrawerSuffix + " already exists, no files were created.", MessageType.Error);
+                    break;
+            }
+        }
+
+        if (GUILayout.Button ("Reset", GUILayout.Width (60f)))
+        {
+            ResetWindow ();
+        }
+
+        EditorGUILayout.EndScrollView ();
+    }
+
+    void StandardBlendPlayablePropertyGUI (bool findNewProperties)
+    {
+        if (findNewProperties || m_TrackBindingProperties == null && m_TrackBindingFields == null)
+        {
+            m_TrackBindingUsableProperties.Clear ();
+            
+            IEnumerable<PropertyInfo> propertyInfos = trackBinding.type.GetProperties (BindingFlags.Instance | BindingFlags.Public | BindingFlags.SetProperty | BindingFlags.GetProperty);
+            propertyInfos = propertyInfos.Where (x => IsTypeBlendable(x.PropertyType) || IsTypeAssignable(x.PropertyType));
+            propertyInfos = propertyInfos.Where (x => x.CanWrite && x.CanRead);
+            propertyInfos = propertyInfos.Where (x => HasAllowedName (x));
+            // Uncomment the below to stop Obsolete properties being selectable.
+            //propertyInfos = propertyInfos.Where (x => !Attribute.IsDefined (x, typeof(ObsoleteAttribute)));
+            m_TrackBindingProperties = propertyInfos.ToArray();
+            foreach (PropertyInfo trackBindingProperty in m_TrackBindingProperties)
+            {
+                m_TrackBindingUsableProperties.Add (new UsableProperty (trackBindingProperty));
+            }
+            
+            IEnumerable<FieldInfo> fieldInfos = trackBinding.type.GetFields (BindingFlags.Instance | BindingFlags.Public);
+            fieldInfos = fieldInfos.Where(x => IsTypeBlendable(x.FieldType) || IsTypeAssignable(x.FieldType));
+            m_TrackBindingFields = fieldInfos.ToArray ();
+            foreach (FieldInfo trackBindingField in m_TrackBindingFields)
+            {
+                m_TrackBindingUsableProperties.Add (new UsableProperty (trackBindingField));
+            }
+
+            m_TrackBindingUsableProperties = m_TrackBindingUsableProperties.OrderBy (x => x.name).ToList ();
+            standardBlendPlayableProperties.Clear ();
+        }
+
+        EditorGUILayout.BeginVertical (GUI.skin.box);
+
+        if (showHelpBoxes)
+        {
+            EditorGUILayout.HelpBox(m_StandardBlendPlayablePropertiesContent.tooltip, MessageType.Info);
+            EditorGUILayout.Space();
+        }
+
+        EditorGUILayout.LabelField(m_StandardBlendPlayablePropertiesContent);
+
+        int indexToRemove = -1;
+        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+        {
+            if (standardBlendPlayableProperties[i].GUI(m_TrackBindingUsableProperties))
+                indexToRemove = i;
+        }
+        if (indexToRemove != -1)
+            standardBlendPlayableProperties.RemoveAt(indexToRemove);
+
+        if (GUILayout.Button("Add", GUILayout.Width(40f)))
+            standardBlendPlayableProperties.Add(m_TrackBindingUsableProperties[0].GetDuplicate ());
+
+        if (standardBlendPlayableProperties.Any(IsObsolete))
+            EditorGUILayout.HelpBox ("One or more of your chosen properties are marked 'Obsolete'.  Consider changing them to avoid deprecation with future versions of Unity.", MessageType.Warning);
+
+        EditorGUILayout.EndVertical ();
+    }
+
+    static bool IsTypeBlendable (Type type)
+    {
+        for (int i = 0; i < s_BlendableTypes.Length; i++)
+        {
+            if (type == s_BlendableTypes[i])
+                return true;
+        }
+        return false;
+    }
+
+    static bool IsTypeAssignable (Type type)
+    {
+        for (int i = 0; i < s_AssignableTypes.Length; i++)
+        {
+            if (type == s_AssignableTypes[i] || type.IsEnum)
+                return true;
+        }
+        return false;
+    }
+
+    static bool HasAllowedName (PropertyInfo propertyInfo)
+    {
+        for (int i = 0; i < s_DisallowedPropertyNames.Length; i++)
+        {
+            if (propertyInfo.Name == s_DisallowedPropertyNames[i])
+                return false;
+        }
+        return true;
+    }
+
+    static bool IsObsolete (UsableProperty usableProperty)
+    {
+        if (usableProperty.usablePropertyType == UsableProperty.UsablePropertyType.Field)
+            return Attribute.IsDefined (usableProperty.fieldInfo, typeof(ObsoleteAttribute));
+        return Attribute.IsDefined (usableProperty.propertyInfo, typeof(ObsoleteAttribute));
+    }
+
+    bool VariableListGUI (List<Variable> variables, UsableType[] usableTypes, GUIContent guiContent, string newName)
+    {
+        EditorGUILayout.BeginVertical(GUI.skin.box);
+
+        if (showHelpBoxes)
+        {
+            EditorGUILayout.HelpBox(guiContent.tooltip, MessageType.Info);
+            EditorGUILayout.Space();
+        }
+
+        EditorGUILayout.LabelField(guiContent);
+
+        int indexToRemove = -1;
+        bool allNamesValid = true;
+        for (int i = 0; i < variables.Count; i++)
+        {
+            if (variables[i].GUI(usableTypes))
+                indexToRemove = i;
+
+            if (!CodeGenerator.IsValidLanguageIndependentIdentifier(variables[i].name))
+            {
+                allNamesValid = false;
+            }
+        }
+
+        if (indexToRemove != -1)
+            variables.RemoveAt(indexToRemove);
+
+        if (GUILayout.Button("Add", GUILayout.Width(40f)))
+            variables.Add(new Variable(newName, usableTypes[0]));
+
+        if (!allNamesValid)
+            EditorGUILayout.HelpBox("One of the variables has an invalid character, make sure they don't contain any spaces or special characters.", MessageType.Error);
+
+        EditorGUILayout.EndVertical();
+
+        return allNamesValid;
+    }
+
+    bool AllVariablesUniquelyNamed ()
+    {
+        for (int i = 0; i < exposedReferences.Count; i++)
+        {
+            string exposedRefName = exposedReferences[i].name;
+
+            for (int j = 0; j < exposedReferences.Count; j++)
+            {
+                if (i != j && exposedRefName == exposedReferences[j].name)
+                    return false;
+            }
+
+            for (int j = 0; j < playableBehaviourVariables.Count; j++)
+            {
+                if (exposedRefName == playableBehaviourVariables[j].name)
+                    return false;
+            }
+        }
+
+        for (int i = 0; i < playableBehaviourVariables.Count; i++)
+        {
+            string scriptPlayableVariableName = playableBehaviourVariables[i].name;
+
+            for (int j = 0; j < exposedReferences.Count; j++)
+            {
+                if (scriptPlayableVariableName == exposedReferences[j].name)
+                    return false;
+            }
+
+            for (int j = 0; j < playableBehaviourVariables.Count; j++)
+            {
+                if (i != j && scriptPlayableVariableName == playableBehaviourVariables[j].name)
+                    return false;
+            }
+        }
+        return true;
+    }
+
+    void ClipCapsGUI ()
+    {
+        EditorGUILayout.BeginVertical (GUI.skin.box);
+
+        if (showHelpBoxes)
+        {
+            EditorGUILayout.HelpBox(m_ClipCapsContent.tooltip, MessageType.Info);
+            EditorGUILayout.Space();
+        }
+
+        EditorGUILayout.LabelField (m_ClipCapsContent);
+
+        bool isLooping = (clipCaps & ClipCaps.Looping) == ClipCaps.Looping;
+        bool isExtrapolation = (clipCaps & ClipCaps.Extrapolation) == ClipCaps.Extrapolation;
+        bool isClipIn = (clipCaps & ClipCaps.ClipIn) == ClipCaps.ClipIn;
+        bool isSpeedMultiplier = (clipCaps & ClipCaps.SpeedMultiplier) == ClipCaps.SpeedMultiplier;
+        bool isBlending = (clipCaps & ClipCaps.Blending) == ClipCaps.Blending;
+
+        bool isNone = !isLooping && !isExtrapolation && !isClipIn && !isSpeedMultiplier && !isBlending;
+        bool isAll = isLooping && isExtrapolation && isClipIn && isSpeedMultiplier && isBlending;
+
+        EditorGUI.BeginChangeCheck ();
+        isNone = EditorGUILayout.ToggleLeft (m_CCNoneContent, isNone);
+        if (EditorGUI.EndChangeCheck ())
+        {
+            if (isNone)
+            {
+                isLooping = false;
+                isExtrapolation = false;
+                isClipIn = false;
+                isSpeedMultiplier = false;
+                isBlending = false;
+                isAll = false;
+            }
+        }
+
+        EditorGUI.BeginChangeCheck ();
+        isLooping = EditorGUILayout.ToggleLeft (m_CCLoopingContent, isLooping);
+        isExtrapolation = EditorGUILayout.ToggleLeft (m_CCExtrapolationContent, isExtrapolation);
+        isClipIn = EditorGUILayout.ToggleLeft (m_CCClipInContent, isClipIn);
+        isSpeedMultiplier = EditorGUILayout.ToggleLeft (m_CCSpeedMultiplierContent, isSpeedMultiplier);
+        isBlending = EditorGUILayout.ToggleLeft (m_CCBlendingContent, isBlending);
+        if (EditorGUI.EndChangeCheck ())
+        {
+            isNone = !isLooping && !isExtrapolation && !isClipIn && !isSpeedMultiplier && !isBlending;
+            isAll = isLooping && isExtrapolation && isClipIn && isSpeedMultiplier && isBlending;
+        }
+
+        EditorGUI.BeginChangeCheck ();
+        isAll = EditorGUILayout.ToggleLeft (m_CCAllContent, isAll);
+        if (EditorGUI.EndChangeCheck ())
+        {
+            if (isAll)
+            {
+                isNone = false;
+                isLooping = true;
+                isExtrapolation = true;
+                isClipIn = true;
+                isSpeedMultiplier = true;
+                isBlending = true;
+            }
+        }
+
+        EditorGUILayout.EndVertical();
+
+        clipCaps = ClipCaps.None;
+
+        if (isNone)
+            return;
+
+        if (isAll)
+        {
+            clipCaps = ClipCaps.All;
+            return;
+        }
+
+        if (isLooping)
+            clipCaps |= ClipCaps.Looping;
+
+        if (isExtrapolation)
+            clipCaps |= ClipCaps.Extrapolation;
+
+        if (isClipIn)
+            clipCaps |= ClipCaps.ClipIn;
+
+        if (isSpeedMultiplier)
+            clipCaps |= ClipCaps.SpeedMultiplier;
+
+        if (isBlending)
+            clipCaps |= ClipCaps.Blending;
+    }
+
+    /*void ClipDefaultsGUI ()
+    {
+        EditorGUILayout.BeginVertical (GUI.skin.box);
+
+        setClipDefaults = EditorGUILayout.Toggle (m_SetClipDefaultsContent, setClipDefaults);
+
+        if (!setClipDefaults)
+        {
+            EditorGUILayout.EndVertical ();
+            return;
+        }
+
+        if (showHelpBoxes)
+        {
+            EditorGUILayout.HelpBox (m_ClipDefaultsContent.tooltip, MessageType.Info);
+        }
+
+        EditorGUILayout.LabelField (m_ClipDefaultsContent);
+
+        EditorGUILayout.Space ();
+
+        EditorGUILayout.LabelField (m_CDClipTimingContent);
+        EditorGUI.indentLevel++;
+        clipDefaultDurationSeconds = EditorGUILayout.FloatField(m_CDDurationContent, clipDefaultDurationSeconds);
+        
+        EditorGUILayout.Space ();
+        
+        clipDefaultEaseInSeconds = EditorGUILayout.FloatField(m_CDEaseInContent, clipDefaultEaseInSeconds);
+        clipDefaultEaseOutSeconds = EditorGUILayout.FloatField (m_CDEaseOutContent, clipDefaultEaseOutSeconds);
+
+        if (isStandardBlendPlayable)
+        {
+            EditorGUILayout.EndVertical();
+            return;
+        }
+
+        EditorGUILayout.Space();
+        
+        clipDefaultClipInSeconds = EditorGUILayout.FloatField(m_CDClipInContent, clipDefaultClipInSeconds);
+        
+        EditorGUILayout.Space();
+        
+        clipDefaultSpeedMultiplier = EditorGUILayout.FloatField(m_CDSpeedMultiplierContent, clipDefaultSpeedMultiplier);
+        EditorGUI.indentLevel--;
+        
+        EditorGUILayout.EndVertical();
+    }*/
+
+    CreationError CreateScripts ()
+    {
+        if (ScriptAlreadyExists(playableName + k_TimelineClipAssetSuffix))
+            return CreationError.PlayableAssetAlreadyExists;
+
+        if (ScriptAlreadyExists(playableName + k_TimelineClipBehaviourSuffix))
+            return CreationError.PlayableBehaviourAlreadyExists;
+
+        if (ScriptAlreadyExists(playableName + k_PlayableBehaviourMixerSuffix))
+            return CreationError.PlayableBehaviourMixerAlreadyExists;
+
+        if (ScriptAlreadyExists(playableName + k_TrackAssetSuffix))
+            return CreationError.TrackAssetAlreadyExists;
+
+        if (m_CreateDrawer && ScriptAlreadyExists(playableName + k_PropertyDrawerSuffix))
+            return CreationError.PlayableDrawerAlreadyExists;
+
+        AssetDatabase.CreateFolder ("Assets", playableName);
+
+        if (isStandardBlendPlayable)
+        {
+            CreateScript (playableName + k_TimelineClipAssetSuffix, StandardBlendPlayableAsset());
+            CreateScript (playableName + k_TimelineClipBehaviourSuffix, StandardBlendPlayableBehaviour ());
+            CreateScript (playableName + k_PlayableBehaviourMixerSuffix, StandardBlendPlayableBehaviourMixer ());
+            CreateScript (playableName + k_TrackAssetSuffix, StandardBlendTrackAssetScript ());
+
+            AssetDatabase.CreateFolder ("Assets/" + playableName, "Editor");
+
+            string path = Application.dataPath + "/" + playableName + "/Editor/" + playableName + k_PropertyDrawerSuffix + ".cs";
+            using (StreamWriter writer = File.CreateText (path))
+            {
+                writer.Write (StandardBlendPlayableDrawer ());
+            }
+        }
+        else
+        {
+            CreateScript(playableName + k_TimelineClipAssetSuffix, PlayableAsset());
+            CreateScript(playableName + k_TimelineClipBehaviourSuffix, PlayableBehaviour());
+            CreateScript(playableName + k_PlayableBehaviourMixerSuffix, PlayableBehaviourMixer());
+            CreateScript(playableName + k_TrackAssetSuffix, TrackAssetScript());
+
+            if (m_CreateDrawer)
+            {
+                AssetDatabase.CreateFolder("Assets/" + playableName, "Editor");
+
+                string path = Application.dataPath + "/" + playableName + "/Editor/" + playableName + k_PropertyDrawerSuffix + ".cs";
+                using (StreamWriter writer = File.CreateText(path))
+                {
+                    writer.Write(PlayableDrawer());
+                }
+            }
+        }
+
+        AssetDatabase.SaveAssets ();
+        AssetDatabase.Refresh ();
+
+        return CreationError.NoError;
+    }
+
+    static bool ScriptAlreadyExists(string scriptName)
+    {
+        string[] guids = AssetDatabase.FindAssets(scriptName);
+
+        if (guids.Length == 0)
+            return false;
+
+        for (int i = 0; i < guids.Length; i++)
+        {
+            string path = AssetDatabase.GUIDToAssetPath(guids[i]);
+            Type assetType = AssetDatabase.GetMainAssetTypeAtPath(path);
+            if (assetType == typeof(MonoScript))
+                return true;
+        }
+
+        return false;
+    }
+
+    void CreateScript (string fileName, string content)
+    {
+        string path = Application.dataPath + "/" + playableName + "/" + fileName + ".cs";
+        using (StreamWriter writer = File.CreateText (path))
+            writer.Write (content);
+    }
+
+    void ResetWindow ()
+    {
+        playableName = "";
+        isStandardBlendPlayable = false;
+        trackBinding = s_TrackBindingTypes[0];
+        defaultValuesComponent = null;
+        exposedReferences = new List<Variable>();
+        playableBehaviourVariables = new List<Variable>();
+        standardBlendPlayableProperties = new List<UsableProperty>();
+        clipCaps = ClipCaps.None;
+        /*setClipDefaults = false;
+        clipDefaultDurationSeconds = 5f;
+        clipDefaultEaseInSeconds = 0f;
+        clipDefaultEaseOutSeconds = 0f;
+        clipDefaultClipInSeconds = 0f;
+        clipDefaultSpeedMultiplier = 1f;*/
+        trackColor = new Color(0.855f, 0.8623f, 0.870f);
+
+        m_TrackBindingTypeIndex = 0;
+        m_ComponentBindingTypeIndex = 0;
+        m_TrackBindingProperties = null;
+        m_TrackBindingFields = null;
+        m_TrackBindingUsableProperties = null;
+        m_CreateDrawer = false;
+    }
+
+    string TrackAssetScript ()
+    {
+        return 
+            "using UnityEngine;\n" +
+            "using UnityEngine.Playables;\n" +
+            "using UnityEngine.Timeline;\n" +
+            AdditionalNamespacesToString() + 
+            "\n" +
+            "[TrackColor(" + trackColor.r + "f, " + trackColor.g + "f, " + trackColor.b + "f)]\n" +
+            "[TrackClipType(typeof(" + playableName + k_TimelineClipAssetSuffix + "))]\n" +
+            TrackBindingToString () +
+            "public class " + playableName + k_TrackAssetSuffix + " : TrackAsset\n" +
+            "{\n" +
+            k_Tab + "public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)\n" +
+            k_Tab + "{\n" +
+            k_Tab + k_Tab + "return ScriptPlayable<" + playableName + k_PlayableBehaviourMixerSuffix + ">.Create (graph, inputCount);\n" +
+            k_Tab + "}\n" +
+            "}\n";
+    }
+
+    string PlayableAsset ()
+    {
+        return 
+            "using System;\n" +
+            "using UnityEngine;\n" +
+            "using UnityEngine.Playables;\n" +
+            "using UnityEngine.Timeline;\n" +
+            AdditionalNamespacesToString() +
+            "\n" +
+            "[Serializable]\n" +
+            "public class " + playableName + k_TimelineClipAssetSuffix + " : PlayableAsset, ITimelineClipAsset\n" +
+            "{\n" +
+            k_Tab + "public " + playableName + k_TimelineClipBehaviourSuffix + " template = new " + playableName + k_TimelineClipBehaviourSuffix + " ();\n" +
+            ExposedReferencesToString () +
+            "\n" +
+            k_Tab + "public ClipCaps clipCaps\n" +
+            k_Tab + "{\n" +
+            k_Tab + k_Tab + "get { return " + ClipCapsToString () + "; }\n" +
+            k_Tab + "}\n" +
+            "\n" +
+            k_Tab + "public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)\n" +
+            k_Tab + "{\n" +
+            k_Tab + k_Tab + "var playable = ScriptPlayable<" + playableName + k_TimelineClipBehaviourSuffix + ">.Create (graph, template);\n" +
+            ExposedReferencesResolvingToString () +
+            k_Tab + k_Tab + "return playable;\n" +
+            k_Tab + "}\n" +
+            "}\n";
+    }
+
+    string PlayableBehaviour ()
+    {
+        return 
+            "using System;\n" +
+            "using UnityEngine;\n" +
+            "using UnityEngine.Playables;\n" +
+            "using UnityEngine.Timeline;\n" +
+            AdditionalNamespacesToString() +
+            "\n" +
+            "[Serializable]\n" +
+            "public class " + playableName + k_TimelineClipBehaviourSuffix + " : PlayableBehaviour\n" +
+            "{\n" +
+            ExposedReferencesAsScriptVariablesToString () +
+            PlayableBehaviourVariablesToString () +
+            "\n" +
+            k_Tab + "public override void OnPlayableCreate (Playable playable)\n" +
+            k_Tab + "{\n" +
+            k_Tab + k_Tab + "\n" +
+            k_Tab + "}\n" +
+            "}\n";
+    }
+
+    string PlayableBehaviourMixer ()
+    {
+        return 
+            "using System;\n" +
+            "using UnityEngine;\n" +
+            "using UnityEngine.Playables;\n" +
+            "using UnityEngine.Timeline;\n" +
+            AdditionalNamespacesToString() +
+            "\n" +
+            "public class " + playableName + k_PlayableBehaviourMixerSuffix + " : PlayableBehaviour\n" +
+            "{\n" +
+            k_Tab + "// NOTE: This function is called at runtime and edit time.  Keep that in mind when setting the values of properties.\n" +
+            k_Tab + "public override void ProcessFrame(Playable playable, FrameData info, object playerData)\n" +
+            k_Tab + "{\n" +
+            MixerTrackBindingLocalVariableToString () +
+            k_Tab + k_Tab + "int inputCount = playable.GetInputCount ();\n" +
+            "\n" +
+            k_Tab + k_Tab + "for (int i = 0; i < inputCount; i++)\n" +
+            k_Tab + k_Tab + "{\n" +
+            k_Tab + k_Tab + k_Tab + "float inputWeight = playable.GetInputWeight(i);\n" +
+            k_Tab + k_Tab + k_Tab + "ScriptPlayable<" + playableName + k_TimelineClipBehaviourSuffix + "> inputPlayable = (ScriptPlayable<" + playableName + k_TimelineClipBehaviourSuffix + ">)playable.GetInput(i);\n" +
+            k_Tab + k_Tab + k_Tab + playableName + k_TimelineClipBehaviourSuffix + " input = inputPlayable.GetBehaviour ();\n" +
+            k_Tab + k_Tab + k_Tab + "\n" +
+            k_Tab + k_Tab + k_Tab + "// Use the above variables to process each frame of this playable.\n" +
+            k_Tab + k_Tab + k_Tab + "\n" +
+            k_Tab + k_Tab + "}\n" +
+            k_Tab + "}\n" +
+            "}\n";
+    }
+
+    string PlayableDrawer ()
+    {
+        return 
+            "using UnityEditor;\n" +
+            "using UnityEngine;\n" +
+            "\n" +
+            "[CustomPropertyDrawer(typeof(" + playableName + k_TimelineClipBehaviourSuffix + "))]\n" +
+            "public class " + playableName + k_PropertyDrawerSuffix + " : PropertyDrawer\n" +
+            "{\n" +
+            k_Tab + "public override float GetPropertyHeight (SerializedProperty property, GUIContent label)\n" +
+            k_Tab + "{\n" +
+            k_Tab + k_Tab + "int fieldCount = " + playableBehaviourVariables.Count +";\n" +
+            k_Tab + k_Tab + "return fieldCount * EditorGUIUtility.singleLineHeight;\n" +
+            k_Tab + "}\n" +
+            "\n" +
+            k_Tab + "public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)\n" +
+            k_Tab + "{\n" +
+            ScriptVariablesAsSerializedPropAssignmentToString () +
+            "\n" + 
+            k_Tab + k_Tab + "Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);\n" +
+            ScriptVariablesAsSerializedPropGUIToString () +
+            k_Tab + "}\n" +
+            "}\n";
+    }
+
+    string TrackBindingToString ()
+    {
+        if (m_TrackBindingTypeIndex != 0)
+            return "[TrackBindingType(typeof(" + trackBinding.name + "))]\n";
+        return "";
+    }
+
+    string AdditionalNamespacesToString ()
+    {
+        UsableType[] exposedReferenceTypes = Variable.GetUsableTypesFromVariableArray (exposedReferences.ToArray ());
+        UsableType[] behaviourVariableTypes = Variable.GetUsableTypesFromVariableArray (playableBehaviourVariables.ToArray ());
+        UsableType[] allUsedTypes = new UsableType[exposedReferenceTypes.Length + behaviourVariableTypes.Length + 1];
+        for (int i = 0; i < exposedReferenceTypes.Length; i++)
+        {
+            allUsedTypes[i] = exposedReferenceTypes[i];
+        }
+        for (int i = 0; i < behaviourVariableTypes.Length; i++)
+        {
+            allUsedTypes[i + exposedReferenceTypes.Length] = behaviourVariableTypes[i];
+        }
+        allUsedTypes[allUsedTypes.Length - 1] = trackBinding;
+
+        string[] distinctNamespaces = UsableType.GetDistinctAdditionalNamespaces (allUsedTypes).Where (x => !string.IsNullOrEmpty (x)).ToArray ();
+        string returnVal = "";
+        for (int i = 0; i < distinctNamespaces.Length; i++)
+        {
+            returnVal += "using " + distinctNamespaces[i] + ";\n";
+        }
+        return returnVal;
+    }
+
+    string ExposedReferencesToString ()
+    {
+        string expRefText = "";
+        foreach (var expRef in exposedReferences)
+            expRefText += k_Tab + "public ExposedReference<" + expRef.usableType.name + "> " + expRef.name + ";\n";
+        return expRefText;
+    }
+
+    string ExposedReferencesResolvingToString ()
+    {
+        string returnVal = "";
+        returnVal += k_Tab + k_Tab + playableName + k_TimelineClipBehaviourSuffix + " clone = playable.GetBehaviour ();\n";
+        for (int i = 0; i < exposedReferences.Count; i++)
+        {
+            returnVal += k_Tab + k_Tab + "clone." + exposedReferences[i].name + " = " + exposedReferences[i].name + ".Resolve (graph.GetResolver ());\n";
+        }
+        return returnVal;
+    }
+
+    /*string OnCreateFunctionToString ()
+    {
+        if (!setClipDefaults)
+            return "";
+
+        string returnVal = "\n";
+            returnVal += k_Tab + "public override void OnCreate ()\n";
+            returnVal += k_Tab + "{\n";
+            returnVal += k_Tab + k_Tab + "owner.duration = " + clipDefaultDurationSeconds + ";\n";
+            returnVal += k_Tab + k_Tab + "owner.easeInDuration = " + clipDefaultEaseInSeconds + ";\n";
+            returnVal += k_Tab + k_Tab + "owner.easeOutDuration = " + clipDefaultEaseOutSeconds + ";\n";
+            returnVal += k_Tab + k_Tab + "owner.clipIn = " + clipDefaultClipInSeconds + ";\n";
+            returnVal += k_Tab + k_Tab + "owner.timeScale = " + clipDefaultSpeedMultiplier + ";\n";
+            returnVal += k_Tab + "}\n";
+        return returnVal;
+    }*/
+
+    string ClipCapsToString ()
+    {
+        string message = clipCaps.ToString ();
+        string[] splits = message.Split (' ');
+
+        for (int i = 0; i < splits.Length; i++)
+        {
+            if (splits[i][splits[i].Length - 1] == ',')
+                splits[i] = splits[i].Substring (0, splits[i].Length - 1);
+        }
+
+        string returnVal = "";
+
+        for (int i = 0; i < splits.Length; i++)
+        {
+            returnVal += "ClipCaps." + splits[i];
+
+            if (i < splits.Length - 1)
+                returnVal += " | ";
+        }
+
+        return returnVal;
+    }
+
+    string ExposedReferencesAsScriptVariablesToString ()
+    {
+        string returnVal = "";
+        for (int i = 0; i < exposedReferences.Count; i++)
+        {
+            returnVal += k_Tab + "public " + exposedReferences[i].usableType.name + " " + exposedReferences[i].name + ";\n";
+        }
+        return returnVal;
+    }
+
+    string PlayableBehaviourVariablesToString ()
+    {
+        string returnVal = "";
+        for (int i = 0; i < playableBehaviourVariables.Count; i++)
+        {
+            returnVal += k_Tab + "public " + playableBehaviourVariables[i].usableType.name + " " + playableBehaviourVariables[i].name + ";\n";
+        }
+        return returnVal;
+    }
+
+    string MixerTrackBindingLocalVariableToString ()
+    {
+        if (m_TrackBindingTypeIndex != 0)
+            return
+                k_Tab + k_Tab + trackBinding.name + " trackBinding = playerData as " + trackBinding.name + ";\n\n" +
+                k_Tab + k_Tab + "if (!trackBinding)\n" +
+                k_Tab + k_Tab + k_Tab + "return;\n" +
+                "\n";
+        return "";
+    }
+
+    string ScriptVariablesAsSerializedPropAssignmentToString ()
+    {
+        string returnVal = "";
+        for (int i = 0; i < playableBehaviourVariables.Count; i++)
+        {
+            returnVal += k_Tab + k_Tab + "SerializedProperty " + playableBehaviourVariables[i].name + "Prop = property.FindPropertyRelative(\"" + playableBehaviourVariables[i].name + "\");\n";
+        }
+        return returnVal;
+    }
+
+    string ScriptVariablesAsSerializedPropGUIToString ()
+    {
+        string returnVal = "";
+        for (int i = 0; i < playableBehaviourVariables.Count; i++)
+        {
+            returnVal += k_Tab + k_Tab + "EditorGUI.PropertyField(singleFieldRect, " + playableBehaviourVariables[i].name + "Prop);\n";
+
+            if (i < playableBehaviourVariables.Count - 1)
+            {
+                returnVal += "\n";
+                returnVal += k_Tab + k_Tab + "singleFieldRect.y += EditorGUIUtility.singleLineHeight;\n";
+            }
+        }
+        return returnVal;
+    }
+
+    string StandardBlendPlayableAsset ()
+    {
+        return
+            "using System;\n" +
+            "using UnityEngine;\n" +
+            "using UnityEngine.Playables;\n" +
+            "using UnityEngine.Timeline;\n" +
+            "\n" +
+            "[Serializable]\n" +
+            "public class " + playableName + k_TimelineClipAssetSuffix + " : PlayableAsset, ITimelineClipAsset\n" +
+            "{\n" +
+            k_Tab + "public " + playableName + k_TimelineClipBehaviourSuffix + " template = new " + playableName + k_TimelineClipBehaviourSuffix + " ();\n" +
+            "\n" +
+            k_Tab + "public ClipCaps clipCaps\n" +
+            k_Tab + "{\n" +
+            k_Tab + k_Tab + "get { return ClipCaps.Blending; }\n" +
+            k_Tab + "}\n" +
+            "\n" +
+            k_Tab + "public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)\n" +
+            k_Tab + "{\n" +
+            k_Tab + k_Tab + "var playable = ScriptPlayable<" + playableName + k_TimelineClipBehaviourSuffix + ">.Create (graph, template);\n" +
+            k_Tab + k_Tab + "return playable;\n" +
+            k_Tab + "}\n" +
+            "}\n";
+    }
+
+    string StandardBlendPlayableBehaviour ()
+    {
+        return
+            "using System;\n" +
+            "using UnityEngine;\n" +
+            "using UnityEngine.Playables;\n" +
+            "using UnityEngine.Timeline;\n" +
+            AdditionalNamespacesToString() +
+            "\n" +
+            "[Serializable]\n" +
+            "public class " + playableName + k_TimelineClipBehaviourSuffix + " : PlayableBehaviour\n" +
+            "{\n" +
+            StandardBlendScriptPlayablePropertiesToString () +
+            "}\n";
+    }
+
+    string StandardBlendPlayableBehaviourMixer ()
+    {
+        return
+            "using System;\n" +
+            "using UnityEngine;\n" +
+            "using UnityEngine.Playables;\n" +
+            "using UnityEngine.Timeline;\n" +
+            AdditionalNamespacesToString() +
+            "\n" +
+            "public class " + playableName + k_PlayableBehaviourMixerSuffix + " : PlayableBehaviour\n" +
+            "{\n" +
+            StandardBlendTrackBindingPropertiesDefaultsDeclarationToString () +
+            "\n" +
+            StandardBlendTrackBindingPropertiesBlendedDeclarationToString () +
+            "\n" +
+            k_Tab + trackBinding.name + " m_TrackBinding;\n" +
+            "\n" +
+            k_Tab + "public override void ProcessFrame(Playable playable, FrameData info, object playerData)\n" +
+            k_Tab + "{\n" +
+            k_Tab + k_Tab + "m_TrackBinding = playerData as " + trackBinding.name + ";\n" +
+            "\n" +
+            k_Tab + k_Tab + "if (m_TrackBinding == null)\n" +
+            k_Tab + k_Tab + k_Tab + "return;\n" +
+            "\n" +
+            StandardBlendTrackBindingPropertiesDefaultsAssignmentToString () +
+            "\n" +
+            k_Tab + k_Tab + "int inputCount = playable.GetInputCount ();\n" +
+            "\n" +
+            StandardBlendBlendedVariablesCreationToString () +
+            k_Tab + k_Tab + "float totalWeight = 0f;\n" +
+            k_Tab + k_Tab + "float greatestWeight = 0f;\n" +
+            StandardBlendPlayableCurrentInputsDeclarationToString () +
+            "\n" +
+            k_Tab + k_Tab + "for (int i = 0; i < inputCount; i++)\n" +
+            k_Tab + k_Tab + "{\n" +
+            k_Tab + k_Tab + k_Tab + "float inputWeight = playable.GetInputWeight(i);\n" +
+            k_Tab + k_Tab + k_Tab + "ScriptPlayable<" + playableName + k_TimelineClipBehaviourSuffix + "> inputPlayable = (ScriptPlayable<" + playableName + k_TimelineClipBehaviourSuffix + ">)playable.GetInput(i);\n" +
+            k_Tab + k_Tab + k_Tab + playableName + k_TimelineClipBehaviourSuffix + " input = inputPlayable.GetBehaviour ();\n" +
+            k_Tab + k_Tab + k_Tab + "\n" +
+            StandardBlendBlendedVariablesWeightedIncrementationToString () +
+            k_Tab + k_Tab + k_Tab + "totalWeight += inputWeight;\n" +
+            "\n" +
+            StandardBlendAssignableVariablesAssignedBasedOnGreatestWeightToString () +
+            StandardBlendPlayableCurrentInputIterationToString () + 
+            k_Tab + k_Tab + "}\n" +
+            StandardBlendTrackBindingPropertiesBlendedAssignmentToString () +
+            StandardBlendTrackBindingPropertiesAssignableAssignmentToString () +
+            k_Tab + "}\n" +
+            "}\n";
+    }
+
+    string StandardBlendTrackAssetScript ()
+    {
+        return
+            "using UnityEngine;\n" +
+            "using UnityEngine.Playables;\n" +
+            "using UnityEngine.Timeline;\n" +
+            "using System.Collections.Generic;\n" +
+            AdditionalNamespacesToString() +
+            "\n" +
+            "[TrackColor(" + trackColor.r + "f, " + trackColor.g + "f, " + trackColor.b + "f)]\n" +
+            "[TrackClipType(typeof(" + playableName + k_TimelineClipAssetSuffix + "))]\n" +
+            StandardBlendComponentBindingToString () +
+            "public class " + playableName + k_TrackAssetSuffix + " : TrackAsset\n" +
+            "{\n" +
+            k_Tab + "public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)\n" +
+            k_Tab + "{\n" +
+            k_Tab + k_Tab + "return ScriptPlayable<" + playableName + k_PlayableBehaviourMixerSuffix + ">.Create (graph, inputCount);\n" +
+            k_Tab + "}\n" +
+            "\n" +
+            k_Tab + "// Please note this assumes only one component of type " + trackBinding.name + " on the same gameobject.\n" +
+            k_Tab + "public override void GatherProperties (PlayableDirector director, IPropertyCollector driver)\n" +
+            k_Tab + "{\n" +
+            "#if UNITY_EDITOR\n" +
+            k_Tab + k_Tab + trackBinding.name + " trackBinding = director.GetGenericBinding(this) as " + trackBinding.name + ";\n" +
+            k_Tab + k_Tab + "if (trackBinding == null)\n" +
+            k_Tab + k_Tab + k_Tab + "return;\n" +
+            "\n" +
+            //k_Tab + k_Tab + "var serializedObject = new UnityEditor.SerializedObject (trackBinding);\n" +
+            //k_Tab + k_Tab + "var iterator = serializedObject.GetIterator();\n" +
+            //k_Tab + k_Tab + "while (iterator.NextVisible(true))\n" +
+            //k_Tab + k_Tab + "{\n" +
+            //k_Tab + k_Tab + k_Tab + "if (iterator.hasVisibleChildren)\n" +
+            //k_Tab + k_Tab + k_Tab + k_Tab + "continue;\n" +
+            //"\n" +
+            //k_Tab + k_Tab + k_Tab + "driver.AddFromName<" + trackBinding.name + ">(trackBinding.gameObject, iterator.propertyPath);\n" +
+            //k_Tab + k_Tab + "}\n" +
+            StandardBlendPropertiesAssignedToPropertyDriverToString () +
+            "#endif\n" +
+            k_Tab + k_Tab + "base.GatherProperties (director, driver);\n" +
+            k_Tab + "}\n" +
+            "}\n";
+    }
+    
+    string StandardBlendPlayableDrawer ()
+    {
+        return
+            "using UnityEditor;\n" +
+            "using UnityEngine;\n" +
+            "using UnityEngine.Playables;\n" +
+            AdditionalNamespacesToString() +
+            "\n" +
+            "[CustomPropertyDrawer(typeof(" + playableName + k_TimelineClipBehaviourSuffix + "))]\n" +
+            "public class " + playableName + k_PropertyDrawerSuffix + " : PropertyDrawer\n" +
+            "{\n" +
+            k_Tab + "public override float GetPropertyHeight (SerializedProperty property, GUIContent label)\n" +
+            k_Tab + "{\n" +
+            k_Tab + k_Tab + "int fieldCount = " + standardBlendPlayableProperties.Count + ";\n" +
+            k_Tab + k_Tab + "return fieldCount * EditorGUIUtility.singleLineHeight;\n" +
+            k_Tab + "}\n" +
+            "\n" +
+            k_Tab + "public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)\n" +
+            k_Tab + "{\n" +
+            StandardBlendTrackBindingPropertiesAsSerializedPropsDeclarationToString () +
+            "\n" +
+            k_Tab + k_Tab + "Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);\n" +
+            StandardBlendSerializedPropertyGUIToString () +
+            k_Tab + "}\n" +
+            "}\n";
+    }
+    
+    string StandardBlendScriptPlayablePropertiesToString ()
+    {
+        string returnVal = "";
+        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+        {
+            UsableProperty prop = standardBlendPlayableProperties[i];
+            if(prop.defaultValue == "")
+                returnVal += k_Tab + "public " + prop.type + " " + prop.name + ";\n";
+            else
+            {
+                returnVal += k_Tab + "public " + prop.type + " " + prop.name + " = " + prop.defaultValue + ";\n";
+            }
+        }
+        return returnVal;
+    }
+
+    string StandardBlendTrackBindingPropertiesDefaultsDeclarationToString ()
+    {
+        string returnVal = "";
+        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+        {
+            UsableProperty prop = standardBlendPlayableProperties[i];
+            returnVal += k_Tab + prop.type + " " + prop.NameAsPrivateDefault + ";\n";
+        }
+        return returnVal;
+    }
+
+    string StandardBlendTrackBindingPropertiesBlendedDeclarationToString ()
+    {
+        string returnVal = "";
+        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+        {
+            UsableProperty prop = standardBlendPlayableProperties[i];
+            
+            returnVal += k_Tab + prop.type + " " + prop.NameAsPrivateAssigned + ";\n";
+        }
+        return returnVal;
+    }
+
+    string StandardBlendTrackBindingPropertiesDefaultsAssignmentToString ()
+    {
+        string returnVal = "";
+        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+        {
+            UsableProperty prop = standardBlendPlayableProperties[i];
+
+            switch (prop.type)
+            {
+                case "float":
+                    returnVal += k_Tab + k_Tab + "if (!Mathf.Approximately(m_TrackBinding." + prop.name + ", " + prop.NameAsPrivateAssigned + "))\n";
+                    returnVal += k_Tab + k_Tab + k_Tab + prop.NameAsPrivateDefault + " = m_TrackBinding." + prop.name + ";\n";
+                    break;
+                case "double":
+                    returnVal += k_Tab + k_Tab + "if (!Mathf.Approximately((float)m_TrackBinding." + prop.name + ", (float)" + prop.NameAsPrivateAssigned + "))\n";
+                    returnVal += k_Tab + k_Tab + k_Tab + prop.NameAsPrivateDefault + " = m_TrackBinding." + prop.name + ";\n";
+                    break;
+                default:
+                    returnVal += k_Tab + k_Tab + "if (m_TrackBinding." + prop.name + " != " + prop.NameAsPrivateAssigned + ")\n";
+                    returnVal += k_Tab + k_Tab + k_Tab + prop.NameAsPrivateDefault + " = m_TrackBinding." + prop.name + ";\n";
+                    break;
+            }
+        }
+        return returnVal;
+    }
+
+    string StandardBlendBlendedVariablesCreationToString ()
+    {
+        string returnVal = "";
+        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+        {
+            UsableProperty prop = standardBlendPlayableProperties[i];
+            
+            if(prop.usability != UsableProperty.Usability.Blendable)
+                continue;
+            
+            string type = prop.type == "int" ? "float" : prop.type;
+            string zeroVal = prop.type == "int" ? "0f" : prop.ZeroValueAsString ();
+            returnVal += k_Tab + k_Tab + type + " " + prop.NameAsLocalBlended + " = " + zeroVal + ";\n";
+        }
+        return returnVal;
+    }
+
+    string StandardBlendPlayableCurrentInputsDeclarationToString ()
+    {
+        if (standardBlendPlayableProperties.Any (x => x.usability == UsableProperty.Usability.Assignable))
+        {
+            return k_Tab + k_Tab + "int currentInputs = 0;\n";
+        }
+        return "";
+    }
+
+    string StandardBlendBlendedVariablesWeightedIncrementationToString ()
+    {
+        string returnVal = "";
+        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+        {
+            UsableProperty prop = standardBlendPlayableProperties[i];
+            
+            if (prop.usability == UsableProperty.Usability.Blendable)
+                returnVal += k_Tab + k_Tab + k_Tab + prop.NameAsLocalBlended + " += input." + prop.name + " * inputWeight;\n";
+            
+        }
+        return returnVal;
+    }
+
+    string StandardBlendAssignableVariablesAssignedBasedOnGreatestWeightToString ()
+    {
+        if (standardBlendPlayableProperties.Count == 0)
+            return "";
+
+        string returnVal = k_Tab + k_Tab + k_Tab + "if (inputWeight > greatestWeight)\n";
+        returnVal += k_Tab + k_Tab + k_Tab + "{\n";
+        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+        {
+            UsableProperty prop = standardBlendPlayableProperties[i];
+            if (prop.usability == UsableProperty.Usability.Assignable)
+            {
+                returnVal += k_Tab + k_Tab + k_Tab + k_Tab + prop.NameAsPrivateAssigned + " = input." + prop.name + ";\n";
+                returnVal += k_Tab + k_Tab + k_Tab + k_Tab + "m_TrackBinding." + prop.name + " = " + prop.NameAsPrivateAssigned + ";\n";
+            }
+        }
+        returnVal += k_Tab + k_Tab + k_Tab + k_Tab + "greatestWeight = inputWeight;\n";
+        returnVal += k_Tab + k_Tab + k_Tab + "}\n";
+        return returnVal;
+    }
+
+    string StandardBlendPlayableCurrentInputIterationToString ()
+    {
+        if (standardBlendPlayableProperties.Any (x => x.usability == UsableProperty.Usability.Assignable))
+        {
+            string returnVal = "\n";
+            returnVal += k_Tab + k_Tab + k_Tab + "if (!Mathf.Approximately (inputWeight, 0f))\n";
+            returnVal += k_Tab + k_Tab + k_Tab + k_Tab + "currentInputs++;\n";
+            return returnVal;
+        }
+        return "";
+    }
+
+    string StandardBlendTrackBindingPropertiesBlendedAssignmentToString ()
+    {
+        string returnVal = "";
+        bool firstNewLine = false;
+        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+        {
+            UsableProperty prop = standardBlendPlayableProperties[i];
+            if (prop.usability != UsableProperty.Usability.Blendable)
+                continue;
+
+            if (!firstNewLine)
+            {
+                firstNewLine = true;
+                returnVal += "\n";
+            }
+            
+            if (prop.type == "int")
+                returnVal += k_Tab + k_Tab + prop.NameAsPrivateAssigned + " = Mathf.RoundToInt (" + prop.NameAsLocalBlended + " + " + prop.NameAsPrivateDefault + " * (1f - totalWeight));\n";
+            else
+                returnVal += k_Tab + k_Tab + prop.NameAsPrivateAssigned + " = " + prop.NameAsLocalBlended + " + " + prop.NameAsPrivateDefault + " * (1f - totalWeight);\n";
+
+            returnVal += k_Tab + k_Tab + "m_TrackBinding." + prop.name + " = " + prop.NameAsPrivateAssigned + ";\n";
+        }
+        return returnVal;
+    }
+
+    string StandardBlendTrackBindingPropertiesAssignableAssignmentToString ()
+    {
+        if (standardBlendPlayableProperties.Count == 0)
+            return "";
+
+        if (standardBlendPlayableProperties.Any (x => x.usability == UsableProperty.Usability.Assignable))
+        {
+            string returnVal = "\n" + k_Tab + k_Tab + "if (currentInputs != 1 && 1f - totalWeight > greatestWeight)\n";
+            returnVal += k_Tab + k_Tab + "{\n";
+            for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+            {
+                UsableProperty prop = standardBlendPlayableProperties[i];
+                if (prop.usability != UsableProperty.Usability.Assignable)
+                    continue;
+
+                returnVal += k_Tab + k_Tab + k_Tab + "m_TrackBinding." + prop.name + " = " + prop.NameAsPrivateDefault + ";\n";
+            }
+            returnVal += k_Tab + k_Tab + "}\n";
+            return returnVal;
+        }
+
+        return "";
+    }
+
+    string StandardBlendComponentBindingToString ()
+    {
+        return "[TrackBindingType(typeof(" + trackBinding.name + "))]\n";
+    }
+
+    string StandardBlendPropertiesAssignedToPropertyDriverToString ()
+    {
+        if (standardBlendPlayableProperties.Count == 0)
+            return "";
+
+        string returnVal = k_Tab + k_Tab + "// These field names are procedurally generated estimations based on the associated property names.\n";
+        returnVal += k_Tab + k_Tab + "// If any of the names are incorrect you will get a DrivenPropertyManager error saying it has failed to register the name.\n";
+        returnVal += k_Tab + k_Tab + "// In this case you will need to find the correct backing field name.\n";
+        returnVal += k_Tab + k_Tab + "// The suggested way of finding the field name is to:\n";
+        returnVal += k_Tab + k_Tab + "// 1. Make sure your scene is serialized to text.\n";
+        returnVal += k_Tab + k_Tab + "// 2. Search the text for the track binding component type.\n";
+        returnVal += k_Tab + k_Tab + "// 3. Look through the field names until you see one that looks correct.\n";
+
+        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+        {
+            UsableProperty prop = standardBlendPlayableProperties[i];
+
+            if (prop.usablePropertyType == UsableProperty.UsablePropertyType.Field)
+            {
+                returnVal += k_Tab + k_Tab + "driver.AddFromName<" + trackBinding.name + ">(trackBinding.gameObject, \"" + prop.name + "\");\n";
+            }
+            else
+            {
+                returnVal += k_Tab + k_Tab + "driver.AddFromName<" + trackBinding.name + ">(trackBinding.gameObject, \"" + prop.NameAsPrivate + "\");\n";
+            }
+        }
+
+        return returnVal;
+    }
+
+    string StandardBlendTrackBindingPropertiesAsSerializedPropsDeclarationToString ()
+    {
+        string returnVal = "";
+        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+        {
+            UsableProperty prop = standardBlendPlayableProperties[i];
+            returnVal += k_Tab + k_Tab + "SerializedProperty " + prop.NameAsLocalSerializedProperty + " = property.FindPropertyRelative(\"" + prop.name + "\");\n";
+        }
+        return returnVal;
+    }
+
+    string StandardBlendSerializedPropertyGUIToString ()
+    {
+        string returnVal = "";
+        for (int i = 0; i < standardBlendPlayableProperties.Count; i++)
+        {
+            if (i != 0)
+            {
+                returnVal += "\n";
+                returnVal += k_Tab + k_Tab + "singleFieldRect.y += EditorGUIUtility.singleLineHeight;\n";
+            }
+
+            returnVal += k_Tab + k_Tab + "EditorGUI.PropertyField(singleFieldRect, " + standardBlendPlayableProperties[i].NameAsLocalSerializedProperty + ");\n";
+        }
+        return returnVal;
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/Editor/TimelinePlayableWizard.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 01cfeabdfa5f36740b2b9c9658bbb29e
-timeCreated: 1490191896
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 01cfeabdfa5f36740b2b9c9658bbb29e
+timeCreated: 1490191896
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 33 - 33
Assets/DefaultPlayables/LightControl/Editor/LightControlDrawer.cs

@@ -1,33 +1,33 @@
-using UnityEditor;
-using UnityEngine;
-using UnityEngine.Playables;
-
-[CustomPropertyDrawer(typeof(LightControlBehaviour))]
-public class LightControlDrawer : PropertyDrawer
-{
-    public override float GetPropertyHeight (SerializedProperty property, GUIContent label)
-    {
-        int fieldCount = 4;
-        return fieldCount * EditorGUIUtility.singleLineHeight;
-    }
-
-    public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
-    {
-        SerializedProperty colorProp = property.FindPropertyRelative("color");
-        SerializedProperty intensityProp = property.FindPropertyRelative("intensity");
-        SerializedProperty bounceIntensityProp = property.FindPropertyRelative("bounceIntensity");
-        SerializedProperty rangeProp = property.FindPropertyRelative("range");
-
-        Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
-        EditorGUI.PropertyField(singleFieldRect, colorProp);
-        
-        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
-        EditorGUI.PropertyField(singleFieldRect, intensityProp);
-        
-        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
-        EditorGUI.PropertyField(singleFieldRect, bounceIntensityProp);
-        
-        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
-        EditorGUI.PropertyField(singleFieldRect, rangeProp);
-    }
-}
+using UnityEditor;
+using UnityEngine;
+using UnityEngine.Playables;
+
+[CustomPropertyDrawer(typeof(LightControlBehaviour))]
+public class LightControlDrawer : PropertyDrawer
+{
+    public override float GetPropertyHeight (SerializedProperty property, GUIContent label)
+    {
+        int fieldCount = 4;
+        return fieldCount * EditorGUIUtility.singleLineHeight;
+    }
+
+    public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
+    {
+        SerializedProperty colorProp = property.FindPropertyRelative("color");
+        SerializedProperty intensityProp = property.FindPropertyRelative("intensity");
+        SerializedProperty bounceIntensityProp = property.FindPropertyRelative("bounceIntensity");
+        SerializedProperty rangeProp = property.FindPropertyRelative("range");
+
+        Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
+        EditorGUI.PropertyField(singleFieldRect, colorProp);
+        
+        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
+        EditorGUI.PropertyField(singleFieldRect, intensityProp);
+        
+        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
+        EditorGUI.PropertyField(singleFieldRect, bounceIntensityProp);
+        
+        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
+        EditorGUI.PropertyField(singleFieldRect, rangeProp);
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/LightControl/Editor/LightControlDrawer.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: a217f65052ddf094ba45e737b2428b1c
-timeCreated: 1496915002
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: a217f65052ddf094ba45e737b2428b1c
+timeCreated: 1496915002
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 13 - 13
Assets/DefaultPlayables/LightControl/LightControlBehaviour.cs

@@ -1,13 +1,13 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-[Serializable]
-public class LightControlBehaviour : PlayableBehaviour
-{
-    public Color color = Color.white;
-    public float intensity = 1f;
-    public float bounceIntensity = 1f;
-    public float range = 10f;
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+[Serializable]
+public class LightControlBehaviour : PlayableBehaviour
+{
+    public Color color = Color.white;
+    public float intensity = 1f;
+    public float bounceIntensity = 1f;
+    public float range = 10f;
+}

+ 12 - 12
Assets/DefaultPlayables/LightControl/LightControlBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 7e7c747bf1731824682c539494feba37
-timeCreated: 1496915002
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 7e7c747bf1731824682c539494feba37
+timeCreated: 1496915002
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 20 - 20
Assets/DefaultPlayables/LightControl/LightControlClip.cs

@@ -1,20 +1,20 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-[Serializable]
-public class LightControlClip : PlayableAsset, ITimelineClipAsset
-{
-    public LightControlBehaviour template = new LightControlBehaviour ();
-
-    public ClipCaps clipCaps
-    {
-        get { return ClipCaps.Blending; }
-    }
-
-    public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
-    {
-        var playable = ScriptPlayable<LightControlBehaviour>.Create (graph, template);
-        return playable;    }
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+[Serializable]
+public class LightControlClip : PlayableAsset, ITimelineClipAsset
+{
+    public LightControlBehaviour template = new LightControlBehaviour ();
+
+    public ClipCaps clipCaps
+    {
+        get { return ClipCaps.Blending; }
+    }
+
+    public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
+    {
+        var playable = ScriptPlayable<LightControlBehaviour>.Create (graph, template);
+        return playable;    }
+}

+ 12 - 12
Assets/DefaultPlayables/LightControl/LightControlClip.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 23b46759ef7b0fd4bb74d73bf4d2839b
-timeCreated: 1496915002
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 23b46759ef7b0fd4bb74d73bf4d2839b
+timeCreated: 1496915002
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 81 - 81
Assets/DefaultPlayables/LightControl/LightControlMixerBehaviour.cs

@@ -1,81 +1,81 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-public class LightControlMixerBehaviour : PlayableBehaviour
-{
-    Color m_DefaultColor;
-    float m_DefaultIntensity;
-    float m_DefaultBounceIntensity;
-    float m_DefaultRange;
-
-    Light m_TrackBinding;
-    bool m_FirstFrameHappened;
-
-    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
-    {
-        m_TrackBinding = playerData as Light;
-
-        if (m_TrackBinding == null)
-            return;
-
-        if (!m_FirstFrameHappened)
-        {
-            m_DefaultColor = m_TrackBinding.color;
-            m_DefaultIntensity = m_TrackBinding.intensity;
-            m_DefaultBounceIntensity = m_TrackBinding.bounceIntensity;
-            m_DefaultRange = m_TrackBinding.range;
-            m_FirstFrameHappened = true;
-        }
-
-        int inputCount = playable.GetInputCount ();
-
-        Color blendedColor = Color.clear;
-        float blendedIntensity = 0f;
-        float blendedBounceIntensity = 0f;
-        float blendedRange = 0f;
-        float totalWeight = 0f;
-        float greatestWeight = 0f;
-        int currentInputs = 0;
-
-        for (int i = 0; i < inputCount; i++)
-        {
-            float inputWeight = playable.GetInputWeight(i);
-            ScriptPlayable<LightControlBehaviour> inputPlayable = (ScriptPlayable<LightControlBehaviour>)playable.GetInput(i);
-            LightControlBehaviour input = inputPlayable.GetBehaviour ();
-            
-            blendedColor += input.color * inputWeight;
-            blendedIntensity += input.intensity * inputWeight;
-            blendedBounceIntensity += input.bounceIntensity * inputWeight;
-            blendedRange += input.range * inputWeight;
-            totalWeight += inputWeight;
-
-            if (inputWeight > greatestWeight)
-            {
-                greatestWeight = inputWeight;
-            }
-
-            if (!Mathf.Approximately (inputWeight, 0f))
-                currentInputs++;
-        }
-
-        m_TrackBinding.color = blendedColor + m_DefaultColor * (1f - totalWeight);
-        m_TrackBinding.intensity = blendedIntensity + m_DefaultIntensity * (1f - totalWeight);
-        m_TrackBinding.bounceIntensity = blendedBounceIntensity + m_DefaultBounceIntensity * (1f - totalWeight);
-        m_TrackBinding.range = blendedRange + m_DefaultRange * (1f - totalWeight);
-    }
-
-    public override void OnPlayableDestroy (Playable playable)
-    {
-        m_FirstFrameHappened = false;
-
-        if(m_TrackBinding == null)
-            return;
-
-        m_TrackBinding.color = m_DefaultColor;
-        m_TrackBinding.intensity = m_DefaultIntensity;
-        m_TrackBinding.bounceIntensity = m_DefaultBounceIntensity;
-        m_TrackBinding.range = m_DefaultRange;
-    }
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+public class LightControlMixerBehaviour : PlayableBehaviour
+{
+    Color m_DefaultColor;
+    float m_DefaultIntensity;
+    float m_DefaultBounceIntensity;
+    float m_DefaultRange;
+
+    Light m_TrackBinding;
+    bool m_FirstFrameHappened;
+
+    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
+    {
+        m_TrackBinding = playerData as Light;
+
+        if (m_TrackBinding == null)
+            return;
+
+        if (!m_FirstFrameHappened)
+        {
+            m_DefaultColor = m_TrackBinding.color;
+            m_DefaultIntensity = m_TrackBinding.intensity;
+            m_DefaultBounceIntensity = m_TrackBinding.bounceIntensity;
+            m_DefaultRange = m_TrackBinding.range;
+            m_FirstFrameHappened = true;
+        }
+
+        int inputCount = playable.GetInputCount ();
+
+        Color blendedColor = Color.clear;
+        float blendedIntensity = 0f;
+        float blendedBounceIntensity = 0f;
+        float blendedRange = 0f;
+        float totalWeight = 0f;
+        float greatestWeight = 0f;
+        int currentInputs = 0;
+
+        for (int i = 0; i < inputCount; i++)
+        {
+            float inputWeight = playable.GetInputWeight(i);
+            ScriptPlayable<LightControlBehaviour> inputPlayable = (ScriptPlayable<LightControlBehaviour>)playable.GetInput(i);
+            LightControlBehaviour input = inputPlayable.GetBehaviour ();
+            
+            blendedColor += input.color * inputWeight;
+            blendedIntensity += input.intensity * inputWeight;
+            blendedBounceIntensity += input.bounceIntensity * inputWeight;
+            blendedRange += input.range * inputWeight;
+            totalWeight += inputWeight;
+
+            if (inputWeight > greatestWeight)
+            {
+                greatestWeight = inputWeight;
+            }
+
+            if (!Mathf.Approximately (inputWeight, 0f))
+                currentInputs++;
+        }
+
+        m_TrackBinding.color = blendedColor + m_DefaultColor * (1f - totalWeight);
+        m_TrackBinding.intensity = blendedIntensity + m_DefaultIntensity * (1f - totalWeight);
+        m_TrackBinding.bounceIntensity = blendedBounceIntensity + m_DefaultBounceIntensity * (1f - totalWeight);
+        m_TrackBinding.range = blendedRange + m_DefaultRange * (1f - totalWeight);
+    }
+
+    public override void OnPlayableDestroy (Playable playable)
+    {
+        m_FirstFrameHappened = false;
+
+        if(m_TrackBinding == null)
+            return;
+
+        m_TrackBinding.color = m_DefaultColor;
+        m_TrackBinding.intensity = m_DefaultIntensity;
+        m_TrackBinding.bounceIntensity = m_DefaultBounceIntensity;
+        m_TrackBinding.range = m_DefaultRange;
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/LightControl/LightControlMixerBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: b6ddd7db188548f49bf8d55102e62b63
-timeCreated: 1496915002
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: b6ddd7db188548f49bf8d55102e62b63
+timeCreated: 1496915002
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 29 - 29
Assets/DefaultPlayables/LightControl/LightControlTrack.cs

@@ -1,29 +1,29 @@
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-using System.Collections.Generic;
-
-[TrackColor(0.9454092f, 0.9779412f, 0.3883002f)]
-[TrackClipType(typeof(LightControlClip))]
-[TrackBindingType(typeof(Light))]
-public class LightControlTrack : TrackAsset
-{
-    public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
-    {
-        return ScriptPlayable<LightControlMixerBehaviour>.Create (graph, inputCount);
-    }
-
-    public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
-    {
-#if UNITY_EDITOR
-       Light trackBinding = director.GetGenericBinding(this) as Light;
-       if (trackBinding == null)
-           return;
-       driver.AddFromName<Light>(trackBinding.gameObject, "m_Color");
-       driver.AddFromName<Light>(trackBinding.gameObject, "m_Intensity");
-       driver.AddFromName<Light>(trackBinding.gameObject, "m_Range");
-       driver.AddFromName<Light>(trackBinding.gameObject, "m_BounceIntensity");
-#endif
-        base.GatherProperties(director, driver);
-    }
-}
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+using System.Collections.Generic;
+
+[TrackColor(0.9454092f, 0.9779412f, 0.3883002f)]
+[TrackClipType(typeof(LightControlClip))]
+[TrackBindingType(typeof(Light))]
+public class LightControlTrack : TrackAsset
+{
+    public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
+    {
+        return ScriptPlayable<LightControlMixerBehaviour>.Create (graph, inputCount);
+    }
+
+    public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
+    {
+#if UNITY_EDITOR
+       Light trackBinding = director.GetGenericBinding(this) as Light;
+       if (trackBinding == null)
+           return;
+       driver.AddFromName<Light>(trackBinding.gameObject, "m_Color");
+       driver.AddFromName<Light>(trackBinding.gameObject, "m_Intensity");
+       driver.AddFromName<Light>(trackBinding.gameObject, "m_Range");
+       driver.AddFromName<Light>(trackBinding.gameObject, "m_BounceIntensity");
+#endif
+        base.GatherProperties(director, driver);
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/LightControl/LightControlTrack.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: e97b7684a1a63ed42afa5e89e962140f
-timeCreated: 1496915002
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: e97b7684a1a63ed42afa5e89e962140f
+timeCreated: 1496915002
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 16 - 16
Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlBehaviour.cs

@@ -1,16 +1,16 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-[Serializable]
-public class NavMeshAgentControlBehaviour : PlayableBehaviour
-{
-    public Transform destination;
-    public bool destinationSet;
-
-    public override void OnPlayableCreate (Playable playable)
-    {
-        destinationSet = false;
-    }
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+[Serializable]
+public class NavMeshAgentControlBehaviour : PlayableBehaviour
+{
+    public Transform destination;
+    public bool destinationSet;
+
+    public override void OnPlayableCreate (Playable playable)
+    {
+        destinationSet = false;
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 05bbdc6a3b254694e8d1e2d9d55cd256
-timeCreated: 1492603101
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 05bbdc6a3b254694e8d1e2d9d55cd256
+timeCreated: 1492603101
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 25 - 25
Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlClip.cs

@@ -1,25 +1,25 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-[Serializable]
-public class NavMeshAgentControlClip : PlayableAsset, ITimelineClipAsset
-{
-    public ExposedReference<Transform> destination;
-    [HideInInspector]
-    public NavMeshAgentControlBehaviour template = new NavMeshAgentControlBehaviour ();
-
-    public ClipCaps clipCaps
-    {
-        get { return ClipCaps.None; }
-    }
-
-    public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
-    {
-        var playable = ScriptPlayable<NavMeshAgentControlBehaviour>.Create (graph, template);
-        NavMeshAgentControlBehaviour clone = playable.GetBehaviour ();
-        clone.destination = destination.Resolve (graph.GetResolver ());
-        return playable;
-    }
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+[Serializable]
+public class NavMeshAgentControlClip : PlayableAsset, ITimelineClipAsset
+{
+    public ExposedReference<Transform> destination;
+    [HideInInspector]
+    public NavMeshAgentControlBehaviour template = new NavMeshAgentControlBehaviour ();
+
+    public ClipCaps clipCaps
+    {
+        get { return ClipCaps.None; }
+    }
+
+    public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
+    {
+        var playable = ScriptPlayable<NavMeshAgentControlBehaviour>.Create (graph, template);
+        NavMeshAgentControlBehaviour clone = playable.GetBehaviour ();
+        clone.destination = destination.Resolve (graph.GetResolver ());
+        return playable;
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlClip.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: cfedc374dca69334db907af09ba5c404
-timeCreated: 1492603101
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: cfedc374dca69334db907af09ba5c404
+timeCreated: 1492603101
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 34 - 34
Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlMixerBehaviour.cs

@@ -1,34 +1,34 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-using UnityEngine.AI;
-
-public class NavMeshAgentControlMixerBehaviour : PlayableBehaviour
-{
-    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
-    {
-        NavMeshAgent trackBinding = playerData as NavMeshAgent;
-
-        if (!trackBinding)
-            return;
-
-        int inputCount = playable.GetInputCount();
-
-        for (int i = 0; i < inputCount; i++)
-        {
-            float inputWeight = playable.GetInputWeight(i);
-            ScriptPlayable<NavMeshAgentControlBehaviour> inputPlayable = (ScriptPlayable<NavMeshAgentControlBehaviour>)playable.GetInput(i);
-            NavMeshAgentControlBehaviour input = inputPlayable.GetBehaviour();
-
-            if (inputWeight > 0.5f && !input.destinationSet && input.destination)
-            {
-                if (!trackBinding.isOnNavMesh)
-                    continue;
-
-                trackBinding.SetDestination (input.destination.position);
-                input.destinationSet = true;
-            }
-        }
-    }
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+using UnityEngine.AI;
+
+public class NavMeshAgentControlMixerBehaviour : PlayableBehaviour
+{
+    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
+    {
+        NavMeshAgent trackBinding = playerData as NavMeshAgent;
+
+        if (!trackBinding)
+            return;
+
+        int inputCount = playable.GetInputCount();
+
+        for (int i = 0; i < inputCount; i++)
+        {
+            float inputWeight = playable.GetInputWeight(i);
+            ScriptPlayable<NavMeshAgentControlBehaviour> inputPlayable = (ScriptPlayable<NavMeshAgentControlBehaviour>)playable.GetInput(i);
+            NavMeshAgentControlBehaviour input = inputPlayable.GetBehaviour();
+
+            if (inputWeight > 0.5f && !input.destinationSet && input.destination)
+            {
+                if (!trackBinding.isOnNavMesh)
+                    continue;
+
+                trackBinding.SetDestination (input.destination.position);
+                input.destinationSet = true;
+            }
+        }
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlMixerBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: a3805dde487857b41b2fff7d26f06f1e
-timeCreated: 1492603101
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: a3805dde487857b41b2fff7d26f06f1e
+timeCreated: 1492603101
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 15 - 15
Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlTrack.cs

@@ -1,15 +1,15 @@
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-using UnityEngine.AI;
-
-[TrackColor(0.855f, 0.8623f, 0.87f)]
-[TrackClipType(typeof(NavMeshAgentControlClip))]
-[TrackBindingType(typeof(NavMeshAgent))]
-public class NavMeshAgentControlTrack : TrackAsset
-{
-    public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
-    {
-        return ScriptPlayable<NavMeshAgentControlMixerBehaviour>.Create (graph, inputCount);
-    }
-}
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+using UnityEngine.AI;
+
+[TrackColor(0.855f, 0.8623f, 0.87f)]
+[TrackClipType(typeof(NavMeshAgentControlClip))]
+[TrackBindingType(typeof(NavMeshAgent))]
+public class NavMeshAgentControlTrack : TrackAsset
+{
+    public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
+    {
+        return ScriptPlayable<NavMeshAgentControlMixerBehaviour>.Create (graph, inputCount);
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlTrack.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: d201ca921ed322e418c25df03740a308
-timeCreated: 1492603101
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: d201ca921ed322e418c25df03740a308
+timeCreated: 1492603101
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 22 - 22
Assets/DefaultPlayables/ScreenFader/Editor/ScreenFaderDrawer.cs

@@ -1,22 +1,22 @@
-using UnityEditor;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.UI;
-
-[CustomPropertyDrawer(typeof(ScreenFaderBehaviour))]
-public class ScreenFaderDrawer : PropertyDrawer
-{
-    public override float GetPropertyHeight (SerializedProperty property, GUIContent label)
-    {
-        int fieldCount = 1;
-        return fieldCount * EditorGUIUtility.singleLineHeight;
-    }
-
-    public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
-    {
-        SerializedProperty colorProp = property.FindPropertyRelative("color");
-
-        Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
-        EditorGUI.PropertyField(singleFieldRect, colorProp);
-    }
-}
+using UnityEditor;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.UI;
+
+[CustomPropertyDrawer(typeof(ScreenFaderBehaviour))]
+public class ScreenFaderDrawer : PropertyDrawer
+{
+    public override float GetPropertyHeight (SerializedProperty property, GUIContent label)
+    {
+        int fieldCount = 1;
+        return fieldCount * EditorGUIUtility.singleLineHeight;
+    }
+
+    public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
+    {
+        SerializedProperty colorProp = property.FindPropertyRelative("color");
+
+        Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
+        EditorGUI.PropertyField(singleFieldRect, colorProp);
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/ScreenFader/Editor/ScreenFaderDrawer.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 7075b31fb4bae504f8480419ce90246f
-timeCreated: 1496916563
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 7075b31fb4bae504f8480419ce90246f
+timeCreated: 1496916563
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 11 - 11
Assets/DefaultPlayables/ScreenFader/ScreenFaderBehaviour.cs

@@ -1,11 +1,11 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-using UnityEngine.UI;
-
-[Serializable]
-public class ScreenFaderBehaviour : PlayableBehaviour
-{
-    public Color color = Color.black;
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+using UnityEngine.UI;
+
+[Serializable]
+public class ScreenFaderBehaviour : PlayableBehaviour
+{
+    public Color color = Color.black;
+}

+ 12 - 12
Assets/DefaultPlayables/ScreenFader/ScreenFaderBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 4cf88cabc4dadeb4fafeefdbc61869ca
-timeCreated: 1496916563
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 4cf88cabc4dadeb4fafeefdbc61869ca
+timeCreated: 1496916563
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 20 - 20
Assets/DefaultPlayables/ScreenFader/ScreenFaderClip.cs

@@ -1,20 +1,20 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-[Serializable]
-public class ScreenFaderClip : PlayableAsset, ITimelineClipAsset
-{
-    public ScreenFaderBehaviour template = new ScreenFaderBehaviour ();
-
-    public ClipCaps clipCaps
-    {
-        get { return ClipCaps.Blending; }
-    }
-
-    public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
-    {
-        var playable = ScriptPlayable<ScreenFaderBehaviour>.Create (graph, template);
-        return playable;    }
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+[Serializable]
+public class ScreenFaderClip : PlayableAsset, ITimelineClipAsset
+{
+    public ScreenFaderBehaviour template = new ScreenFaderBehaviour ();
+
+    public ClipCaps clipCaps
+    {
+        get { return ClipCaps.Blending; }
+    }
+
+    public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
+    {
+        var playable = ScriptPlayable<ScreenFaderBehaviour>.Create (graph, template);
+        return playable;    }
+}

+ 12 - 12
Assets/DefaultPlayables/ScreenFader/ScreenFaderClip.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 0445258a5c40b364ab21547784905327
-timeCreated: 1496916563
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 0445258a5c40b364ab21547784905327
+timeCreated: 1496916563
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 64 - 64
Assets/DefaultPlayables/ScreenFader/ScreenFaderMixerBehaviour.cs

@@ -1,64 +1,64 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-using UnityEngine.UI;
-
-public class ScreenFaderMixerBehaviour : PlayableBehaviour
-{
-    Color m_DefaultColor;
-
-    Image m_TrackBinding;
-    bool m_FirstFrameHappened;
-
-    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
-    {
-        m_TrackBinding = playerData as Image;
-
-        if (m_TrackBinding == null)
-            return;
-
-        if (!m_FirstFrameHappened)
-        {
-            m_DefaultColor = m_TrackBinding.color;
-            m_FirstFrameHappened = true;
-        }
-
-        int inputCount = playable.GetInputCount ();
-
-        Color blendedColor = Color.clear;
-        float totalWeight = 0f;
-        float greatestWeight = 0f;
-        int currentInputs = 0;
-
-        for (int i = 0; i < inputCount; i++)
-        {
-            float inputWeight = playable.GetInputWeight(i);
-            ScriptPlayable<ScreenFaderBehaviour> inputPlayable = (ScriptPlayable<ScreenFaderBehaviour>)playable.GetInput(i);
-            ScreenFaderBehaviour input = inputPlayable.GetBehaviour ();
-            
-            blendedColor += input.color * inputWeight;
-            totalWeight += inputWeight;
-
-            if (inputWeight > greatestWeight)
-            {
-                greatestWeight = inputWeight;
-            }
-
-            if (!Mathf.Approximately (inputWeight, 0f))
-                currentInputs++;
-        }
-
-        m_TrackBinding.color = blendedColor + m_DefaultColor * (1f - totalWeight);
-    }
-
-    public override void OnPlayableDestroy (Playable playable)
-    {
-        m_FirstFrameHappened = false;
-
-        if (m_TrackBinding == null)
-            return;
-
-        m_TrackBinding.color = m_DefaultColor;
-    }
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+using UnityEngine.UI;
+
+public class ScreenFaderMixerBehaviour : PlayableBehaviour
+{
+    Color m_DefaultColor;
+
+    Image m_TrackBinding;
+    bool m_FirstFrameHappened;
+
+    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
+    {
+        m_TrackBinding = playerData as Image;
+
+        if (m_TrackBinding == null)
+            return;
+
+        if (!m_FirstFrameHappened)
+        {
+            m_DefaultColor = m_TrackBinding.color;
+            m_FirstFrameHappened = true;
+        }
+
+        int inputCount = playable.GetInputCount ();
+
+        Color blendedColor = Color.clear;
+        float totalWeight = 0f;
+        float greatestWeight = 0f;
+        int currentInputs = 0;
+
+        for (int i = 0; i < inputCount; i++)
+        {
+            float inputWeight = playable.GetInputWeight(i);
+            ScriptPlayable<ScreenFaderBehaviour> inputPlayable = (ScriptPlayable<ScreenFaderBehaviour>)playable.GetInput(i);
+            ScreenFaderBehaviour input = inputPlayable.GetBehaviour ();
+            
+            blendedColor += input.color * inputWeight;
+            totalWeight += inputWeight;
+
+            if (inputWeight > greatestWeight)
+            {
+                greatestWeight = inputWeight;
+            }
+
+            if (!Mathf.Approximately (inputWeight, 0f))
+                currentInputs++;
+        }
+
+        m_TrackBinding.color = blendedColor + m_DefaultColor * (1f - totalWeight);
+    }
+
+    public override void OnPlayableDestroy (Playable playable)
+    {
+        m_FirstFrameHappened = false;
+
+        if (m_TrackBinding == null)
+            return;
+
+        m_TrackBinding.color = m_DefaultColor;
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/ScreenFader/ScreenFaderMixerBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 88173aff48b4ccb429d83dca32d03a86
-timeCreated: 1496916563
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 88173aff48b4ccb429d83dca32d03a86
+timeCreated: 1496916563
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 36 - 36
Assets/DefaultPlayables/ScreenFader/ScreenFaderTrack.cs

@@ -1,36 +1,36 @@
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-using System.Collections.Generic;
-using UnityEngine.UI;
-
-[TrackColor(0.875f, 0.5944853f, 0.1737132f)]
-[TrackClipType(typeof(ScreenFaderClip))]
-[TrackBindingType(typeof(Image))]
-public class ScreenFaderTrack : TrackAsset
-{
-    public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
-    {
-        return ScriptPlayable<ScreenFaderMixerBehaviour>.Create (graph, inputCount);
-    }
-
-    public override void GatherProperties (PlayableDirector director, IPropertyCollector driver)
-    {
-#if UNITY_EDITOR
-        Image trackBinding = director.GetGenericBinding(this) as Image;
-        if (trackBinding == null)
-            return;
-
-        var serializedObject = new UnityEditor.SerializedObject (trackBinding);
-        var iterator = serializedObject.GetIterator();
-        while (iterator.NextVisible(true))
-        {
-            if (iterator.hasVisibleChildren)
-                continue;
-
-            driver.AddFromName<Image>(trackBinding.gameObject, iterator.propertyPath);
-        }
-#endif
-        base.GatherProperties (director, driver);
-    }
-}
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+using System.Collections.Generic;
+using UnityEngine.UI;
+
+[TrackColor(0.875f, 0.5944853f, 0.1737132f)]
+[TrackClipType(typeof(ScreenFaderClip))]
+[TrackBindingType(typeof(Image))]
+public class ScreenFaderTrack : TrackAsset
+{
+    public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
+    {
+        return ScriptPlayable<ScreenFaderMixerBehaviour>.Create (graph, inputCount);
+    }
+
+    public override void GatherProperties (PlayableDirector director, IPropertyCollector driver)
+    {
+#if UNITY_EDITOR
+        Image trackBinding = director.GetGenericBinding(this) as Image;
+        if (trackBinding == null)
+            return;
+
+        var serializedObject = new UnityEditor.SerializedObject (trackBinding);
+        var iterator = serializedObject.GetIterator();
+        while (iterator.NextVisible(true))
+        {
+            if (iterator.hasVisibleChildren)
+                continue;
+
+            driver.AddFromName<Image>(trackBinding.gameObject, iterator.propertyPath);
+        }
+#endif
+        base.GatherProperties (director, driver);
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/ScreenFader/ScreenFaderTrack.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 6a8190b9dc143d64ab3322e49af85f7b
-timeCreated: 1496916563
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 6a8190b9dc143d64ab3322e49af85f7b
+timeCreated: 1496916563
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 30 - 30
Assets/DefaultPlayables/TextSwitcher/Editor/TextSwitcherDrawer.cs

@@ -1,30 +1,30 @@
-using UnityEditor;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.UI;
-
-[CustomPropertyDrawer(typeof(TextSwitcherBehaviour))]
-public class TextSwitcherDrawer : PropertyDrawer
-{
-    public override float GetPropertyHeight (SerializedProperty property, GUIContent label)
-    {
-        int fieldCount = 3;
-        return fieldCount * EditorGUIUtility.singleLineHeight;
-    }
-
-    public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
-    {
-        SerializedProperty colorProp = property.FindPropertyRelative("color");
-        SerializedProperty fontSizeProp = property.FindPropertyRelative("fontSize");
-        SerializedProperty textProp = property.FindPropertyRelative("text");
-
-        Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
-        EditorGUI.PropertyField(singleFieldRect, colorProp);
-
-        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
-        EditorGUI.PropertyField(singleFieldRect, fontSizeProp);
-
-        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
-        EditorGUI.PropertyField(singleFieldRect, textProp);
-    }
-}
+using UnityEditor;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.UI;
+
+[CustomPropertyDrawer(typeof(TextSwitcherBehaviour))]
+public class TextSwitcherDrawer : PropertyDrawer
+{
+    public override float GetPropertyHeight (SerializedProperty property, GUIContent label)
+    {
+        int fieldCount = 3;
+        return fieldCount * EditorGUIUtility.singleLineHeight;
+    }
+
+    public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
+    {
+        SerializedProperty colorProp = property.FindPropertyRelative("color");
+        SerializedProperty fontSizeProp = property.FindPropertyRelative("fontSize");
+        SerializedProperty textProp = property.FindPropertyRelative("text");
+
+        Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
+        EditorGUI.PropertyField(singleFieldRect, colorProp);
+
+        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
+        EditorGUI.PropertyField(singleFieldRect, fontSizeProp);
+
+        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
+        EditorGUI.PropertyField(singleFieldRect, textProp);
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/TextSwitcher/Editor/TextSwitcherDrawer.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: d10fec9d6fdea024293153308aa74ef7
-timeCreated: 1496915579
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: d10fec9d6fdea024293153308aa74ef7
+timeCreated: 1496915579
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 13 - 13
Assets/DefaultPlayables/TextSwitcher/TextSwitcherBehaviour.cs

@@ -1,13 +1,13 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-using UnityEngine.UI;
-
-[Serializable]
-public class TextSwitcherBehaviour : PlayableBehaviour
-{
-    public Color color = Color.white;
-    public int fontSize = 14;
-    public string text;
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+using UnityEngine.UI;
+
+[Serializable]
+public class TextSwitcherBehaviour : PlayableBehaviour
+{
+    public Color color = Color.white;
+    public int fontSize = 14;
+    public string text;
+}

+ 12 - 12
Assets/DefaultPlayables/TextSwitcher/TextSwitcherBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 6480896635305a7418e42ec32d3c64d3
-timeCreated: 1496915579
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 6480896635305a7418e42ec32d3c64d3
+timeCreated: 1496915579
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 20 - 20
Assets/DefaultPlayables/TextSwitcher/TextSwitcherClip.cs

@@ -1,20 +1,20 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-[Serializable]
-public class TextSwitcherClip : PlayableAsset, ITimelineClipAsset
-{
-    public TextSwitcherBehaviour template = new TextSwitcherBehaviour ();
-
-    public ClipCaps clipCaps
-    {
-        get { return ClipCaps.Blending; }
-    }
-
-    public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
-    {
-        var playable = ScriptPlayable<TextSwitcherBehaviour>.Create (graph, template);
-        return playable;    }
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+[Serializable]
+public class TextSwitcherClip : PlayableAsset, ITimelineClipAsset
+{
+    public TextSwitcherBehaviour template = new TextSwitcherBehaviour ();
+
+    public ClipCaps clipCaps
+    {
+        get { return ClipCaps.Blending; }
+    }
+
+    public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
+    {
+        var playable = ScriptPlayable<TextSwitcherBehaviour>.Create (graph, template);
+        return playable;    }
+}

+ 12 - 12
Assets/DefaultPlayables/TextSwitcher/TextSwitcherClip.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: d4d683f551d33a84db12bb6fa65573f9
-timeCreated: 1496915579
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: d4d683f551d33a84db12bb6fa65573f9
+timeCreated: 1496915579
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 78 - 78
Assets/DefaultPlayables/TextSwitcher/TextSwitcherMixerBehaviour.cs

@@ -1,78 +1,78 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-using UnityEngine.UI;
-
-public class TextSwitcherMixerBehaviour : PlayableBehaviour
-{
-    Color m_DefaultColor;
-    int m_DefaultFontSize;
-    string m_DefaultText;
-
-    Text m_TrackBinding;
-    bool m_FirstFrameHappened;
-
-    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
-    {
-        m_TrackBinding = playerData as Text;
-
-        if (m_TrackBinding == null)
-            return;
-
-        if (!m_FirstFrameHappened)
-        {
-            m_DefaultColor = m_TrackBinding.color;
-            m_DefaultFontSize = m_TrackBinding.fontSize;
-            m_DefaultText = m_TrackBinding.text;
-            m_FirstFrameHappened = true;
-        }
-
-        int inputCount = playable.GetInputCount ();
-
-        Color blendedColor = Color.clear;
-        float blendedFontSize = 0f;
-        float totalWeight = 0f;
-        float greatestWeight = 0f;
-        int currentInputs = 0;
-
-        for (int i = 0; i < inputCount; i++)
-        {
-            float inputWeight = playable.GetInputWeight(i);
-            ScriptPlayable<TextSwitcherBehaviour> inputPlayable = (ScriptPlayable<TextSwitcherBehaviour>)playable.GetInput(i);
-            TextSwitcherBehaviour input = inputPlayable.GetBehaviour ();
-            
-            blendedColor += input.color * inputWeight;
-            blendedFontSize += input.fontSize * inputWeight;
-            totalWeight += inputWeight;
-
-            if (inputWeight > greatestWeight)
-            {
-                m_TrackBinding.text = input.text;
-                greatestWeight = inputWeight;
-            }
-
-            if (!Mathf.Approximately (inputWeight, 0f))
-                currentInputs++;
-        }
-
-        m_TrackBinding.color = blendedColor + m_DefaultColor * (1f - totalWeight);
-        m_TrackBinding.fontSize = Mathf.RoundToInt (blendedFontSize + m_DefaultFontSize * (1f - totalWeight));
-        if (currentInputs != 1 && 1f - totalWeight > greatestWeight)
-        {
-            m_TrackBinding.text = m_DefaultText;
-        }
-    }
-
-    public override void OnPlayableDestroy (Playable playable)
-    {
-        m_FirstFrameHappened = false;
-
-        if (m_TrackBinding == null)
-            return;
-
-        m_TrackBinding.color = m_DefaultColor;
-        m_TrackBinding.fontSize = m_DefaultFontSize;
-        m_TrackBinding.text = m_DefaultText;
-    }
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+using UnityEngine.UI;
+
+public class TextSwitcherMixerBehaviour : PlayableBehaviour
+{
+    Color m_DefaultColor;
+    int m_DefaultFontSize;
+    string m_DefaultText;
+
+    Text m_TrackBinding;
+    bool m_FirstFrameHappened;
+
+    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
+    {
+        m_TrackBinding = playerData as Text;
+
+        if (m_TrackBinding == null)
+            return;
+
+        if (!m_FirstFrameHappened)
+        {
+            m_DefaultColor = m_TrackBinding.color;
+            m_DefaultFontSize = m_TrackBinding.fontSize;
+            m_DefaultText = m_TrackBinding.text;
+            m_FirstFrameHappened = true;
+        }
+
+        int inputCount = playable.GetInputCount ();
+
+        Color blendedColor = Color.clear;
+        float blendedFontSize = 0f;
+        float totalWeight = 0f;
+        float greatestWeight = 0f;
+        int currentInputs = 0;
+
+        for (int i = 0; i < inputCount; i++)
+        {
+            float inputWeight = playable.GetInputWeight(i);
+            ScriptPlayable<TextSwitcherBehaviour> inputPlayable = (ScriptPlayable<TextSwitcherBehaviour>)playable.GetInput(i);
+            TextSwitcherBehaviour input = inputPlayable.GetBehaviour ();
+            
+            blendedColor += input.color * inputWeight;
+            blendedFontSize += input.fontSize * inputWeight;
+            totalWeight += inputWeight;
+
+            if (inputWeight > greatestWeight)
+            {
+                m_TrackBinding.text = input.text;
+                greatestWeight = inputWeight;
+            }
+
+            if (!Mathf.Approximately (inputWeight, 0f))
+                currentInputs++;
+        }
+
+        m_TrackBinding.color = blendedColor + m_DefaultColor * (1f - totalWeight);
+        m_TrackBinding.fontSize = Mathf.RoundToInt (blendedFontSize + m_DefaultFontSize * (1f - totalWeight));
+        if (currentInputs != 1 && 1f - totalWeight > greatestWeight)
+        {
+            m_TrackBinding.text = m_DefaultText;
+        }
+    }
+
+    public override void OnPlayableDestroy (Playable playable)
+    {
+        m_FirstFrameHappened = false;
+
+        if (m_TrackBinding == null)
+            return;
+
+        m_TrackBinding.color = m_DefaultColor;
+        m_TrackBinding.fontSize = m_DefaultFontSize;
+        m_TrackBinding.text = m_DefaultText;
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/TextSwitcher/TextSwitcherMixerBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 8a4266a3acde3c24e995780329819997
-timeCreated: 1496915579
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 8a4266a3acde3c24e995780329819997
+timeCreated: 1496915579
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 36 - 36
Assets/DefaultPlayables/TextSwitcher/TextSwitcherTrack.cs

@@ -1,36 +1,36 @@
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-using System.Collections.Generic;
-using UnityEngine.UI;
-
-[TrackColor(0.1394896f, 0.4411765f, 0.3413077f)]
-[TrackClipType(typeof(TextSwitcherClip))]
-[TrackBindingType(typeof(Text))]
-public class TextSwitcherTrack : TrackAsset
-{
-    public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
-    {
-        return ScriptPlayable<TextSwitcherMixerBehaviour>.Create (graph, inputCount);
-    }
-
-    public override void GatherProperties (PlayableDirector director, IPropertyCollector driver)
-    {
-#if UNITY_EDITOR
-        Text trackBinding = director.GetGenericBinding(this) as Text;
-        if (trackBinding == null)
-            return;
-
-        var serializedObject = new UnityEditor.SerializedObject (trackBinding);
-        var iterator = serializedObject.GetIterator();
-        while (iterator.NextVisible(true))
-        {
-            if (iterator.hasVisibleChildren)
-                continue;
-
-            driver.AddFromName<Text>(trackBinding.gameObject, iterator.propertyPath);
-        }
-#endif
-        base.GatherProperties (director, driver);
-    }
-}
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+using System.Collections.Generic;
+using UnityEngine.UI;
+
+[TrackColor(0.1394896f, 0.4411765f, 0.3413077f)]
+[TrackClipType(typeof(TextSwitcherClip))]
+[TrackBindingType(typeof(Text))]
+public class TextSwitcherTrack : TrackAsset
+{
+    public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
+    {
+        return ScriptPlayable<TextSwitcherMixerBehaviour>.Create (graph, inputCount);
+    }
+
+    public override void GatherProperties (PlayableDirector director, IPropertyCollector driver)
+    {
+#if UNITY_EDITOR
+        Text trackBinding = director.GetGenericBinding(this) as Text;
+        if (trackBinding == null)
+            return;
+
+        var serializedObject = new UnityEditor.SerializedObject (trackBinding);
+        var iterator = serializedObject.GetIterator();
+        while (iterator.NextVisible(true))
+        {
+            if (iterator.hasVisibleChildren)
+                continue;
+
+            driver.AddFromName<Text>(trackBinding.gameObject, iterator.propertyPath);
+        }
+#endif
+        base.GatherProperties (director, driver);
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/TextSwitcher/TextSwitcherTrack.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 73211584ea373f3409e0a7a83d711aef
-timeCreated: 1496915579
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 73211584ea373f3409e0a7a83d711aef
+timeCreated: 1496915579
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 20 - 20
Assets/DefaultPlayables/TimeDilation/Editor/TimeDilationDrawer.cs

@@ -1,20 +1,20 @@
-using UnityEditor;
-using UnityEngine;
-
-[CustomPropertyDrawer(typeof(TimeDilationBehaviour))]
-public class TimeDilationDrawer : PropertyDrawer
-{
-    public override float GetPropertyHeight (SerializedProperty property, GUIContent label)
-    {
-        int fieldCount = 1;
-        return fieldCount * EditorGUIUtility.singleLineHeight;
-    }
-
-    public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
-    {
-        SerializedProperty timeScaleProp = property.FindPropertyRelative("timeScale");
-
-        Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
-        EditorGUI.PropertyField(singleFieldRect, timeScaleProp);
-    }
-}
+using UnityEditor;
+using UnityEngine;
+
+[CustomPropertyDrawer(typeof(TimeDilationBehaviour))]
+public class TimeDilationDrawer : PropertyDrawer
+{
+    public override float GetPropertyHeight (SerializedProperty property, GUIContent label)
+    {
+        int fieldCount = 1;
+        return fieldCount * EditorGUIUtility.singleLineHeight;
+    }
+
+    public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
+    {
+        SerializedProperty timeScaleProp = property.FindPropertyRelative("timeScale");
+
+        Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
+        EditorGUI.PropertyField(singleFieldRect, timeScaleProp);
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/TimeDilation/Editor/TimeDilationDrawer.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 96853521ef6ea974d96cf7ef72f7c6a7
-timeCreated: 1491318587
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 96853521ef6ea974d96cf7ef72f7c6a7
+timeCreated: 1491318587
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 10 - 10
Assets/DefaultPlayables/TimeDilation/TimeDilationBehaviour.cs

@@ -1,10 +1,10 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-[Serializable]
-public class TimeDilationBehaviour : PlayableBehaviour
-{
-    public float timeScale = 1f;
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+[Serializable]
+public class TimeDilationBehaviour : PlayableBehaviour
+{
+    public float timeScale = 1f;
+}

+ 12 - 12
Assets/DefaultPlayables/TimeDilation/TimeDilationBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: a0b944926d9e8514d892737116110502
-timeCreated: 1491318587
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: a0b944926d9e8514d892737116110502
+timeCreated: 1491318587
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 21 - 21
Assets/DefaultPlayables/TimeDilation/TimeDilationClip.cs

@@ -1,21 +1,21 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-[Serializable]
-public class TimeDilationClip : PlayableAsset, ITimelineClipAsset
-{
-    public TimeDilationBehaviour template = new TimeDilationBehaviour ();
-
-    public ClipCaps clipCaps
-    {
-        get { return ClipCaps.Extrapolation | ClipCaps.Blending; }
-    }
-
-    public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
-    {
-        var playable = ScriptPlayable<TimeDilationBehaviour>.Create (graph, template);
-        return playable;
-    }
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+[Serializable]
+public class TimeDilationClip : PlayableAsset, ITimelineClipAsset
+{
+    public TimeDilationBehaviour template = new TimeDilationBehaviour ();
+
+    public ClipCaps clipCaps
+    {
+        get { return ClipCaps.Extrapolation | ClipCaps.Blending; }
+    }
+
+    public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
+    {
+        var playable = ScriptPlayable<TimeDilationBehaviour>.Create (graph, template);
+        return playable;
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/TimeDilation/TimeDilationClip.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: eed9a3f59ff436340b05ff8248f0d998
-timeCreated: 1491318587
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: eed9a3f59ff436340b05ff8248f0d998
+timeCreated: 1491318587
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 41 - 41
Assets/DefaultPlayables/TimeDilation/TimeDilationMixerBehaviour.cs

@@ -1,41 +1,41 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-public class TimeDilationMixerBehaviour : PlayableBehaviour
-{
-    float m_OldTimeScale = 1f;
-
-    public override void OnPlayableCreate (Playable playable)
-    {
-        m_OldTimeScale = Time.timeScale;
-    }
-
-    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
-    {
-        int inputCount = playable.GetInputCount ();
-
-        float mixedTimeScale = 0f;
-        float totalWeight = 0f;
-
-        for (int i = 0; i < inputCount; i++)
-        {
-            float inputWeight = playable.GetInputWeight(i);
-
-            totalWeight += inputWeight;
-
-            ScriptPlayable<TimeDilationBehaviour> playableInput = (ScriptPlayable<TimeDilationBehaviour>)playable.GetInput (i);
-            TimeDilationBehaviour input = playableInput.GetBehaviour ();
-
-            mixedTimeScale += inputWeight * input.timeScale;
-        }
-
-        Time.timeScale = mixedTimeScale + m_OldTimeScale * (1f - totalWeight);
-    }
-
-    public override void OnPlayableDestroy (Playable playable)
-    {
-        Time.timeScale = m_OldTimeScale;
-    }
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+public class TimeDilationMixerBehaviour : PlayableBehaviour
+{
+    float m_OldTimeScale = 1f;
+
+    public override void OnPlayableCreate (Playable playable)
+    {
+        m_OldTimeScale = Time.timeScale;
+    }
+
+    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
+    {
+        int inputCount = playable.GetInputCount ();
+
+        float mixedTimeScale = 0f;
+        float totalWeight = 0f;
+
+        for (int i = 0; i < inputCount; i++)
+        {
+            float inputWeight = playable.GetInputWeight(i);
+
+            totalWeight += inputWeight;
+
+            ScriptPlayable<TimeDilationBehaviour> playableInput = (ScriptPlayable<TimeDilationBehaviour>)playable.GetInput (i);
+            TimeDilationBehaviour input = playableInput.GetBehaviour ();
+
+            mixedTimeScale += inputWeight * input.timeScale;
+        }
+
+        Time.timeScale = mixedTimeScale + m_OldTimeScale * (1f - totalWeight);
+    }
+
+    public override void OnPlayableDestroy (Playable playable)
+    {
+        Time.timeScale = m_OldTimeScale;
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/TimeDilation/TimeDilationMixerBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 64af3ceaf545d3341b852718827f2b64
-timeCreated: 1491318587
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 64af3ceaf545d3341b852718827f2b64
+timeCreated: 1491318587
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 13 - 13
Assets/DefaultPlayables/TimeDilation/TimeDilationTrack.cs

@@ -1,13 +1,13 @@
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-[TrackColor(0.855f, 0.8623f, 0.87f)]
-[TrackClipType(typeof(TimeDilationClip))]
-public class TimeDilationTrack : TrackAsset
-{
-    public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
-    {
-        return ScriptPlayable<TimeDilationMixerBehaviour>.Create (graph, inputCount);
-    }
-}
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+[TrackColor(0.855f, 0.8623f, 0.87f)]
+[TrackClipType(typeof(TimeDilationClip))]
+public class TimeDilationTrack : TrackAsset
+{
+    public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
+    {
+        return ScriptPlayable<TimeDilationMixerBehaviour>.Create (graph, inputCount);
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/TimeDilation/TimeDilationTrack.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 0282fd402247fd34eb165b280236e58a
-timeCreated: 1491318587
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 0282fd402247fd34eb165b280236e58a
+timeCreated: 1491318587
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 44 - 44
Assets/DefaultPlayables/TransformTween/Editor/TransformTweenDrawer.cs

@@ -1,44 +1,44 @@
-using UnityEngine;
-using UnityEditor;
-
-[CustomPropertyDrawer(typeof(TransformTweenBehaviour))]
-public class TransformTweenDrawer : PropertyDrawer
-{
-    GUIContent m_TweenPositionContent = new GUIContent("Tween Position", "This should be true if the transformToMove to change position.  This causes recalulations each frame which are more CPU intensive.");
-    GUIContent m_TweenRotationContent = new GUIContent("Tween Rotation", "This should be true if the transformToMove to change rotation.");
-    GUIContent m_TweenTypeContent = new GUIContent("Tween Type", "Linear - the transform moves the same amount each frame (assuming static start and end locations).\n"
-        + "Deceleration - the transform moves slower the closer to the end location it is.\n"
-        + "Harmonic - the transform moves faster in the middle of its tween.\n"
-        + "Custom - uses the customStartingSpeed and customEndingSpeed to create a curve for the desired tween.");
-    GUIContent m_CustomCurveContent = new GUIContent("Custom Curve", "This should be a normalised curve (between 0,0 and 1,1) that represents how the tweening object accelerates at different points along the clip.");
-
-    public override float GetPropertyHeight (SerializedProperty property, GUIContent label)
-    {
-        int fieldCount = property.FindPropertyRelative ("tweenType").enumValueIndex == (int)TransformTweenBehaviour.TweenType.Custom ? 5 : 3;
-        return fieldCount * (EditorGUIUtility.singleLineHeight);
-    }
-
-    public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
-    {
-        SerializedProperty tweenPositionProp = property.FindPropertyRelative ("tweenPosition");
-        SerializedProperty tweenRotationProp = property.FindPropertyRelative("tweenRotation");
-        SerializedProperty tweenTypeProp = property.FindPropertyRelative ("tweenType");
-        
-        Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
-        EditorGUI.PropertyField (singleFieldRect, tweenPositionProp, m_TweenPositionContent);
-        
-        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
-        EditorGUI.PropertyField (singleFieldRect, tweenRotationProp, m_TweenRotationContent);
-
-        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
-        EditorGUI.PropertyField(singleFieldRect, tweenTypeProp, m_TweenTypeContent);
-
-        if (tweenTypeProp.enumValueIndex == (int)TransformTweenBehaviour.TweenType.Custom)
-        {
-            SerializedProperty customCurveProp = property.FindPropertyRelative ("customCurve");
-            
-            singleFieldRect.y += EditorGUIUtility.singleLineHeight;
-            EditorGUI.PropertyField (singleFieldRect, customCurveProp, m_CustomCurveContent);
-        }
-    }
-}
+using UnityEngine;
+using UnityEditor;
+
+[CustomPropertyDrawer(typeof(TransformTweenBehaviour))]
+public class TransformTweenDrawer : PropertyDrawer
+{
+    GUIContent m_TweenPositionContent = new GUIContent("Tween Position", "This should be true if the transformToMove to change position.  This causes recalulations each frame which are more CPU intensive.");
+    GUIContent m_TweenRotationContent = new GUIContent("Tween Rotation", "This should be true if the transformToMove to change rotation.");
+    GUIContent m_TweenTypeContent = new GUIContent("Tween Type", "Linear - the transform moves the same amount each frame (assuming static start and end locations).\n"
+        + "Deceleration - the transform moves slower the closer to the end location it is.\n"
+        + "Harmonic - the transform moves faster in the middle of its tween.\n"
+        + "Custom - uses the customStartingSpeed and customEndingSpeed to create a curve for the desired tween.");
+    GUIContent m_CustomCurveContent = new GUIContent("Custom Curve", "This should be a normalised curve (between 0,0 and 1,1) that represents how the tweening object accelerates at different points along the clip.");
+
+    public override float GetPropertyHeight (SerializedProperty property, GUIContent label)
+    {
+        int fieldCount = property.FindPropertyRelative ("tweenType").enumValueIndex == (int)TransformTweenBehaviour.TweenType.Custom ? 5 : 3;
+        return fieldCount * (EditorGUIUtility.singleLineHeight);
+    }
+
+    public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
+    {
+        SerializedProperty tweenPositionProp = property.FindPropertyRelative ("tweenPosition");
+        SerializedProperty tweenRotationProp = property.FindPropertyRelative("tweenRotation");
+        SerializedProperty tweenTypeProp = property.FindPropertyRelative ("tweenType");
+        
+        Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
+        EditorGUI.PropertyField (singleFieldRect, tweenPositionProp, m_TweenPositionContent);
+        
+        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
+        EditorGUI.PropertyField (singleFieldRect, tweenRotationProp, m_TweenRotationContent);
+
+        singleFieldRect.y += EditorGUIUtility.singleLineHeight;
+        EditorGUI.PropertyField(singleFieldRect, tweenTypeProp, m_TweenTypeContent);
+
+        if (tweenTypeProp.enumValueIndex == (int)TransformTweenBehaviour.TweenType.Custom)
+        {
+            SerializedProperty customCurveProp = property.FindPropertyRelative ("customCurve");
+            
+            singleFieldRect.y += EditorGUIUtility.singleLineHeight;
+            EditorGUI.PropertyField (singleFieldRect, customCurveProp, m_CustomCurveContent);
+        }
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/TransformTween/Editor/TransformTweenDrawer.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: d4c9e800b8d9b3344850b4b658de699d
-timeCreated: 1491229652
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: d4c9e800b8d9b3344850b4b658de699d
+timeCreated: 1491229652
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 80 - 80
Assets/DefaultPlayables/TransformTween/TransformTweenBehaviour.cs

@@ -1,81 +1,81 @@
-using System;
-using JetBrains.Annotations;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-[Serializable]
-public class TransformTweenBehaviour : PlayableBehaviour
-{
-    public enum TweenType
-    {
-        Linear,
-        Deceleration,
-        Harmonic,
-        Custom,
-    }
-
-    public Transform startLocation;
-    public Transform endLocation;
-    public bool tweenPosition = true;
-    public bool tweenRotation = true;
-    public TweenType tweenType;
-    public AnimationCurve customCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
-    
-    public Vector3 startingPosition;
-    public Quaternion startingRotation = Quaternion.identity;
-
-    AnimationCurve m_LinearCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
-    AnimationCurve m_DecelerationCurve = new AnimationCurve
-    (
-        new Keyframe(0f, 0f, -k_RightAngleInRads, k_RightAngleInRads),
-        new Keyframe(1f, 1f, 0f, 0f)
-    );
-    AnimationCurve m_HarmonicCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
-
-    const float k_RightAngleInRads = Mathf.PI * 0.5f;
-
-    public override void PrepareFrame (Playable playable, FrameData info)
-    {
-        if (startLocation)
-        {
-            startingPosition = startLocation.position;
-            startingRotation = startLocation.rotation;
-        }
-    }
-
-    public float EvaluateCurrentCurve (float time)
-    {
-        if (tweenType == TweenType.Custom && !IsCustomCurveNormalised ())
-        {
-            Debug.LogError("Custom Curve is not normalised.  Curve must start at 0,0 and end at 1,1.");
-            return 0f;
-        }
-        
-        switch (tweenType)
-        {
-            case TweenType.Linear:
-                return m_LinearCurve.Evaluate (time);
-            case TweenType.Deceleration:
-                return m_DecelerationCurve.Evaluate (time);
-            case TweenType.Harmonic:
-                return m_HarmonicCurve.Evaluate (time);
-            default:
-                return customCurve.Evaluate (time);
-        }
-    }
-
-    bool IsCustomCurveNormalised ()
-    {
-        if (!Mathf.Approximately (customCurve[0].time, 0f))
-            return false;
-        
-        if (!Mathf.Approximately (customCurve[0].value, 0f))
-            return false;
-        
-        if (!Mathf.Approximately (customCurve[customCurve.length - 1].time, 1f))
-            return false;
-        
-        return Mathf.Approximately (customCurve[customCurve.length - 1].value, 1f);
-    }
+using System;
+using JetBrains.Annotations;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+[Serializable]
+public class TransformTweenBehaviour : PlayableBehaviour
+{
+    public enum TweenType
+    {
+        Linear,
+        Deceleration,
+        Harmonic,
+        Custom,
+    }
+
+    public Transform startLocation;
+    public Transform endLocation;
+    public bool tweenPosition = true;
+    public bool tweenRotation = true;
+    public TweenType tweenType;
+    public AnimationCurve customCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
+    
+    public Vector3 startingPosition;
+    public Quaternion startingRotation = Quaternion.identity;
+
+    AnimationCurve m_LinearCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
+    AnimationCurve m_DecelerationCurve = new AnimationCurve
+    (
+        new Keyframe(0f, 0f, -k_RightAngleInRads, k_RightAngleInRads),
+        new Keyframe(1f, 1f, 0f, 0f)
+    );
+    AnimationCurve m_HarmonicCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
+
+    const float k_RightAngleInRads = Mathf.PI * 0.5f;
+
+    public override void PrepareFrame (Playable playable, FrameData info)
+    {
+        if (startLocation)
+        {
+            startingPosition = startLocation.position;
+            startingRotation = startLocation.rotation;
+        }
+    }
+
+    public float EvaluateCurrentCurve (float time)
+    {
+        if (tweenType == TweenType.Custom && !IsCustomCurveNormalised ())
+        {
+            Debug.LogError("Custom Curve is not normalised.  Curve must start at 0,0 and end at 1,1.");
+            return 0f;
+        }
+        
+        switch (tweenType)
+        {
+            case TweenType.Linear:
+                return m_LinearCurve.Evaluate (time);
+            case TweenType.Deceleration:
+                return m_DecelerationCurve.Evaluate (time);
+            case TweenType.Harmonic:
+                return m_HarmonicCurve.Evaluate (time);
+            default:
+                return customCurve.Evaluate (time);
+        }
+    }
+
+    bool IsCustomCurveNormalised ()
+    {
+        if (!Mathf.Approximately (customCurve[0].time, 0f))
+            return false;
+        
+        if (!Mathf.Approximately (customCurve[0].value, 0f))
+            return false;
+        
+        if (!Mathf.Approximately (customCurve[customCurve.length - 1].time, 1f))
+            return false;
+        
+        return Mathf.Approximately (customCurve[customCurve.length - 1].value, 1f);
+    }
 }

+ 12 - 12
Assets/DefaultPlayables/TransformTween/TransformTweenBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 0594bfd3cbfda4d4bab34de00fb2faed
-timeCreated: 1493024223
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 0594bfd3cbfda4d4bab34de00fb2faed
+timeCreated: 1493024223
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 25 - 25
Assets/DefaultPlayables/TransformTween/TransformTweenClip.cs

@@ -1,26 +1,26 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-[Serializable]
-public class TransformTweenClip : PlayableAsset, ITimelineClipAsset
-{
-    public TransformTweenBehaviour template = new TransformTweenBehaviour ();
-    public ExposedReference<Transform> startLocation;
-    public ExposedReference<Transform> endLocation;
-    
-    public ClipCaps clipCaps
-    {
-        get { return ClipCaps.Blending; }
-    }
-
-    public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
-    {
-        var playable = ScriptPlayable<TransformTweenBehaviour>.Create (graph, template);
-        TransformTweenBehaviour clone = playable.GetBehaviour ();
-        clone.startLocation = startLocation.Resolve (graph.GetResolver ());
-        clone.endLocation = endLocation.Resolve (graph.GetResolver ());
-        return playable;
-    }
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+[Serializable]
+public class TransformTweenClip : PlayableAsset, ITimelineClipAsset
+{
+    public TransformTweenBehaviour template = new TransformTweenBehaviour ();
+    public ExposedReference<Transform> startLocation;
+    public ExposedReference<Transform> endLocation;
+    
+    public ClipCaps clipCaps
+    {
+        get { return ClipCaps.Blending; }
+    }
+
+    public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
+    {
+        var playable = ScriptPlayable<TransformTweenBehaviour>.Create (graph, template);
+        TransformTweenBehaviour clone = playable.GetBehaviour ();
+        clone.startLocation = startLocation.Resolve (graph.GetResolver ());
+        clone.endLocation = endLocation.Resolve (graph.GetResolver ());
+        return playable;
+    }
 }

+ 12 - 12
Assets/DefaultPlayables/TransformTween/TransformTweenClip.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: f28fb04ff66f85e40af453230799042c
-timeCreated: 1489416659
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: f28fb04ff66f85e40af453230799042c
+timeCreated: 1489416659
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 118 - 118
Assets/DefaultPlayables/TransformTween/TransformTweenMixerBehaviour.cs

@@ -1,119 +1,119 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-
-public class TransformTweenMixerBehaviour : PlayableBehaviour
-{
-    bool m_FirstFrameHappened;
-
-    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
-    {
-        Transform trackBinding = playerData as Transform;
-
-        if(trackBinding == null)
-            return;
-
-        Vector3 defaultPosition = trackBinding.position;
-        Quaternion defaultRotation = trackBinding.rotation;
-
-        int inputCount = playable.GetInputCount ();
-
-        float positionTotalWeight = 0f;
-        float rotationTotalWeight = 0f;
-
-        Vector3 blendedPosition = Vector3.zero;
-        Quaternion blendedRotation = new Quaternion(0f, 0f, 0f, 0f);
-
-        for (int i = 0; i < inputCount; i++)
-        {
-            ScriptPlayable<TransformTweenBehaviour> playableInput = (ScriptPlayable<TransformTweenBehaviour>)playable.GetInput (i);
-            TransformTweenBehaviour input = playableInput.GetBehaviour ();
-
-            if(input.endLocation == null)
-                continue;
-
-            float inputWeight = playable.GetInputWeight(i);
-
-            if (!m_FirstFrameHappened && !input.startLocation)
-            {
-                input.startingPosition = defaultPosition;
-                input.startingRotation = defaultRotation;
-            }
-
-            float normalisedTime = (float)(playableInput.GetTime() / playableInput.GetDuration ());
-            float tweenProgress = input.EvaluateCurrentCurve(normalisedTime);
-
-            if (input.tweenPosition)
-            {
-                positionTotalWeight += inputWeight;
-
-                blendedPosition += Vector3.Lerp(input.startingPosition, input.endLocation.position, tweenProgress) * inputWeight;
-            }
-
-            if (input.tweenRotation)
-            {
-                rotationTotalWeight += inputWeight;
-
-                Quaternion desiredRotation = Quaternion.Lerp(input.startingRotation, input.endLocation.rotation, tweenProgress);
-                desiredRotation = NormalizeQuaternion(desiredRotation);
-
-                if (Quaternion.Dot (blendedRotation, desiredRotation) < 0f)
-                {
-                    desiredRotation = ScaleQuaternion (desiredRotation, -1f);
-                }
-
-                desiredRotation = ScaleQuaternion(desiredRotation, inputWeight);
-
-                blendedRotation = AddQuaternions (blendedRotation, desiredRotation);
-            }
-        }
-
-        blendedPosition += defaultPosition * (1f - positionTotalWeight);
-        Quaternion weightedDefaultRotation = ScaleQuaternion (defaultRotation, 1f - rotationTotalWeight);
-        blendedRotation = AddQuaternions (blendedRotation, weightedDefaultRotation);
-
-        trackBinding.position = blendedPosition;
-        trackBinding.rotation = blendedRotation;
-        
-        m_FirstFrameHappened = true;
-    }
-
-    public override void OnPlayableDestroy (Playable playable)
-    {
-        m_FirstFrameHappened = false;
-    }
-
-    static Quaternion AddQuaternions (Quaternion first, Quaternion second)
-    {
-        first.w += second.w;
-        first.x += second.x;
-        first.y += second.y;
-        first.z += second.z;
-        return first;
-    }
-
-    static Quaternion ScaleQuaternion (Quaternion rotation, float multiplier)
-    {
-        rotation.w *= multiplier;
-        rotation.x *= multiplier;
-        rotation.y *= multiplier;
-        rotation.z *= multiplier;
-        return rotation;
-    }
-
-    static float QuaternionMagnitude (Quaternion rotation)
-    {
-        return Mathf.Sqrt ((Quaternion.Dot (rotation, rotation)));
-    }
-
-    static Quaternion NormalizeQuaternion (Quaternion rotation)
-    {
-        float magnitude = QuaternionMagnitude (rotation);
-
-        if (magnitude > 0f)
-            return ScaleQuaternion (rotation, 1f / magnitude);
-
-        Debug.LogWarning ("Cannot normalize a quaternion with zero magnitude.");
-        return Quaternion.identity;
-    }
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+
+public class TransformTweenMixerBehaviour : PlayableBehaviour
+{
+    bool m_FirstFrameHappened;
+
+    public override void ProcessFrame(Playable playable, FrameData info, object playerData)
+    {
+        Transform trackBinding = playerData as Transform;
+
+        if(trackBinding == null)
+            return;
+
+        Vector3 defaultPosition = trackBinding.position;
+        Quaternion defaultRotation = trackBinding.rotation;
+
+        int inputCount = playable.GetInputCount ();
+
+        float positionTotalWeight = 0f;
+        float rotationTotalWeight = 0f;
+
+        Vector3 blendedPosition = Vector3.zero;
+        Quaternion blendedRotation = new Quaternion(0f, 0f, 0f, 0f);
+
+        for (int i = 0; i < inputCount; i++)
+        {
+            ScriptPlayable<TransformTweenBehaviour> playableInput = (ScriptPlayable<TransformTweenBehaviour>)playable.GetInput (i);
+            TransformTweenBehaviour input = playableInput.GetBehaviour ();
+
+            if(input.endLocation == null)
+                continue;
+
+            float inputWeight = playable.GetInputWeight(i);
+
+            if (!m_FirstFrameHappened && !input.startLocation)
+            {
+                input.startingPosition = defaultPosition;
+                input.startingRotation = defaultRotation;
+            }
+
+            float normalisedTime = (float)(playableInput.GetTime() / playableInput.GetDuration ());
+            float tweenProgress = input.EvaluateCurrentCurve(normalisedTime);
+
+            if (input.tweenPosition)
+            {
+                positionTotalWeight += inputWeight;
+
+                blendedPosition += Vector3.Lerp(input.startingPosition, input.endLocation.position, tweenProgress) * inputWeight;
+            }
+
+            if (input.tweenRotation)
+            {
+                rotationTotalWeight += inputWeight;
+
+                Quaternion desiredRotation = Quaternion.Lerp(input.startingRotation, input.endLocation.rotation, tweenProgress);
+                desiredRotation = NormalizeQuaternion(desiredRotation);
+
+                if (Quaternion.Dot (blendedRotation, desiredRotation) < 0f)
+                {
+                    desiredRotation = ScaleQuaternion (desiredRotation, -1f);
+                }
+
+                desiredRotation = ScaleQuaternion(desiredRotation, inputWeight);
+
+                blendedRotation = AddQuaternions (blendedRotation, desiredRotation);
+            }
+        }
+
+        blendedPosition += defaultPosition * (1f - positionTotalWeight);
+        Quaternion weightedDefaultRotation = ScaleQuaternion (defaultRotation, 1f - rotationTotalWeight);
+        blendedRotation = AddQuaternions (blendedRotation, weightedDefaultRotation);
+
+        trackBinding.position = blendedPosition;
+        trackBinding.rotation = blendedRotation;
+        
+        m_FirstFrameHappened = true;
+    }
+
+    public override void OnPlayableDestroy (Playable playable)
+    {
+        m_FirstFrameHappened = false;
+    }
+
+    static Quaternion AddQuaternions (Quaternion first, Quaternion second)
+    {
+        first.w += second.w;
+        first.x += second.x;
+        first.y += second.y;
+        first.z += second.z;
+        return first;
+    }
+
+    static Quaternion ScaleQuaternion (Quaternion rotation, float multiplier)
+    {
+        rotation.w *= multiplier;
+        rotation.x *= multiplier;
+        rotation.y *= multiplier;
+        rotation.z *= multiplier;
+        return rotation;
+    }
+
+    static float QuaternionMagnitude (Quaternion rotation)
+    {
+        return Mathf.Sqrt ((Quaternion.Dot (rotation, rotation)));
+    }
+
+    static Quaternion NormalizeQuaternion (Quaternion rotation)
+    {
+        float magnitude = QuaternionMagnitude (rotation);
+
+        if (magnitude > 0f)
+            return ScaleQuaternion (rotation, 1f / magnitude);
+
+        Debug.LogWarning ("Cannot normalize a quaternion with zero magnitude.");
+        return Quaternion.identity;
+    }
 }

+ 12 - 12
Assets/DefaultPlayables/TransformTween/TransformTweenMixerBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: e904ec43bfb67e843b3b830e3d2adc1d
-timeCreated: 1493024236
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: e904ec43bfb67e843b3b830e3d2adc1d
+timeCreated: 1493024236
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 32 - 32
Assets/DefaultPlayables/TransformTween/TransformTweenTrack.cs

@@ -1,32 +1,32 @@
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-[TrackColor(0.855f,0.8623f,0.870f)]
-[TrackClipType(typeof(TransformTweenClip))]
-[TrackBindingType(typeof(Transform))]
-public class TransformTweenTrack : TrackAsset
-{
-	public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
-	{
-	    return ScriptPlayable<TransformTweenMixerBehaviour>.Create (graph, inputCount);
-	}
-
-    public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
-    {
-#if UNITY_EDITOR
-        var comp = director.GetGenericBinding(this) as Transform;
-        if (comp == null)
-            return;
-        var so = new UnityEditor.SerializedObject(comp);
-        var iter = so.GetIterator();
-        while (iter.NextVisible(true))
-        {
-            if (iter.hasVisibleChildren)
-                continue;
-            driver.AddFromName<Transform>(comp.gameObject, iter.propertyPath);
-        }
-#endif
-        base.GatherProperties(director, driver);
-    }
-}
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Timeline;
+
+[TrackColor(0.855f,0.8623f,0.870f)]
+[TrackClipType(typeof(TransformTweenClip))]
+[TrackBindingType(typeof(Transform))]
+public class TransformTweenTrack : TrackAsset
+{
+	public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
+	{
+	    return ScriptPlayable<TransformTweenMixerBehaviour>.Create (graph, inputCount);
+	}
+
+    public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
+    {
+#if UNITY_EDITOR
+        var comp = director.GetGenericBinding(this) as Transform;
+        if (comp == null)
+            return;
+        var so = new UnityEditor.SerializedObject(comp);
+        var iter = so.GetIterator();
+        while (iter.NextVisible(true))
+        {
+            if (iter.hasVisibleChildren)
+                continue;
+            driver.AddFromName<Transform>(comp.gameObject, iter.propertyPath);
+        }
+#endif
+        base.GatherProperties(director, driver);
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/TransformTween/TransformTweenTrack.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: f2e6ab84ba07902498da4807885565cb
-timeCreated: 1489416673
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: f2e6ab84ba07902498da4807885565cb
+timeCreated: 1489416673
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 176 - 176
Assets/DefaultPlayables/Video/VideoPlayableBehaviour.cs

@@ -1,176 +1,176 @@
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Video;
-
-namespace UnityEngine.Timeline
-{
-	public class VideoPlayableBehaviour : PlayableBehaviour
-    {
-        public VideoPlayer videoPlayer;
-		public VideoClip videoClip;
-        public bool mute = false;
-        public bool loop = true;
-        public double preloadTime = 0.3;
-        public double clipInTime = 0.0;
-
-        private bool playedOnce = false;
-        private bool preparing = false;
-
-        public void PrepareVideo()
-        {
-            if (videoPlayer == null || videoClip == null)
-                return;
-
-            videoPlayer.targetCameraAlpha = 0.0f;
-
-            if (videoPlayer.clip != videoClip)
-                StopVideo();
-
-            if (videoPlayer.isPrepared || preparing)
-                return;
-
-            videoPlayer.source = VideoSource.VideoClip;
-            videoPlayer.clip = videoClip;
-            videoPlayer.playOnAwake = false;
-            videoPlayer.waitForFirstFrame = true;
-		    videoPlayer.isLooping = loop;
-
-            for (ushort i = 0; i < videoClip.audioTrackCount; ++i)
-            {
-                if (videoPlayer.audioOutputMode == VideoAudioOutputMode.Direct)
-                    videoPlayer.SetDirectAudioMute(i, mute || !Application.isPlaying);
-                else if (videoPlayer.audioOutputMode == VideoAudioOutputMode.AudioSource)
-                {
-                    AudioSource audioSource = videoPlayer.GetTargetAudioSource(i);
-                    if (audioSource != null)
-                        audioSource.mute = mute || !Application.isPlaying;
-                }
-            }
-
-            videoPlayer.loopPointReached += LoopPointReached;
-            videoPlayer.time = clipInTime;
-            videoPlayer.Prepare();
-            preparing = true;
-        }
-
-        void LoopPointReached(VideoPlayer vp)
-        {
-            playedOnce = !loop;
-        }
-
-        public override void PrepareFrame(Playable playable, FrameData info)
-		{
-			if (videoPlayer == null || videoClip == null)
-				return;
-
-            videoPlayer.timeReference = Application.isPlaying ? VideoTimeReference.ExternalTime :
-                                                                VideoTimeReference.Freerun;
-																
-		    if (videoPlayer.isPlaying && Application.isPlaying)
-			    videoPlayer.externalReferenceTime = playable.GetTime();
-            else if (!Application.isPlaying)
-                SyncVideoToPlayable(playable);
-        }
-
-        public override void OnBehaviourPlay(Playable playable, FrameData info)
-        {
-            if (videoPlayer == null)
-                return;
-
-            if (!playedOnce)
-            {
-                PlayVideo();
-                SyncVideoToPlayable(playable);
-            }
-        }
-
-        public override void OnBehaviourPause(Playable playable, FrameData info)
-        {
-            if (videoPlayer == null)
-                return;
-
-            if (Application.isPlaying)
-                PauseVideo();
-            else
-                StopVideo();
-        }
-
-		public override void ProcessFrame(Playable playable, FrameData info, object playerData)
-		{
-			if (videoPlayer == null || videoPlayer.clip == null)
-				return;
-
-            videoPlayer.targetCameraAlpha = info.weight;
-
-		    if (Application.isPlaying)
-		    {
-		        for (ushort i = 0; i < videoPlayer.clip.audioTrackCount; ++i)
-		        {
-		            if (videoPlayer.audioOutputMode == VideoAudioOutputMode.Direct)
-		                videoPlayer.SetDirectAudioVolume(i, info.weight);
-		            else if (videoPlayer.audioOutputMode == VideoAudioOutputMode.AudioSource)
-		            {
-		                AudioSource audioSource = videoPlayer.GetTargetAudioSource(i);
-		                if (audioSource != null)
-		                    audioSource.volume = info.weight;
-		            }
-		        }
-		    }
-		}
-
-		public override void OnGraphStart(Playable playable)
-		{
-		    playedOnce = false;
-		}
-
-		public override void OnGraphStop(Playable playable)
-		{
-		    if (!Application.isPlaying)
-		        StopVideo();
-		}
-
-        public override void OnPlayableDestroy(Playable playable)
-        {
-            StopVideo();
-        }
-
-        public void PlayVideo()
-        {
-            if (videoPlayer == null)
-                return;
-
-            videoPlayer.Play();
-            preparing = false;
-
-            if (!Application.isPlaying)
-                PauseVideo();
-        }
-
-        public void PauseVideo()
-        {
-            if (videoPlayer == null)
-                return;
-
-            videoPlayer.Pause();
-            preparing = false;
-        }
-
-        public void StopVideo()
-        {
-            if (videoPlayer == null)
-                return;
-
-            playedOnce = false;
-            videoPlayer.Stop();
-            preparing = false;
-        }
-
-        private void SyncVideoToPlayable(Playable playable)
-        {
-            if (videoPlayer == null || videoPlayer.clip == null)
-                return;
-
-            videoPlayer.time = (clipInTime + (playable.GetTime() * videoPlayer.playbackSpeed)) % videoPlayer.clip.length;
-        }
-    }
-}
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Video;
+
+namespace UnityEngine.Timeline
+{
+	public class VideoPlayableBehaviour : PlayableBehaviour
+    {
+        public VideoPlayer videoPlayer;
+		public VideoClip videoClip;
+        public bool mute = false;
+        public bool loop = true;
+        public double preloadTime = 0.3;
+        public double clipInTime = 0.0;
+
+        private bool playedOnce = false;
+        private bool preparing = false;
+
+        public void PrepareVideo()
+        {
+            if (videoPlayer == null || videoClip == null)
+                return;
+
+            videoPlayer.targetCameraAlpha = 0.0f;
+
+            if (videoPlayer.clip != videoClip)
+                StopVideo();
+
+            if (videoPlayer.isPrepared || preparing)
+                return;
+
+            videoPlayer.source = VideoSource.VideoClip;
+            videoPlayer.clip = videoClip;
+            videoPlayer.playOnAwake = false;
+            videoPlayer.waitForFirstFrame = true;
+		    videoPlayer.isLooping = loop;
+
+            for (ushort i = 0; i < videoClip.audioTrackCount; ++i)
+            {
+                if (videoPlayer.audioOutputMode == VideoAudioOutputMode.Direct)
+                    videoPlayer.SetDirectAudioMute(i, mute || !Application.isPlaying);
+                else if (videoPlayer.audioOutputMode == VideoAudioOutputMode.AudioSource)
+                {
+                    AudioSource audioSource = videoPlayer.GetTargetAudioSource(i);
+                    if (audioSource != null)
+                        audioSource.mute = mute || !Application.isPlaying;
+                }
+            }
+
+            videoPlayer.loopPointReached += LoopPointReached;
+            videoPlayer.time = clipInTime;
+            videoPlayer.Prepare();
+            preparing = true;
+        }
+
+        void LoopPointReached(VideoPlayer vp)
+        {
+            playedOnce = !loop;
+        }
+
+        public override void PrepareFrame(Playable playable, FrameData info)
+		{
+			if (videoPlayer == null || videoClip == null)
+				return;
+
+            videoPlayer.timeReference = Application.isPlaying ? VideoTimeReference.ExternalTime :
+                                                                VideoTimeReference.Freerun;
+																
+		    if (videoPlayer.isPlaying && Application.isPlaying)
+			    videoPlayer.externalReferenceTime = playable.GetTime();
+            else if (!Application.isPlaying)
+                SyncVideoToPlayable(playable);
+        }
+
+        public override void OnBehaviourPlay(Playable playable, FrameData info)
+        {
+            if (videoPlayer == null)
+                return;
+
+            if (!playedOnce)
+            {
+                PlayVideo();
+                SyncVideoToPlayable(playable);
+            }
+        }
+
+        public override void OnBehaviourPause(Playable playable, FrameData info)
+        {
+            if (videoPlayer == null)
+                return;
+
+            if (Application.isPlaying)
+                PauseVideo();
+            else
+                StopVideo();
+        }
+
+		public override void ProcessFrame(Playable playable, FrameData info, object playerData)
+		{
+			if (videoPlayer == null || videoPlayer.clip == null)
+				return;
+
+            videoPlayer.targetCameraAlpha = info.weight;
+
+		    if (Application.isPlaying)
+		    {
+		        for (ushort i = 0; i < videoPlayer.clip.audioTrackCount; ++i)
+		        {
+		            if (videoPlayer.audioOutputMode == VideoAudioOutputMode.Direct)
+		                videoPlayer.SetDirectAudioVolume(i, info.weight);
+		            else if (videoPlayer.audioOutputMode == VideoAudioOutputMode.AudioSource)
+		            {
+		                AudioSource audioSource = videoPlayer.GetTargetAudioSource(i);
+		                if (audioSource != null)
+		                    audioSource.volume = info.weight;
+		            }
+		        }
+		    }
+		}
+
+		public override void OnGraphStart(Playable playable)
+		{
+		    playedOnce = false;
+		}
+
+		public override void OnGraphStop(Playable playable)
+		{
+		    if (!Application.isPlaying)
+		        StopVideo();
+		}
+
+        public override void OnPlayableDestroy(Playable playable)
+        {
+            StopVideo();
+        }
+
+        public void PlayVideo()
+        {
+            if (videoPlayer == null)
+                return;
+
+            videoPlayer.Play();
+            preparing = false;
+
+            if (!Application.isPlaying)
+                PauseVideo();
+        }
+
+        public void PauseVideo()
+        {
+            if (videoPlayer == null)
+                return;
+
+            videoPlayer.Pause();
+            preparing = false;
+        }
+
+        public void StopVideo()
+        {
+            if (videoPlayer == null)
+                return;
+
+            playedOnce = false;
+            videoPlayer.Stop();
+            preparing = false;
+        }
+
+        private void SyncVideoToPlayable(Playable playable)
+        {
+            if (videoPlayer == null || videoPlayer.clip == null)
+                return;
+
+            videoPlayer.time = (clipInTime + (playable.GetTime() * videoPlayer.playbackSpeed)) % videoPlayer.clip.length;
+        }
+    }
+}

+ 12 - 12
Assets/DefaultPlayables/Video/VideoPlayableBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: f9cbe3d1fa4843444a5eb76370a4dd15
-timeCreated: 1497258618
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: f9cbe3d1fa4843444a5eb76370a4dd15
+timeCreated: 1497258618
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 52 - 52
Assets/DefaultPlayables/Video/VideoSchedulerPlayableBehaviour.cs

@@ -1,52 +1,52 @@
-using System;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.Playables;
-
-namespace UnityEngine.Timeline
-{
-    public sealed class VideoSchedulerPlayableBehaviour : PlayableBehaviour
-    {
-		private IEnumerable<TimelineClip> m_Clips;
-        private PlayableDirector m_Director;
-
-        internal PlayableDirector director
-        {
-            get { return m_Director; }
-            set { m_Director = value; }
-        }
-
-        internal IEnumerable<TimelineClip> clips
-        {
-            get { return m_Clips; }
-            set { m_Clips = value; }
-        }
-
-        public override void ProcessFrame(Playable playable, FrameData info, object playerData)
-        {
-            if (m_Clips == null)
-                return;
-
-            int inputPort = 0;
-            foreach (TimelineClip clip in m_Clips)
-            {
-				ScriptPlayable<VideoPlayableBehaviour> scriptPlayable =
-					(ScriptPlayable<VideoPlayableBehaviour>)playable.GetInput(inputPort);
-
-				VideoPlayableBehaviour videoPlayableBehaviour = scriptPlayable.GetBehaviour();
-
-				if (videoPlayableBehaviour != null)
-				{
-					double preloadTime = Math.Max(0.0, videoPlayableBehaviour.preloadTime);
-					if (m_Director.time >= clip.start + clip.duration ||
-						m_Director.time <= clip.start - preloadTime)
-						videoPlayableBehaviour.StopVideo();
-					else if (m_Director.time > clip.start - preloadTime)
-						videoPlayableBehaviour.PrepareVideo();
-				}
-					
-                ++inputPort;
-            }
-        }
-	}
-}
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Playables;
+
+namespace UnityEngine.Timeline
+{
+    public sealed class VideoSchedulerPlayableBehaviour : PlayableBehaviour
+    {
+		private IEnumerable<TimelineClip> m_Clips;
+        private PlayableDirector m_Director;
+
+        internal PlayableDirector director
+        {
+            get { return m_Director; }
+            set { m_Director = value; }
+        }
+
+        internal IEnumerable<TimelineClip> clips
+        {
+            get { return m_Clips; }
+            set { m_Clips = value; }
+        }
+
+        public override void ProcessFrame(Playable playable, FrameData info, object playerData)
+        {
+            if (m_Clips == null)
+                return;
+
+            int inputPort = 0;
+            foreach (TimelineClip clip in m_Clips)
+            {
+				ScriptPlayable<VideoPlayableBehaviour> scriptPlayable =
+					(ScriptPlayable<VideoPlayableBehaviour>)playable.GetInput(inputPort);
+
+				VideoPlayableBehaviour videoPlayableBehaviour = scriptPlayable.GetBehaviour();
+
+				if (videoPlayableBehaviour != null)
+				{
+					double preloadTime = Math.Max(0.0, videoPlayableBehaviour.preloadTime);
+					if (m_Director.time >= clip.start + clip.duration ||
+						m_Director.time <= clip.start - preloadTime)
+						videoPlayableBehaviour.StopVideo();
+					else if (m_Director.time > clip.start - preloadTime)
+						videoPlayableBehaviour.PrepareVideo();
+				}
+					
+                ++inputPort;
+            }
+        }
+	}
+}

+ 12 - 12
Assets/DefaultPlayables/Video/VideoSchedulerPlayableBehaviour.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 6dfd332197b07004c90e572e7b383e47
-timeCreated: 1497258618
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 6dfd332197b07004c90e572e7b383e47
+timeCreated: 1497258618
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 45 - 45
Assets/DefaultPlayables/Video/VideoScriptPlayableAsset.cs

@@ -1,45 +1,45 @@
-using System;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Video;
-
-namespace UnityEngine.Timeline
-{
-	[Serializable]
-    public class VideoScriptPlayableAsset : PlayableAsset
-	{
-        public ExposedReference<VideoPlayer> videoPlayer;
-
-        [SerializeField, NotKeyable]
-		public VideoClip videoClip;
-
-        [SerializeField, NotKeyable]
-        public bool mute = false;
-
-        [SerializeField, NotKeyable]
-        public bool loop = true;
-
-        [SerializeField, NotKeyable]
-        public double preloadTime = 0.3;
-
-        [SerializeField, NotKeyable]
-        public double clipInTime = 0.0;
-
-        public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
-		{
-            ScriptPlayable<VideoPlayableBehaviour> playable =
-                ScriptPlayable<VideoPlayableBehaviour>.Create(graph);
-
-            VideoPlayableBehaviour playableBehaviour = playable.GetBehaviour();
-
-            playableBehaviour.videoPlayer = videoPlayer.Resolve(graph.GetResolver());
-            playableBehaviour.videoClip = videoClip;
-            playableBehaviour.mute = mute;
-            playableBehaviour.loop = loop;
-            playableBehaviour.preloadTime = preloadTime;
-            playableBehaviour.clipInTime = clipInTime;
-
-            return playable;
-		}
-	}
-}
+using System;
+using UnityEngine;
+using UnityEngine.Playables;
+using UnityEngine.Video;
+
+namespace UnityEngine.Timeline
+{
+	[Serializable]
+    public class VideoScriptPlayableAsset : PlayableAsset
+	{
+        public ExposedReference<VideoPlayer> videoPlayer;
+
+        [SerializeField, NotKeyable]
+		public VideoClip videoClip;
+
+        [SerializeField, NotKeyable]
+        public bool mute = false;
+
+        [SerializeField, NotKeyable]
+        public bool loop = true;
+
+        [SerializeField, NotKeyable]
+        public double preloadTime = 0.3;
+
+        [SerializeField, NotKeyable]
+        public double clipInTime = 0.0;
+
+        public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
+		{
+            ScriptPlayable<VideoPlayableBehaviour> playable =
+                ScriptPlayable<VideoPlayableBehaviour>.Create(graph);
+
+            VideoPlayableBehaviour playableBehaviour = playable.GetBehaviour();
+
+            playableBehaviour.videoPlayer = videoPlayer.Resolve(graph.GetResolver());
+            playableBehaviour.videoClip = videoClip;
+            playableBehaviour.mute = mute;
+            playableBehaviour.loop = loop;
+            playableBehaviour.preloadTime = preloadTime;
+            playableBehaviour.clipInTime = clipInTime;
+
+            return playable;
+		}
+	}
+}

+ 12 - 12
Assets/DefaultPlayables/Video/VideoScriptPlayableAsset.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: 88bb1acb4c6ce544788ae727c940bd7e
-timeCreated: 1497258618
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: 88bb1acb4c6ce544788ae727c940bd7e
+timeCreated: 1497258618
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 34 - 34
Assets/DefaultPlayables/Video/VideoScriptPlayableTrack.cs

@@ -1,34 +1,34 @@
-using System;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.Playables;
-
-namespace UnityEngine.Timeline
-{
-	[Serializable]
-    [TrackClipType(typeof(VideoScriptPlayableAsset))]
-    [TrackMediaType(TimelineAsset.MediaType.Script)]
-    [TrackColor(0.008f, 0.698f, 0.655f)]
-    public class VideoScriptPlayableTrack : TrackAsset
-	{
-        public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
-        {
-            PlayableDirector playableDirector = go.GetComponent<PlayableDirector>();
-
-            ScriptPlayable<VideoSchedulerPlayableBehaviour> playable =
-                ScriptPlayable<VideoSchedulerPlayableBehaviour>.Create(graph, inputCount);
-
-            VideoSchedulerPlayableBehaviour videoSchedulerPlayableBehaviour =
-                   playable.GetBehaviour();
-
-            if (videoSchedulerPlayableBehaviour != null)
-            {
-                videoSchedulerPlayableBehaviour.director = playableDirector;
-                videoSchedulerPlayableBehaviour.clips = GetClips();
-            }
-
-            return playable;
-        }
-    }
-}
-
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Playables;
+
+namespace UnityEngine.Timeline
+{
+	[Serializable]
+    [TrackClipType(typeof(VideoScriptPlayableAsset))]
+    [TrackMediaType(TimelineAsset.MediaType.Script)]
+    [TrackColor(0.008f, 0.698f, 0.655f)]
+    public class VideoScriptPlayableTrack : TrackAsset
+	{
+        public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
+        {
+            PlayableDirector playableDirector = go.GetComponent<PlayableDirector>();
+
+            ScriptPlayable<VideoSchedulerPlayableBehaviour> playable =
+                ScriptPlayable<VideoSchedulerPlayableBehaviour>.Create(graph, inputCount);
+
+            VideoSchedulerPlayableBehaviour videoSchedulerPlayableBehaviour =
+                   playable.GetBehaviour();
+
+            if (videoSchedulerPlayableBehaviour != null)
+            {
+                videoSchedulerPlayableBehaviour.director = playableDirector;
+                videoSchedulerPlayableBehaviour.clips = GetClips();
+            }
+
+            return playable;
+        }
+    }
+}
+

+ 12 - 12
Assets/DefaultPlayables/Video/VideoScriptPlayableTrack.cs.meta

@@ -1,12 +1,12 @@
-fileFormatVersion: 2
-guid: b5bef7c9d630a7042b864b59b09e597c
-timeCreated: 1497258618
-licenseType: Store
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 
+fileFormatVersion: 2
+guid: b5bef7c9d630a7042b864b59b09e597c
+timeCreated: 1497258618
+licenseType: Store
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 60 - 60
Assets/DrawingAir/DrawListManager.cs

@@ -1,60 +1,60 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class DrawListManager : MonoBehaviour
-{
-    public static DrawListManager _instance;
-    private Stack<GameObject> Dlist = new Stack<GameObject>();
-    
-    private void Awake()
-    {
-        _instance = this;
-        MessageCenterController.Instance.Register(GameEnum.MESSAGE_DRAW_UNDO_PREVIOUS, RemoveLast);
-        MessageCenterController.Instance.Register(GameEnum.MESSAGE_DRAW_UNDO_ALL, RemoveAll);
-    }
-
-    private void OnDestroy()
-    {
-        RemoveAll();
-        MessageCenterController.Instance.UnRegister(GameEnum.MESSAGE_DRAW_UNDO_PREVIOUS, RemoveLast);
-        MessageCenterController.Instance.UnRegister(GameEnum.MESSAGE_DRAW_UNDO_ALL, RemoveAll);
-    }
-
-
-    public void AddBrush(GameObject g)
-    {
-        g.transform.parent = transform;
-        Dlist.Push(g);
-    }
-
-    public void RemoveLast(object o = null)
-    {
-        if (Dlist.Count > 0)
-        {
-            GameObject g = Dlist.Pop();
-            Destroy(g);
-        }
-    }
-
-    public void RemoveAll(object o = null)
-    {
-        while (Dlist.Count > 0)
-        {
-            Destroy(Dlist.Pop());
-        }
-        Dlist.Clear();
-    }
-
-    private void Update()
-    {
-        if (Input.GetKeyUp(KeyCode.H))
-        {
-            RemoveLast();
-        }
-        else if (Input.GetKeyUp(KeyCode.J))
-        {
-            RemoveAll();
-        }
-    }
-}
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class DrawListManager : MonoBehaviour
+{
+    public static DrawListManager _instance;
+    private Stack<GameObject> Dlist = new Stack<GameObject>();
+    
+    private void Awake()
+    {
+        _instance = this;
+        MessageCenterController.Instance.Register(GameEnum.MESSAGE_DRAW_UNDO_PREVIOUS, RemoveLast);
+        MessageCenterController.Instance.Register(GameEnum.MESSAGE_DRAW_UNDO_ALL, RemoveAll);
+    }
+
+    private void OnDestroy()
+    {
+        RemoveAll();
+        MessageCenterController.Instance.UnRegister(GameEnum.MESSAGE_DRAW_UNDO_PREVIOUS, RemoveLast);
+        MessageCenterController.Instance.UnRegister(GameEnum.MESSAGE_DRAW_UNDO_ALL, RemoveAll);
+    }
+
+
+    public void AddBrush(GameObject g)
+    {
+        g.transform.parent = transform;
+        Dlist.Push(g);
+    }
+
+    public void RemoveLast(object o = null)
+    {
+        if (Dlist.Count > 0)
+        {
+            GameObject g = Dlist.Pop();
+            Destroy(g);
+        }
+    }
+
+    public void RemoveAll(object o = null)
+    {
+        while (Dlist.Count > 0)
+        {
+            Destroy(Dlist.Pop());
+        }
+        Dlist.Clear();
+    }
+
+    private void Update()
+    {
+        if (Input.GetKeyUp(KeyCode.H))
+        {
+            RemoveLast();
+        }
+        else if (Input.GetKeyUp(KeyCode.J))
+        {
+            RemoveAll();
+        }
+    }
+}

+ 85 - 85
Assets/DrawingAir/Paint.cs

@@ -1,85 +1,85 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class Paint : MonoBehaviour
-{
-    public GameObject trailPrefab;
-    private TrailRenderer thisTrail;
-    private Vector3 startPos;
-    private Plane objPlane;
-    private Vector3 TeacherPos;
-    [SerializeField]
-    private bool isStart = false;
-    void Start()
-    {
-        MessageCenterController.Instance.Register(GameEnum.MESSAGE_REFRESH_LINE_TARGET_POS_DATA, RefreshData);
-        MessageCenterController.Instance.Register(GameEnum.MESSAGE_DRAW_START, DrawStart);
-        MessageCenterController.Instance.Register(GameEnum.MESSAGE_DRAW_END, DrawEnd);
-        isStart = false;
-    }
-
-    private void OnDestroy()
-    {
-        MessageCenterController.Instance.UnRegister(GameEnum.MESSAGE_REFRESH_LINE_TARGET_POS_DATA, RefreshData);
-        MessageCenterController.Instance.UnRegister(GameEnum.MESSAGE_DRAW_START, DrawStart);
-        MessageCenterController.Instance.UnRegister(GameEnum.MESSAGE_DRAW_END, DrawEnd);
-    }
-
-    void DrawStart(System.Object o)
-    {
-        StartCoroutine(_DrawStart(o));
-    }
-
-    IEnumerator _DrawStart(System.Object o)
-    {
-        yield return new WaitForEndOfFrame();
-        DrawData data = (DrawData)o;
-        startPos = DrawingManager._instance.DrawPoint(); // 获取射线点
-        GameObject g = Instantiate(trailPrefab, startPos, Quaternion.identity);
-        // 加入绘制Stack
-        DrawListManager._instance.AddBrush(g);
-        thisTrail = g.GetComponent<TrailRenderer>();
-        thisTrail.startColor = data.GetColor();
-        thisTrail.endColor = data.GetColor();
-        // thisTrail.widthMultiplier = data.size;
-        isStart = true;
-    }
-
-    void DrawEnd(System.Object o)
-    {
-        isStart = false;
-    }
-
-
-    private void RefreshData(System.Object data)
-    {
-        if (GamePlayerData.Instance.room_data.IsReconnectOwner())
-        {
-            return;//如果是老师的话不执行
-        }
-        TeacherPos = (Vector3)data;
-    }
-
-    // Update is called once per frame
-    void Update()
-    {
-        if (isStart)
-        {
-            Vector3 v;
-            if (GamePlayerData.Instance.room_data.IsReconnectOwner())
-            {
-                v = DrawingManager.Instance.DrawPoint();
-            }
-            else
-            {
-                v = TeacherPos;
-            }
-            if (thisTrail)
-            {
-                thisTrail.transform.position = v;
-            }
-            
-        }
-    }
-}
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class Paint : MonoBehaviour
+{
+    public GameObject trailPrefab;
+    private TrailRenderer thisTrail;
+    private Vector3 startPos;
+    private Plane objPlane;
+    private Vector3 TeacherPos;
+    [SerializeField]
+    private bool isStart = false;
+    void Start()
+    {
+        MessageCenterController.Instance.Register(GameEnum.MESSAGE_REFRESH_LINE_TARGET_POS_DATA, RefreshData);
+        MessageCenterController.Instance.Register(GameEnum.MESSAGE_DRAW_START, DrawStart);
+        MessageCenterController.Instance.Register(GameEnum.MESSAGE_DRAW_END, DrawEnd);
+        isStart = false;
+    }
+
+    private void OnDestroy()
+    {
+        MessageCenterController.Instance.UnRegister(GameEnum.MESSAGE_REFRESH_LINE_TARGET_POS_DATA, RefreshData);
+        MessageCenterController.Instance.UnRegister(GameEnum.MESSAGE_DRAW_START, DrawStart);
+        MessageCenterController.Instance.UnRegister(GameEnum.MESSAGE_DRAW_END, DrawEnd);
+    }
+
+    void DrawStart(System.Object o)
+    {
+        StartCoroutine(_DrawStart(o));
+    }
+
+    IEnumerator _DrawStart(System.Object o)
+    {
+        yield return new WaitForEndOfFrame();
+        DrawData data = (DrawData)o;
+        startPos = DrawingManager._instance.DrawPoint(); // 获取射线点
+        GameObject g = Instantiate(trailPrefab, startPos, Quaternion.identity);
+        // 加入绘制Stack
+        DrawListManager._instance.AddBrush(g);
+        thisTrail = g.GetComponent<TrailRenderer>();
+        thisTrail.startColor = data.GetColor();
+        thisTrail.endColor = data.GetColor();
+        // thisTrail.widthMultiplier = data.size;
+        isStart = true;
+    }
+
+    void DrawEnd(System.Object o)
+    {
+        isStart = false;
+    }
+
+
+    private void RefreshData(System.Object data)
+    {
+        if (GamePlayerData.Instance.room_data.IsReconnectOwner())
+        {
+            return;//如果是老师的话不执行
+        }
+        TeacherPos = (Vector3)data;
+    }
+
+    // Update is called once per frame
+    void Update()
+    {
+        if (isStart)
+        {
+            Vector3 v;
+            if (GamePlayerData.Instance.room_data.IsReconnectOwner())
+            {
+                v = DrawingManager.Instance.DrawPoint();
+            }
+            else
+            {
+                v = TeacherPos;
+            }
+            if (thisTrail)
+            {
+                thisTrail.transform.position = v;
+            }
+            
+        }
+    }
+}

+ 152 - 152
Assets/DrawingAir/PaintBoard.cs

@@ -1,153 +1,153 @@
-using System.Linq;
-using UnityEngine;
-
-/// <summary>
-/// 画板
-/// </summary>
-public class PaintBoard : MonoBehaviour
-{
-    //当画笔移动速度很快时,为了不出现断断续续的点,所以需要对两个点之间进行插值,lerp就是插值系数
-    [Range(0, 1)]
-    public float lerp = 0.05f;
-    //初始化背景的图片
-    public Texture2D initailizeTexture;
-    //当前背景的图片
-    private Texture2D currentTexture;
-    //画笔所在位置映射到画板图片的UV坐标
-    private Vector2 paintPos;
-
-    private bool isDrawing = false;//当前画笔是不是正在画板上
-    //离开时画笔所在的位置 
-    private int lastPaintX;
-    private int lastPaintY;
-    //画笔所代表的色块的大小
-    private int painterTipsWidth = 30;
-    private int painterTipsHeight = 15;
-    //当前画板的背景图片的尺寸
-    private int textureWidth;
-    private int textureHeight;
-
-    //画笔的颜色
-    private Color32[] painterColor;
-
-    private Color32[] currentColor;
-    private Color32[] originColor;
-
-
-    private void Start()
-    {
-        //获取原始图片的大小 
-        Texture2D originTexture = GetComponent<MeshRenderer>().material.mainTexture as Texture2D;
-        textureWidth = originTexture.width;//1920   
-        textureHeight = originTexture.height;//1080
-
-        //设置当前图片
-        currentTexture = new Texture2D(textureWidth, textureHeight, TextureFormat.RGBA32, false, true);
-        currentTexture.SetPixels32(originTexture.GetPixels32());
-        currentTexture.Apply();
-
-        //赋值给黑板
-        GetComponent<MeshRenderer>().material.mainTexture = currentTexture;
-
-        //初始化画笔的颜色
-        painterColor = Enumerable.Repeat<Color32>(new Color32(255, 0, 0, 255), painterTipsWidth * painterTipsHeight).ToArray<Color32>();
-    }
-
-    private void LateUpdate()
-    {
-        if (Input.GetKeyUp(KeyCode.Space))
-        {
-            currentTexture.ClearRequestedMipmapLevel();
-            currentTexture.Apply();
-        }
-        //计算当前画笔,所代表的色块的一个起始点
-        int texPosX = (int)(paintPos.x * (float)textureWidth - (float)(painterTipsWidth / 2));
-        int texPosY = (int)(paintPos.y * (float)textureHeight - (float)(painterTipsHeight / 2));
-        if (isDrawing)
-        {
-            //改变画笔所在的块的像素值
-            currentTexture.SetPixels32(texPosX, texPosY, painterTipsWidth, painterTipsHeight, painterColor);
-            //如果快速移动画笔的话,会出现断续的现象,所以要插值
-            if (lastPaintX != 0 && lastPaintY != 0)
-            {
-                int lerpCount = (int)(1 / lerp);
-                for (int i = 0; i <= lerpCount; i++)
-                {
-                    int x = (int)Mathf.Lerp((float)lastPaintX, (float)texPosX, lerp);
-                    int y = (int)Mathf.Lerp((float)lastPaintY, (float)texPosY, lerp);
-                    currentTexture.SetPixels32(x, y, painterTipsWidth, painterTipsHeight, painterColor);
-                }
-            }
-            currentTexture.Apply();
-            lastPaintX = texPosX;
-            lastPaintY = texPosY;
-        }
-        else
-        {
-            lastPaintX = lastPaintY = 0;
-        }
-
-    }
-
-    /// <summary>
-    /// 设置当前画笔所在的UV位置
-    /// </summary>
-    /// <param name="x"></param>
-    /// <param name="y"></param>
-    public void SetPainterPositon(float x, float y)
-    {
-        paintPos.Set(x, y);
-    }
-
-    /// <summary>
-    /// 画笔当前是不是在画画
-    /// </summary>
-    public bool IsDrawing
-    {
-        get
-        {
-            return isDrawing;
-        }
-        set
-        {
-            isDrawing = value;
-        }
-    }
-
-    /// <summary>
-    /// 使用当前正在画板上的画笔的颜色
-    /// </summary>
-    /// <param name="color"></param>
-    public void SetPainterColor(Color32 color)
-    {
-        if (!painterColor[0].IsEqual(color))
-        {
-            for (int i = 0; i < painterColor.Length; i++)
-            {
-                painterColor[i] = color;
-            }
-        }
-    }
-
-
-}
-public static class MethodExtention
-{
-    /// <summary>
-    /// 用于比较两个Color32类型是不是同种颜色
-    /// </summary>
-    /// <param name="origin"></param>
-    /// <param name="compare"></param>
-    /// <returns></returns>
-    public static bool IsEqual(this Color32 origin, Color32 compare)
-    {
-        if (origin.g == compare.g && origin.r == compare.r)
-        {
-            if (origin.a == compare.a && origin.b == compare.b)
-            {
-                return true;
-            }
-        }
-        return false;
-    }
+using System.Linq;
+using UnityEngine;
+
+/// <summary>
+/// 画板
+/// </summary>
+public class PaintBoard : MonoBehaviour
+{
+    //当画笔移动速度很快时,为了不出现断断续续的点,所以需要对两个点之间进行插值,lerp就是插值系数
+    [Range(0, 1)]
+    public float lerp = 0.05f;
+    //初始化背景的图片
+    public Texture2D initailizeTexture;
+    //当前背景的图片
+    private Texture2D currentTexture;
+    //画笔所在位置映射到画板图片的UV坐标
+    private Vector2 paintPos;
+
+    private bool isDrawing = false;//当前画笔是不是正在画板上
+    //离开时画笔所在的位置 
+    private int lastPaintX;
+    private int lastPaintY;
+    //画笔所代表的色块的大小
+    private int painterTipsWidth = 30;
+    private int painterTipsHeight = 15;
+    //当前画板的背景图片的尺寸
+    private int textureWidth;
+    private int textureHeight;
+
+    //画笔的颜色
+    private Color32[] painterColor;
+
+    private Color32[] currentColor;
+    private Color32[] originColor;
+
+
+    private void Start()
+    {
+        //获取原始图片的大小 
+        Texture2D originTexture = GetComponent<MeshRenderer>().material.mainTexture as Texture2D;
+        textureWidth = originTexture.width;//1920   
+        textureHeight = originTexture.height;//1080
+
+        //设置当前图片
+        currentTexture = new Texture2D(textureWidth, textureHeight, TextureFormat.RGBA32, false, true);
+        currentTexture.SetPixels32(originTexture.GetPixels32());
+        currentTexture.Apply();
+
+        //赋值给黑板
+        GetComponent<MeshRenderer>().material.mainTexture = currentTexture;
+
+        //初始化画笔的颜色
+        painterColor = Enumerable.Repeat<Color32>(new Color32(255, 0, 0, 255), painterTipsWidth * painterTipsHeight).ToArray<Color32>();
+    }
+
+    private void LateUpdate()
+    {
+        if (Input.GetKeyUp(KeyCode.Space))
+        {
+            currentTexture.ClearRequestedMipmapLevel();
+            currentTexture.Apply();
+        }
+        //计算当前画笔,所代表的色块的一个起始点
+        int texPosX = (int)(paintPos.x * (float)textureWidth - (float)(painterTipsWidth / 2));
+        int texPosY = (int)(paintPos.y * (float)textureHeight - (float)(painterTipsHeight / 2));
+        if (isDrawing)
+        {
+            //改变画笔所在的块的像素值
+            currentTexture.SetPixels32(texPosX, texPosY, painterTipsWidth, painterTipsHeight, painterColor);
+            //如果快速移动画笔的话,会出现断续的现象,所以要插值
+            if (lastPaintX != 0 && lastPaintY != 0)
+            {
+                int lerpCount = (int)(1 / lerp);
+                for (int i = 0; i <= lerpCount; i++)
+                {
+                    int x = (int)Mathf.Lerp((float)lastPaintX, (float)texPosX, lerp);
+                    int y = (int)Mathf.Lerp((float)lastPaintY, (float)texPosY, lerp);
+                    currentTexture.SetPixels32(x, y, painterTipsWidth, painterTipsHeight, painterColor);
+                }
+            }
+            currentTexture.Apply();
+            lastPaintX = texPosX;
+            lastPaintY = texPosY;
+        }
+        else
+        {
+            lastPaintX = lastPaintY = 0;
+        }
+
+    }
+
+    /// <summary>
+    /// 设置当前画笔所在的UV位置
+    /// </summary>
+    /// <param name="x"></param>
+    /// <param name="y"></param>
+    public void SetPainterPositon(float x, float y)
+    {
+        paintPos.Set(x, y);
+    }
+
+    /// <summary>
+    /// 画笔当前是不是在画画
+    /// </summary>
+    public bool IsDrawing
+    {
+        get
+        {
+            return isDrawing;
+        }
+        set
+        {
+            isDrawing = value;
+        }
+    }
+
+    /// <summary>
+    /// 使用当前正在画板上的画笔的颜色
+    /// </summary>
+    /// <param name="color"></param>
+    public void SetPainterColor(Color32 color)
+    {
+        if (!painterColor[0].IsEqual(color))
+        {
+            for (int i = 0; i < painterColor.Length; i++)
+            {
+                painterColor[i] = color;
+            }
+        }
+    }
+
+
+}
+public static class MethodExtention
+{
+    /// <summary>
+    /// 用于比较两个Color32类型是不是同种颜色
+    /// </summary>
+    /// <param name="origin"></param>
+    /// <param name="compare"></param>
+    /// <returns></returns>
+    public static bool IsEqual(this Color32 origin, Color32 compare)
+    {
+        if (origin.g == compare.g && origin.r == compare.r)
+        {
+            if (origin.a == compare.a && origin.b == compare.b)
+            {
+                return true;
+            }
+        }
+        return false;
+    }
 }

+ 57 - 57
Assets/DrawingAir/Painter.cs

@@ -1,58 +1,58 @@
-using UnityEngine;
-
-public class Painter : MonoBehaviour
-{
-    /// <summary>
-    /// 画笔的颜色
-    /// </summary>
-    public Color32 penColor;
-
-    public Transform rayOrigin;
-
-    private RaycastHit hitInfo;
-    //这个画笔是不是正在被手柄抓着
-    private bool IsGrabbing;
-    private static PaintBoard board;//设置成类型的成员,而不是类型实例的成员,因为所有画笔都是用的同一个board
-
-    private void Start()
-    {
-        //将画笔部件设置为画笔的颜色,用于识别这个画笔的颜色
-        foreach (var renderer in GetComponentsInChildren<MeshRenderer>())
-        {
-            if (renderer.transform == transform)
-            {
-                continue;
-            }
-            renderer.material.color = penColor;
-        }
-        if (!board)
-        {
-            board = FindObjectOfType<PaintBoard>();
-        }
-
-    }
-
-    private void Update()
-    {
-        Ray r = new Ray(rayOrigin.position, rayOrigin.forward);
-        Debug.DrawLine(rayOrigin.position, rayOrigin.position + rayOrigin.forward * 10, Color.red);
-        if (Physics.Raycast(r, out hitInfo, 0.1f))
-        {
-            if (hitInfo.collider.tag == "Board")
-            {
-                //设置画笔所在位置对应画板图片的UV坐标 
-                board.SetPainterPositon(hitInfo.textureCoord.x, hitInfo.textureCoord.y);
-                //当前笔的颜色
-                board.SetPainterColor(penColor);
-                board.IsDrawing = true;
-                IsGrabbing = true;
-            }
-        }
-        else if (IsGrabbing)
-        {
-            board.IsDrawing = false;
-            IsGrabbing = false;
-        }
-    }
-
+using UnityEngine;
+
+public class Painter : MonoBehaviour
+{
+    /// <summary>
+    /// 画笔的颜色
+    /// </summary>
+    public Color32 penColor;
+
+    public Transform rayOrigin;
+
+    private RaycastHit hitInfo;
+    //这个画笔是不是正在被手柄抓着
+    private bool IsGrabbing;
+    private static PaintBoard board;//设置成类型的成员,而不是类型实例的成员,因为所有画笔都是用的同一个board
+
+    private void Start()
+    {
+        //将画笔部件设置为画笔的颜色,用于识别这个画笔的颜色
+        foreach (var renderer in GetComponentsInChildren<MeshRenderer>())
+        {
+            if (renderer.transform == transform)
+            {
+                continue;
+            }
+            renderer.material.color = penColor;
+        }
+        if (!board)
+        {
+            board = FindObjectOfType<PaintBoard>();
+        }
+
+    }
+
+    private void Update()
+    {
+        Ray r = new Ray(rayOrigin.position, rayOrigin.forward);
+        Debug.DrawLine(rayOrigin.position, rayOrigin.position + rayOrigin.forward * 10, Color.red);
+        if (Physics.Raycast(r, out hitInfo, 0.1f))
+        {
+            if (hitInfo.collider.tag == "Board")
+            {
+                //设置画笔所在位置对应画板图片的UV坐标 
+                board.SetPainterPositon(hitInfo.textureCoord.x, hitInfo.textureCoord.y);
+                //当前笔的颜色
+                board.SetPainterColor(penColor);
+                board.IsDrawing = true;
+                IsGrabbing = true;
+            }
+        }
+        else if (IsGrabbing)
+        {
+            board.IsDrawing = false;
+            IsGrabbing = false;
+        }
+    }
+
 }

+ 0 - 96
Assets/FT_MagicEffects_Vol01/Model/FTME01_sphere01.obj.meta

@@ -1,96 +0,0 @@
-fileFormatVersion: 2
-guid: bb89dc0e9a7608245b3f9873773454d7
-ModelImporter:
-  serializedVersion: 23
-  fileIDToRecycleName:
-    100000: //RootNode
-    100002: sphere
-    400000: //RootNode
-    400002: sphere
-    2300000: sphere
-    3300000: sphere
-    4300000: sphere
-    9500000: //RootNode
-  externalObjects: {}
-  materials:
-    importMaterials: 0
-    materialName: 0
-    materialSearch: 1
-    materialLocation: 0
-  animations:
-    legacyGenerateAnimations: 4
-    bakeSimulation: 0
-    resampleCurves: 1
-    optimizeGameObjects: 0
-    motionNodeName: 
-    rigImportErrors: 
-    rigImportWarnings: 
-    animationImportErrors: 
-    animationImportWarnings: 
-    animationRetargetingWarnings: 
-    animationDoRetargetingWarnings: 0
-    importAnimatedCustomProperties: 0
-    importConstraints: 0
-    animationCompression: 1
-    animationRotationError: 0.5
-    animationPositionError: 0.5
-    animationScaleError: 0.5
-    animationWrapMode: 0
-    extraExposedTransformPaths: []
-    extraUserProperties: []
-    clipAnimations: []
-    isReadable: 1
-  meshes:
-    lODScreenPercentages: []
-    globalScale: 0.1
-    meshCompression: 0
-    addColliders: 0
-    importVisibility: 0
-    importBlendShapes: 1
-    importCameras: 0
-    importLights: 0
-    swapUVChannels: 0
-    generateSecondaryUV: 0
-    useFileUnits: 1
-    optimizeMeshForGPU: 1
-    keepQuads: 0
-    weldVertices: 1
-    preserveHierarchy: 0
-    indexFormat: 1
-    secondaryUVAngleDistortion: 8
-    secondaryUVAreaDistortion: 15.000001
-    secondaryUVHardAngle: 88
-    secondaryUVPackMargin: 4
-    useFileScale: 0
-    previousCalculatedGlobalScale: 1
-    hasPreviousCalculatedGlobalScale: 0
-  tangentSpace:
-    normalSmoothAngle: 60
-    normalImportMode: 1
-    tangentImportMode: 4
-    normalCalculationMode: 0
-  importAnimation: 1
-  copyAvatar: 0
-  humanDescription:
-    serializedVersion: 2
-    human: []
-    skeleton: []
-    armTwist: 0.5
-    foreArmTwist: 0.5
-    upperLegTwist: 0.5
-    legTwist: 0.5
-    armStretch: 0.05
-    legStretch: 0.05
-    feetSpacing: 0
-    rootMotionBoneName: 
-    rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
-    hasTranslationDoF: 0
-    hasExtraRoot: 0
-    skeletonHasParents: 0
-  lastHumanDescriptionAvatarSource: {instanceID: 0}
-  animationType: 2
-  humanoidOversampling: 1
-  additionalBone: 0
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 96
Assets/FT_MagicEffects_Vol01/Model/FTME01_sphere02.obj.meta

@@ -1,96 +0,0 @@
-fileFormatVersion: 2
-guid: e2e82d7d1923ffd40b8a4f64088bda23
-ModelImporter:
-  serializedVersion: 23
-  fileIDToRecycleName:
-    100000: FTME01_sphere02
-    100002: //RootNode
-    400000: FTME01_sphere02
-    400002: //RootNode
-    2300000: FTME01_sphere02
-    3300000: FTME01_sphere02
-    4300000: FTME01_sphere02
-    9500000: //RootNode
-  externalObjects: {}
-  materials:
-    importMaterials: 0
-    materialName: 0
-    materialSearch: 1
-    materialLocation: 0
-  animations:
-    legacyGenerateAnimations: 4
-    bakeSimulation: 0
-    resampleCurves: 1
-    optimizeGameObjects: 0
-    motionNodeName: 
-    rigImportErrors: 
-    rigImportWarnings: 
-    animationImportErrors: 
-    animationImportWarnings: 
-    animationRetargetingWarnings: 
-    animationDoRetargetingWarnings: 0
-    importAnimatedCustomProperties: 0
-    importConstraints: 0
-    animationCompression: 1
-    animationRotationError: 0.5
-    animationPositionError: 0.5
-    animationScaleError: 0.5
-    animationWrapMode: 0
-    extraExposedTransformPaths: []
-    extraUserProperties: []
-    clipAnimations: []
-    isReadable: 1
-  meshes:
-    lODScreenPercentages: []
-    globalScale: 0.1
-    meshCompression: 0
-    addColliders: 0
-    importVisibility: 0
-    importBlendShapes: 1
-    importCameras: 0
-    importLights: 0
-    swapUVChannels: 0
-    generateSecondaryUV: 0
-    useFileUnits: 1
-    optimizeMeshForGPU: 1
-    keepQuads: 0
-    weldVertices: 1
-    preserveHierarchy: 0
-    indexFormat: 1
-    secondaryUVAngleDistortion: 8
-    secondaryUVAreaDistortion: 15.000001
-    secondaryUVHardAngle: 88
-    secondaryUVPackMargin: 4
-    useFileScale: 0
-    previousCalculatedGlobalScale: 1
-    hasPreviousCalculatedGlobalScale: 0
-  tangentSpace:
-    normalSmoothAngle: 60
-    normalImportMode: 1
-    tangentImportMode: 4
-    normalCalculationMode: 0
-  importAnimation: 1
-  copyAvatar: 0
-  humanDescription:
-    serializedVersion: 2
-    human: []
-    skeleton: []
-    armTwist: 0.5
-    foreArmTwist: 0.5
-    upperLegTwist: 0.5
-    legTwist: 0.5
-    armStretch: 0.05
-    legStretch: 0.05
-    feetSpacing: 0
-    rootMotionBoneName: 
-    rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
-    hasTranslationDoF: 0
-    hasExtraRoot: 0
-    skeletonHasParents: 0
-  lastHumanDescriptionAvatarSource: {instanceID: 0}
-  animationType: 2
-  humanoidOversampling: 1
-  additionalBone: 0
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 101
Assets/Hard Surface Pro/Shared/Props/Candles/CandleLow.OBJ.meta

@@ -1,101 +0,0 @@
-fileFormatVersion: 2
-guid: 3ed2510dfcef962419177676e2547772
-ModelImporter:
-  serializedVersion: 23
-  fileIDToRecycleName:
-    100000: CandleLow
-    100002: //RootNode
-    400000: CandleLow
-    400002: //RootNode
-    2300000: CandleLow
-    3300000: CandleLow
-    4300000: CandleLow
-    11100000: //RootNode
-  externalObjects:
-  - first:
-      type: UnityEngine:Material
-      assembly: UnityEngine.CoreModule
-      name: CandleLowMat
-    second: {fileID: 2100000, guid: 9c7fd8dbbdc7a3b4f877e059bd90c052, type: 2}
-  materials:
-    importMaterials: 1
-    materialName: 3
-    materialSearch: 1
-    materialLocation: 0
-  animations:
-    legacyGenerateAnimations: 4
-    bakeSimulation: 0
-    resampleCurves: 1
-    optimizeGameObjects: 0
-    motionNodeName: 
-    rigImportErrors: 
-    rigImportWarnings: 
-    animationImportErrors: 
-    animationImportWarnings: 
-    animationRetargetingWarnings: 
-    animationDoRetargetingWarnings: 0
-    importAnimatedCustomProperties: 0
-    importConstraints: 0
-    animationCompression: 1
-    animationRotationError: 0.5
-    animationPositionError: 0.5
-    animationScaleError: 0.5
-    animationWrapMode: 0
-    extraExposedTransformPaths: []
-    extraUserProperties: []
-    clipAnimations: []
-    isReadable: 1
-  meshes:
-    lODScreenPercentages: []
-    globalScale: 0.01
-    meshCompression: 0
-    addColliders: 0
-    importVisibility: 0
-    importBlendShapes: 1
-    importCameras: 0
-    importLights: 0
-    swapUVChannels: 0
-    generateSecondaryUV: 0
-    useFileUnits: 1
-    optimizeMeshForGPU: 1
-    keepQuads: 0
-    weldVertices: 1
-    preserveHierarchy: 0
-    indexFormat: 1
-    secondaryUVAngleDistortion: 8
-    secondaryUVAreaDistortion: 15.000001
-    secondaryUVHardAngle: 88
-    secondaryUVPackMargin: 4
-    useFileScale: 0
-    previousCalculatedGlobalScale: 1
-    hasPreviousCalculatedGlobalScale: 0
-  tangentSpace:
-    normalSmoothAngle: 180
-    normalImportMode: 1
-    tangentImportMode: 4
-    normalCalculationMode: 0
-  importAnimation: 1
-  copyAvatar: 0
-  humanDescription:
-    serializedVersion: 2
-    human: []
-    skeleton: []
-    armTwist: 0.5
-    foreArmTwist: 0.5
-    upperLegTwist: 0.5
-    legTwist: 0.5
-    armStretch: 0.05
-    legStretch: 0.05
-    feetSpacing: 0
-    rootMotionBoneName: 
-    rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
-    hasTranslationDoF: 0
-    hasExtraRoot: 0
-    skeletonHasParents: 1
-  lastHumanDescriptionAvatarSource: {instanceID: 0}
-  animationType: 1
-  humanoidOversampling: 1
-  additionalBone: 0
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 36 - 36
Assets/MaterializeFX/MaterializationFX/Scripts/ShaderParameterSetter.cs

@@ -1,37 +1,37 @@
-using UnityEngine;
-
-namespace MaterializationFX.Scripts
-{
-    internal sealed class ShaderParameterSetter
-    {
-        private Renderer[] _rends;
-
-        public void Init(GameObject targetObject, string shaderName, bool modifyChildren)
-        {
-            _rends = !modifyChildren
-                ? new[] {targetObject.GetComponent<Renderer>()}
-                : targetObject.GetComponentsInChildren<Renderer>();
-
-            foreach (var rend in _rends)
-                rend.material.shader = Shader.Find(shaderName);
-        }
-
-        public void SetFloat(string propertyName, float value)
-        {
-            foreach (var rend in _rends)
-                rend.material.SetFloat(propertyName, value);
-        }
-
-        public void SetInt(string propertyName, int value)
-        {
-            foreach (var rend in _rends)
-                rend.material.SetInt(propertyName, value);
-        }
-        
-        public void SetVector(string propertyName, Vector3 value)
-        {
-            foreach (var rend in _rends)
-                rend.material.SetVector(propertyName, value);
-        }
-    }
+using UnityEngine;
+
+namespace MaterializationFX.Scripts
+{
+    internal sealed class ShaderParameterSetter
+    {
+        private Renderer[] _rends;
+
+        public void Init(GameObject targetObject, string shaderName, bool modifyChildren)
+        {
+            _rends = !modifyChildren
+                ? new[] {targetObject.GetComponent<Renderer>()}
+                : targetObject.GetComponentsInChildren<Renderer>();
+
+            foreach (var rend in _rends)
+                rend.material.shader = Shader.Find(shaderName);
+        }
+
+        public void SetFloat(string propertyName, float value)
+        {
+            foreach (var rend in _rends)
+                rend.material.SetFloat(propertyName, value);
+        }
+
+        public void SetInt(string propertyName, int value)
+        {
+            foreach (var rend in _rends)
+                rend.material.SetInt(propertyName, value);
+        }
+        
+        public void SetVector(string propertyName, Vector3 value)
+        {
+            foreach (var rend in _rends)
+                rend.material.SetVector(propertyName, value);
+        }
+    }
 }

+ 40 - 40
Assets/MaterializeFX/MaterializationFX/Scripts/Utils/DemoPrefabController.cs

@@ -1,41 +1,41 @@
-using UnityEngine;
-
-namespace MaterializationFX.Scripts.Utils
-{
-    internal sealed class DemoPrefabController : MonoBehaviour
-    {
-        public int StartNum;
-        public GameObject[] Prefabs;
-
-        private GameObject _currentInstance;
-        private int _currentPrefabNum;
-
-        public void Next()
-        {
-            if (Prefabs.Length == 0)
-                return;
-
-            _currentPrefabNum++;
-            if (_currentPrefabNum >= Prefabs.Length)
-                _currentPrefabNum = 0;
-
-            ChangePrefab(_currentPrefabNum);
-        }
-
-        private void Start()
-        {
-            _currentPrefabNum = StartNum;
-
-            ChangePrefab(_currentPrefabNum);
-        }
-
-        private void ChangePrefab(int num)
-        {
-            if (_currentInstance != null)
-                Destroy(_currentInstance);
-            var newPrefab = Prefabs[num];
-            _currentInstance = Instantiate(newPrefab, newPrefab.transform.position, newPrefab.transform.transform.rotation);
-            _currentInstance.SetActive(true);
-        }
-    }
+using UnityEngine;
+
+namespace MaterializationFX.Scripts.Utils
+{
+    internal sealed class DemoPrefabController : MonoBehaviour
+    {
+        public int StartNum;
+        public GameObject[] Prefabs;
+
+        private GameObject _currentInstance;
+        private int _currentPrefabNum;
+
+        public void Next()
+        {
+            if (Prefabs.Length == 0)
+                return;
+
+            _currentPrefabNum++;
+            if (_currentPrefabNum >= Prefabs.Length)
+                _currentPrefabNum = 0;
+
+            ChangePrefab(_currentPrefabNum);
+        }
+
+        private void Start()
+        {
+            _currentPrefabNum = StartNum;
+
+            ChangePrefab(_currentPrefabNum);
+        }
+
+        private void ChangePrefab(int num)
+        {
+            if (_currentInstance != null)
+                Destroy(_currentInstance);
+            var newPrefab = Prefabs[num];
+            _currentInstance = Instantiate(newPrefab, newPrefab.transform.position, newPrefab.transform.transform.rotation);
+            _currentInstance.SetActive(true);
+        }
+    }
 }

+ 58 - 58
Assets/MaterializeFX/MaterializationFX/Scripts/Utils/MouseOrbitController.cs

@@ -1,58 +1,58 @@
-using UnityEngine;
-
-namespace MaterializationFX.Scripts.Utils
-{
-	internal sealed class MouseOrbitController : MonoBehaviour
-	{
-		public Transform Target;
-		public float Distance = 5.0f;
-		public float XSpeed = 120.0f;
-		public float YSpeed = 120.0f;
-
-		public float YMinLimit = 20f;
-		public float YMaxLimit = 80f;
-
-		public float DistanceMin = .5f;
-		public float DistanceMax = 15f;
-
-		private float _x;
-		private float _y;
-
-		private void Start()
-		{
-			var angles = transform.eulerAngles;
-			_x = angles.y;
-			_y = angles.x;
-		}
-
-		private void LateUpdate()
-		{
-			if (!Input.GetMouseButton(0))
-				return;
-
-			_x += Input.GetAxis("Mouse X") * XSpeed * Distance * 0.02f;
-			_y -= Input.GetAxis("Mouse Y") * YSpeed * 0.02f;
-
-			_y = ClampAngle(_y, YMinLimit, YMaxLimit);
-
-			var rotation = Quaternion.Euler(_y, _x, 0);
-
-			Distance -= Input.GetAxis("Mouse ScrollWheel") * 5;
-
-			var negDistance = new Vector3(0.0f, 0.0f, -Distance);
-			var position = rotation * negDistance + Target.position;
-
-			transform.rotation = rotation;
-			transform.position = position;
-		}
-
-		private static float ClampAngle(float angle, float min, float max)
-		{
-			if (angle < -360F)
-				angle += 360F;
-			if (angle > 360F)
-				angle -= 360F;
-			return Mathf.Clamp(angle, min, max);
-		}
-	}
-}
+using UnityEngine;
+
+namespace MaterializationFX.Scripts.Utils
+{
+	internal sealed class MouseOrbitController : MonoBehaviour
+	{
+		public Transform Target;
+		public float Distance = 5.0f;
+		public float XSpeed = 120.0f;
+		public float YSpeed = 120.0f;
+
+		public float YMinLimit = 20f;
+		public float YMaxLimit = 80f;
+
+		public float DistanceMin = .5f;
+		public float DistanceMax = 15f;
+
+		private float _x;
+		private float _y;
+
+		private void Start()
+		{
+			var angles = transform.eulerAngles;
+			_x = angles.y;
+			_y = angles.x;
+		}
+
+		private void LateUpdate()
+		{
+			if (!Input.GetMouseButton(0))
+				return;
+
+			_x += Input.GetAxis("Mouse X") * XSpeed * Distance * 0.02f;
+			_y -= Input.GetAxis("Mouse Y") * YSpeed * 0.02f;
+
+			_y = ClampAngle(_y, YMinLimit, YMaxLimit);
+
+			var rotation = Quaternion.Euler(_y, _x, 0);
+
+			Distance -= Input.GetAxis("Mouse ScrollWheel") * 5;
+
+			var negDistance = new Vector3(0.0f, 0.0f, -Distance);
+			var position = rotation * negDistance + Target.position;
+
+			transform.rotation = rotation;
+			transform.position = position;
+		}
+
+		private static float ClampAngle(float angle, float min, float max)
+		{
+			if (angle < -360F)
+				angle += 360F;
+			if (angle > 360F)
+				angle -= 360F;
+			return Mathf.Clamp(angle, min, max);
+		}
+	}
+}

+ 30 - 30
Assets/MathClass/Scripts/Line.cs

@@ -1,30 +1,30 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class Line : MonoBehaviour {
-	private LineRenderer line;
-	public GameObject pos1;
-	public GameObject pos2;
-
-	// Use this for initialization
-	void Start () {
-		line = this.gameObject.AddComponent<LineRenderer>();
-		
-		line.material = new Material(Shader.Find("Standard"));
-		line.SetVertexCount(2);
-		line.SetColors(Color.yellow, Color.yellow); 
-		line.SetWidth(0.01f, 0.01f);
-
-		
-
-	}
-	
-	// Update is called once per frame
-	void Update () {
-	
-		line.SetPosition(0, pos1.transform.position);
-		line.SetPosition(1, pos2.transform.position);
-
-	}
-}
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class Line : MonoBehaviour {
+	private LineRenderer line;
+	public GameObject pos1;
+	public GameObject pos2;
+
+	// Use this for initialization
+	void Start () {
+		line = this.gameObject.AddComponent<LineRenderer>();
+		
+		line.material = new Material(Shader.Find("Standard"));
+		line.SetVertexCount(2);
+		line.SetColors(Color.yellow, Color.yellow); 
+		line.SetWidth(0.01f, 0.01f);
+
+		
+
+	}
+	
+	// Update is called once per frame
+	void Update () {
+	
+		line.SetPosition(0, pos1.transform.position);
+		line.SetPosition(1, pos2.transform.position);
+
+	}
+}

+ 52 - 52
Assets/MathClass/Scripts/MethodExtensionForUnity.cs

@@ -1,52 +1,52 @@
-using UnityEngine;
-
-//Unity的一些扩展方法
-static public class MethodExtensionForUnity
-{
-	/// <summary>
-	/// Gets or add a component. Usage example:
-	/// BoxCollider boxCollider = transform.GetOrAddComponent<BoxCollider>();
-	/// </summary>
-	static public T GetOrAddComponent<T>(this Component child, bool set_enable = false) where T : Component
-	{
-		T result = child.GetComponent<T>();
-		if (result == null)
-		{
-			result = child.gameObject.AddComponent<T>();
-		}
-		var bcomp = result as Behaviour;
-		if (set_enable)
-		{
-			if (bcomp != null) bcomp.enabled = true;
-		}
-		return result;
-	}
-
-	static public T GetOrAddComponent<T>(this GameObject go) where T : Component
-	{
-		T result = go.transform.GetComponent<T>();
-		if (result == null)
-		{
-			result = go.AddComponent<T>();
-		}
-		var bcomp = result as Behaviour;
-		if (bcomp != null) bcomp.enabled = true;
-		return result;
-	}
-
-
-	public static void walk(this GameObject o, System.Action<GameObject> f)
-	{
-		f(o);
-
-		int numChildren = o.transform.childCount;
-
-		for (int i = 0; i < numChildren; ++i)
-		{
-			walk(o.transform.GetChild(i).gameObject, f);
-		}
-	}
-
-
-}
-
+using UnityEngine;
+
+//Unity的一些扩展方法
+static public class MethodExtensionForUnity
+{
+	/// <summary>
+	/// Gets or add a component. Usage example:
+	/// BoxCollider boxCollider = transform.GetOrAddComponent<BoxCollider>();
+	/// </summary>
+	static public T GetOrAddComponent<T>(this Component child, bool set_enable = false) where T : Component
+	{
+		T result = child.GetComponent<T>();
+		if (result == null)
+		{
+			result = child.gameObject.AddComponent<T>();
+		}
+		var bcomp = result as Behaviour;
+		if (set_enable)
+		{
+			if (bcomp != null) bcomp.enabled = true;
+		}
+		return result;
+	}
+
+	static public T GetOrAddComponent<T>(this GameObject go) where T : Component
+	{
+		T result = go.transform.GetComponent<T>();
+		if (result == null)
+		{
+			result = go.AddComponent<T>();
+		}
+		var bcomp = result as Behaviour;
+		if (bcomp != null) bcomp.enabled = true;
+		return result;
+	}
+
+
+	public static void walk(this GameObject o, System.Action<GameObject> f)
+	{
+		f(o);
+
+		int numChildren = o.transform.childCount;
+
+		for (int i = 0; i < numChildren; ++i)
+		{
+			walk(o.transform.GetChild(i).gameObject, f);
+		}
+	}
+
+
+}
+

+ 59 - 59
Assets/MathClass/Scripts/Play.cs

@@ -1,59 +1,59 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class Play : MonoBehaviour {
-	//int countIndex=1;
-	public GameObject butPlay;
-	Animator ani;
-	AudioSource aud;
-	public string playani;
-
-	// Use this for initialization
-	void Start () {
-		ani = butPlay.GetComponent<Animator> ();
-		ani.speed = 0;
-		aud = butPlay.GetComponent<AudioSource> ();
-	}
-	
-	// Update is called once per frame
-	void Update () {
-		if (Input.GetKeyDown(KeyCode.F)) {
-			
-			if(PauseSign.sign==false)
-			{
-				ani.speed = 1;
-				ani.Play (playani, 0, 0f);
-
-			}
-			if (PauseSign.sign == true) 
-			{
-				ani.speed = 1;
-				PauseSign.sign = false;
-			
-			}
-		}
-
-	}
-	public void onClick(){
-		//countIndex *= -1;
-		//if(countIndex>0){
-		//	ani.speed = 1;
-		//}
-		//if(countIndex<0){
-		//	ani.speed = 0;
-		//}
-		if(PauseSign.sign==false)
-		{
-			ani.speed = 1;
-			ani.Play (playani, 0, 0f);
-			aud.Play ();
-		}
-		if (PauseSign.sign == true) 
-		{
-			ani.speed = 1;
-			PauseSign.sign = false;
-			aud.Pause ();
-		}
-	}
-}
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class Play : MonoBehaviour {
+	//int countIndex=1;
+	public GameObject butPlay;
+	Animator ani;
+	AudioSource aud;
+	public string playani;
+
+	// Use this for initialization
+	void Start () {
+		ani = butPlay.GetComponent<Animator> ();
+		ani.speed = 0;
+		aud = butPlay.GetComponent<AudioSource> ();
+	}
+	
+	// Update is called once per frame
+	void Update () {
+		if (Input.GetKeyDown(KeyCode.F)) {
+			
+			if(PauseSign.sign==false)
+			{
+				ani.speed = 1;
+				ani.Play (playani, 0, 0f);
+
+			}
+			if (PauseSign.sign == true) 
+			{
+				ani.speed = 1;
+				PauseSign.sign = false;
+			
+			}
+		}
+
+	}
+	public void onClick(){
+		//countIndex *= -1;
+		//if(countIndex>0){
+		//	ani.speed = 1;
+		//}
+		//if(countIndex<0){
+		//	ani.speed = 0;
+		//}
+		if(PauseSign.sign==false)
+		{
+			ani.speed = 1;
+			ani.Play (playani, 0, 0f);
+			aud.Play ();
+		}
+		if (PauseSign.sign == true) 
+		{
+			ani.speed = 1;
+			PauseSign.sign = false;
+			aud.Pause ();
+		}
+	}
+}

+ 54 - 54
Assets/MathClass/Scripts/PolygonDrawer.cs

@@ -1,55 +1,55 @@
-using UnityEngine;
-
-/// <summary>
-/// 绘制多边形
-/// TODO: 存在两点重合时绘制有问题
-/// </summary>
-public class PolygonDrawer : MonoBehaviour
-{
-	public Material material;
-	public Transform[] vertices;
-	private MeshRenderer mRenderer;
-	private MeshFilter mFilter;
-
-	void Start()
-	{
-		Draw();
-	}
-
-	void Update()
-	{
-		Draw();
-	}
-
-	[ContextMenu("Draw")]
-	public void Draw()
-	{
-		Vector2[] vertices2D = new Vector2[vertices.Length];
-		Vector3[] vertices3D = new Vector3[vertices.Length];
-		for (int i = 0; i < vertices.Length; i++)
-		{
-			Vector3 vertice = vertices[i].localPosition;
-			vertices2D[i] = new Vector2(vertice.x, vertice.y);
-			vertices3D[i] = vertice;
-		}
-
-		Triangulator tr = new Triangulator(vertices2D);
-		int[] triangles = tr.Triangulate();
-
-		Mesh mesh = new Mesh();
-		mesh.vertices = vertices3D;
-		mesh.triangles = triangles;
-
-		if (mRenderer == null)
-		{
-			mRenderer = gameObject.GetOrAddComponent<MeshRenderer>();
-		}
-		mRenderer.material = material;
-		if (mFilter == null)
-		{
-			mFilter = gameObject.GetOrAddComponent<MeshFilter>();
-		}
-		mFilter.mesh = mesh;
-		
-	}
+using UnityEngine;
+
+/// <summary>
+/// 绘制多边形
+/// TODO: 存在两点重合时绘制有问题
+/// </summary>
+public class PolygonDrawer : MonoBehaviour
+{
+	public Material material;
+	public Transform[] vertices;
+	private MeshRenderer mRenderer;
+	private MeshFilter mFilter;
+
+	void Start()
+	{
+		Draw();
+	}
+
+	void Update()
+	{
+		Draw();
+	}
+
+	[ContextMenu("Draw")]
+	public void Draw()
+	{
+		Vector2[] vertices2D = new Vector2[vertices.Length];
+		Vector3[] vertices3D = new Vector3[vertices.Length];
+		for (int i = 0; i < vertices.Length; i++)
+		{
+			Vector3 vertice = vertices[i].localPosition;
+			vertices2D[i] = new Vector2(vertice.x, vertice.y);
+			vertices3D[i] = vertice;
+		}
+
+		Triangulator tr = new Triangulator(vertices2D);
+		int[] triangles = tr.Triangulate();
+
+		Mesh mesh = new Mesh();
+		mesh.vertices = vertices3D;
+		mesh.triangles = triangles;
+
+		if (mRenderer == null)
+		{
+			mRenderer = gameObject.GetOrAddComponent<MeshRenderer>();
+		}
+		mRenderer.material = material;
+		if (mFilter == null)
+		{
+			mFilter = gameObject.GetOrAddComponent<MeshFilter>();
+		}
+		mFilter.mesh = mesh;
+		
+	}
 }

+ 120 - 120
Assets/MathClass/Scripts/Triangulator.cs

@@ -1,121 +1,121 @@
-using UnityEngine;
-using System.Collections.Generic;
-
-public class Triangulator
-{
-	private List<Vector2> m_points = new List<Vector2>();
-
-	public Triangulator(Vector2[] points)
-	{
-		m_points = new List<Vector2>(points);
-	}
-
-	public int[] Triangulate()
-	{
-		List<int> indices = new List<int>();
-
-		int n = m_points.Count;
-		if (n < 3)
-			return indices.ToArray();
-
-		int[] V = new int[n];
-		if (Area() > 0)
-		{
-			for (int v = 0; v < n; v++)
-				V[v] = v;
-		}
-		else
-		{
-			for (int v = 0; v < n; v++)
-				V[v] = (n - 1) - v;
-		}
-
-		int nv = n;
-		int count = 2 * nv;
-		for (int m = 0, v = nv - 1; nv > 2;)
-		{
-			if ((count--) <= 0)
-				return indices.ToArray();
-
-			int u = v;
-			if (nv <= u)
-				u = 0;
-			v = u + 1;
-			if (nv <= v)
-				v = 0;
-			int w = v + 1;
-			if (nv <= w)
-				w = 0;
-
-			if (Snip(u, v, w, nv, V))
-			{
-				int a, b, c, s, t;
-				a = V[u];
-				b = V[v];
-				c = V[w];
-				indices.Add(a);
-				indices.Add(b);
-				indices.Add(c);
-				m++;
-				for (s = v, t = v + 1; t < nv; s++, t++)
-					V[s] = V[t];
-				nv--;
-				count = 2 * nv;
-			}
-		}
-
-		indices.Reverse();
-		return indices.ToArray();
-	}
-
-	private float Area()
-	{
-		int n = m_points.Count;
-		float A = 0.0f;
-		for (int p = n - 1, q = 0; q < n; p = q++)
-		{
-			Vector2 pval = m_points[p];
-			Vector2 qval = m_points[q];
-			A += pval.x * qval.y - qval.x * pval.y;
-		}
-		return (A * 0.5f);
-	}
-
-	private bool Snip(int u, int v, int w, int n, int[] V)
-	{
-		int p;
-		Vector2 A = m_points[V[u]];
-		Vector2 B = m_points[V[v]];
-		Vector2 C = m_points[V[w]];
-		if (Mathf.Epsilon > (((B.x - A.x) * (C.y - A.y)) - ((B.y - A.y) * (C.x - A.x))))
-			return false;
-		for (p = 0; p < n; p++)
-		{
-			if ((p == u) || (p == v) || (p == w))
-				continue;
-			Vector2 P = m_points[V[p]];
-			if (InsideTriangle(A, B, C, P))
-				return false;
-		}
-		return true;
-	}
-
-	private bool InsideTriangle(Vector2 A, Vector2 B, Vector2 C, Vector2 P)
-	{
-		float ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy;
-		float cCROSSap, bCROSScp, aCROSSbp;
-
-		ax = C.x - B.x; ay = C.y - B.y;
-		bx = A.x - C.x; by = A.y - C.y;
-		cx = B.x - A.x; cy = B.y - A.y;
-		apx = P.x - A.x; apy = P.y - A.y;
-		bpx = P.x - B.x; bpy = P.y - B.y;
-		cpx = P.x - C.x; cpy = P.y - C.y;
-
-		aCROSSbp = ax * bpy - ay * bpx;
-		cCROSSap = cx * apy - cy * apx;
-		bCROSScp = bx * cpy - by * cpx;
-
-		return ((aCROSSbp >= 0.0f) && (bCROSScp >= 0.0f) && (cCROSSap >= 0.0f));
-	}
+using UnityEngine;
+using System.Collections.Generic;
+
+public class Triangulator
+{
+	private List<Vector2> m_points = new List<Vector2>();
+
+	public Triangulator(Vector2[] points)
+	{
+		m_points = new List<Vector2>(points);
+	}
+
+	public int[] Triangulate()
+	{
+		List<int> indices = new List<int>();
+
+		int n = m_points.Count;
+		if (n < 3)
+			return indices.ToArray();
+
+		int[] V = new int[n];
+		if (Area() > 0)
+		{
+			for (int v = 0; v < n; v++)
+				V[v] = v;
+		}
+		else
+		{
+			for (int v = 0; v < n; v++)
+				V[v] = (n - 1) - v;
+		}
+
+		int nv = n;
+		int count = 2 * nv;
+		for (int m = 0, v = nv - 1; nv > 2;)
+		{
+			if ((count--) <= 0)
+				return indices.ToArray();
+
+			int u = v;
+			if (nv <= u)
+				u = 0;
+			v = u + 1;
+			if (nv <= v)
+				v = 0;
+			int w = v + 1;
+			if (nv <= w)
+				w = 0;
+
+			if (Snip(u, v, w, nv, V))
+			{
+				int a, b, c, s, t;
+				a = V[u];
+				b = V[v];
+				c = V[w];
+				indices.Add(a);
+				indices.Add(b);
+				indices.Add(c);
+				m++;
+				for (s = v, t = v + 1; t < nv; s++, t++)
+					V[s] = V[t];
+				nv--;
+				count = 2 * nv;
+			}
+		}
+
+		indices.Reverse();
+		return indices.ToArray();
+	}
+
+	private float Area()
+	{
+		int n = m_points.Count;
+		float A = 0.0f;
+		for (int p = n - 1, q = 0; q < n; p = q++)
+		{
+			Vector2 pval = m_points[p];
+			Vector2 qval = m_points[q];
+			A += pval.x * qval.y - qval.x * pval.y;
+		}
+		return (A * 0.5f);
+	}
+
+	private bool Snip(int u, int v, int w, int n, int[] V)
+	{
+		int p;
+		Vector2 A = m_points[V[u]];
+		Vector2 B = m_points[V[v]];
+		Vector2 C = m_points[V[w]];
+		if (Mathf.Epsilon > (((B.x - A.x) * (C.y - A.y)) - ((B.y - A.y) * (C.x - A.x))))
+			return false;
+		for (p = 0; p < n; p++)
+		{
+			if ((p == u) || (p == v) || (p == w))
+				continue;
+			Vector2 P = m_points[V[p]];
+			if (InsideTriangle(A, B, C, P))
+				return false;
+		}
+		return true;
+	}
+
+	private bool InsideTriangle(Vector2 A, Vector2 B, Vector2 C, Vector2 P)
+	{
+		float ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy;
+		float cCROSSap, bCROSScp, aCROSSbp;
+
+		ax = C.x - B.x; ay = C.y - B.y;
+		bx = A.x - C.x; by = A.y - C.y;
+		cx = B.x - A.x; cy = B.y - A.y;
+		apx = P.x - A.x; apy = P.y - A.y;
+		bpx = P.x - B.x; bpy = P.y - B.y;
+		cpx = P.x - C.x; cpy = P.y - C.y;
+
+		aCROSSbp = ax * bpy - ay * bpx;
+		cCROSSap = cx * apy - cy * apx;
+		bCROSScp = bx * cpy - by * cpx;
+
+		return ((aCROSSbp >= 0.0f) && (bCROSScp >= 0.0f) && (cCROSSap >= 0.0f));
+	}
 }

+ 9 - 9
Assets/MathClass/Scripts/test.cs

@@ -1,10 +1,10 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class test {
-	private List<Vector2> m_vector2s = new List<Vector2>();
-	public test(Vector2[] vector2s) {
-		m_vector2s = new List<Vector2>(vector2s);
- }
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class test {
+	private List<Vector2> m_vector2s = new List<Vector2>();
+	public test(Vector2[] vector2s) {
+		m_vector2s = new List<Vector2>(vector2s);
+ }
 }

+ 100 - 100
Assets/Mirza Beig/Demos/The Last Particle/Scripts/AudioPitchAndVolumeByVelocity.cs

@@ -1,100 +1,100 @@
-
-// =================================	
-// Namespaces.
-// =================================
-
-using UnityEngine;
-
-// =================================	
-// Define namespace.
-// =================================
-
-namespace MirzaBeig
-{
-
-    namespace Demos
-    {
-
-        namespace TheLastParticle
-        {
-
-            // =================================	
-            // Classes.
-            // =================================
-
-            //[ExecuteInEditMode]
-            [System.Serializable]
-
-            public class AudioPitchAndVolumeByVelocity : MonoBehaviour
-            {
-                // =================================	
-                // Nested classes and structures.
-                // =================================
-
-                // ...
-
-                // =================================	
-                // Variables.
-                // =================================
-
-                // ...
-
-                public float maxSpeed = 20.0f;
-
-                public Vector2 volumeRange = new Vector2(0.5f, 1.0f);
-                public Vector2 pitchRange = new Vector2(0.5f, 2.0f);
-
-                Rigidbody rb;
-                AudioSource audioSource;
-
-                // =================================	
-                // Functions.
-                // =================================
-
-                // ...
-
-                void Awake()
-                {
-
-                }
-
-                // ...
-
-                void Start()
-                {
-                    rb = GetComponentInParent<Rigidbody>();
-                    audioSource = GetComponent<AudioSource>();
-                }
-
-                // ...
-
-                void LateUpdate()
-                {
-                    float speed = rb.velocity.magnitude;
-                    float lerpTimePosition = speed / maxSpeed;
-
-                    lerpTimePosition = Mathf.Clamp01(lerpTimePosition);
-
-                    audioSource.volume = Mathf.Lerp(volumeRange.x, volumeRange.y, lerpTimePosition);
-                    audioSource.pitch = Mathf.Lerp(pitchRange.x, pitchRange.y, lerpTimePosition);
-                }
-
-                // =================================	
-                // End functions.
-                // =================================
-
-            }
-
-            // =================================	
-            // End namespace.
-            // =================================
-
-        }
-
-    }
-
-}
-
-// =================================	
-// --END-- //
-// =================================
+
+// =================================	
+// Namespaces.
+// =================================
+
+using UnityEngine;
+
+// =================================	
+// Define namespace.
+// =================================
+
+namespace MirzaBeig
+{
+
+    namespace Demos
+    {
+
+        namespace TheLastParticle
+        {
+
+            // =================================	
+            // Classes.
+            // =================================
+
+            //[ExecuteInEditMode]
+            [System.Serializable]
+
+            public class AudioPitchAndVolumeByVelocity : MonoBehaviour
+            {
+                // =================================	
+                // Nested classes and structures.
+                // =================================
+
+                // ...
+
+                // =================================	
+                // Variables.
+                // =================================
+
+                // ...
+
+                public float maxSpeed = 20.0f;
+
+                public Vector2 volumeRange = new Vector2(0.5f, 1.0f);
+                public Vector2 pitchRange = new Vector2(0.5f, 2.0f);
+
+                Rigidbody rb;
+                AudioSource audioSource;
+
+                // =================================	
+                // Functions.
+                // =================================
+
+                // ...
+
+                void Awake()
+                {
+
+                }
+
+                // ...
+
+                void Start()
+                {
+                    rb = GetComponentInParent<Rigidbody>();
+                    audioSource = GetComponent<AudioSource>();
+                }
+
+                // ...
+
+                void LateUpdate()
+                {
+                    float speed = rb.velocity.magnitude;
+                    float lerpTimePosition = speed / maxSpeed;
+
+                    lerpTimePosition = Mathf.Clamp01(lerpTimePosition);
+
+                    audioSource.volume = Mathf.Lerp(volumeRange.x, volumeRange.y, lerpTimePosition);
+                    audioSource.pitch = Mathf.Lerp(pitchRange.x, pitchRange.y, lerpTimePosition);
+                }
+
+                // =================================	
+                // End functions.
+                // =================================
+
+            }
+
+            // =================================	
+            // End namespace.
+            // =================================
+
+        }
+
+    }
+
+}
+
+// =================================	
+// --END-- //
+// =================================

+ 369 - 369
Assets/Mirza Beig/Demos/The Last Particle/Scripts/CameraController.cs

@@ -1,369 +1,369 @@
-
-// =================================	
-// Namespaces.
-// =================================
-
-using UnityEngine;
-
-// =================================	
-// Define namespace.
-// =================================
-
-namespace MirzaBeig
-{
-
-    namespace Demos
-    {
-
-        namespace TheLastParticle
-        {
-
-            // =================================	
-            // Classes.
-            // =================================
-
-            //[ExecuteInEditMode]
-            [System.Serializable]
-
-            public class CameraController : MonoBehaviour
-            {
-                // =================================	
-                // Nested classes and structures.
-                // =================================
-
-                // ...
-
-                public struct ClipPlanePoints
-                {
-                    public Vector3 UpperLeft;
-                    public Vector3 UpperRight;
-                    public Vector3 LowerLeft;
-                    public Vector3 LowerRight;
-                }
-
-                // =================================	
-                // Variables.
-                // =================================
-
-                // ...
-
-                new Camera camera;
-
-                // Transforms.
-
-                [Header("Transforms")]
-
-                public Transform target;
-                public Transform offset;
-
-                // Position.
-
-                [Header("Position")]
-
-                public float followTargetSpeed = 8.0f;
-
-                // Rotation.
-
-                [Header("Rotation")]
-
-                Vector2 mouseInput;
-
-                public float mouseRotateAmount = 5.0f;
-                public float mouseRotateSpeed = 5.0f;
-
-                public float rotateZSpeed = 1.0f;
-                public float resetZRotationSpeed = 5.0f;
-
-                public Vector2 lookUpDownRange = new Vector2(-80.0f, 80.0f);
-
-                // Zoom.
-
-                [Header("Zoom")]
-
-                public float zoomDistance = 4.0f;
-
-                public float mouseZoomAmount = 1.0f;
-                public float mouseZoomSpeed = 5.0f;
-
-                public float mouseZoomMin = 1.0f;
-                public float mouseZoomMax = 5.0f;
-
-                // ...
-
-                [Header("Occlusion Zoom")]
-
-                public float occlusionZoomSpeed = 8.0f;
-                public float occlusionZoomOffset = 0.0f;
-
-                public float occlusionRaycastDownDistance = 0.5f;
-
-                public AnimationCurve occlisionRaycastDownCurve =
-                    new AnimationCurve(new Keyframe(0.0f, 1.0f), new Keyframe(1.0f, 0.0f));
-
-                // Offset framing.
-
-                [Header("Offset (Framing)")]
-
-                public float offsetFramingAmount = 2.0f;
-                public float offsetFramingSpeed = 1.0f;
-
-                public float minPlayerSpeedForOffsetFraming = 1.0f;
-                public float minMouseMoveForOffsetFraming = 1.0f;
-
-                Vector3 offsetStartPosition;
-
-                Vector3 offsetPositionTarget;
-                Vector3 offsetMouseFramePosition;
-
-                // Stored locally as euler because Quaternions take shortest
-                // path around for rotation. By using euler, I don't run into 
-                // the problem of spinning the camera too quickly and causing 
-                // a sudden snap because the rotation exceeded 180 degrees.
-
-                Vector3 rotationEuler;
-                Vector3 targetRotationEuler;
-
-                // Player.
-
-                Player player;
-
-                // =================================	
-                // Functions.
-                // =================================
-
-                // ...
-
-                void Awake()
-                {
-
-                }
-
-                // ...
-
-                void Start()
-                {
-                    lockMouse();
-
-                    camera = Camera.main;
-                    player = FindObjectOfType<Player>();
-
-                    zoomDistance = Vector3.Distance(camera.transform.position, target.position);
-
-                    offsetStartPosition = offset.localPosition;
-                    offsetPositionTarget = offsetStartPosition;
-                }
-
-                // ...
-
-                void lockMouse()
-                {
-                    Cursor.visible = false;
-                    Cursor.lockState = CursorLockMode.Locked;
-                }
-                void unlockMouse()
-                {
-                    Cursor.visible = true;
-                    Cursor.lockState = CursorLockMode.None;
-                }
-
-                // ...
-
-                void FixedUpdate()
-                {
-
-                }
-
-                // ...
-
-                void Update()
-                {
-                    // Input.
-
-                    mouseInput.x = Input.GetAxis("Mouse X");
-                    mouseInput.y = Input.GetAxis("Mouse Y");
-
-                    if (Input.GetMouseButtonDown(0))
-                    {
-                        lockMouse();
-                    }
-                    else if (Input.GetKeyDown(KeyCode.Escape))
-                    {
-                        unlockMouse();
-                    }
-                }
-
-                // ...
-
-                void LateUpdate()
-                {                    
-                    // Follow position.
-
-                    transform.position = Damping.dampVector3(transform.position, target.position, followTargetSpeed, Time.deltaTime);
-
-                    if (Cursor.lockState == CursorLockMode.Locked)
-                    {
-                        // Rotation.
-                        // Can't get it to smooth when rotating, so I just set the physica time step to 0.01f (half of default).
-
-                        targetRotationEuler.y += mouseInput.x * mouseRotateAmount;
-                        targetRotationEuler.x += -mouseInput.y * mouseRotateAmount;
-
-                        targetRotationEuler.x = Mathf.Clamp(targetRotationEuler.x, lookUpDownRange.x, lookUpDownRange.y);
-
-                        targetRotationEuler.z += mouseInput.x * rotateZSpeed;
-
-                        rotationEuler = Damping.dampVector3(rotationEuler, targetRotationEuler, mouseRotateSpeed, Time.deltaTime);
-
-                        transform.eulerAngles = rotationEuler;
-
-                        //transform.rotation *= Quaternion.AngleAxis(mouseRotateSpeed * Time.deltaTime, Vector3.up);
-
-                        // Offset framing.
-
-                        float playerSpeed = player.rb.velocity.magnitude;
-
-                        if (playerSpeed < minPlayerSpeedForOffsetFraming)
-                        {
-                            offsetMouseFramePosition = offsetStartPosition;
-                        }
-                        else
-                        {
-                            if (mouseInput.x > minMouseMoveForOffsetFraming)
-                            {
-                                offsetMouseFramePosition.x = -offsetFramingAmount;
-                            }
-                            else if (mouseInput.x < -minMouseMoveForOffsetFraming)
-                            {
-                                offsetMouseFramePosition.x = offsetFramingAmount;
-                            }
-
-                            if (mouseInput.y > minMouseMoveForOffsetFraming)
-                            {
-                                offsetMouseFramePosition.y = -offsetFramingAmount;
-                            }
-                            else if (mouseInput.y < -minMouseMoveForOffsetFraming)
-                            {
-                                offsetMouseFramePosition.y = offsetFramingAmount;
-                            }
-                        }
-
-                        offsetPositionTarget = Damping.dampVector3(offsetPositionTarget, offsetMouseFramePosition, offsetFramingSpeed, Time.deltaTime);
-
-                        // Balance out rotation around Z back to 0.0f.
-
-                        targetRotationEuler.z = Damping.dampFloat(targetRotationEuler.z, 0.0f, resetZRotationSpeed, Time.deltaTime);
-
-                        // Zoom.
-
-                        // Scrolling happens as 0.1f increments. x10.0f to make it 1.0f.
-
-                        float scroll = Input.GetAxis("Mouse ScrollWheel") * 10.0f;
-
-                        zoomDistance -= scroll * mouseZoomAmount;
-                        zoomDistance = Mathf.Clamp(zoomDistance, mouseZoomMin, mouseZoomMax);
-
-                        // Player occlusion check and zoom.
-
-                        RaycastHit hitInfo;
-
-                        checkIfPlayerOccluded(out hitInfo);
-                        //float nearestDistance = checkCameraPoints(out hitInfo);
-
-                        Vector3 finalOffsetPositionTarget;
-
-                        RaycastHit hitInfo2;
-
-                        Transform cameraTransform = camera.transform;
-
-                        Vector3 directionToTarget = (target.position - cameraTransform.position).normalized;
-                        Vector3 end = target.position - (directionToTarget * (zoomDistance + occlusionZoomOffset));
-
-                        Physics.Raycast(end, Vector3.down, out hitInfo2, occlusionRaycastDownDistance);
-                        Debug.DrawLine(end, end + (Vector3.down * occlusionRaycastDownDistance), Color.white);
-
-                        if (hitInfo.collider)
-                        {
-                            //finalOffsetPositionTarget = offsetPositionTarget.normalized * nearestDistance;
-                            finalOffsetPositionTarget = offsetPositionTarget.normalized * hitInfo.distance;
-                        }
-                        //if (hitInfo2.collider)
-                        //{                            
-                        //    float curveResult = 1.0f - occlisionRaycastDownCurve.Evaluate(hitInfo2.distance / occlusionRaycastDownDistance);
-                        //    finalOffsetPositionTarget = (offsetPositionTarget.normalized * zoomDistance) * curveResult;
-                        //}
-                        //else if (hitInfo.collider)
-                        //{
-                        //    finalOffsetPositionTarget = Vector3.zero;
-                        //}
-                        else
-                        {
-                            finalOffsetPositionTarget = offsetPositionTarget.normalized * zoomDistance;
-                        }
-
-                        offset.localPosition = Damping.dampVector3(offset.localPosition, finalOffsetPositionTarget, mouseZoomSpeed, Time.deltaTime);
-                    }
-                }
-
-                // ...
-
-                void checkIfPlayerOccluded(out RaycastHit hitInfo)
-                {
-                    if (!camera)
-                    {
-                        camera = Camera.main;
-                    }
-
-                    Transform cameraTransform = camera.transform;
-
-                    Vector3 directionToTarget = (target.position - cameraTransform.position).normalized;
-
-                    Vector3 start = target.position;
-                    Vector3 end = Application.isPlaying ?
-
-                        (target.position - (directionToTarget * (zoomDistance + occlusionZoomOffset))) :
-                        (offset.position + (-directionToTarget * occlusionZoomOffset));
-
-                    Physics.Linecast(start, end, out hitInfo);
-
-                    if (!Application.isPlaying)
-                    {
-                        Gizmos.color =
-                            hitInfo.collider ? Color.red : Color.green;
-
-                        Gizmos.DrawLine(start, end);
-                    }
-                    else
-                    {
-                        Debug.DrawLine(start, end, hitInfo.collider ? Color.red : Color.green);
-                    }
-                }
-
-                // ...
-
-                void OnDrawGizmos()
-                {
-                    RaycastHit hitInfo;
-
-                    checkIfPlayerOccluded(out hitInfo);
-                    //checkCameraPoints(out hitInfo);
-                }
-
-                // =================================	
-                // End functions.
-                // =================================
-
-            }
-
-            // =================================	
-            // End namespace.
-            // =================================
-
-        }
-
-    }
-
-}
-
-// =================================	
-// --END-- //
-// =================================
+
+// =================================	
+// Namespaces.
+// =================================
+
+using UnityEngine;
+
+// =================================	
+// Define namespace.
+// =================================
+
+namespace MirzaBeig
+{
+
+    namespace Demos
+    {
+
+        namespace TheLastParticle
+        {
+
+            // =================================	
+            // Classes.
+            // =================================
+
+            //[ExecuteInEditMode]
+            [System.Serializable]
+
+            public class CameraController : MonoBehaviour
+            {
+                // =================================	
+                // Nested classes and structures.
+                // =================================
+
+                // ...
+
+                public struct ClipPlanePoints
+                {
+                    public Vector3 UpperLeft;
+                    public Vector3 UpperRight;
+                    public Vector3 LowerLeft;
+                    public Vector3 LowerRight;
+                }
+
+                // =================================	
+                // Variables.
+                // =================================
+
+                // ...
+
+                new Camera camera;
+
+                // Transforms.
+
+                [Header("Transforms")]
+
+                public Transform target;
+                public Transform offset;
+
+                // Position.
+
+                [Header("Position")]
+
+                public float followTargetSpeed = 8.0f;
+
+                // Rotation.
+
+                [Header("Rotation")]
+
+                Vector2 mouseInput;
+
+                public float mouseRotateAmount = 5.0f;
+                public float mouseRotateSpeed = 5.0f;
+
+                public float rotateZSpeed = 1.0f;
+                public float resetZRotationSpeed = 5.0f;
+
+                public Vector2 lookUpDownRange = new Vector2(-80.0f, 80.0f);
+
+                // Zoom.
+
+                [Header("Zoom")]
+
+                public float zoomDistance = 4.0f;
+
+                public float mouseZoomAmount = 1.0f;
+                public float mouseZoomSpeed = 5.0f;
+
+                public float mouseZoomMin = 1.0f;
+                public float mouseZoomMax = 5.0f;
+
+                // ...
+
+                [Header("Occlusion Zoom")]
+
+                public float occlusionZoomSpeed = 8.0f;
+                public float occlusionZoomOffset = 0.0f;
+
+                public float occlusionRaycastDownDistance = 0.5f;
+
+                public AnimationCurve occlisionRaycastDownCurve =
+                    new AnimationCurve(new Keyframe(0.0f, 1.0f), new Keyframe(1.0f, 0.0f));
+
+                // Offset framing.
+
+                [Header("Offset (Framing)")]
+
+                public float offsetFramingAmount = 2.0f;
+                public float offsetFramingSpeed = 1.0f;
+
+                public float minPlayerSpeedForOffsetFraming = 1.0f;
+                public float minMouseMoveForOffsetFraming = 1.0f;
+
+                Vector3 offsetStartPosition;
+
+                Vector3 offsetPositionTarget;
+                Vector3 offsetMouseFramePosition;
+
+                // Stored locally as euler because Quaternions take shortest
+                // path around for rotation. By using euler, I don't run into 
+                // the problem of spinning the camera too quickly and causing 
+                // a sudden snap because the rotation exceeded 180 degrees.
+
+                Vector3 rotationEuler;
+                Vector3 targetRotationEuler;
+
+                // Player.
+
+                Player player;
+
+                // =================================	
+                // Functions.
+                // =================================
+
+                // ...
+
+                void Awake()
+                {
+
+                }
+
+                // ...
+
+                void Start()
+                {
+                    lockMouse();
+
+                    camera = Camera.main;
+                    player = FindObjectOfType<Player>();
+
+                    zoomDistance = Vector3.Distance(camera.transform.position, target.position);
+
+                    offsetStartPosition = offset.localPosition;
+                    offsetPositionTarget = offsetStartPosition;
+                }
+
+                // ...
+
+                void lockMouse()
+                {
+                    Cursor.visible = false;
+                    Cursor.lockState = CursorLockMode.Locked;
+                }
+                void unlockMouse()
+                {
+                    Cursor.visible = true;
+                    Cursor.lockState = CursorLockMode.None;
+                }
+
+                // ...
+
+                void FixedUpdate()
+                {
+
+                }
+
+                // ...
+
+                void Update()
+                {
+                    // Input.
+
+                    mouseInput.x = Input.GetAxis("Mouse X");
+                    mouseInput.y = Input.GetAxis("Mouse Y");
+
+                    if (Input.GetMouseButtonDown(0))
+                    {
+                        lockMouse();
+                    }
+                    else if (Input.GetKeyDown(KeyCode.Escape))
+                    {
+                        unlockMouse();
+                    }
+                }
+
+                // ...
+
+                void LateUpdate()
+                {                    
+                    // Follow position.
+
+                    transform.position = Damping.dampVector3(transform.position, target.position, followTargetSpeed, Time.deltaTime);
+
+                    if (Cursor.lockState == CursorLockMode.Locked)
+                    {
+                        // Rotation.
+                        // Can't get it to smooth when rotating, so I just set the physica time step to 0.01f (half of default).
+
+                        targetRotationEuler.y += mouseInput.x * mouseRotateAmount;
+                        targetRotationEuler.x += -mouseInput.y * mouseRotateAmount;
+
+                        targetRotationEuler.x = Mathf.Clamp(targetRotationEuler.x, lookUpDownRange.x, lookUpDownRange.y);
+
+                        targetRotationEuler.z += mouseInput.x * rotateZSpeed;
+
+                        rotationEuler = Damping.dampVector3(rotationEuler, targetRotationEuler, mouseRotateSpeed, Time.deltaTime);
+
+                        transform.eulerAngles = rotationEuler;
+
+                        //transform.rotation *= Quaternion.AngleAxis(mouseRotateSpeed * Time.deltaTime, Vector3.up);
+
+                        // Offset framing.
+
+                        float playerSpeed = player.rb.velocity.magnitude;
+
+                        if (playerSpeed < minPlayerSpeedForOffsetFraming)
+                        {
+                            offsetMouseFramePosition = offsetStartPosition;
+                        }
+                        else
+                        {
+                            if (mouseInput.x > minMouseMoveForOffsetFraming)
+                            {
+                                offsetMouseFramePosition.x = -offsetFramingAmount;
+                            }
+                            else if (mouseInput.x < -minMouseMoveForOffsetFraming)
+                            {
+                                offsetMouseFramePosition.x = offsetFramingAmount;
+                            }
+
+                            if (mouseInput.y > minMouseMoveForOffsetFraming)
+                            {
+                                offsetMouseFramePosition.y = -offsetFramingAmount;
+                            }
+                            else if (mouseInput.y < -minMouseMoveForOffsetFraming)
+                            {
+                                offsetMouseFramePosition.y = offsetFramingAmount;
+                            }
+                        }
+
+                        offsetPositionTarget = Damping.dampVector3(offsetPositionTarget, offsetMouseFramePosition, offsetFramingSpeed, Time.deltaTime);
+
+                        // Balance out rotation around Z back to 0.0f.
+
+                        targetRotationEuler.z = Damping.dampFloat(targetRotationEuler.z, 0.0f, resetZRotationSpeed, Time.deltaTime);
+
+                        // Zoom.
+
+                        // Scrolling happens as 0.1f increments. x10.0f to make it 1.0f.
+
+                        float scroll = Input.GetAxis("Mouse ScrollWheel") * 10.0f;
+
+                        zoomDistance -= scroll * mouseZoomAmount;
+                        zoomDistance = Mathf.Clamp(zoomDistance, mouseZoomMin, mouseZoomMax);
+
+                        // Player occlusion check and zoom.
+
+                        RaycastHit hitInfo;
+
+                        checkIfPlayerOccluded(out hitInfo);
+                        //float nearestDistance = checkCameraPoints(out hitInfo);
+
+                        Vector3 finalOffsetPositionTarget;
+
+                        RaycastHit hitInfo2;
+
+                        Transform cameraTransform = camera.transform;
+
+                        Vector3 directionToTarget = (target.position - cameraTransform.position).normalized;
+                        Vector3 end = target.position - (directionToTarget * (zoomDistance + occlusionZoomOffset));
+
+                        Physics.Raycast(end, Vector3.down, out hitInfo2, occlusionRaycastDownDistance);
+                        Debug.DrawLine(end, end + (Vector3.down * occlusionRaycastDownDistance), Color.white);
+
+                        if (hitInfo.collider)
+                        {
+                            //finalOffsetPositionTarget = offsetPositionTarget.normalized * nearestDistance;
+                            finalOffsetPositionTarget = offsetPositionTarget.normalized * hitInfo.distance;
+                        }
+                        //if (hitInfo2.collider)
+                        //{                            
+                        //    float curveResult = 1.0f - occlisionRaycastDownCurve.Evaluate(hitInfo2.distance / occlusionRaycastDownDistance);
+                        //    finalOffsetPositionTarget = (offsetPositionTarget.normalized * zoomDistance) * curveResult;
+                        //}
+                        //else if (hitInfo.collider)
+                        //{
+                        //    finalOffsetPositionTarget = Vector3.zero;
+                        //}
+                        else
+                        {
+                            finalOffsetPositionTarget = offsetPositionTarget.normalized * zoomDistance;
+                        }
+
+                        offset.localPosition = Damping.dampVector3(offset.localPosition, finalOffsetPositionTarget, mouseZoomSpeed, Time.deltaTime);
+                    }
+                }
+
+                // ...
+
+                void checkIfPlayerOccluded(out RaycastHit hitInfo)
+                {
+                    if (!camera)
+                    {
+                        camera = Camera.main;
+                    }
+
+                    Transform cameraTransform = camera.transform;
+
+                    Vector3 directionToTarget = (target.position - cameraTransform.position).normalized;
+
+                    Vector3 start = target.position;
+                    Vector3 end = Application.isPlaying ?
+
+                        (target.position - (directionToTarget * (zoomDistance + occlusionZoomOffset))) :
+                        (offset.position + (-directionToTarget * occlusionZoomOffset));
+
+                    Physics.Linecast(start, end, out hitInfo);
+
+                    if (!Application.isPlaying)
+                    {
+                        Gizmos.color =
+                            hitInfo.collider ? Color.red : Color.green;
+
+                        Gizmos.DrawLine(start, end);
+                    }
+                    else
+                    {
+                        Debug.DrawLine(start, end, hitInfo.collider ? Color.red : Color.green);
+                    }
+                }
+
+                // ...
+
+                void OnDrawGizmos()
+                {
+                    RaycastHit hitInfo;
+
+                    checkIfPlayerOccluded(out hitInfo);
+                    //checkCameraPoints(out hitInfo);
+                }
+
+                // =================================	
+                // End functions.
+                // =================================
+
+            }
+
+            // =================================	
+            // End namespace.
+            // =================================
+
+        }
+
+    }
+
+}
+
+// =================================	
+// --END-- //
+// =================================

+ 95 - 95
Assets/Mirza Beig/Demos/The Last Particle/Scripts/Collectable.cs

@@ -1,95 +1,95 @@
-
-// =================================	
-// Namespaces.
-// =================================
-
-using UnityEngine;
-
-// =================================	
-// Define namespace.
-// =================================
-
-namespace MirzaBeig
-{
-
-    namespace Demos
-    {
-
-        namespace TheLastParticle
-        {
-
-            // =================================	
-            // Classes.
-            // =================================
-
-            //[ExecuteInEditMode]
-            [System.Serializable]
-
-            public class Collectable : MonoBehaviour
-            {
-                // =================================	
-                // Nested classes and structures.
-                // =================================
-
-                // ...
-
-                // =================================	
-                // Variables.
-                // =================================
-
-                // ...
-
-                public GameObject[] deathPrefabs;
-
-                SetParent sp;
-                ParticleSystems.ParticleSystems ps;
-
-                // =================================	
-                // Functions.
-                // =================================
-
-                // ...
-
-                void Start()
-                {
-                    sp = GetComponent<SetParent>();
-                    ps = GetComponentInChildren<ParticleSystems.ParticleSystems>();
-                }
-
-                // ...
-
-                void OnTriggerEnter(Collider collider)
-                {
-                    if (collider.tag == "Player")
-                    {
-                        sp.run();
-                        ps.stop();
-
-                        for (int i = 0; i < deathPrefabs.Length; i++)
-                        {
-                            Instantiate(deathPrefabs[i], transform.position, transform.rotation);
-                        }
-
-                        Destroy(gameObject);
-                    }
-                }
-
-                // =================================	
-                // End functions.
-                // =================================
-
-            }
-
-            // =================================	
-            // End namespace.
-            // =================================
-
-        }
-
-    }
-
-}
-
-// =================================	
-// --END-- //
-// =================================
+
+// =================================	
+// Namespaces.
+// =================================
+
+using UnityEngine;
+
+// =================================	
+// Define namespace.
+// =================================
+
+namespace MirzaBeig
+{
+
+    namespace Demos
+    {
+
+        namespace TheLastParticle
+        {
+
+            // =================================	
+            // Classes.
+            // =================================
+
+            //[ExecuteInEditMode]
+            [System.Serializable]
+
+            public class Collectable : MonoBehaviour
+            {
+                // =================================	
+                // Nested classes and structures.
+                // =================================
+
+                // ...
+
+                // =================================	
+                // Variables.
+                // =================================
+
+                // ...
+
+                public GameObject[] deathPrefabs;
+
+                SetParent sp;
+                ParticleSystems.ParticleSystems ps;
+
+                // =================================	
+                // Functions.
+                // =================================
+
+                // ...
+
+                void Start()
+                {
+                    sp = GetComponent<SetParent>();
+                    ps = GetComponentInChildren<ParticleSystems.ParticleSystems>();
+                }
+
+                // ...
+
+                void OnTriggerEnter(Collider collider)
+                {
+                    if (collider.tag == "Player")
+                    {
+                        sp.run();
+                        ps.stop();
+
+                        for (int i = 0; i < deathPrefabs.Length; i++)
+                        {
+                            Instantiate(deathPrefabs[i], transform.position, transform.rotation);
+                        }
+
+                        Destroy(gameObject);
+                    }
+                }
+
+                // =================================	
+                // End functions.
+                // =================================
+
+            }
+
+            // =================================	
+            // End namespace.
+            // =================================
+
+        }
+
+    }
+
+}
+
+// =================================	
+// --END-- //
+// =================================

+ 106 - 106
Assets/Mirza Beig/Demos/The Last Particle/Scripts/CollectableSpawner.cs

@@ -1,106 +1,106 @@
-
-// =================================	
-// Namespaces.
-// =================================
-
-using UnityEngine;
-
-// =================================	
-// Define namespace.
-// =================================
-
-namespace MirzaBeig
-{
-
-    namespace Demos
-    {
-
-        namespace TheLastParticle
-        {
-
-            // =================================	
-            // Classes.
-            // =================================
-
-            //[ExecuteInEditMode]
-            [System.Serializable]
-
-            public class CollectableSpawner : MonoBehaviour
-            {
-                // =================================	
-                // Nested classes and structures.
-                // =================================
-
-                // ...
-
-                // =================================	
-                // Variables.
-                // =================================
-
-                // ...
-
-                public Collectable collectable;
-
-                public float collectablesPerSecond = 0.25f;
-                public Vector3 spawnBoxScale = Vector3.one * 10.0f;
-
-                float timer;
-
-                // =================================	
-                // Functions.
-                // =================================
-
-                // ...
-
-                void Start()
-                {
-                    timer = 0.0f;
-                }
-
-                // ...
-
-                void Update()
-                {
-                    timer += Time.deltaTime * collectablesPerSecond;
-
-                    if (timer >= 1.0f)
-                    {
-                        timer = 0.0f;
-
-                        Vector3 position = transform.position;
-                        Vector3 scale = spawnBoxScale / 2.0f;
-
-                        position.x += Random.Range(-scale.x, scale.x);
-                        position.y += Random.Range(-scale.y, scale.y);
-                        position.z += Random.Range(-scale.z, scale.z);
-                                                
-                        Instantiate(collectable, position, Quaternion.identity);
-                    }
-                }
-
-                // ...
-
-                void OnDrawGizmos()
-                {
-                    Gizmos.DrawWireCube(transform.position, spawnBoxScale);
-                }
-
-                // =================================	
-                // End functions.
-                // =================================
-
-            }
-
-            // =================================	
-            // End namespace.
-            // =================================
-
-        }
-
-    }
-
-}
-
-// =================================	
-// --END-- //
-// =================================
+
+// =================================	
+// Namespaces.
+// =================================
+
+using UnityEngine;
+
+// =================================	
+// Define namespace.
+// =================================
+
+namespace MirzaBeig
+{
+
+    namespace Demos
+    {
+
+        namespace TheLastParticle
+        {
+
+            // =================================	
+            // Classes.
+            // =================================
+
+            //[ExecuteInEditMode]
+            [System.Serializable]
+
+            public class CollectableSpawner : MonoBehaviour
+            {
+                // =================================	
+                // Nested classes and structures.
+                // =================================
+
+                // ...
+
+                // =================================	
+                // Variables.
+                // =================================
+
+                // ...
+
+                public Collectable collectable;
+
+                public float collectablesPerSecond = 0.25f;
+                public Vector3 spawnBoxScale = Vector3.one * 10.0f;
+
+                float timer;
+
+                // =================================	
+                // Functions.
+                // =================================
+
+                // ...
+
+                void Start()
+                {
+                    timer = 0.0f;
+                }
+
+                // ...
+
+                void Update()
+                {
+                    timer += Time.deltaTime * collectablesPerSecond;
+
+                    if (timer >= 1.0f)
+                    {
+                        timer = 0.0f;
+
+                        Vector3 position = transform.position;
+                        Vector3 scale = spawnBoxScale / 2.0f;
+
+                        position.x += Random.Range(-scale.x, scale.x);
+                        position.y += Random.Range(-scale.y, scale.y);
+                        position.z += Random.Range(-scale.z, scale.z);
+                                                
+                        Instantiate(collectable, position, Quaternion.identity);
+                    }
+                }
+
+                // ...
+
+                void OnDrawGizmos()
+                {
+                    Gizmos.DrawWireCube(transform.position, spawnBoxScale);
+                }
+
+                // =================================	
+                // End functions.
+                // =================================
+
+            }
+
+            // =================================	
+            // End namespace.
+            // =================================
+
+        }
+
+    }
+
+}
+
+// =================================	
+// --END-- //
+// =================================

+ 79 - 79
Assets/Mirza Beig/Demos/The Last Particle/Scripts/Damping.cs

@@ -1,79 +1,79 @@
-
-// =================================	
-// Namespaces.
-// =================================
-
-using UnityEngine;
-
-// =================================	
-// Define namespace.
-// =================================
-
-namespace MirzaBeig
-{
-
-    namespace Demos
-    {
-
-        namespace TheLastParticle
-        {
-
-            // =================================	
-            // Classes.
-            // =================================
-
-            //[ExecuteInEditMode]
-            [System.Serializable]
-
-            public static class Damping
-            {
-                // =================================	
-                // Nested classes and structures.
-                // =================================
-
-                // ...
-
-                // =================================	
-                // Variables.
-                // =================================
-
-                // ...
-
-                // =================================	
-                // Functions.
-                // =================================
-
-                // ...
-
-                public static float dampFloat(float from, float to, float speed, float deltaTime)
-                {
-                    return Mathf.Lerp(from, to, 1.0f - Mathf.Exp(-speed * deltaTime));
-                }
-                public static Vector3 dampVector3(Vector3 from, Vector3 to, float speed, float deltaTime)
-                {
-                    return Vector3.Lerp(from, to, 1.0f - Mathf.Exp(-speed * deltaTime));
-                }
-                public static Quaternion dampQuaternion(Quaternion from, Quaternion to, float speed, float deltaTime)
-                {
-                    return Quaternion.Slerp(from, to, 1.0f - Mathf.Exp(-speed * deltaTime));
-                }
-
-                // =================================	
-                // End functions.
-                // =================================
-
-            }
-
-            // =================================	
-            // End namespace.
-            // =================================
-
-        }
-
-    }
-
-}
-
-// =================================	
-// --END-- //
-// =================================
+
+// =================================	
+// Namespaces.
+// =================================
+
+using UnityEngine;
+
+// =================================	
+// Define namespace.
+// =================================
+
+namespace MirzaBeig
+{
+
+    namespace Demos
+    {
+
+        namespace TheLastParticle
+        {
+
+            // =================================	
+            // Classes.
+            // =================================
+
+            //[ExecuteInEditMode]
+            [System.Serializable]
+
+            public static class Damping
+            {
+                // =================================	
+                // Nested classes and structures.
+                // =================================
+
+                // ...
+
+                // =================================	
+                // Variables.
+                // =================================
+
+                // ...
+
+                // =================================	
+                // Functions.
+                // =================================
+
+                // ...
+
+                public static float dampFloat(float from, float to, float speed, float deltaTime)
+                {
+                    return Mathf.Lerp(from, to, 1.0f - Mathf.Exp(-speed * deltaTime));
+                }
+                public static Vector3 dampVector3(Vector3 from, Vector3 to, float speed, float deltaTime)
+                {
+                    return Vector3.Lerp(from, to, 1.0f - Mathf.Exp(-speed * deltaTime));
+                }
+                public static Quaternion dampQuaternion(Quaternion from, Quaternion to, float speed, float deltaTime)
+                {
+                    return Quaternion.Slerp(from, to, 1.0f - Mathf.Exp(-speed * deltaTime));
+                }
+
+                // =================================	
+                // End functions.
+                // =================================
+
+            }
+
+            // =================================	
+            // End namespace.
+            // =================================
+
+        }
+
+    }
+
+}
+
+// =================================	
+// --END-- //
+// =================================

+ 83 - 83
Assets/Mirza Beig/Demos/The Last Particle/Scripts/DestroyOnAudioStop.cs

@@ -1,83 +1,83 @@
-
-// =================================	
-// Namespaces.
-// =================================
-
-using UnityEngine;
-
-// =================================	
-// Define namespace.
-// =================================
-
-namespace MirzaBeig
-{
-
-    namespace Demos
-    {
-
-        namespace TheLastParticle
-        {
-
-            // =================================	
-            // Classes.
-            // =================================
-
-            //[ExecuteInEditMode]
-            [System.Serializable]
-
-            public class DestroyOnAudioStop : MonoBehaviour
-            {
-                // =================================	
-                // Nested classes and structures.
-                // =================================
-
-                // ...
-
-                // =================================	
-                // Variables.
-                // =================================
-
-                // ...
-
-                AudioSource audioSource;
-
-                // =================================	
-                // Functions.
-                // =================================
-
-                // ...
-
-                void Start()
-                {
-                    audioSource = GetComponent<AudioSource>();
-                }
-
-                // ...
-
-                void Update()
-                {
-                    if (!audioSource.isPlaying)
-                    {
-                        Destroy(gameObject);
-                    }
-                }
-
-                // =================================	
-                // End functions.
-                // =================================
-
-            }
-
-            // =================================	
-            // End namespace.
-            // =================================
-
-        }
-
-    }
-
-}
-
-// =================================	
-// --END-- //
-// =================================
+
+// =================================	
+// Namespaces.
+// =================================
+
+using UnityEngine;
+
+// =================================	
+// Define namespace.
+// =================================
+
+namespace MirzaBeig
+{
+
+    namespace Demos
+    {
+
+        namespace TheLastParticle
+        {
+
+            // =================================	
+            // Classes.
+            // =================================
+
+            //[ExecuteInEditMode]
+            [System.Serializable]
+
+            public class DestroyOnAudioStop : MonoBehaviour
+            {
+                // =================================	
+                // Nested classes and structures.
+                // =================================
+
+                // ...
+
+                // =================================	
+                // Variables.
+                // =================================
+
+                // ...
+
+                AudioSource audioSource;
+
+                // =================================	
+                // Functions.
+                // =================================
+
+                // ...
+
+                void Start()
+                {
+                    audioSource = GetComponent<AudioSource>();
+                }
+
+                // ...
+
+                void Update()
+                {
+                    if (!audioSource.isPlaying)
+                    {
+                        Destroy(gameObject);
+                    }
+                }
+
+                // =================================	
+                // End functions.
+                // =================================
+
+            }
+
+            // =================================	
+            // End namespace.
+            // =================================
+
+        }
+
+    }
+
+}
+
+// =================================	
+// --END-- //
+// =================================

+ 78 - 78
Assets/Mirza Beig/Demos/The Last Particle/Scripts/InstantiatePrefabOnCollisionEnter.cs

@@ -1,78 +1,78 @@
-
-// =================================	
-// Namespaces.
-// =================================
-
-using UnityEngine;
-
-// =================================	
-// Define namespace.
-// =================================
-
-namespace MirzaBeig
-{
-
-    namespace Demos
-    {
-
-        namespace TheLastParticle
-        {
-
-            // =================================	
-            // Classes.
-            // =================================
-
-            //[ExecuteInEditMode]
-            [System.Serializable]
-
-            public class InstantiatePrefabOnCollisionEnter : MonoBehaviour
-            {
-                // =================================	
-                // Nested classes and structures.
-                // =================================
-
-                // ...
-
-                // =================================	
-                // Variables.
-                // =================================
-
-                // ...
-
-                public GameObject[] prefabs;
-
-                // =================================	
-                // Functions.
-                // =================================
-
-                // ...
-
-                void OnCollisionEnter(Collision collision)
-                {
-                    ContactPoint contactPoint = collision.contacts[0];
-
-                    for (int i = 0; i < prefabs.Length; i++)
-                    {
-                        Instantiate(prefabs[i], contactPoint.point, Quaternion.Euler(contactPoint.point));
-                    }
-                }
-
-                // =================================	
-                // End functions.
-                // =================================
-
-            }
-
-            // =================================	
-            // End namespace.
-            // =================================
-
-        }
-
-    }
-
-}
-
-// =================================	
-// --END-- //
-// =================================
+
+// =================================	
+// Namespaces.
+// =================================
+
+using UnityEngine;
+
+// =================================	
+// Define namespace.
+// =================================
+
+namespace MirzaBeig
+{
+
+    namespace Demos
+    {
+
+        namespace TheLastParticle
+        {
+
+            // =================================	
+            // Classes.
+            // =================================
+
+            //[ExecuteInEditMode]
+            [System.Serializable]
+
+            public class InstantiatePrefabOnCollisionEnter : MonoBehaviour
+            {
+                // =================================	
+                // Nested classes and structures.
+                // =================================
+
+                // ...
+
+                // =================================	
+                // Variables.
+                // =================================
+
+                // ...
+
+                public GameObject[] prefabs;
+
+                // =================================	
+                // Functions.
+                // =================================
+
+                // ...
+
+                void OnCollisionEnter(Collision collision)
+                {
+                    ContactPoint contactPoint = collision.contacts[0];
+
+                    for (int i = 0; i < prefabs.Length; i++)
+                    {
+                        Instantiate(prefabs[i], contactPoint.point, Quaternion.Euler(contactPoint.point));
+                    }
+                }
+
+                // =================================	
+                // End functions.
+                // =================================
+
+            }
+
+            // =================================	
+            // End namespace.
+            // =================================
+
+        }
+
+    }
+
+}
+
+// =================================	
+// --END-- //
+// =================================

+ 77 - 77
Assets/Mirza Beig/Demos/The Last Particle/Scripts/OnTriggerEvents.cs

@@ -1,77 +1,77 @@
-
-// =================================	
-// Namespaces.
-// =================================
-
-using UnityEngine;
-using UnityEngine.Events;
-
-// =================================	
-// Define namespace.
-// =================================
-
-namespace MirzaBeig
-{
-
-    namespace Demos
-    {
-
-        namespace TheLastParticle
-        {
-
-            // =================================	
-            // Classes.
-            // =================================
-
-            //[ExecuteInEditMode]
-            [System.Serializable]
-
-            public class OnTriggerEvents : MonoBehaviour
-            {
-                // =================================	
-                // Nested classes and structures.
-                // =================================
-
-                // ...
-
-                // =================================	
-                // Variables.
-                // =================================
-
-                // ...
-
-                public UnityEvent OnTriggerEvent;
-
-                // =================================	
-                // Functions.
-                // =================================
-
-                // ...
-
-                void OnTriggerEnter(Collider collider)
-                {
-                    if (OnTriggerEvent != null)
-                    {
-                        OnTriggerEvent.Invoke();
-                    }
-                }
-
-                // =================================	
-                // End functions.
-                // =================================
-
-            }
-
-            // =================================	
-            // End namespace.
-            // =================================
-
-        }
-
-    }
-
-}
-
-// =================================	
-// --END-- //
-// =================================
+
+// =================================	
+// Namespaces.
+// =================================
+
+using UnityEngine;
+using UnityEngine.Events;
+
+// =================================	
+// Define namespace.
+// =================================
+
+namespace MirzaBeig
+{
+
+    namespace Demos
+    {
+
+        namespace TheLastParticle
+        {
+
+            // =================================	
+            // Classes.
+            // =================================
+
+            //[ExecuteInEditMode]
+            [System.Serializable]
+
+            public class OnTriggerEvents : MonoBehaviour
+            {
+                // =================================	
+                // Nested classes and structures.
+                // =================================
+
+                // ...
+
+                // =================================	
+                // Variables.
+                // =================================
+
+                // ...
+
+                public UnityEvent OnTriggerEvent;
+
+                // =================================	
+                // Functions.
+                // =================================
+
+                // ...
+
+                void OnTriggerEnter(Collider collider)
+                {
+                    if (OnTriggerEvent != null)
+                    {
+                        OnTriggerEvent.Invoke();
+                    }
+                }
+
+                // =================================	
+                // End functions.
+                // =================================
+
+            }
+
+            // =================================	
+            // End namespace.
+            // =================================
+
+        }
+
+    }
+
+}
+
+// =================================	
+// --END-- //
+// =================================

+ 186 - 186
Assets/Mirza Beig/Demos/The Last Particle/Scripts/Player.cs

@@ -1,186 +1,186 @@
-
-// =================================	
-// Namespaces.
-// =================================
-
-using UnityEngine;
-
-// =================================	
-// Define namespace.
-// =================================
-
-namespace MirzaBeig
-{
-
-    namespace Demos
-    {
-
-        namespace TheLastParticle
-        {
-
-            // =================================	
-            // Classes.
-            // =================================
-
-            //[ExecuteInEditMode]
-            [System.Serializable]
-
-            public class Player : MonoBehaviour
-            {
-                // =================================	
-                // Nested classes and structures.
-                // =================================
-
-                // ...
-
-                // =================================	
-                // Variables.
-                // =================================
-
-                // ...
-
-                public Rigidbody rb { get; set; }
-
-                // ...
-
-                public float thrust = 0.125f;
-                public float boostThrustMult = 2.0f;
-
-                // ...
-
-                new Camera camera;
-                public float rotateToCameraForwardSpeed = Mathf.Infinity;
-
-                // ...
-
-                public float cameraFieldOfViewMaxSpeed = 20.0f;
-                public Vector2 cameraFieldOfViewAngleRange = new Vector2(50.0f, 75.0f);
-
-                // ...
-
-                Vector3 startPosition;
-                Quaternion startRotation;
-
-                // =================================	
-                // Functions.
-                // =================================
-
-                // ...
-
-                void Awake()
-                {
-
-                }
-
-                // ...
-
-                void Start()
-                {
-                    rb = GetComponent<Rigidbody>();
-
-                    startPosition = transform.position;
-                    startRotation = transform.rotation;
-
-                    lockMouse();
-
-                    camera = Camera.main;
-                }
-
-                // ...
-
-                void lockMouse()
-                {
-                    Cursor.visible = false;
-                    Cursor.lockState = CursorLockMode.Locked;
-                }
-                void unlockMouse()
-                {
-                    Cursor.visible = true;
-                    Cursor.lockState = CursorLockMode.None;
-                }
-
-                // ...
-
-                void FixedUpdate()
-                {
-                    // Input.
-
-                    float vertical = Input.GetAxis("Vertical");
-                    float horizontal = Input.GetAxis("Horizontal");
-
-                    //float forward = Input.GetKey(KeyCode.LeftShift) ? 1.0f : 0.0f;
-
-                    Vector3 force = Vector3.zero;
-
-                    force += Vector3.forward * vertical;
-                    force += Vector3.right * horizontal;
-
-                    force *= thrust;
-
-                    bool boost = Input.GetKey(KeyCode.LeftShift);
-
-                    if (boost)
-                    {
-                        force *= boostThrustMult;
-                    }
-
-                    rb.AddRelativeForce(force, ForceMode.VelocityChange);
-
-                    // ...
-
-                    float currentSpeed = rb.velocity.magnitude;
-                    float cameraFieldOfViewSpeedTime = currentSpeed / cameraFieldOfViewMaxSpeed;
-
-                    cameraFieldOfViewSpeedTime = Mathf.Clamp01(cameraFieldOfViewSpeedTime);
-
-                    camera.fieldOfView = Mathf.Lerp(
-                        cameraFieldOfViewAngleRange.x, cameraFieldOfViewAngleRange.y, cameraFieldOfViewSpeedTime);
-                }
-
-                // ...
-
-                void Update()
-                {
-                    if (Input.GetMouseButtonDown(0))
-                    {
-                        lockMouse();
-                    }
-                    else if (Input.GetKeyDown(KeyCode.Escape))
-                    {
-                        unlockMouse();
-                    }
-
-                    if (Input.GetKeyDown(KeyCode.R))
-                    {
-                        transform.position = startPosition;
-                        transform.rotation = startRotation;
-                    }
-                }
-
-                // ...
-
-                void LateUpdate()
-                {
-                    transform.rotation = Damping.dampQuaternion(transform.rotation,
-                        Quaternion.LookRotation(camera.transform.forward), rotateToCameraForwardSpeed, Time.deltaTime);
-                }
-
-                // =================================	
-                // End functions.
-                // =================================
-
-            }
-
-            // =================================	
-            // End namespace.
-            // =================================
-
-        }
-
-    }
-
-}
-
-// =================================	
-// --END-- //
-// =================================
+
+// =================================	
+// Namespaces.
+// =================================
+
+using UnityEngine;
+
+// =================================	
+// Define namespace.
+// =================================
+
+namespace MirzaBeig
+{
+
+    namespace Demos
+    {
+
+        namespace TheLastParticle
+        {
+
+            // =================================	
+            // Classes.
+            // =================================
+
+            //[ExecuteInEditMode]
+            [System.Serializable]
+
+            public class Player : MonoBehaviour
+            {
+                // =================================	
+                // Nested classes and structures.
+                // =================================
+
+                // ...
+
+                // =================================	
+                // Variables.
+                // =================================
+
+                // ...
+
+                public Rigidbody rb { get; set; }
+
+                // ...
+
+                public float thrust = 0.125f;
+                public float boostThrustMult = 2.0f;
+
+                // ...
+
+                new Camera camera;
+                public float rotateToCameraForwardSpeed = Mathf.Infinity;
+
+                // ...
+
+                public float cameraFieldOfViewMaxSpeed = 20.0f;
+                public Vector2 cameraFieldOfViewAngleRange = new Vector2(50.0f, 75.0f);
+
+                // ...
+
+                Vector3 startPosition;
+                Quaternion startRotation;
+
+                // =================================	
+                // Functions.
+                // =================================
+
+                // ...
+
+                void Awake()
+                {
+
+                }
+
+                // ...
+
+                void Start()
+                {
+                    rb = GetComponent<Rigidbody>();
+
+                    startPosition = transform.position;
+                    startRotation = transform.rotation;
+
+                    lockMouse();
+
+                    camera = Camera.main;
+                }
+
+                // ...
+
+                void lockMouse()
+                {
+                    Cursor.visible = false;
+                    Cursor.lockState = CursorLockMode.Locked;
+                }
+                void unlockMouse()
+                {
+                    Cursor.visible = true;
+                    Cursor.lockState = CursorLockMode.None;
+                }
+
+                // ...
+
+                void FixedUpdate()
+                {
+                    // Input.
+
+                    float vertical = Input.GetAxis("Vertical");
+                    float horizontal = Input.GetAxis("Horizontal");
+
+                    //float forward = Input.GetKey(KeyCode.LeftShift) ? 1.0f : 0.0f;
+
+                    Vector3 force = Vector3.zero;
+
+                    force += Vector3.forward * vertical;
+                    force += Vector3.right * horizontal;
+
+                    force *= thrust;
+
+                    bool boost = Input.GetKey(KeyCode.LeftShift);
+
+                    if (boost)
+                    {
+                        force *= boostThrustMult;
+                    }
+
+                    rb.AddRelativeForce(force, ForceMode.VelocityChange);
+
+                    // ...
+
+                    float currentSpeed = rb.velocity.magnitude;
+                    float cameraFieldOfViewSpeedTime = currentSpeed / cameraFieldOfViewMaxSpeed;
+
+                    cameraFieldOfViewSpeedTime = Mathf.Clamp01(cameraFieldOfViewSpeedTime);
+
+                    camera.fieldOfView = Mathf.Lerp(
+                        cameraFieldOfViewAngleRange.x, cameraFieldOfViewAngleRange.y, cameraFieldOfViewSpeedTime);
+                }
+
+                // ...
+
+                void Update()
+                {
+                    if (Input.GetMouseButtonDown(0))
+                    {
+                        lockMouse();
+                    }
+                    else if (Input.GetKeyDown(KeyCode.Escape))
+                    {
+                        unlockMouse();
+                    }
+
+                    if (Input.GetKeyDown(KeyCode.R))
+                    {
+                        transform.position = startPosition;
+                        transform.rotation = startRotation;
+                    }
+                }
+
+                // ...
+
+                void LateUpdate()
+                {
+                    transform.rotation = Damping.dampQuaternion(transform.rotation,
+                        Quaternion.LookRotation(camera.transform.forward), rotateToCameraForwardSpeed, Time.deltaTime);
+                }
+
+                // =================================	
+                // End functions.
+                // =================================
+
+            }
+
+            // =================================	
+            // End namespace.
+            // =================================
+
+        }
+
+    }
+
+}
+
+// =================================	
+// --END-- //
+// =================================

+ 105 - 105
Assets/Mirza Beig/Demos/The Last Particle/Scripts/RandomInvoke.cs

@@ -1,105 +1,105 @@
-
-// =================================	
-// Namespaces.
-// =================================
-
-using UnityEngine;
-using UnityEngine.Events;
-
-// =================================	
-// Define namespace.
-// =================================
-
-namespace MirzaBeig
-{
-
-    namespace Demos
-    {
-
-        namespace TheLastParticle
-        {
-
-            // =================================	
-            // Classes.
-            // =================================
-
-            [ExecuteInEditMode]
-            [System.Serializable]
-
-            public class RandomInvoke : MonoBehaviour
-            {
-                // =================================	
-                // Nested classes and structures.
-                // =================================
-
-                // ...
-
-                // =================================	
-                // Variables.
-                // =================================
-
-                // ...
-
-                float timer;
-                float nextInvokeTime;
-
-                public Vector2 timeRange = new Vector2(2.0f, 5.0f);
-
-                // =================================	
-                // Functions.
-                // =================================
-
-                // ...
-
-                protected virtual void Start()
-                {
-                    // Even though invoke just calls Invoke, DON'T call the local invoke here!
-                    // Since it will be overriden and made to do more...
-
-                    // NOTE: Invoke doesn't seem to work with inheritance. So I'll just do it manually.
-
-                    nextInvokeTime = Random.Range(timeRange.x, timeRange.y);
-                }
-
-                // ...
-
-                protected virtual void Update()
-                {
-                    timer += Time.deltaTime;
-
-                    if (timer >= nextInvokeTime)
-                    {
-                        doSomething();
-
-                        timer = 0.0f;
-                        nextInvokeTime = Random.Range(timeRange.x, timeRange.y);
-
-                    }
-                }
-
-                // ...
-
-                protected virtual void doSomething()
-                {
-
-                }
-
-                // =================================	
-                // End functions.
-                // =================================
-
-            }
-
-            // =================================	
-            // End namespace.
-            // =================================
-
-        }
-
-    }
-
-}
-
-// =================================	
-// --END-- //
-// =================================
+
+// =================================	
+// Namespaces.
+// =================================
+
+using UnityEngine;
+using UnityEngine.Events;
+
+// =================================	
+// Define namespace.
+// =================================
+
+namespace MirzaBeig
+{
+
+    namespace Demos
+    {
+
+        namespace TheLastParticle
+        {
+
+            // =================================	
+            // Classes.
+            // =================================
+
+            [ExecuteInEditMode]
+            [System.Serializable]
+
+            public class RandomInvoke : MonoBehaviour
+            {
+                // =================================	
+                // Nested classes and structures.
+                // =================================
+
+                // ...
+
+                // =================================	
+                // Variables.
+                // =================================
+
+                // ...
+
+                float timer;
+                float nextInvokeTime;
+
+                public Vector2 timeRange = new Vector2(2.0f, 5.0f);
+
+                // =================================	
+                // Functions.
+                // =================================
+
+                // ...
+
+                protected virtual void Start()
+                {
+                    // Even though invoke just calls Invoke, DON'T call the local invoke here!
+                    // Since it will be overriden and made to do more...
+
+                    // NOTE: Invoke doesn't seem to work with inheritance. So I'll just do it manually.
+
+                    nextInvokeTime = Random.Range(timeRange.x, timeRange.y);
+                }
+
+                // ...
+
+                protected virtual void Update()
+                {
+                    timer += Time.deltaTime;
+
+                    if (timer >= nextInvokeTime)
+                    {
+                        doSomething();
+
+                        timer = 0.0f;
+                        nextInvokeTime = Random.Range(timeRange.x, timeRange.y);
+
+                    }
+                }
+
+                // ...
+
+                protected virtual void doSomething()
+                {
+
+                }
+
+                // =================================	
+                // End functions.
+                // =================================
+
+            }
+
+            // =================================	
+            // End namespace.
+            // =================================
+
+        }
+
+    }
+
+}
+
+// =================================	
+// --END-- //
+// =================================

+ 100 - 100
Assets/Mirza Beig/Demos/The Last Particle/Scripts/RandomInvoke_EmitParticle.cs

@@ -1,100 +1,100 @@
-
-// =================================	
-// Namespaces.
-// =================================
-
-using UnityEngine;
-using UnityEngine.Events;
-
-// =================================	
-// Define namespace.
-// =================================
-
-namespace MirzaBeig
-{
-
-    namespace Demos
-    {
-
-        namespace TheLastParticle
-        {
-
-            // =================================	
-            // Classes.
-            // =================================
-
-            [ExecuteInEditMode]
-            [System.Serializable]
-
-            public class RandomInvoke_EmitParticle : RandomInvoke
-            {
-                // =================================	
-                // Nested classes and structures.
-                // =================================
-
-                // ...
-
-                // =================================	
-                // Variables.
-                // =================================
-
-                // ...
-
-                ParticleSystem ps;
-
-                public IntRange count = new IntRange(1, 2);
-                public UnityEvent OnEmit;
-
-                // =================================	
-                // Functions.
-                // =================================
-
-                // ...
-
-                protected override void Start()
-                {
-                    base.Start();
-
-                    ps = GetComponent<ParticleSystem>();
-                }
-
-                // ...
-
-                protected override void Update()
-                {
-                    base.Update();
-                }
-
-                // ...
-
-                protected override void doSomething()
-                {
-                    base.doSomething();
-
-                    ps.Emit(count.random);
-
-                    if (OnEmit != null)
-                    {
-                        OnEmit.Invoke();
-                    }
-                }
-
-                // =================================	
-                // End functions.
-                // =================================
-
-            }
-
-            // =================================	
-            // End namespace.
-            // =================================
-
-        }
-
-    }
-
-}
-
-// =================================	
-// --END-- //
-// =================================
+
+// =================================	
+// Namespaces.
+// =================================
+
+using UnityEngine;
+using UnityEngine.Events;
+
+// =================================	
+// Define namespace.
+// =================================
+
+namespace MirzaBeig
+{
+
+    namespace Demos
+    {
+
+        namespace TheLastParticle
+        {
+
+            // =================================	
+            // Classes.
+            // =================================
+
+            [ExecuteInEditMode]
+            [System.Serializable]
+
+            public class RandomInvoke_EmitParticle : RandomInvoke
+            {
+                // =================================	
+                // Nested classes and structures.
+                // =================================
+
+                // ...
+
+                // =================================	
+                // Variables.
+                // =================================
+
+                // ...
+
+                ParticleSystem ps;
+
+                public IntRange count = new IntRange(1, 2);
+                public UnityEvent OnEmit;
+
+                // =================================	
+                // Functions.
+                // =================================
+
+                // ...
+
+                protected override void Start()
+                {
+                    base.Start();
+
+                    ps = GetComponent<ParticleSystem>();
+                }
+
+                // ...
+
+                protected override void Update()
+                {
+                    base.Update();
+                }
+
+                // ...
+
+                protected override void doSomething()
+                {
+                    base.doSomething();
+
+                    ps.Emit(count.random);
+
+                    if (OnEmit != null)
+                    {
+                        OnEmit.Invoke();
+                    }
+                }
+
+                // =================================	
+                // End functions.
+                // =================================
+
+            }
+
+            // =================================	
+            // End namespace.
+            // =================================
+
+        }
+
+    }
+
+}
+
+// =================================	
+// --END-- //
+// =================================

Някои файлове не бяха показани, защото твърде много файлове са промени