├── .gitignore ├── Assets ├── SimpleAnimationComponent.meta └── SimpleAnimationComponent │ ├── CustomPlayableExtensions.cs │ ├── CustomPlayableExtensions.cs.meta │ ├── Editor.meta │ ├── Editor │ ├── SimpleAnimationComponent-Editor.asmdef │ ├── SimpleAnimationComponent-Editor.asmdef.meta │ ├── SimpleAnimationEditor.cs │ └── SimpleAnimationEditor.cs.meta │ ├── SimpleAnimation.cs │ ├── SimpleAnimation.cs.meta │ ├── SimpleAnimationComponent.asmdef │ ├── SimpleAnimationComponent.asmdef.meta │ ├── SimpleAnimationPlayable.cs │ ├── SimpleAnimationPlayable.cs.meta │ ├── SimpleAnimationPlayable_States.cs │ ├── SimpleAnimationPlayable_States.cs.meta │ ├── SimpleAnimation_impl.cs │ ├── SimpleAnimation_impl.cs.meta │ ├── Tests.meta │ └── Tests │ ├── AnimationProxy.cs │ ├── AnimationProxy.cs.meta │ ├── IAnimation.cs │ ├── IAnimation.cs.meta │ ├── PerformanceTests.meta │ ├── PerformanceTests │ ├── Complex.meta │ ├── Complex.unity │ ├── Complex.unity.meta │ ├── Complex │ │ ├── AndroidAnimator.prefab │ │ ├── AndroidAnimator.prefab.meta │ │ ├── AndroidGenericAnim.controller │ │ ├── AndroidGenericAnim.controller.meta │ │ ├── AndroidGenericAnim.fbx │ │ ├── AndroidGenericAnim.fbx.meta │ │ ├── AndroidLegacy.prefab │ │ ├── AndroidLegacy.prefab.meta │ │ ├── AndroidLegacyAnim.fbx │ │ ├── AndroidLegacyAnim.fbx.meta │ │ ├── AndroidSimpleAnimation.prefab │ │ └── AndroidSimpleAnimation.prefab.meta │ ├── ComplexWithTransition.meta │ ├── ComplexWithTransition │ │ ├── AndroidAnimatorWithTransitions.prefab │ │ ├── AndroidAnimatorWithTransitions.prefab.meta │ │ ├── AndroidGenericAnimWithTransitions.controller │ │ ├── AndroidGenericAnimWithTransitions.controller.meta │ │ ├── AndroidLegacyWithTransitions.prefab │ │ ├── AndroidLegacyWithTransitions.prefab.meta │ │ ├── AndroidSimpleAnimationWithTransitions.prefab │ │ ├── AndroidSimpleAnimationWithTransitions.prefab.meta │ │ ├── SimpleAnimationTransitions.cs │ │ └── SimpleAnimationTransitions.cs.meta │ ├── ComplexWithTransitions.unity │ ├── ComplexWithTransitions.unity.meta │ ├── PlayOnce.meta │ ├── PlayOnce.unity │ ├── PlayOnce.unity.meta │ ├── PlayOnce │ │ ├── RotateAnimatorOnce.anim │ │ ├── RotateAnimatorOnce.anim.meta │ │ ├── RotateAnimatorOnce.controller │ │ ├── RotateAnimatorOnce.controller.meta │ │ ├── RotateAnimatorOnce.prefab │ │ ├── RotateAnimatorOnce.prefab.meta │ │ ├── RotateLegacyOnce.anim │ │ ├── RotateLegacyOnce.anim.meta │ │ ├── RotateLegacyOnce.prefab │ │ ├── RotateLegacyOnce.prefab.meta │ │ ├── RotateSimpleAnimationOnce.prefab │ │ └── RotateSimpleAnimationOnce.prefab.meta │ ├── RotateCubes.meta │ ├── RotateCubes │ │ ├── RotateAnimator.anim │ │ ├── RotateAnimator.anim.meta │ │ ├── RotateLegacy.anim │ │ ├── RotateLegacy.anim.meta │ │ ├── RotatingCubes.unity │ │ └── RotatingCubes.unity.meta │ ├── TestUI.cs │ └── TestUI.cs.meta │ ├── PlaymodeTests.meta │ ├── PlaymodeTests │ ├── ComparativeTests.meta │ ├── ComparativeTests │ │ ├── BaseConditionsTests.cs │ │ ├── BaseConditionsTests.cs.meta │ │ ├── ClipManagementTests.cs │ │ ├── ClipManagementTests.cs.meta │ │ ├── ComparativeTestFixture.cs │ │ ├── ComparativeTestFixture.cs.meta │ │ ├── DifferencesTests.cs │ │ ├── DifferencesTests.cs.meta │ │ ├── MiscTests.cs │ │ ├── MiscTests.cs.meta │ │ ├── PlaybackTests.cs │ │ ├── PlaybackTests.cs.meta │ │ ├── QueueTests.cs │ │ ├── QueueTests.cs.meta │ │ ├── StateAccessTests.cs │ │ └── StateAccessTests.cs.meta │ ├── Resources.meta │ ├── Resources │ │ ├── FiresEvent.anim │ │ ├── FiresEvent.anim.meta │ │ ├── LinearX.anim │ │ ├── LinearX.anim.meta │ │ ├── LinearXLegacy.anim │ │ ├── LinearXLegacy.anim.meta │ │ ├── LinearY.anim │ │ ├── LinearY.anim.meta │ │ ├── LinearZ.anim │ │ ├── LinearZ.anim.meta │ │ ├── WithSimpleAnimation.prefab │ │ └── WithSimpleAnimation.prefab.meta │ ├── SimpleAnimationTests.cs │ └── SimpleAnimationTests.cs.meta │ ├── SimpleAnimation-Tests.asmdef │ ├── SimpleAnimation-Tests.asmdef.meta │ ├── SimpleAnimationProxy.cs │ └── SimpleAnimationProxy.cs.meta ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | Temp 2 | Library/** 3 | ProjectSettings 4 | Packages 5 | SimpleAnimation.sln 6 | SimpleAnimation.csproj 7 | SimpleAnimation.Editor.csproj 8 | .vs 9 | *.csproj 10 | Logs/ 11 | obj/ 12 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8fc03674866ae9a4f9fdacc1444511bf 3 | folderAsset: yes 4 | timeCreated: 1493740709 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/CustomPlayableExtensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Playables; 3 | 4 | public static class CustomPlayableExtensions 5 | { 6 | public static void ResetTime(this Playable playable, float time) 7 | { 8 | playable.SetTime(time); 9 | playable.SetTime(time); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/CustomPlayableExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d6aadfd4af940c47a915f6e609245bd 3 | timeCreated: 1519667576 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13eb8d583b55e3f4998b9c8d1fc4f631 3 | folderAsset: yes 4 | timeCreated: 1502472444 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Editor/SimpleAnimationComponent-Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SimpleAnimationComponent-Editor", 3 | "references": [ 4 | "SimpleAnimationComponent" 5 | ], 6 | "optionalUnityReferences": [], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false 12 | } -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Editor/SimpleAnimationComponent-Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4073e604354115342b874ea3137b12f7 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Editor/SimpleAnimationEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | [CustomEditor(typeof(SimpleAnimation))] 5 | public class SimpleAnimationEditor : Editor 6 | { 7 | static class Styles 8 | { 9 | public static GUIContent animation = new GUIContent("Animation", "The clip that will be played if Play() is called, or if \"Play Automatically\" is enabled"); 10 | public static GUIContent animations = new GUIContent("Animations", "These clips will define the States the component will start with"); 11 | public static GUIContent playAutomatically = new GUIContent("Play Automatically", "If checked, the default clip will automatically be played"); 12 | public static GUIContent animatePhysics = new GUIContent("Animate Physics", "If checked, animations will be updated at the same frequency as Fixed Update"); 13 | 14 | public static GUIContent cullingMode = new GUIContent("Culling Mode", "Controls what is updated when the object has been culled"); 15 | } 16 | 17 | SerializedProperty clip; 18 | SerializedProperty states; 19 | SerializedProperty playAutomatically; 20 | SerializedProperty animatePhysics; 21 | SerializedProperty cullingMode; 22 | 23 | void OnEnable() 24 | { 25 | clip = serializedObject.FindProperty("m_Clip"); 26 | states = serializedObject.FindProperty("m_States"); 27 | playAutomatically = serializedObject.FindProperty("m_PlayAutomatically"); 28 | animatePhysics = serializedObject.FindProperty("m_AnimatePhysics"); 29 | cullingMode = serializedObject.FindProperty("m_CullingMode"); 30 | } 31 | 32 | public override void OnInspectorGUI() 33 | { 34 | serializedObject.Update(); 35 | EditorGUILayout.PropertyField(clip, Styles.animation); 36 | EditorGUILayout.PropertyField(states, Styles.animations, true); 37 | EditorGUILayout.PropertyField(playAutomatically, Styles.playAutomatically); 38 | EditorGUILayout.PropertyField(animatePhysics, Styles.animatePhysics); 39 | EditorGUILayout.PropertyField(cullingMode, Styles.cullingMode); 40 | 41 | 42 | serializedObject.ApplyModifiedProperties(); 43 | } 44 | 45 | 46 | } 47 | 48 | [CustomPropertyDrawer(typeof(SimpleAnimation.EditorState))] 49 | class StateDrawer : PropertyDrawer 50 | { 51 | class Styles 52 | { 53 | public static readonly GUIContent disabledTooltip = new GUIContent("", "The Default state cannot be edited, change the Animation clip to change the Default State"); 54 | } 55 | 56 | // Draw the property inside the given rect 57 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 58 | { 59 | // Using BeginProperty / EndProperty on the parent property means that 60 | // prefab override logic works on the entire property. 61 | EditorGUI.BeginProperty(position, label, property); 62 | 63 | // Draw label 64 | position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); 65 | 66 | // Don't make child fields be indented 67 | var indent = EditorGUI.indentLevel; 68 | EditorGUI.indentLevel = 0; 69 | 70 | EditorGUILayout.BeginHorizontal(); 71 | // Calculate rects 72 | Rect clipRect = new Rect(position.x, position.y, position.width/2 - 5, position.height); 73 | Rect nameRect = new Rect(position.x + position.width/2 + 5, position.y, position.width/2 - 5, position.height); 74 | 75 | 76 | EditorGUI.BeginDisabledGroup(property.FindPropertyRelative("defaultState").boolValue); 77 | EditorGUI.PropertyField(nameRect, property.FindPropertyRelative("clip"), GUIContent.none); 78 | EditorGUI.PropertyField(clipRect, property.FindPropertyRelative("name"), GUIContent.none); 79 | if (property.FindPropertyRelative("defaultState").boolValue) 80 | { 81 | EditorGUI.LabelField(position, Styles.disabledTooltip); 82 | } 83 | 84 | EditorGUI.EndDisabledGroup(); 85 | 86 | EditorGUILayout.EndHorizontal(); 87 | // Set indent back to what it was 88 | EditorGUI.indentLevel = indent; 89 | 90 | EditorGUI.EndProperty(); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Editor/SimpleAnimationEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b42bbe25e28af494dadccf960ecfc32e 3 | timeCreated: 1502472599 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/SimpleAnimation.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using UnityEngine; 5 | using UnityEngine.Playables; 6 | 7 | [RequireComponent(typeof(Animator))] 8 | public partial class SimpleAnimation: MonoBehaviour 9 | { 10 | public interface State 11 | { 12 | bool enabled { get; set; } 13 | bool isValid { get; } 14 | float time { get; set; } 15 | float normalizedTime { get; set; } 16 | float speed { get; set; } 17 | string name { get; set; } 18 | float weight { get; set; } 19 | float length { get; } 20 | AnimationClip clip { get; } 21 | WrapMode wrapMode { get; set; } 22 | 23 | } 24 | public Animator animator 25 | { 26 | get 27 | { 28 | if (m_Animator == null) 29 | { 30 | m_Animator = GetComponent(); 31 | } 32 | return m_Animator; 33 | } 34 | } 35 | 36 | public bool animatePhysics 37 | { 38 | get { return m_AnimatePhysics; } 39 | set { m_AnimatePhysics = value; animator.updateMode = m_AnimatePhysics ? AnimatorUpdateMode.AnimatePhysics : AnimatorUpdateMode.Normal; } 40 | } 41 | 42 | public AnimatorCullingMode cullingMode 43 | { 44 | get { return animator.cullingMode; } 45 | set { m_CullingMode = value; animator.cullingMode = m_CullingMode; } 46 | } 47 | 48 | public bool isPlaying { get { return m_Playable.IsPlaying(); } } 49 | 50 | public bool playAutomatically 51 | { 52 | get { return m_PlayAutomatically; } 53 | set { m_PlayAutomatically = value; } 54 | } 55 | 56 | public AnimationClip clip 57 | { 58 | get { return m_Clip; } 59 | set 60 | { 61 | LegacyClipCheck(value); 62 | m_Clip = value; 63 | } 64 | } 65 | 66 | public WrapMode wrapMode 67 | { 68 | get { return m_WrapMode; } 69 | set { m_WrapMode = value; } 70 | } 71 | 72 | public void AddClip(AnimationClip clip, string newName) 73 | { 74 | LegacyClipCheck(clip); 75 | AddState(clip, newName); 76 | } 77 | 78 | public void Blend(string stateName, float targetWeight, float fadeLength) 79 | { 80 | m_Animator.enabled = true; 81 | Kick(); 82 | m_Playable.Blend(stateName, targetWeight, fadeLength); 83 | } 84 | 85 | public void CrossFade(string stateName, float fadeLength) 86 | { 87 | m_Animator.enabled = true; 88 | Kick(); 89 | m_Playable.Crossfade(stateName, fadeLength); 90 | } 91 | 92 | public void CrossFadeQueued(string stateName, float fadeLength, QueueMode queueMode) 93 | { 94 | m_Animator.enabled = true; 95 | Kick(); 96 | m_Playable.CrossfadeQueued(stateName, fadeLength, queueMode); 97 | } 98 | 99 | public int GetClipCount() 100 | { 101 | return m_Playable.GetClipCount(); 102 | } 103 | 104 | public bool IsPlaying(string stateName) 105 | { 106 | return m_Playable.IsPlaying(stateName); 107 | } 108 | 109 | public void Stop() 110 | { 111 | m_Playable.StopAll(); 112 | } 113 | 114 | public void Stop(string stateName) 115 | { 116 | m_Playable.Stop(stateName); 117 | } 118 | 119 | public void Sample() 120 | { 121 | m_Graph.Evaluate(); 122 | } 123 | 124 | public bool Play() 125 | { 126 | m_Animator.enabled = true; 127 | Kick(); 128 | if (m_Clip != null && m_PlayAutomatically) 129 | { 130 | m_Playable.Play(kDefaultStateName); 131 | } 132 | return false; 133 | } 134 | 135 | public void AddState(AnimationClip clip, string name) 136 | { 137 | LegacyClipCheck(clip); 138 | Kick(); 139 | if (m_Playable.AddClip(clip, name)) 140 | { 141 | RebuildStates(); 142 | } 143 | 144 | } 145 | 146 | public void RemoveState(string name) 147 | { 148 | if (m_Playable.RemoveClip(name)) 149 | { 150 | RebuildStates(); 151 | } 152 | } 153 | 154 | public bool Play(string stateName) 155 | { 156 | m_Animator.enabled = true; 157 | Kick(); 158 | return m_Playable.Play(stateName); 159 | } 160 | 161 | public void PlayQueued(string stateName, QueueMode queueMode) 162 | { 163 | m_Animator.enabled = true; 164 | Kick(); 165 | m_Playable.PlayQueued(stateName, queueMode); 166 | } 167 | 168 | public void RemoveClip(AnimationClip clip) 169 | { 170 | if (clip == null) 171 | throw new System.NullReferenceException("clip"); 172 | 173 | if ( m_Playable.RemoveClip(clip) ) 174 | { 175 | RebuildStates(); 176 | } 177 | 178 | } 179 | 180 | public void Rewind() 181 | { 182 | Kick(); 183 | m_Playable.Rewind(); 184 | } 185 | 186 | public void Rewind(string stateName) 187 | { 188 | Kick(); 189 | m_Playable.Rewind(stateName); 190 | } 191 | 192 | public State GetState(string stateName) 193 | { 194 | SimpleAnimationPlayable.IState state = m_Playable.GetState(stateName); 195 | if (state == null) 196 | return null; 197 | 198 | return new StateImpl(state, this); 199 | } 200 | 201 | public IEnumerable GetStates() 202 | { 203 | return new StateEnumerable(this); 204 | } 205 | 206 | public State this[string name] 207 | { 208 | get { return GetState(name); } 209 | } 210 | 211 | } 212 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/SimpleAnimation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3759e2aae0f7b9a47bb98fc64bf3c543 3 | timeCreated: 1493315774 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/SimpleAnimationComponent.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SimpleAnimationComponent" 3 | } 4 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/SimpleAnimationComponent.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aff632302a0b84b498c3f33f7639b4d3 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/SimpleAnimationPlayable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e979d7febf8bb72429b0869d1791a78a 3 | timeCreated: 1493310304 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/SimpleAnimationPlayable_States.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce4f5507fa3bef446a3981a7e6d2475e 3 | timeCreated: 1502387922 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/SimpleAnimation_impl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | #if UNITY_EDITOR 5 | using UnityEditor; 6 | #endif 7 | using UnityEngine; 8 | using UnityEngine.Playables; 9 | 10 | [RequireComponent(typeof(Animator))] 11 | public partial class SimpleAnimation: MonoBehaviour, IAnimationClipSource 12 | { 13 | const string kDefaultStateName = "Default"; 14 | private class StateEnumerable : IEnumerable 15 | { 16 | private SimpleAnimation m_Owner; 17 | public StateEnumerable(SimpleAnimation owner) 18 | { 19 | m_Owner = owner; 20 | } 21 | 22 | public IEnumerator GetEnumerator() 23 | { 24 | return new StateEnumerator(m_Owner); 25 | } 26 | 27 | IEnumerator IEnumerable.GetEnumerator() 28 | { 29 | return new StateEnumerator(m_Owner); 30 | } 31 | 32 | class StateEnumerator : IEnumerator 33 | { 34 | private SimpleAnimation m_Owner; 35 | private IEnumerator m_Impl; 36 | public StateEnumerator(SimpleAnimation owner) 37 | { 38 | m_Owner = owner; 39 | m_Impl = m_Owner.m_Playable.GetStates().GetEnumerator(); 40 | Reset(); 41 | } 42 | 43 | State GetCurrent() 44 | { 45 | return new StateImpl(m_Impl.Current, m_Owner); 46 | } 47 | 48 | object IEnumerator.Current { get { return GetCurrent(); } } 49 | 50 | State IEnumerator.Current { get { return GetCurrent(); } } 51 | 52 | public void Dispose() { } 53 | 54 | public bool MoveNext() 55 | { 56 | return m_Impl.MoveNext(); 57 | } 58 | 59 | public void Reset() 60 | { 61 | m_Impl.Reset(); 62 | } 63 | } 64 | } 65 | private class StateImpl : State 66 | { 67 | public StateImpl(SimpleAnimationPlayable.IState handle, SimpleAnimation component) 68 | { 69 | m_StateHandle = handle; 70 | m_Component = component; 71 | } 72 | 73 | private SimpleAnimationPlayable.IState m_StateHandle; 74 | private SimpleAnimation m_Component; 75 | 76 | bool State.enabled 77 | { 78 | get { return m_StateHandle.enabled; } 79 | set 80 | { 81 | m_StateHandle.enabled = value; 82 | if (value) 83 | { 84 | m_Component.Kick(); 85 | } 86 | } 87 | } 88 | 89 | bool State.isValid 90 | { 91 | get { return m_StateHandle.IsValid(); } 92 | } 93 | float State.time 94 | { 95 | get { return m_StateHandle.time; } 96 | set { m_StateHandle.time = value; 97 | m_Component.Kick(); } 98 | } 99 | float State.normalizedTime 100 | { 101 | get { return m_StateHandle.normalizedTime; } 102 | set { m_StateHandle.normalizedTime = value; 103 | m_Component.Kick();} 104 | } 105 | float State.speed 106 | { 107 | get { return m_StateHandle.speed; } 108 | set { m_StateHandle.speed = value; 109 | m_Component.Kick();} 110 | } 111 | 112 | string State.name 113 | { 114 | get { return m_StateHandle.name; } 115 | set { m_StateHandle.name = value; } 116 | } 117 | float State.weight 118 | { 119 | get { return m_StateHandle.weight; } 120 | set { m_StateHandle.weight = value; 121 | m_Component.Kick();} 122 | } 123 | float State.length 124 | { 125 | get { return m_StateHandle.length; } 126 | } 127 | 128 | AnimationClip State.clip 129 | { 130 | get { return m_StateHandle.clip; } 131 | } 132 | 133 | WrapMode State.wrapMode 134 | { 135 | get { return m_StateHandle.wrapMode; } 136 | set { Debug.LogError("Not Implemented"); } 137 | } 138 | } 139 | 140 | [System.Serializable] 141 | public class EditorState 142 | { 143 | public AnimationClip clip; 144 | public string name; 145 | public bool defaultState; 146 | } 147 | 148 | protected void Kick() 149 | { 150 | if (!m_IsPlaying) 151 | { 152 | m_Graph.Play(); 153 | m_IsPlaying = true; 154 | } 155 | } 156 | 157 | protected PlayableGraph m_Graph; 158 | protected PlayableHandle m_LayerMixer; 159 | protected PlayableHandle m_TransitionMixer; 160 | protected Animator m_Animator; 161 | protected bool m_Initialized; 162 | protected bool m_IsPlaying; 163 | 164 | protected SimpleAnimationPlayable m_Playable; 165 | 166 | [SerializeField] 167 | protected bool m_PlayAutomatically = true; 168 | 169 | [SerializeField] 170 | protected bool m_AnimatePhysics = false; 171 | 172 | [SerializeField] 173 | protected AnimatorCullingMode m_CullingMode = AnimatorCullingMode.CullUpdateTransforms; 174 | 175 | [SerializeField] 176 | protected WrapMode m_WrapMode; 177 | 178 | [SerializeField] 179 | protected AnimationClip m_Clip; 180 | 181 | [SerializeField] 182 | private EditorState[] m_States; 183 | 184 | protected virtual void OnEnable() 185 | { 186 | Initialize(); 187 | m_Graph.Play(); 188 | if (m_PlayAutomatically) 189 | { 190 | Stop(); 191 | Play(); 192 | } 193 | } 194 | 195 | protected virtual void OnDisable() 196 | { 197 | if (m_Initialized) 198 | { 199 | Stop(); 200 | m_Graph.Stop(); 201 | } 202 | } 203 | 204 | private void Reset() 205 | { 206 | if (m_Graph.IsValid()) 207 | m_Graph.Destroy(); 208 | 209 | m_Initialized = false; 210 | } 211 | 212 | private void Initialize() 213 | { 214 | if (m_Initialized) 215 | return; 216 | 217 | m_Animator = GetComponent(); 218 | m_Animator.updateMode = m_AnimatePhysics ? AnimatorUpdateMode.AnimatePhysics : AnimatorUpdateMode.Normal; 219 | m_Animator.cullingMode = m_CullingMode; 220 | m_Graph = PlayableGraph.Create(); 221 | m_Graph.SetTimeUpdateMode(DirectorUpdateMode.GameTime); 222 | SimpleAnimationPlayable template = new SimpleAnimationPlayable(); 223 | 224 | var playable = ScriptPlayable.Create(m_Graph, template, 1); 225 | m_Playable = playable.GetBehaviour(); 226 | m_Playable.onDone += OnPlayableDone; 227 | if (m_States == null) 228 | { 229 | m_States = new EditorState[1]; 230 | m_States[0] = new EditorState(); 231 | m_States[0].defaultState = true; 232 | m_States[0].name = "Default"; 233 | } 234 | 235 | 236 | if (m_States != null) 237 | { 238 | foreach (var state in m_States) 239 | { 240 | if (state.clip) 241 | { 242 | m_Playable.AddClip(state.clip, state.name); 243 | } 244 | } 245 | } 246 | 247 | EnsureDefaultStateExists(); 248 | 249 | AnimationPlayableUtilities.Play(m_Animator, m_Playable.playable, m_Graph); 250 | Play(); 251 | Kick(); 252 | m_Initialized = true; 253 | } 254 | 255 | private void EnsureDefaultStateExists() 256 | { 257 | if ( m_Playable != null && m_Clip != null && m_Playable.GetState(kDefaultStateName) == null ) 258 | { 259 | m_Playable.AddClip(m_Clip, kDefaultStateName); 260 | Kick(); 261 | } 262 | } 263 | 264 | protected virtual void Awake() 265 | { 266 | Initialize(); 267 | } 268 | 269 | protected void OnDestroy() 270 | { 271 | if (m_Graph.IsValid()) 272 | { 273 | m_Graph.Destroy(); 274 | } 275 | } 276 | 277 | private void OnPlayableDone() 278 | { 279 | m_Graph.Stop(); 280 | m_IsPlaying = false; 281 | } 282 | 283 | private void RebuildStates() 284 | { 285 | var playableStates = GetStates(); 286 | var list = new List(); 287 | foreach (var state in playableStates) 288 | { 289 | var newState = new EditorState(); 290 | newState.clip = state.clip; 291 | newState.name = state.name; 292 | list.Add(newState); 293 | } 294 | m_States = list.ToArray(); 295 | } 296 | 297 | EditorState CreateDefaultEditorState() 298 | { 299 | var defaultState = new EditorState(); 300 | defaultState.name = "Default"; 301 | defaultState.clip = m_Clip; 302 | defaultState.defaultState = true; 303 | 304 | return defaultState; 305 | } 306 | 307 | static void LegacyClipCheck(AnimationClip clip) 308 | { 309 | if (clip && clip.legacy) 310 | { 311 | throw new ArgumentException(string.Format("Legacy clip {0} cannot be used in this component. Set .legacy property to false before using this clip", clip)); 312 | } 313 | } 314 | 315 | void InvalidLegacyClipError(string clipName, string stateName) 316 | { 317 | Debug.LogErrorFormat(this.gameObject,"Animation clip {0} in state {1} is Legacy. Set clip.legacy to false, or reimport as Generic to use it with SimpleAnimationComponent", clipName, stateName); 318 | } 319 | 320 | private void OnValidate() 321 | { 322 | //Don't mess with runtime data 323 | if (Application.isPlaying) 324 | return; 325 | 326 | if (m_Clip && m_Clip.legacy) 327 | { 328 | Debug.LogErrorFormat(this.gameObject,"Animation clip {0} is Legacy. Set clip.legacy to false, or reimport as Generic to use it with SimpleAnimationComponent", m_Clip.name); 329 | m_Clip = null; 330 | } 331 | 332 | //Ensure at least one state exists 333 | if (m_States == null || m_States.Length == 0) 334 | { 335 | m_States = new EditorState[1]; 336 | } 337 | 338 | //Create default state if it's null 339 | if (m_States[0] == null) 340 | { 341 | m_States[0] = CreateDefaultEditorState(); 342 | } 343 | 344 | //If first state is not the default state, create a new default state at index 0 and push back the rest 345 | if (m_States[0].defaultState == false || m_States[0].name != "Default") 346 | { 347 | var oldArray = m_States; 348 | m_States = new EditorState[oldArray.Length + 1]; 349 | m_States[0] = CreateDefaultEditorState(); 350 | oldArray.CopyTo(m_States, 1); 351 | } 352 | 353 | //If default clip changed, update the default state 354 | if (m_States[0].clip != m_Clip) 355 | m_States[0].clip = m_Clip; 356 | 357 | 358 | //Make sure only one state is default 359 | for (int i = 1; i < m_States.Length; i++) 360 | { 361 | if (m_States[i] == null) 362 | { 363 | m_States[i] = new EditorState(); 364 | } 365 | m_States[i].defaultState = false; 366 | } 367 | 368 | //Ensure state names are unique 369 | int stateCount = m_States.Length; 370 | string[] names = new string[stateCount]; 371 | 372 | for (int i = 0; i < stateCount; i++) 373 | { 374 | EditorState state = m_States[i]; 375 | if (state.name == "" && state.clip) 376 | { 377 | state.name = state.clip.name; 378 | } 379 | 380 | #if UNITY_EDITOR 381 | state.name = ObjectNames.GetUniqueName(names, state.name); 382 | #endif 383 | names[i] = state.name; 384 | 385 | if (state.clip && state.clip.legacy) 386 | { 387 | InvalidLegacyClipError(state.clip.name, state.name); 388 | state.clip = null; 389 | } 390 | } 391 | 392 | m_Animator = GetComponent(); 393 | m_Animator.updateMode = m_AnimatePhysics ? AnimatorUpdateMode.AnimatePhysics : AnimatorUpdateMode.Normal; 394 | m_Animator.cullingMode = m_CullingMode; 395 | } 396 | 397 | public void GetAnimationClips(List results) 398 | { 399 | foreach (var state in m_States) 400 | { 401 | if (state.clip != null) 402 | results.Add(state.clip); 403 | } 404 | } 405 | } 406 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/SimpleAnimation_impl.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11c2ad7a923243841ab35b83723a6473 3 | timeCreated: 1502394771 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52d9c3bfd6589ad4fad615672d33562b 3 | folderAsset: yes 4 | timeCreated: 1502464957 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/AnimationProxy.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [RequireComponent(typeof(Animation))] 6 | public class AnimationProxy : MonoBehaviour, IAnimation 7 | { 8 | 9 | private class AnimationStateProxy: IAnimationState 10 | { 11 | public AnimationStateProxy(AnimationState state) 12 | { 13 | m_State = state; 14 | } 15 | 16 | private AnimationState m_State; 17 | 18 | public bool enabled 19 | { 20 | get { return m_State.enabled; } 21 | set { m_State.enabled = value; } 22 | } 23 | 24 | public bool isValid 25 | { 26 | get { return (bool)m_State; } 27 | } 28 | 29 | public float time 30 | { 31 | get { return m_State.time; } 32 | set { m_State.time = value; } 33 | } 34 | public float normalizedTime 35 | { 36 | get { return m_State.normalizedTime; } 37 | set { m_State.normalizedTime = value; } 38 | } 39 | public float speed 40 | { 41 | get { return m_State.speed; } 42 | set { m_State.speed = value; } 43 | } 44 | 45 | public string name 46 | { 47 | get { return m_State.name; } 48 | set { m_State.name = value; } 49 | } 50 | public float weight 51 | { 52 | get { return m_State.weight; } 53 | set { m_State.weight = value; } 54 | } 55 | public float length 56 | { 57 | get { return m_State.length; } 58 | } 59 | 60 | public AnimationClip clip 61 | { 62 | get { return m_State.clip; } 63 | } 64 | 65 | public WrapMode wrapMode 66 | { 67 | get { return m_State.wrapMode; } 68 | set { m_State.wrapMode = value; } 69 | } 70 | } 71 | 72 | private Animation m_Animation; 73 | 74 | new private Animation animation 75 | { 76 | get 77 | { 78 | if (m_Animation == null) 79 | { 80 | m_Animation = GetComponent(); 81 | } 82 | return m_Animation; 83 | } 84 | } 85 | 86 | public bool animatePhysics 87 | { 88 | get { return animation.animatePhysics; } 89 | set { animation.animatePhysics = value; } 90 | } 91 | 92 | public AnimatorCullingMode cullingMode 93 | { 94 | get 95 | { 96 | AnimatorCullingMode mode; 97 | switch (animation.cullingType) 98 | { 99 | case AnimationCullingType.AlwaysAnimate: 100 | mode = AnimatorCullingMode.AlwaysAnimate; 101 | break; 102 | case AnimationCullingType.BasedOnRenderers: 103 | mode = AnimatorCullingMode.CullCompletely; 104 | break; 105 | default: 106 | mode = AnimatorCullingMode.CullUpdateTransforms; 107 | break; 108 | } 109 | return mode; 110 | } 111 | 112 | set 113 | { 114 | AnimationCullingType type; 115 | switch(value) 116 | { 117 | case AnimatorCullingMode.AlwaysAnimate: 118 | type = AnimationCullingType.AlwaysAnimate; 119 | break; 120 | default: 121 | type = AnimationCullingType.BasedOnRenderers; 122 | break; 123 | 124 | } 125 | animation.cullingType = type; 126 | } 127 | } 128 | 129 | public bool isPlaying 130 | { 131 | get { return animation.isPlaying; } 132 | } 133 | 134 | public bool playAutomatically 135 | { 136 | get { return animation.playAutomatically; } 137 | set { animation.playAutomatically = value; } 138 | } 139 | 140 | public WrapMode wrapMode 141 | { 142 | get { return animation.wrapMode; } 143 | set { animation.wrapMode = value; } 144 | } 145 | 146 | public AnimationClip clip 147 | { 148 | get { return animation.clip; } 149 | set { animation.clip = value; } 150 | } 151 | 152 | public bool usesLegacy 153 | { 154 | get { return true; } 155 | } 156 | new public GameObject gameObject 157 | { 158 | get { return animation.gameObject; } 159 | } 160 | 161 | public void AddClip(AnimationClip clip, string newName) 162 | { 163 | animation.AddClip(clip, newName); 164 | } 165 | 166 | public void Blend(string state, float targetWeight, float fadeLength) 167 | { 168 | animation.Blend(state, targetWeight, fadeLength); 169 | } 170 | 171 | public void CrossFade(string state, float fadeLength) 172 | { 173 | animation.CrossFade(state, fadeLength); 174 | } 175 | 176 | public void CrossFadeQueued(string state, float fadeLength, QueueMode queueMode) 177 | { 178 | animation.CrossFadeQueued(state, fadeLength, queueMode); 179 | } 180 | 181 | public int GetClipCount() 182 | { 183 | return animation.GetClipCount(); 184 | } 185 | 186 | public bool IsPlaying(string stateName) 187 | { 188 | return animation.IsPlaying(stateName); 189 | } 190 | 191 | public void Stop() 192 | { 193 | animation.Stop(); 194 | } 195 | 196 | public void Stop(string stateName) 197 | { 198 | animation.Stop(stateName); 199 | } 200 | 201 | public void Sample() 202 | { 203 | animation.Sample(); 204 | } 205 | 206 | public bool Play() 207 | { 208 | return animation.Play(); 209 | } 210 | 211 | public bool Play(string stateName) 212 | { 213 | return animation.Play(stateName); 214 | } 215 | 216 | public void PlayQueued(string stateName, QueueMode queueMode) 217 | { 218 | animation.PlayQueued(stateName, queueMode); 219 | } 220 | 221 | public void RemoveClip(AnimationClip clip) 222 | { 223 | animation.RemoveClip(clip); 224 | } 225 | 226 | public void RemoveClip(string stateName) 227 | { 228 | animation.RemoveClip(stateName); 229 | } 230 | 231 | public void Rewind() 232 | { 233 | animation.Rewind(); 234 | } 235 | 236 | public void Rewind(string stateName) 237 | { 238 | animation.Rewind(stateName); 239 | } 240 | 241 | public IAnimationState GetState(string stateName) 242 | { 243 | AnimationState state = animation[stateName]; 244 | if (state != null) 245 | return new AnimationStateProxy(state); 246 | 247 | return null; 248 | } 249 | 250 | public IAnimationState this[string name] 251 | { 252 | get { return GetState(name); } 253 | } 254 | 255 | 256 | } 257 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/AnimationProxy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64de6b5accadb98478255b5777dbb960 3 | timeCreated: 1494556789 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/IAnimation.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | public interface IAnimationState 7 | { 8 | bool enabled { get; set; } 9 | bool isValid { get; } 10 | float time { get; set; } 11 | float normalizedTime { get; set; } 12 | float speed { get; set; } 13 | string name { get; set; } 14 | float weight { get; set; } 15 | float length { get; } 16 | AnimationClip clip { get; } 17 | WrapMode wrapMode { get; set; } 18 | 19 | } 20 | public interface IAnimation 21 | { 22 | //Should animations apply velocities to physics objects 23 | bool animatePhysics { get; set; } 24 | //How should animations mode updated based on renderer visibility 25 | AnimatorCullingMode cullingMode { get; set; } 26 | //Are we currently playing animations 27 | bool isPlaying { get;} 28 | //Should we start playing the default state 29 | bool playAutomatically { get; set; } 30 | //For clips where wrap mode is default, how should clips behave after they are done 31 | WrapMode wrapMode { get; set; } 32 | bool usesLegacy { get; } 33 | GameObject gameObject { get; } 34 | AnimationClip clip { get; set; } 35 | 36 | //Adds a new state named newName, which uses the AnimationClip clip 37 | void AddClip(AnimationClip clip, string newName); 38 | 39 | //Starts blending the state animation, towards weight targetWeight, fading over fadeLength seconds 40 | void Blend(string animation, float targetWeight, float fadeLength); 41 | 42 | //Over the next fadeLength seconds, start fading in state animation, fading out all other states 43 | void CrossFade(string animation, float fadeLength); 44 | 45 | //Queue a crossfade after the currently playing states are done playing. 46 | void CrossFadeQueued(string animation, float fadeLength, QueueMode queueMode); 47 | 48 | //Gets the number of AnimationClips attached to the component 49 | int GetClipCount(); 50 | 51 | //Returns true if state stateName is playing 52 | bool IsPlaying(string stateName); 53 | 54 | //Stops all playing animations on this component 55 | void Stop(); 56 | 57 | //Stops state named stateName 58 | void Stop(string stateName); 59 | 60 | //Evaluates the animations at the current time 61 | void Sample(); 62 | 63 | //Plays the default clip. Returns false if there is no clip attached 64 | bool Play(); 65 | 66 | //Plays the specified clip. Returns false if the state does not exist 67 | bool Play(string stateName); 68 | 69 | //Queue a Play after the current states are done playing 70 | void PlayQueued(string stateName, QueueMode queueMode); 71 | 72 | //Removes the specified clip, and any states using it 73 | void RemoveClip(AnimationClip clip); 74 | 75 | //Removes the specified state from the list of states, 76 | void RemoveClip(string stateName); 77 | 78 | //Rewinds all states 79 | void Rewind(); 80 | 81 | //Rewinds state named stateName 82 | void Rewind(string stateName); 83 | 84 | //Returns a handle on a state. Returns null if the state doesn't exist 85 | IAnimationState GetState(string stateName); 86 | 87 | IAnimationState this[string name] { get; } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/IAnimation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c1b1cfcce5efef469b2b2392f34f6f8 3 | timeCreated: 1494550643 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: baf2d9b4464e59b4ab9cb1ecdc5dcb95 3 | folderAsset: yes 4 | timeCreated: 1499702943 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a1e5b1b5fa32b94498a6f27e9d63496 3 | folderAsset: yes 4 | timeCreated: 1502215731 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 8 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | --- !u!157 &3 43 | LightmapSettings: 44 | m_ObjectHideFlags: 0 45 | serializedVersion: 11 46 | m_GIWorkflowMode: 1 47 | m_GISettings: 48 | serializedVersion: 2 49 | m_BounceScale: 1 50 | m_IndirectOutputScale: 1 51 | m_AlbedoBoost: 1 52 | m_TemporalCoherenceThreshold: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 9 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_TextureWidth: 1024 61 | m_TextureHeight: 1024 62 | m_AO: 0 63 | m_AOMaxDistance: 1 64 | m_CompAOExponent: 1 65 | m_CompAOExponentDirect: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 0 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVRFilterTypeDirect: 0 81 | m_PVRFilterTypeIndirect: 0 82 | m_PVRFilterTypeAO: 0 83 | m_PVRFilteringMode: 1 84 | m_PVRCulling: 1 85 | m_PVRFilteringGaussRadiusDirect: 1 86 | m_PVRFilteringGaussRadiusIndirect: 5 87 | m_PVRFilteringGaussRadiusAO: 2 88 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 89 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 90 | m_PVRFilteringAtrousPositionSigmaAO: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 1 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &727728709 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_PrefabParentObject: {fileID: 0} 119 | m_PrefabInternal: {fileID: 0} 120 | serializedVersion: 5 121 | m_Component: 122 | - component: {fileID: 727728711} 123 | - component: {fileID: 727728710} 124 | m_Layer: 0 125 | m_Name: TestUI 126 | m_TagString: Untagged 127 | m_Icon: {fileID: 0} 128 | m_NavMeshLayer: 0 129 | m_StaticEditorFlags: 0 130 | m_IsActive: 1 131 | --- !u!114 &727728710 132 | MonoBehaviour: 133 | m_ObjectHideFlags: 0 134 | m_PrefabParentObject: {fileID: 0} 135 | m_PrefabInternal: {fileID: 0} 136 | m_GameObject: {fileID: 727728709} 137 | m_Enabled: 1 138 | m_EditorHideFlags: 0 139 | m_Script: {fileID: 11500000, guid: 2a9da7454dab41842ad0833069495d6c, type: 3} 140 | m_Name: 141 | m_EditorClassIdentifier: 142 | Categories: 143 | - {fileID: 1526536085140382, guid: 876559ea1de191c4680a3ecd965eb5a6, type: 2} 144 | - {fileID: 1738818353288128, guid: 704824adecc7a1b439f4c34e90651320, type: 2} 145 | - {fileID: 1847196155820566, guid: 65148c2646c356b48b45a674d32f7085, type: 2} 146 | fps: 0 147 | fpssamples: 0 148 | numInstances: 10 149 | --- !u!4 &727728711 150 | Transform: 151 | m_ObjectHideFlags: 0 152 | m_PrefabParentObject: {fileID: 0} 153 | m_PrefabInternal: {fileID: 0} 154 | m_GameObject: {fileID: 727728709} 155 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 156 | m_LocalPosition: {x: 0, y: 0, z: 0} 157 | m_LocalScale: {x: 1, y: 1, z: 1} 158 | m_Children: [] 159 | m_Father: {fileID: 0} 160 | m_RootOrder: 2 161 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 162 | --- !u!1 &1161389416 163 | GameObject: 164 | m_ObjectHideFlags: 0 165 | m_PrefabParentObject: {fileID: 0} 166 | m_PrefabInternal: {fileID: 0} 167 | serializedVersion: 5 168 | m_Component: 169 | - component: {fileID: 1161389418} 170 | - component: {fileID: 1161389417} 171 | m_Layer: 0 172 | m_Name: Directional Light 173 | m_TagString: Untagged 174 | m_Icon: {fileID: 0} 175 | m_NavMeshLayer: 0 176 | m_StaticEditorFlags: 0 177 | m_IsActive: 1 178 | --- !u!108 &1161389417 179 | Light: 180 | m_ObjectHideFlags: 0 181 | m_PrefabParentObject: {fileID: 0} 182 | m_PrefabInternal: {fileID: 0} 183 | m_GameObject: {fileID: 1161389416} 184 | m_Enabled: 1 185 | serializedVersion: 8 186 | m_Type: 1 187 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 188 | m_Intensity: 1 189 | m_Range: 10 190 | m_SpotAngle: 30 191 | m_CookieSize: 10 192 | m_Shadows: 193 | m_Type: 2 194 | m_Resolution: -1 195 | m_CustomResolution: -1 196 | m_Strength: 1 197 | m_Bias: 0.05 198 | m_NormalBias: 0.4 199 | m_NearPlane: 0.2 200 | m_Cookie: {fileID: 0} 201 | m_DrawHalo: 0 202 | m_Flare: {fileID: 0} 203 | m_RenderMode: 0 204 | m_CullingMask: 205 | serializedVersion: 2 206 | m_Bits: 4294967295 207 | m_Lightmapping: 4 208 | m_AreaSize: {x: 1, y: 1} 209 | m_BounceIntensity: 1 210 | m_ColorTemperature: 6570 211 | m_UseColorTemperature: 0 212 | m_ShadowRadius: 0 213 | m_ShadowAngle: 0 214 | --- !u!4 &1161389418 215 | Transform: 216 | m_ObjectHideFlags: 0 217 | m_PrefabParentObject: {fileID: 0} 218 | m_PrefabInternal: {fileID: 0} 219 | m_GameObject: {fileID: 1161389416} 220 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 221 | m_LocalPosition: {x: 0, y: 3, z: 0} 222 | m_LocalScale: {x: 1, y: 1, z: 1} 223 | m_Children: [] 224 | m_Father: {fileID: 0} 225 | m_RootOrder: 1 226 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 227 | --- !u!1 &1578799488 228 | GameObject: 229 | m_ObjectHideFlags: 0 230 | m_PrefabParentObject: {fileID: 0} 231 | m_PrefabInternal: {fileID: 0} 232 | serializedVersion: 5 233 | m_Component: 234 | - component: {fileID: 1578799493} 235 | - component: {fileID: 1578799492} 236 | - component: {fileID: 1578799491} 237 | - component: {fileID: 1578799490} 238 | - component: {fileID: 1578799489} 239 | m_Layer: 0 240 | m_Name: Main Camera 241 | m_TagString: MainCamera 242 | m_Icon: {fileID: 0} 243 | m_NavMeshLayer: 0 244 | m_StaticEditorFlags: 0 245 | m_IsActive: 1 246 | --- !u!81 &1578799489 247 | AudioListener: 248 | m_ObjectHideFlags: 0 249 | m_PrefabParentObject: {fileID: 0} 250 | m_PrefabInternal: {fileID: 0} 251 | m_GameObject: {fileID: 1578799488} 252 | m_Enabled: 1 253 | m_ExtensionPropertyValues: [] 254 | --- !u!124 &1578799490 255 | Behaviour: 256 | m_ObjectHideFlags: 0 257 | m_PrefabParentObject: {fileID: 0} 258 | m_PrefabInternal: {fileID: 0} 259 | m_GameObject: {fileID: 1578799488} 260 | m_Enabled: 1 261 | --- !u!92 &1578799491 262 | Behaviour: 263 | m_ObjectHideFlags: 0 264 | m_PrefabParentObject: {fileID: 0} 265 | m_PrefabInternal: {fileID: 0} 266 | m_GameObject: {fileID: 1578799488} 267 | m_Enabled: 1 268 | --- !u!20 &1578799492 269 | Camera: 270 | m_ObjectHideFlags: 0 271 | m_PrefabParentObject: {fileID: 0} 272 | m_PrefabInternal: {fileID: 0} 273 | m_GameObject: {fileID: 1578799488} 274 | m_Enabled: 1 275 | serializedVersion: 2 276 | m_ClearFlags: 1 277 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 278 | m_NormalizedViewPortRect: 279 | serializedVersion: 2 280 | x: 0 281 | y: 0 282 | width: 1 283 | height: 1 284 | near clip plane: 0.3 285 | far clip plane: 1000 286 | field of view: 60 287 | orthographic: 0 288 | orthographic size: 5 289 | m_Depth: -1 290 | m_CullingMask: 291 | serializedVersion: 2 292 | m_Bits: 4294967295 293 | m_RenderingPath: -1 294 | m_TargetTexture: {fileID: 0} 295 | m_TargetDisplay: 0 296 | m_TargetEye: 3 297 | m_HDR: 1 298 | m_AllowMSAA: 1 299 | m_ForceIntoRT: 0 300 | m_OcclusionCulling: 1 301 | m_StereoConvergence: 10 302 | m_StereoSeparation: 0.022 303 | m_StereoMirrorMode: 0 304 | --- !u!4 &1578799493 305 | Transform: 306 | m_ObjectHideFlags: 0 307 | m_PrefabParentObject: {fileID: 0} 308 | m_PrefabInternal: {fileID: 0} 309 | m_GameObject: {fileID: 1578799488} 310 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 311 | m_LocalPosition: {x: 0, y: 1, z: -10} 312 | m_LocalScale: {x: 1, y: 1, z: 1} 313 | m_Children: [] 314 | m_Father: {fileID: 0} 315 | m_RootOrder: 0 316 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 317 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c25e0f0d6f1a4c9458fc5b1a381b764b 3 | timeCreated: 1499702978 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex/AndroidAnimator.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65148c2646c356b48b45a674d32f7085 3 | timeCreated: 1502220683 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex/AndroidGenericAnim.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: AndroidGenericAnim 9 | serializedVersion: 5 10 | m_AnimatorParameters: [] 11 | m_AnimatorLayers: 12 | - serializedVersion: 5 13 | m_Name: Base Layer 14 | m_StateMachine: {fileID: 1107549521193886108} 15 | m_Mask: {fileID: 0} 16 | m_Motions: [] 17 | m_Behaviours: [] 18 | m_BlendingMode: 0 19 | m_SyncedLayerIndex: -1 20 | m_DefaultWeight: 0 21 | m_IKPass: 0 22 | m_SyncedLayerAffectsTiming: 0 23 | m_Controller: {fileID: 9100000} 24 | --- !u!1102 &1102935785621315878 25 | AnimatorState: 26 | serializedVersion: 5 27 | m_ObjectHideFlags: 1 28 | m_PrefabParentObject: {fileID: 0} 29 | m_PrefabInternal: {fileID: 0} 30 | m_Name: Take 001 31 | m_Speed: 1 32 | m_CycleOffset: 0 33 | m_Transitions: [] 34 | m_StateMachineBehaviours: [] 35 | m_Position: {x: 50, y: 50, z: 0} 36 | m_IKOnFeet: 0 37 | m_WriteDefaultValues: 1 38 | m_Mirror: 0 39 | m_SpeedParameterActive: 0 40 | m_MirrorParameterActive: 0 41 | m_CycleOffsetParameterActive: 0 42 | m_TimeParameterActive: 0 43 | m_Motion: {fileID: 7400000, guid: 7eb8b94e211f70f44877f2fbe52f2e78, type: 3} 44 | m_Tag: 45 | m_SpeedParameter: 46 | m_MirrorParameter: 47 | m_CycleOffsetParameter: 48 | m_TimeParameter: 49 | --- !u!1107 &1107549521193886108 50 | AnimatorStateMachine: 51 | serializedVersion: 5 52 | m_ObjectHideFlags: 1 53 | m_PrefabParentObject: {fileID: 0} 54 | m_PrefabInternal: {fileID: 0} 55 | m_Name: Base Layer 56 | m_ChildStates: 57 | - serializedVersion: 1 58 | m_State: {fileID: 1102935785621315878} 59 | m_Position: {x: 200, y: 0, z: 0} 60 | m_ChildStateMachines: [] 61 | m_AnyStateTransitions: [] 62 | m_EntryTransitions: [] 63 | m_StateMachineTransitions: {} 64 | m_StateMachineBehaviours: [] 65 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 66 | m_EntryPosition: {x: 50, y: 120, z: 0} 67 | m_ExitPosition: {x: 800, y: 120, z: 0} 68 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 69 | m_DefaultState: {fileID: 1102935785621315878} 70 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex/AndroidGenericAnim.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92f729d0e503a0b479c3413fba6138c6 3 | timeCreated: 1502220628 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 9100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex/AndroidGenericAnim.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Unity-Technologies/SimpleAnimation/cd255af7dd7579953fa610b049f896570217540f/Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex/AndroidGenericAnim.fbx -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex/AndroidGenericAnim.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7eb8b94e211f70f44877f2fbe52f2e78 3 | timeCreated: 1502215789 4 | licenseType: Pro 5 | ModelImporter: 6 | serializedVersion: 22 7 | fileIDToRecycleName: 8 | 100000: //RootNode 9 | 100002: Body 10 | 100004: Control_Dwn_Mouth 11 | 100006: Control_DwnL_Mouth 12 | 100008: Control_DwnR_Mouth 13 | 100010: Control_Head 14 | 100012: Control_Jaw 15 | 100014: Control_L_Clavice 16 | 100016: Control_L_Elbow 17 | 100018: Control_L_Eyebrow_1 18 | 100020: Control_L_Eyebrow_2 19 | 100022: Control_L_Eyebrow_3 20 | 100024: Control_L_EyeRot 21 | 100026: Control_L_Face 22 | 100028: Control_L_Finger_0 23 | 100030: Control_L_Finger_0 1 24 | 100032: Control_L_Finger_01 25 | 100034: Control_L_Finger_01 1 26 | 100036: Control_L_Finger_0_Master 27 | 100038: Control_L_Finger_0_Master 1 28 | 100040: Control_L_Finger_1 29 | 100042: Control_L_Finger_1 1 30 | 100044: Control_L_Finger_11 31 | 100046: Control_L_Finger_11 1 32 | 100048: Control_L_Finger_12 33 | 100050: Control_L_Finger_12 1 34 | 100052: Control_L_Finger_2 35 | 100054: Control_L_Finger_2 1 36 | 100056: Control_L_Finger_21 37 | 100058: Control_L_Finger_21 1 38 | 100060: Control_L_Finger_22 39 | 100062: Control_L_Finger_22 1 40 | 100064: Control_L_Finger_3 41 | 100066: Control_L_Finger_3 1 42 | 100068: Control_L_Finger_31 43 | 100070: Control_L_Finger_31 1 44 | 100072: Control_L_Finger_32 45 | 100074: Control_L_Finger_32 1 46 | 100076: Control_L_Finger_4 47 | 100078: Control_L_Finger_4 1 48 | 100080: Control_L_Finger_41 49 | 100082: Control_L_Finger_41 1 50 | 100084: Control_L_Finger_42 51 | 100086: Control_L_Finger_42 1 52 | 100088: Control_L_Foot 53 | 100090: Control_L_FootRot 54 | 100092: Control_L_Hand 55 | 100094: Control_L_Mouth 56 | 100096: Control_Neck 57 | 100098: Control_R_Clavice 58 | 100100: Control_R_Elbow 59 | 100102: Control_R_Eyebrow_1 60 | 100104: Control_R_Eyebrow_2 61 | 100106: Control_R_Eyebrow_3 62 | 100108: Control_R_EyeRot 63 | 100110: Control_R_Face 64 | 100112: Control_R_Foot 65 | 100114: Control_R_FootRot 66 | 100116: Control_R_Hand 67 | 100118: Control_R_Mouth 68 | 100120: Control_Root 69 | 100122: Control_Spine_1 70 | 100124: Control_Spine_2 71 | 100126: Control_Spine_3 72 | 100128: Control_Up_Mouth 73 | 100130: Control_UpL_Mouth 74 | 100132: Control_UpR_Mouth 75 | 100134: Controls 76 | 100136: Head1 77 | 100138: Head2 78 | 100140: Hips 79 | 100142: IK_L_Foot 80 | 100144: Ik_L_Hand 81 | 100146: IK_L_Leg 82 | 100148: IK_L_Toe 83 | 100150: Ik_R_Foot 84 | 100152: IK_R_Hand 85 | 100154: Ik_R_Leg 86 | 100156: Ik_R_Toe 87 | 100158: Jaw1 88 | 100160: Jaw2 89 | 100162: L_Ankle_Pivot 90 | 100164: L_HeelPeel 91 | 100166: L_Swivel_Pivot 92 | 100168: L_Toetap_Pivot 93 | 100170: L_ToeTip_Pivot 94 | 100172: LeftArm 95 | 100174: LeftBrow1 96 | 100176: LeftBrow2 97 | 100178: LeftBrow3 98 | 100180: LeftCheek 99 | 100182: LeftEye 100 | 100184: LeftFoot 101 | 100186: LeftForeArm 102 | 100188: LeftHand 103 | 100190: LeftHandIndex1 104 | 100192: LeftHandIndex2 105 | 100194: LeftHandIndex3 106 | 100196: LeftHandIndex4 107 | 100198: LeftHandMiddle1 108 | 100200: LeftHandMiddle2 109 | 100202: LeftHandMiddle3 110 | 100204: LeftHandMiddle4 111 | 100206: LeftHandPinky1 112 | 100208: LeftHandPinky2 113 | 100210: LeftHandPinky3 114 | 100212: LeftHandPinky4 115 | 100214: LeftHandRing1 116 | 100216: LeftHandRing2 117 | 100218: LeftHandRing3 118 | 100220: LeftHandRing4 119 | 100222: LeftHandThumb1 120 | 100224: LeftHandThumb2 121 | 100226: LeftHandThumb3 122 | 100228: LeftLeg 123 | 100230: LeftMouth 124 | 100232: LeftMouthLower 125 | 100234: LeftMouthUpper 126 | 100236: LeftShoulder 127 | 100238: LeftToe1 128 | 100240: LeftToe2 129 | 100242: LeftUpLeg 130 | 100244: Mesh 131 | 100246: MouthLower 132 | 100248: MouthUpper 133 | 100250: Neck 134 | 100252: R_Ankle_Pivot 135 | 100254: R_HeelPeel_Pivot 136 | 100256: R_Swivel_Pivot 137 | 100258: R_ToeTap_Pivot 138 | 100260: R_ToeTip_Pivot 139 | 100262: RightArm 140 | 100264: RightBrow1 141 | 100266: RightBrow2 142 | 100268: RightBrow3 143 | 100270: RightCheek 144 | 100272: RightEye 145 | 100274: RightFoot 146 | 100276: RightForeArm 147 | 100278: RightHand 148 | 100280: RightHandIndex1 149 | 100282: RightHandIndex2 150 | 100284: RightHandIndex3 151 | 100286: RightHandIndex4 152 | 100288: RightHandMiddle1 153 | 100290: RightHandMiddle2 154 | 100292: RightHandMiddle3 155 | 100294: RightHandMiddle4 156 | 100296: RightHandPinky1 157 | 100298: RightHandPinky2 158 | 100300: RightHandPinky3 159 | 100302: RightHandPinky4 160 | 100304: RightHandRing1 161 | 100306: RightHandRing2 162 | 100308: RightHandRing3 163 | 100310: RightHandRing4 164 | 100312: RightHandThumb1 165 | 100314: RightHandThumb2 166 | 100316: RightHandThumb3 167 | 100318: RightLeg 168 | 100320: RightMouth 169 | 100322: RightMouthLower 170 | 100324: RightMouthUpper 171 | 100326: RightShoulder 172 | 100328: RightToe1 173 | 100330: RightToe2 174 | 100332: RightUpLeg 175 | 100334: Skeleton 176 | 100336: Spine1 177 | 100338: Spine2 178 | 100340: Spine3 179 | 400000: //RootNode 180 | 400002: Body 181 | 400004: Control_Dwn_Mouth 182 | 400006: Control_DwnL_Mouth 183 | 400008: Control_DwnR_Mouth 184 | 400010: Control_Head 185 | 400012: Control_Jaw 186 | 400014: Control_L_Clavice 187 | 400016: Control_L_Elbow 188 | 400018: Control_L_Eyebrow_1 189 | 400020: Control_L_Eyebrow_2 190 | 400022: Control_L_Eyebrow_3 191 | 400024: Control_L_EyeRot 192 | 400026: Control_L_Face 193 | 400028: Control_L_Finger_0 194 | 400030: Control_L_Finger_0 1 195 | 400032: Control_L_Finger_01 196 | 400034: Control_L_Finger_01 1 197 | 400036: Control_L_Finger_0_Master 198 | 400038: Control_L_Finger_0_Master 1 199 | 400040: Control_L_Finger_1 200 | 400042: Control_L_Finger_1 1 201 | 400044: Control_L_Finger_11 202 | 400046: Control_L_Finger_11 1 203 | 400048: Control_L_Finger_12 204 | 400050: Control_L_Finger_12 1 205 | 400052: Control_L_Finger_2 206 | 400054: Control_L_Finger_2 1 207 | 400056: Control_L_Finger_21 208 | 400058: Control_L_Finger_21 1 209 | 400060: Control_L_Finger_22 210 | 400062: Control_L_Finger_22 1 211 | 400064: Control_L_Finger_3 212 | 400066: Control_L_Finger_3 1 213 | 400068: Control_L_Finger_31 214 | 400070: Control_L_Finger_31 1 215 | 400072: Control_L_Finger_32 216 | 400074: Control_L_Finger_32 1 217 | 400076: Control_L_Finger_4 218 | 400078: Control_L_Finger_4 1 219 | 400080: Control_L_Finger_41 220 | 400082: Control_L_Finger_41 1 221 | 400084: Control_L_Finger_42 222 | 400086: Control_L_Finger_42 1 223 | 400088: Control_L_Foot 224 | 400090: Control_L_FootRot 225 | 400092: Control_L_Hand 226 | 400094: Control_L_Mouth 227 | 400096: Control_Neck 228 | 400098: Control_R_Clavice 229 | 400100: Control_R_Elbow 230 | 400102: Control_R_Eyebrow_1 231 | 400104: Control_R_Eyebrow_2 232 | 400106: Control_R_Eyebrow_3 233 | 400108: Control_R_EyeRot 234 | 400110: Control_R_Face 235 | 400112: Control_R_Foot 236 | 400114: Control_R_FootRot 237 | 400116: Control_R_Hand 238 | 400118: Control_R_Mouth 239 | 400120: Control_Root 240 | 400122: Control_Spine_1 241 | 400124: Control_Spine_2 242 | 400126: Control_Spine_3 243 | 400128: Control_Up_Mouth 244 | 400130: Control_UpL_Mouth 245 | 400132: Control_UpR_Mouth 246 | 400134: Controls 247 | 400136: Head1 248 | 400138: Head2 249 | 400140: Hips 250 | 400142: IK_L_Foot 251 | 400144: Ik_L_Hand 252 | 400146: IK_L_Leg 253 | 400148: IK_L_Toe 254 | 400150: Ik_R_Foot 255 | 400152: IK_R_Hand 256 | 400154: Ik_R_Leg 257 | 400156: Ik_R_Toe 258 | 400158: Jaw1 259 | 400160: Jaw2 260 | 400162: L_Ankle_Pivot 261 | 400164: L_HeelPeel 262 | 400166: L_Swivel_Pivot 263 | 400168: L_Toetap_Pivot 264 | 400170: L_ToeTip_Pivot 265 | 400172: LeftArm 266 | 400174: LeftBrow1 267 | 400176: LeftBrow2 268 | 400178: LeftBrow3 269 | 400180: LeftCheek 270 | 400182: LeftEye 271 | 400184: LeftFoot 272 | 400186: LeftForeArm 273 | 400188: LeftHand 274 | 400190: LeftHandIndex1 275 | 400192: LeftHandIndex2 276 | 400194: LeftHandIndex3 277 | 400196: LeftHandIndex4 278 | 400198: LeftHandMiddle1 279 | 400200: LeftHandMiddle2 280 | 400202: LeftHandMiddle3 281 | 400204: LeftHandMiddle4 282 | 400206: LeftHandPinky1 283 | 400208: LeftHandPinky2 284 | 400210: LeftHandPinky3 285 | 400212: LeftHandPinky4 286 | 400214: LeftHandRing1 287 | 400216: LeftHandRing2 288 | 400218: LeftHandRing3 289 | 400220: LeftHandRing4 290 | 400222: LeftHandThumb1 291 | 400224: LeftHandThumb2 292 | 400226: LeftHandThumb3 293 | 400228: LeftLeg 294 | 400230: LeftMouth 295 | 400232: LeftMouthLower 296 | 400234: LeftMouthUpper 297 | 400236: LeftShoulder 298 | 400238: LeftToe1 299 | 400240: LeftToe2 300 | 400242: LeftUpLeg 301 | 400244: Mesh 302 | 400246: MouthLower 303 | 400248: MouthUpper 304 | 400250: Neck 305 | 400252: R_Ankle_Pivot 306 | 400254: R_HeelPeel_Pivot 307 | 400256: R_Swivel_Pivot 308 | 400258: R_ToeTap_Pivot 309 | 400260: R_ToeTip_Pivot 310 | 400262: RightArm 311 | 400264: RightBrow1 312 | 400266: RightBrow2 313 | 400268: RightBrow3 314 | 400270: RightCheek 315 | 400272: RightEye 316 | 400274: RightFoot 317 | 400276: RightForeArm 318 | 400278: RightHand 319 | 400280: RightHandIndex1 320 | 400282: RightHandIndex2 321 | 400284: RightHandIndex3 322 | 400286: RightHandIndex4 323 | 400288: RightHandMiddle1 324 | 400290: RightHandMiddle2 325 | 400292: RightHandMiddle3 326 | 400294: RightHandMiddle4 327 | 400296: RightHandPinky1 328 | 400298: RightHandPinky2 329 | 400300: RightHandPinky3 330 | 400302: RightHandPinky4 331 | 400304: RightHandRing1 332 | 400306: RightHandRing2 333 | 400308: RightHandRing3 334 | 400310: RightHandRing4 335 | 400312: RightHandThumb1 336 | 400314: RightHandThumb2 337 | 400316: RightHandThumb3 338 | 400318: RightLeg 339 | 400320: RightMouth 340 | 400322: RightMouthLower 341 | 400324: RightMouthUpper 342 | 400326: RightShoulder 343 | 400328: RightToe1 344 | 400330: RightToe2 345 | 400332: RightUpLeg 346 | 400334: Skeleton 347 | 400336: Spine1 348 | 400338: Spine2 349 | 400340: Spine3 350 | 2100000: Android_Walking_Android 351 | 4300000: Body 352 | 7400000: Take 001 353 | 9500000: //RootNode 354 | 13700000: Body 355 | externalObjects: {} 356 | materials: 357 | importMaterials: 1 358 | materialName: 0 359 | materialSearch: 1 360 | materialLocation: 1 361 | animations: 362 | legacyGenerateAnimations: 4 363 | bakeSimulation: 0 364 | resampleCurves: 1 365 | optimizeGameObjects: 0 366 | motionNodeName: 367 | rigImportErrors: 368 | rigImportWarnings: 369 | animationImportErrors: 370 | animationImportWarnings: 371 | animationRetargetingWarnings: 372 | animationDoRetargetingWarnings: 0 373 | importAnimatedCustomProperties: 0 374 | animationCompression: 1 375 | animationRotationError: 0.5 376 | animationPositionError: 0.5 377 | animationScaleError: 0.5 378 | animationWrapMode: 0 379 | extraExposedTransformPaths: [] 380 | extraUserProperties: [] 381 | clipAnimations: [] 382 | isReadable: 1 383 | meshes: 384 | lODScreenPercentages: [] 385 | globalScale: 1 386 | meshCompression: 0 387 | addColliders: 0 388 | importVisibility: 1 389 | importBlendShapes: 1 390 | importCameras: 1 391 | importLights: 1 392 | swapUVChannels: 0 393 | generateSecondaryUV: 0 394 | useFileUnits: 1 395 | optimizeMeshForGPU: 1 396 | keepQuads: 0 397 | weldVertices: 1 398 | preserveHierarchy: 0 399 | secondaryUVAngleDistortion: 8 400 | secondaryUVAreaDistortion: 15.000001 401 | secondaryUVHardAngle: 88 402 | secondaryUVPackMargin: 4 403 | useFileScale: 1 404 | tangentSpace: 405 | normalSmoothAngle: 60 406 | normalImportMode: 0 407 | tangentImportMode: 3 408 | normalCalculationMode: 4 409 | importAnimation: 1 410 | copyAvatar: 0 411 | humanDescription: 412 | serializedVersion: 2 413 | human: [] 414 | skeleton: [] 415 | armTwist: 0.5 416 | foreArmTwist: 0.5 417 | upperLegTwist: 0.5 418 | legTwist: 0.5 419 | armStretch: 0.05 420 | legStretch: 0.05 421 | feetSpacing: 0 422 | rootMotionBoneName: 423 | rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} 424 | hasTranslationDoF: 0 425 | hasExtraRoot: 0 426 | skeletonHasParents: 1 427 | lastHumanDescriptionAvatarSource: {instanceID: 0} 428 | animationType: 2 429 | humanoidOversampling: 1 430 | additionalBone: 0 431 | userData: 432 | assetBundleName: 433 | assetBundleVariant: 434 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex/AndroidLegacy.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 876559ea1de191c4680a3ecd965eb5a6 3 | timeCreated: 1502220764 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex/AndroidLegacyAnim.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Unity-Technologies/SimpleAnimation/cd255af7dd7579953fa610b049f896570217540f/Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex/AndroidLegacyAnim.fbx -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex/AndroidLegacyAnim.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 832c6aadeccb8324cb11d96f77cf9b74 3 | timeCreated: 1502215789 4 | licenseType: Pro 5 | ModelImporter: 6 | serializedVersion: 22 7 | fileIDToRecycleName: 8 | 100000: //RootNode 9 | 100002: Body 10 | 100004: Control_Dwn_Mouth 11 | 100006: Control_DwnL_Mouth 12 | 100008: Control_DwnR_Mouth 13 | 100010: Control_Head 14 | 100012: Control_Jaw 15 | 100014: Control_L_Clavice 16 | 100016: Control_L_Elbow 17 | 100018: Control_L_Eyebrow_1 18 | 100020: Control_L_Eyebrow_2 19 | 100022: Control_L_Eyebrow_3 20 | 100024: Control_L_EyeRot 21 | 100026: Control_L_Face 22 | 100028: Control_L_Finger_0 23 | 100030: Control_L_Finger_0 1 24 | 100032: Control_L_Finger_01 25 | 100034: Control_L_Finger_01 1 26 | 100036: Control_L_Finger_0_Master 27 | 100038: Control_L_Finger_0_Master 1 28 | 100040: Control_L_Finger_1 29 | 100042: Control_L_Finger_1 1 30 | 100044: Control_L_Finger_11 31 | 100046: Control_L_Finger_11 1 32 | 100048: Control_L_Finger_12 33 | 100050: Control_L_Finger_12 1 34 | 100052: Control_L_Finger_2 35 | 100054: Control_L_Finger_2 1 36 | 100056: Control_L_Finger_21 37 | 100058: Control_L_Finger_21 1 38 | 100060: Control_L_Finger_22 39 | 100062: Control_L_Finger_22 1 40 | 100064: Control_L_Finger_3 41 | 100066: Control_L_Finger_3 1 42 | 100068: Control_L_Finger_31 43 | 100070: Control_L_Finger_31 1 44 | 100072: Control_L_Finger_32 45 | 100074: Control_L_Finger_32 1 46 | 100076: Control_L_Finger_4 47 | 100078: Control_L_Finger_4 1 48 | 100080: Control_L_Finger_41 49 | 100082: Control_L_Finger_41 1 50 | 100084: Control_L_Finger_42 51 | 100086: Control_L_Finger_42 1 52 | 100088: Control_L_Foot 53 | 100090: Control_L_FootRot 54 | 100092: Control_L_Hand 55 | 100094: Control_L_Mouth 56 | 100096: Control_Neck 57 | 100098: Control_R_Clavice 58 | 100100: Control_R_Elbow 59 | 100102: Control_R_Eyebrow_1 60 | 100104: Control_R_Eyebrow_2 61 | 100106: Control_R_Eyebrow_3 62 | 100108: Control_R_EyeRot 63 | 100110: Control_R_Face 64 | 100112: Control_R_Foot 65 | 100114: Control_R_FootRot 66 | 100116: Control_R_Hand 67 | 100118: Control_R_Mouth 68 | 100120: Control_Root 69 | 100122: Control_Spine_1 70 | 100124: Control_Spine_2 71 | 100126: Control_Spine_3 72 | 100128: Control_Up_Mouth 73 | 100130: Control_UpL_Mouth 74 | 100132: Control_UpR_Mouth 75 | 100134: Controls 76 | 100136: Head1 77 | 100138: Head2 78 | 100140: Hips 79 | 100142: IK_L_Foot 80 | 100144: Ik_L_Hand 81 | 100146: IK_L_Leg 82 | 100148: IK_L_Toe 83 | 100150: Ik_R_Foot 84 | 100152: IK_R_Hand 85 | 100154: Ik_R_Leg 86 | 100156: Ik_R_Toe 87 | 100158: Jaw1 88 | 100160: Jaw2 89 | 100162: L_Ankle_Pivot 90 | 100164: L_HeelPeel 91 | 100166: L_Swivel_Pivot 92 | 100168: L_Toetap_Pivot 93 | 100170: L_ToeTip_Pivot 94 | 100172: LeftArm 95 | 100174: LeftBrow1 96 | 100176: LeftBrow2 97 | 100178: LeftBrow3 98 | 100180: LeftCheek 99 | 100182: LeftEye 100 | 100184: LeftFoot 101 | 100186: LeftForeArm 102 | 100188: LeftHand 103 | 100190: LeftHandIndex1 104 | 100192: LeftHandIndex2 105 | 100194: LeftHandIndex3 106 | 100196: LeftHandIndex4 107 | 100198: LeftHandMiddle1 108 | 100200: LeftHandMiddle2 109 | 100202: LeftHandMiddle3 110 | 100204: LeftHandMiddle4 111 | 100206: LeftHandPinky1 112 | 100208: LeftHandPinky2 113 | 100210: LeftHandPinky3 114 | 100212: LeftHandPinky4 115 | 100214: LeftHandRing1 116 | 100216: LeftHandRing2 117 | 100218: LeftHandRing3 118 | 100220: LeftHandRing4 119 | 100222: LeftHandThumb1 120 | 100224: LeftHandThumb2 121 | 100226: LeftHandThumb3 122 | 100228: LeftLeg 123 | 100230: LeftMouth 124 | 100232: LeftMouthLower 125 | 100234: LeftMouthUpper 126 | 100236: LeftShoulder 127 | 100238: LeftToe1 128 | 100240: LeftToe2 129 | 100242: LeftUpLeg 130 | 100244: Mesh 131 | 100246: MouthLower 132 | 100248: MouthUpper 133 | 100250: Neck 134 | 100252: R_Ankle_Pivot 135 | 100254: R_HeelPeel_Pivot 136 | 100256: R_Swivel_Pivot 137 | 100258: R_ToeTap_Pivot 138 | 100260: R_ToeTip_Pivot 139 | 100262: RightArm 140 | 100264: RightBrow1 141 | 100266: RightBrow2 142 | 100268: RightBrow3 143 | 100270: RightCheek 144 | 100272: RightEye 145 | 100274: RightFoot 146 | 100276: RightForeArm 147 | 100278: RightHand 148 | 100280: RightHandIndex1 149 | 100282: RightHandIndex2 150 | 100284: RightHandIndex3 151 | 100286: RightHandIndex4 152 | 100288: RightHandMiddle1 153 | 100290: RightHandMiddle2 154 | 100292: RightHandMiddle3 155 | 100294: RightHandMiddle4 156 | 100296: RightHandPinky1 157 | 100298: RightHandPinky2 158 | 100300: RightHandPinky3 159 | 100302: RightHandPinky4 160 | 100304: RightHandRing1 161 | 100306: RightHandRing2 162 | 100308: RightHandRing3 163 | 100310: RightHandRing4 164 | 100312: RightHandThumb1 165 | 100314: RightHandThumb2 166 | 100316: RightHandThumb3 167 | 100318: RightLeg 168 | 100320: RightMouth 169 | 100322: RightMouthLower 170 | 100324: RightMouthUpper 171 | 100326: RightShoulder 172 | 100328: RightToe1 173 | 100330: RightToe2 174 | 100332: RightUpLeg 175 | 100334: Skeleton 176 | 100336: Spine1 177 | 100338: Spine2 178 | 100340: Spine3 179 | 400000: //RootNode 180 | 400002: Body 181 | 400004: Control_Dwn_Mouth 182 | 400006: Control_DwnL_Mouth 183 | 400008: Control_DwnR_Mouth 184 | 400010: Control_Head 185 | 400012: Control_Jaw 186 | 400014: Control_L_Clavice 187 | 400016: Control_L_Elbow 188 | 400018: Control_L_Eyebrow_1 189 | 400020: Control_L_Eyebrow_2 190 | 400022: Control_L_Eyebrow_3 191 | 400024: Control_L_EyeRot 192 | 400026: Control_L_Face 193 | 400028: Control_L_Finger_0 194 | 400030: Control_L_Finger_0 1 195 | 400032: Control_L_Finger_01 196 | 400034: Control_L_Finger_01 1 197 | 400036: Control_L_Finger_0_Master 198 | 400038: Control_L_Finger_0_Master 1 199 | 400040: Control_L_Finger_1 200 | 400042: Control_L_Finger_1 1 201 | 400044: Control_L_Finger_11 202 | 400046: Control_L_Finger_11 1 203 | 400048: Control_L_Finger_12 204 | 400050: Control_L_Finger_12 1 205 | 400052: Control_L_Finger_2 206 | 400054: Control_L_Finger_2 1 207 | 400056: Control_L_Finger_21 208 | 400058: Control_L_Finger_21 1 209 | 400060: Control_L_Finger_22 210 | 400062: Control_L_Finger_22 1 211 | 400064: Control_L_Finger_3 212 | 400066: Control_L_Finger_3 1 213 | 400068: Control_L_Finger_31 214 | 400070: Control_L_Finger_31 1 215 | 400072: Control_L_Finger_32 216 | 400074: Control_L_Finger_32 1 217 | 400076: Control_L_Finger_4 218 | 400078: Control_L_Finger_4 1 219 | 400080: Control_L_Finger_41 220 | 400082: Control_L_Finger_41 1 221 | 400084: Control_L_Finger_42 222 | 400086: Control_L_Finger_42 1 223 | 400088: Control_L_Foot 224 | 400090: Control_L_FootRot 225 | 400092: Control_L_Hand 226 | 400094: Control_L_Mouth 227 | 400096: Control_Neck 228 | 400098: Control_R_Clavice 229 | 400100: Control_R_Elbow 230 | 400102: Control_R_Eyebrow_1 231 | 400104: Control_R_Eyebrow_2 232 | 400106: Control_R_Eyebrow_3 233 | 400108: Control_R_EyeRot 234 | 400110: Control_R_Face 235 | 400112: Control_R_Foot 236 | 400114: Control_R_FootRot 237 | 400116: Control_R_Hand 238 | 400118: Control_R_Mouth 239 | 400120: Control_Root 240 | 400122: Control_Spine_1 241 | 400124: Control_Spine_2 242 | 400126: Control_Spine_3 243 | 400128: Control_Up_Mouth 244 | 400130: Control_UpL_Mouth 245 | 400132: Control_UpR_Mouth 246 | 400134: Controls 247 | 400136: Head1 248 | 400138: Head2 249 | 400140: Hips 250 | 400142: IK_L_Foot 251 | 400144: Ik_L_Hand 252 | 400146: IK_L_Leg 253 | 400148: IK_L_Toe 254 | 400150: Ik_R_Foot 255 | 400152: IK_R_Hand 256 | 400154: Ik_R_Leg 257 | 400156: Ik_R_Toe 258 | 400158: Jaw1 259 | 400160: Jaw2 260 | 400162: L_Ankle_Pivot 261 | 400164: L_HeelPeel 262 | 400166: L_Swivel_Pivot 263 | 400168: L_Toetap_Pivot 264 | 400170: L_ToeTip_Pivot 265 | 400172: LeftArm 266 | 400174: LeftBrow1 267 | 400176: LeftBrow2 268 | 400178: LeftBrow3 269 | 400180: LeftCheek 270 | 400182: LeftEye 271 | 400184: LeftFoot 272 | 400186: LeftForeArm 273 | 400188: LeftHand 274 | 400190: LeftHandIndex1 275 | 400192: LeftHandIndex2 276 | 400194: LeftHandIndex3 277 | 400196: LeftHandIndex4 278 | 400198: LeftHandMiddle1 279 | 400200: LeftHandMiddle2 280 | 400202: LeftHandMiddle3 281 | 400204: LeftHandMiddle4 282 | 400206: LeftHandPinky1 283 | 400208: LeftHandPinky2 284 | 400210: LeftHandPinky3 285 | 400212: LeftHandPinky4 286 | 400214: LeftHandRing1 287 | 400216: LeftHandRing2 288 | 400218: LeftHandRing3 289 | 400220: LeftHandRing4 290 | 400222: LeftHandThumb1 291 | 400224: LeftHandThumb2 292 | 400226: LeftHandThumb3 293 | 400228: LeftLeg 294 | 400230: LeftMouth 295 | 400232: LeftMouthLower 296 | 400234: LeftMouthUpper 297 | 400236: LeftShoulder 298 | 400238: LeftToe1 299 | 400240: LeftToe2 300 | 400242: LeftUpLeg 301 | 400244: Mesh 302 | 400246: MouthLower 303 | 400248: MouthUpper 304 | 400250: Neck 305 | 400252: R_Ankle_Pivot 306 | 400254: R_HeelPeel_Pivot 307 | 400256: R_Swivel_Pivot 308 | 400258: R_ToeTap_Pivot 309 | 400260: R_ToeTip_Pivot 310 | 400262: RightArm 311 | 400264: RightBrow1 312 | 400266: RightBrow2 313 | 400268: RightBrow3 314 | 400270: RightCheek 315 | 400272: RightEye 316 | 400274: RightFoot 317 | 400276: RightForeArm 318 | 400278: RightHand 319 | 400280: RightHandIndex1 320 | 400282: RightHandIndex2 321 | 400284: RightHandIndex3 322 | 400286: RightHandIndex4 323 | 400288: RightHandMiddle1 324 | 400290: RightHandMiddle2 325 | 400292: RightHandMiddle3 326 | 400294: RightHandMiddle4 327 | 400296: RightHandPinky1 328 | 400298: RightHandPinky2 329 | 400300: RightHandPinky3 330 | 400302: RightHandPinky4 331 | 400304: RightHandRing1 332 | 400306: RightHandRing2 333 | 400308: RightHandRing3 334 | 400310: RightHandRing4 335 | 400312: RightHandThumb1 336 | 400314: RightHandThumb2 337 | 400316: RightHandThumb3 338 | 400318: RightLeg 339 | 400320: RightMouth 340 | 400322: RightMouthLower 341 | 400324: RightMouthUpper 342 | 400326: RightShoulder 343 | 400328: RightToe1 344 | 400330: RightToe2 345 | 400332: RightUpLeg 346 | 400334: Skeleton 347 | 400336: Spine1 348 | 400338: Spine2 349 | 400340: Spine3 350 | 2100000: Android_Walking_Android 351 | 4300000: Body 352 | 7400000: Take 001 353 | 9500000: //RootNode 354 | 11100000: //RootNode 355 | 13700000: Body 356 | externalObjects: {} 357 | materials: 358 | importMaterials: 1 359 | materialName: 0 360 | materialSearch: 1 361 | materialLocation: 1 362 | animations: 363 | legacyGenerateAnimations: 4 364 | bakeSimulation: 0 365 | resampleCurves: 1 366 | optimizeGameObjects: 0 367 | motionNodeName: 368 | rigImportErrors: 369 | rigImportWarnings: 370 | animationImportErrors: 371 | animationImportWarnings: 372 | animationRetargetingWarnings: 373 | animationDoRetargetingWarnings: 0 374 | importAnimatedCustomProperties: 0 375 | animationCompression: 1 376 | animationRotationError: 0.5 377 | animationPositionError: 0.5 378 | animationScaleError: 0.5 379 | animationWrapMode: 0 380 | extraExposedTransformPaths: [] 381 | extraUserProperties: [] 382 | clipAnimations: [] 383 | isReadable: 1 384 | meshes: 385 | lODScreenPercentages: [] 386 | globalScale: 1 387 | meshCompression: 0 388 | addColliders: 0 389 | importVisibility: 1 390 | importBlendShapes: 1 391 | importCameras: 1 392 | importLights: 1 393 | swapUVChannels: 0 394 | generateSecondaryUV: 0 395 | useFileUnits: 1 396 | optimizeMeshForGPU: 1 397 | keepQuads: 0 398 | weldVertices: 1 399 | preserveHierarchy: 0 400 | secondaryUVAngleDistortion: 8 401 | secondaryUVAreaDistortion: 15.000001 402 | secondaryUVHardAngle: 88 403 | secondaryUVPackMargin: 4 404 | useFileScale: 1 405 | tangentSpace: 406 | normalSmoothAngle: 60 407 | normalImportMode: 0 408 | tangentImportMode: 3 409 | normalCalculationMode: 4 410 | importAnimation: 1 411 | copyAvatar: 0 412 | humanDescription: 413 | serializedVersion: 2 414 | human: [] 415 | skeleton: [] 416 | armTwist: 0.5 417 | foreArmTwist: 0.5 418 | upperLegTwist: 0.5 419 | legTwist: 0.5 420 | armStretch: 0.05 421 | legStretch: 0.05 422 | feetSpacing: 0 423 | rootMotionBoneName: 424 | rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} 425 | hasTranslationDoF: 0 426 | hasExtraRoot: 1 427 | skeletonHasParents: 1 428 | lastHumanDescriptionAvatarSource: {instanceID: 0} 429 | animationType: 1 430 | humanoidOversampling: 1 431 | additionalBone: 0 432 | userData: 433 | assetBundleName: 434 | assetBundleVariant: 435 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/Complex/AndroidSimpleAnimation.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 704824adecc7a1b439f4c34e90651320 3 | timeCreated: 1502220731 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/ComplexWithTransition.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e44854009789604f9315bbdb97b6923 3 | folderAsset: yes 4 | timeCreated: 1502215731 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/ComplexWithTransition/AndroidAnimatorWithTransitions.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b957f0ccd368efa4eaa54c5b97bd139d 3 | timeCreated: 1502220683 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/ComplexWithTransition/AndroidGenericAnimWithTransitions.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: AndroidGenericAnimWithTransitions 9 | serializedVersion: 5 10 | m_AnimatorParameters: [] 11 | m_AnimatorLayers: 12 | - serializedVersion: 5 13 | m_Name: Base Layer 14 | m_StateMachine: {fileID: 1107549521193886108} 15 | m_Mask: {fileID: 0} 16 | m_Motions: [] 17 | m_Behaviours: [] 18 | m_BlendingMode: 0 19 | m_SyncedLayerIndex: -1 20 | m_DefaultWeight: 0 21 | m_IKPass: 0 22 | m_SyncedLayerAffectsTiming: 0 23 | m_Controller: {fileID: 9100000} 24 | --- !u!1102 &1102335610593448972 25 | AnimatorState: 26 | serializedVersion: 5 27 | m_ObjectHideFlags: 3 28 | m_PrefabParentObject: {fileID: 0} 29 | m_PrefabInternal: {fileID: 0} 30 | m_Name: B 31 | m_Speed: 1 32 | m_CycleOffset: 0 33 | m_Transitions: [] 34 | m_StateMachineBehaviours: [] 35 | m_Position: {x: 50, y: 50, z: 0} 36 | m_IKOnFeet: 0 37 | m_WriteDefaultValues: 1 38 | m_Mirror: 0 39 | m_SpeedParameterActive: 0 40 | m_MirrorParameterActive: 0 41 | m_CycleOffsetParameterActive: 0 42 | m_TimeParameterActive: 0 43 | m_Motion: {fileID: 7400000, guid: 7eb8b94e211f70f44877f2fbe52f2e78, type: 3} 44 | m_Tag: 45 | m_SpeedParameter: 46 | m_MirrorParameter: 47 | m_CycleOffsetParameter: 48 | m_TimeParameter: 49 | --- !u!1102 &1102935785621315878 50 | AnimatorState: 51 | serializedVersion: 5 52 | m_ObjectHideFlags: 1 53 | m_PrefabParentObject: {fileID: 0} 54 | m_PrefabInternal: {fileID: 0} 55 | m_Name: A 56 | m_Speed: 1 57 | m_CycleOffset: 0 58 | m_Transitions: [] 59 | m_StateMachineBehaviours: [] 60 | m_Position: {x: 50, y: 50, z: 0} 61 | m_IKOnFeet: 0 62 | m_WriteDefaultValues: 1 63 | m_Mirror: 0 64 | m_SpeedParameterActive: 0 65 | m_MirrorParameterActive: 0 66 | m_CycleOffsetParameterActive: 0 67 | m_TimeParameterActive: 0 68 | m_Motion: {fileID: 7400000, guid: 7eb8b94e211f70f44877f2fbe52f2e78, type: 3} 69 | m_Tag: 70 | m_SpeedParameter: 71 | m_MirrorParameter: 72 | m_CycleOffsetParameter: 73 | m_TimeParameter: 74 | --- !u!1107 &1107549521193886108 75 | AnimatorStateMachine: 76 | serializedVersion: 5 77 | m_ObjectHideFlags: 1 78 | m_PrefabParentObject: {fileID: 0} 79 | m_PrefabInternal: {fileID: 0} 80 | m_Name: Base Layer 81 | m_ChildStates: 82 | - serializedVersion: 1 83 | m_State: {fileID: 1102935785621315878} 84 | m_Position: {x: 264, y: 24, z: 0} 85 | - serializedVersion: 1 86 | m_State: {fileID: 1102335610593448972} 87 | m_Position: {x: 564, y: 24, z: 0} 88 | m_ChildStateMachines: [] 89 | m_AnyStateTransitions: [] 90 | m_EntryTransitions: [] 91 | m_StateMachineTransitions: {} 92 | m_StateMachineBehaviours: [] 93 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 94 | m_EntryPosition: {x: 50, y: 120, z: 0} 95 | m_ExitPosition: {x: 800, y: 120, z: 0} 96 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 97 | m_DefaultState: {fileID: 1102935785621315878} 98 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/ComplexWithTransition/AndroidGenericAnimWithTransitions.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53f5d4ad902e961429b0cb91f1634d17 3 | timeCreated: 1502220628 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 9100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/ComplexWithTransition/AndroidLegacyWithTransitions.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6d39a8362ca1b649a555d76ee5858e4 3 | timeCreated: 1502220764 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/ComplexWithTransition/AndroidSimpleAnimationWithTransitions.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a860fdcd8b5e1184c9f7a85a5324277a 3 | timeCreated: 1502220731 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/ComplexWithTransition/SimpleAnimationTransitions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SimpleAnimationTransitions : MonoBehaviour { 6 | enum AnimationType 7 | { 8 | Legacy, 9 | SimplePlayable, 10 | StateMachine 11 | } 12 | AnimationType animationType; 13 | SimpleAnimation simpleAnimation; 14 | public AnimationClip clip; 15 | // Use this for initialization 16 | IEnumerator Start () 17 | { 18 | var animationComponent = GetComponent(); 19 | var animatorComponent = GetComponent(); 20 | var simpleAnimationComponent = GetComponent(); 21 | if (animationComponent) 22 | animationType = AnimationType.Legacy; 23 | else if (simpleAnimationComponent) 24 | animationType = AnimationType.SimplePlayable; 25 | else 26 | animationType = AnimationType.StateMachine; 27 | 28 | 29 | switch (animationType) 30 | { 31 | case AnimationType.Legacy: 32 | animationComponent.AddClip(clip, "A"); 33 | animationComponent.AddClip(clip, "B"); 34 | break; 35 | case AnimationType.SimplePlayable: 36 | simpleAnimationComponent.AddClip(clip, "A"); 37 | simpleAnimationComponent.AddClip(clip, "B"); 38 | break; 39 | case AnimationType.StateMachine: 40 | break; 41 | default: 42 | break; 43 | } 44 | 45 | 46 | while(true) 47 | { 48 | switch (animationType) 49 | { 50 | case AnimationType.Legacy: 51 | animationComponent.Play("A"); 52 | break; 53 | case AnimationType.SimplePlayable: 54 | simpleAnimationComponent.Play("A"); 55 | break; 56 | case AnimationType.StateMachine: 57 | animatorComponent.Play("A"); 58 | break; 59 | default: 60 | break; 61 | } 62 | yield return new WaitForSeconds(0.5f); 63 | 64 | switch (animationType) 65 | { 66 | case AnimationType.Legacy: 67 | animationComponent.Play("B"); 68 | break; 69 | case AnimationType.SimplePlayable: 70 | simpleAnimationComponent.Play("B"); 71 | break; 72 | case AnimationType.StateMachine: 73 | animatorComponent.Play("B"); 74 | break; 75 | default: 76 | break; 77 | } 78 | yield return new WaitForSeconds(0.5f); 79 | } 80 | } 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/ComplexWithTransition/SimpleAnimationTransitions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98e0400eb48644f44bbbae58412a4dda 3 | timeCreated: 1502302146 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/ComplexWithTransitions.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 8 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | --- !u!157 &3 43 | LightmapSettings: 44 | m_ObjectHideFlags: 0 45 | serializedVersion: 11 46 | m_GIWorkflowMode: 1 47 | m_GISettings: 48 | serializedVersion: 2 49 | m_BounceScale: 1 50 | m_IndirectOutputScale: 1 51 | m_AlbedoBoost: 1 52 | m_TemporalCoherenceThreshold: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 9 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_TextureWidth: 1024 61 | m_TextureHeight: 1024 62 | m_AO: 0 63 | m_AOMaxDistance: 1 64 | m_CompAOExponent: 1 65 | m_CompAOExponentDirect: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 0 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVRFilterTypeDirect: 0 81 | m_PVRFilterTypeIndirect: 0 82 | m_PVRFilterTypeAO: 0 83 | m_PVRFilteringMode: 1 84 | m_PVRCulling: 1 85 | m_PVRFilteringGaussRadiusDirect: 1 86 | m_PVRFilteringGaussRadiusIndirect: 5 87 | m_PVRFilteringGaussRadiusAO: 2 88 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 89 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 90 | m_PVRFilteringAtrousPositionSigmaAO: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 1 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &727728709 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_PrefabParentObject: {fileID: 0} 119 | m_PrefabInternal: {fileID: 0} 120 | serializedVersion: 5 121 | m_Component: 122 | - component: {fileID: 727728711} 123 | - component: {fileID: 727728710} 124 | m_Layer: 0 125 | m_Name: TestUI 126 | m_TagString: Untagged 127 | m_Icon: {fileID: 0} 128 | m_NavMeshLayer: 0 129 | m_StaticEditorFlags: 0 130 | m_IsActive: 1 131 | --- !u!114 &727728710 132 | MonoBehaviour: 133 | m_ObjectHideFlags: 0 134 | m_PrefabParentObject: {fileID: 0} 135 | m_PrefabInternal: {fileID: 0} 136 | m_GameObject: {fileID: 727728709} 137 | m_Enabled: 1 138 | m_EditorHideFlags: 0 139 | m_Script: {fileID: 11500000, guid: 2a9da7454dab41842ad0833069495d6c, type: 3} 140 | m_Name: 141 | m_EditorClassIdentifier: 142 | Categories: 143 | - {fileID: 1526536085140382, guid: b6d39a8362ca1b649a555d76ee5858e4, type: 2} 144 | - {fileID: 1738818353288128, guid: a860fdcd8b5e1184c9f7a85a5324277a, type: 2} 145 | - {fileID: 1847196155820566, guid: b957f0ccd368efa4eaa54c5b97bd139d, type: 2} 146 | fps: 0 147 | fpssamples: 0 148 | numInstances: 100 149 | --- !u!4 &727728711 150 | Transform: 151 | m_ObjectHideFlags: 0 152 | m_PrefabParentObject: {fileID: 0} 153 | m_PrefabInternal: {fileID: 0} 154 | m_GameObject: {fileID: 727728709} 155 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 156 | m_LocalPosition: {x: 0, y: 0, z: 0} 157 | m_LocalScale: {x: 1, y: 1, z: 1} 158 | m_Children: [] 159 | m_Father: {fileID: 0} 160 | m_RootOrder: 2 161 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 162 | --- !u!1 &1161389416 163 | GameObject: 164 | m_ObjectHideFlags: 0 165 | m_PrefabParentObject: {fileID: 0} 166 | m_PrefabInternal: {fileID: 0} 167 | serializedVersion: 5 168 | m_Component: 169 | - component: {fileID: 1161389418} 170 | - component: {fileID: 1161389417} 171 | m_Layer: 0 172 | m_Name: Directional Light 173 | m_TagString: Untagged 174 | m_Icon: {fileID: 0} 175 | m_NavMeshLayer: 0 176 | m_StaticEditorFlags: 0 177 | m_IsActive: 1 178 | --- !u!108 &1161389417 179 | Light: 180 | m_ObjectHideFlags: 0 181 | m_PrefabParentObject: {fileID: 0} 182 | m_PrefabInternal: {fileID: 0} 183 | m_GameObject: {fileID: 1161389416} 184 | m_Enabled: 1 185 | serializedVersion: 8 186 | m_Type: 1 187 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 188 | m_Intensity: 1 189 | m_Range: 10 190 | m_SpotAngle: 30 191 | m_CookieSize: 10 192 | m_Shadows: 193 | m_Type: 2 194 | m_Resolution: -1 195 | m_CustomResolution: -1 196 | m_Strength: 1 197 | m_Bias: 0.05 198 | m_NormalBias: 0.4 199 | m_NearPlane: 0.2 200 | m_Cookie: {fileID: 0} 201 | m_DrawHalo: 0 202 | m_Flare: {fileID: 0} 203 | m_RenderMode: 0 204 | m_CullingMask: 205 | serializedVersion: 2 206 | m_Bits: 4294967295 207 | m_Lightmapping: 4 208 | m_AreaSize: {x: 1, y: 1} 209 | m_BounceIntensity: 1 210 | m_ColorTemperature: 6570 211 | m_UseColorTemperature: 0 212 | m_ShadowRadius: 0 213 | m_ShadowAngle: 0 214 | --- !u!4 &1161389418 215 | Transform: 216 | m_ObjectHideFlags: 0 217 | m_PrefabParentObject: {fileID: 0} 218 | m_PrefabInternal: {fileID: 0} 219 | m_GameObject: {fileID: 1161389416} 220 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 221 | m_LocalPosition: {x: 0, y: 3, z: 0} 222 | m_LocalScale: {x: 1, y: 1, z: 1} 223 | m_Children: [] 224 | m_Father: {fileID: 0} 225 | m_RootOrder: 1 226 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 227 | --- !u!1 &1578799488 228 | GameObject: 229 | m_ObjectHideFlags: 0 230 | m_PrefabParentObject: {fileID: 0} 231 | m_PrefabInternal: {fileID: 0} 232 | serializedVersion: 5 233 | m_Component: 234 | - component: {fileID: 1578799493} 235 | - component: {fileID: 1578799492} 236 | - component: {fileID: 1578799491} 237 | - component: {fileID: 1578799490} 238 | - component: {fileID: 1578799489} 239 | m_Layer: 0 240 | m_Name: Main Camera 241 | m_TagString: MainCamera 242 | m_Icon: {fileID: 0} 243 | m_NavMeshLayer: 0 244 | m_StaticEditorFlags: 0 245 | m_IsActive: 1 246 | --- !u!81 &1578799489 247 | AudioListener: 248 | m_ObjectHideFlags: 0 249 | m_PrefabParentObject: {fileID: 0} 250 | m_PrefabInternal: {fileID: 0} 251 | m_GameObject: {fileID: 1578799488} 252 | m_Enabled: 1 253 | m_ExtensionPropertyValues: [] 254 | --- !u!124 &1578799490 255 | Behaviour: 256 | m_ObjectHideFlags: 0 257 | m_PrefabParentObject: {fileID: 0} 258 | m_PrefabInternal: {fileID: 0} 259 | m_GameObject: {fileID: 1578799488} 260 | m_Enabled: 1 261 | --- !u!92 &1578799491 262 | Behaviour: 263 | m_ObjectHideFlags: 0 264 | m_PrefabParentObject: {fileID: 0} 265 | m_PrefabInternal: {fileID: 0} 266 | m_GameObject: {fileID: 1578799488} 267 | m_Enabled: 1 268 | --- !u!20 &1578799492 269 | Camera: 270 | m_ObjectHideFlags: 0 271 | m_PrefabParentObject: {fileID: 0} 272 | m_PrefabInternal: {fileID: 0} 273 | m_GameObject: {fileID: 1578799488} 274 | m_Enabled: 1 275 | serializedVersion: 2 276 | m_ClearFlags: 1 277 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 278 | m_NormalizedViewPortRect: 279 | serializedVersion: 2 280 | x: 0 281 | y: 0 282 | width: 1 283 | height: 1 284 | near clip plane: 0.3 285 | far clip plane: 1000 286 | field of view: 60 287 | orthographic: 0 288 | orthographic size: 5 289 | m_Depth: -1 290 | m_CullingMask: 291 | serializedVersion: 2 292 | m_Bits: 4294967295 293 | m_RenderingPath: -1 294 | m_TargetTexture: {fileID: 0} 295 | m_TargetDisplay: 0 296 | m_TargetEye: 3 297 | m_HDR: 1 298 | m_AllowMSAA: 1 299 | m_ForceIntoRT: 0 300 | m_OcclusionCulling: 1 301 | m_StereoConvergence: 10 302 | m_StereoSeparation: 0.022 303 | m_StereoMirrorMode: 0 304 | --- !u!4 &1578799493 305 | Transform: 306 | m_ObjectHideFlags: 0 307 | m_PrefabParentObject: {fileID: 0} 308 | m_PrefabInternal: {fileID: 0} 309 | m_GameObject: {fileID: 1578799488} 310 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 311 | m_LocalPosition: {x: 0, y: 1, z: -10} 312 | m_LocalScale: {x: 1, y: 1, z: 1} 313 | m_Children: [] 314 | m_Father: {fileID: 0} 315 | m_RootOrder: 0 316 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 317 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/ComplexWithTransitions.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3575b024195d20d4f844ec417f241fb7 3 | timeCreated: 1499702978 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ddcd3ba40b3ab54a9fdf434e653ab74 3 | folderAsset: yes 4 | timeCreated: 1499724042 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 8 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | --- !u!157 &3 43 | LightmapSettings: 44 | m_ObjectHideFlags: 0 45 | serializedVersion: 11 46 | m_GIWorkflowMode: 1 47 | m_GISettings: 48 | serializedVersion: 2 49 | m_BounceScale: 1 50 | m_IndirectOutputScale: 1 51 | m_AlbedoBoost: 1 52 | m_TemporalCoherenceThreshold: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 9 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_TextureWidth: 1024 61 | m_TextureHeight: 1024 62 | m_AO: 0 63 | m_AOMaxDistance: 1 64 | m_CompAOExponent: 1 65 | m_CompAOExponentDirect: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 0 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVRFilterTypeDirect: 0 81 | m_PVRFilterTypeIndirect: 0 82 | m_PVRFilterTypeAO: 0 83 | m_PVRFilteringMode: 1 84 | m_PVRCulling: 1 85 | m_PVRFilteringGaussRadiusDirect: 1 86 | m_PVRFilteringGaussRadiusIndirect: 5 87 | m_PVRFilteringGaussRadiusAO: 2 88 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 89 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 90 | m_PVRFilteringAtrousPositionSigmaAO: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 1 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &727728709 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_PrefabParentObject: {fileID: 0} 119 | m_PrefabInternal: {fileID: 0} 120 | serializedVersion: 5 121 | m_Component: 122 | - component: {fileID: 727728711} 123 | - component: {fileID: 727728710} 124 | m_Layer: 0 125 | m_Name: TestUI 126 | m_TagString: Untagged 127 | m_Icon: {fileID: 0} 128 | m_NavMeshLayer: 0 129 | m_StaticEditorFlags: 0 130 | m_IsActive: 1 131 | --- !u!114 &727728710 132 | MonoBehaviour: 133 | m_ObjectHideFlags: 0 134 | m_PrefabParentObject: {fileID: 0} 135 | m_PrefabInternal: {fileID: 0} 136 | m_GameObject: {fileID: 727728709} 137 | m_Enabled: 1 138 | m_EditorHideFlags: 0 139 | m_Script: {fileID: 11500000, guid: 2a9da7454dab41842ad0833069495d6c, type: 3} 140 | m_Name: 141 | m_EditorClassIdentifier: 142 | Categories: 143 | - {fileID: 1538064715297094, guid: e1ffdb48f32e88844b033116595a2e73, type: 2} 144 | - {fileID: 1364076715903534, guid: 35404a7e2d31d61408685b01188d5d5d, type: 2} 145 | - {fileID: 1341967805661704, guid: d7d944dacc227454f9f7b182c0f79331, type: 2} 146 | fps: 0 147 | fpssamples: 0 148 | numInstances: 1000 149 | --- !u!4 &727728711 150 | Transform: 151 | m_ObjectHideFlags: 0 152 | m_PrefabParentObject: {fileID: 0} 153 | m_PrefabInternal: {fileID: 0} 154 | m_GameObject: {fileID: 727728709} 155 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 156 | m_LocalPosition: {x: 0, y: 0, z: 0} 157 | m_LocalScale: {x: 1, y: 1, z: 1} 158 | m_Children: [] 159 | m_Father: {fileID: 0} 160 | m_RootOrder: 2 161 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 162 | --- !u!1 &1161389416 163 | GameObject: 164 | m_ObjectHideFlags: 0 165 | m_PrefabParentObject: {fileID: 0} 166 | m_PrefabInternal: {fileID: 0} 167 | serializedVersion: 5 168 | m_Component: 169 | - component: {fileID: 1161389418} 170 | - component: {fileID: 1161389417} 171 | m_Layer: 0 172 | m_Name: Directional Light 173 | m_TagString: Untagged 174 | m_Icon: {fileID: 0} 175 | m_NavMeshLayer: 0 176 | m_StaticEditorFlags: 0 177 | m_IsActive: 1 178 | --- !u!108 &1161389417 179 | Light: 180 | m_ObjectHideFlags: 0 181 | m_PrefabParentObject: {fileID: 0} 182 | m_PrefabInternal: {fileID: 0} 183 | m_GameObject: {fileID: 1161389416} 184 | m_Enabled: 1 185 | serializedVersion: 8 186 | m_Type: 1 187 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 188 | m_Intensity: 1 189 | m_Range: 10 190 | m_SpotAngle: 30 191 | m_CookieSize: 10 192 | m_Shadows: 193 | m_Type: 2 194 | m_Resolution: -1 195 | m_CustomResolution: -1 196 | m_Strength: 1 197 | m_Bias: 0.05 198 | m_NormalBias: 0.4 199 | m_NearPlane: 0.2 200 | m_Cookie: {fileID: 0} 201 | m_DrawHalo: 0 202 | m_Flare: {fileID: 0} 203 | m_RenderMode: 0 204 | m_CullingMask: 205 | serializedVersion: 2 206 | m_Bits: 4294967295 207 | m_Lightmapping: 4 208 | m_AreaSize: {x: 1, y: 1} 209 | m_BounceIntensity: 1 210 | m_ColorTemperature: 6570 211 | m_UseColorTemperature: 0 212 | m_ShadowRadius: 0 213 | m_ShadowAngle: 0 214 | --- !u!4 &1161389418 215 | Transform: 216 | m_ObjectHideFlags: 0 217 | m_PrefabParentObject: {fileID: 0} 218 | m_PrefabInternal: {fileID: 0} 219 | m_GameObject: {fileID: 1161389416} 220 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 221 | m_LocalPosition: {x: 0, y: 3, z: 0} 222 | m_LocalScale: {x: 1, y: 1, z: 1} 223 | m_Children: [] 224 | m_Father: {fileID: 0} 225 | m_RootOrder: 1 226 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 227 | --- !u!1 &1578799488 228 | GameObject: 229 | m_ObjectHideFlags: 0 230 | m_PrefabParentObject: {fileID: 0} 231 | m_PrefabInternal: {fileID: 0} 232 | serializedVersion: 5 233 | m_Component: 234 | - component: {fileID: 1578799493} 235 | - component: {fileID: 1578799492} 236 | - component: {fileID: 1578799491} 237 | - component: {fileID: 1578799490} 238 | - component: {fileID: 1578799489} 239 | m_Layer: 0 240 | m_Name: Main Camera 241 | m_TagString: MainCamera 242 | m_Icon: {fileID: 0} 243 | m_NavMeshLayer: 0 244 | m_StaticEditorFlags: 0 245 | m_IsActive: 1 246 | --- !u!81 &1578799489 247 | AudioListener: 248 | m_ObjectHideFlags: 0 249 | m_PrefabParentObject: {fileID: 0} 250 | m_PrefabInternal: {fileID: 0} 251 | m_GameObject: {fileID: 1578799488} 252 | m_Enabled: 1 253 | m_ExtensionPropertyValues: [] 254 | --- !u!124 &1578799490 255 | Behaviour: 256 | m_ObjectHideFlags: 0 257 | m_PrefabParentObject: {fileID: 0} 258 | m_PrefabInternal: {fileID: 0} 259 | m_GameObject: {fileID: 1578799488} 260 | m_Enabled: 1 261 | --- !u!92 &1578799491 262 | Behaviour: 263 | m_ObjectHideFlags: 0 264 | m_PrefabParentObject: {fileID: 0} 265 | m_PrefabInternal: {fileID: 0} 266 | m_GameObject: {fileID: 1578799488} 267 | m_Enabled: 1 268 | --- !u!20 &1578799492 269 | Camera: 270 | m_ObjectHideFlags: 0 271 | m_PrefabParentObject: {fileID: 0} 272 | m_PrefabInternal: {fileID: 0} 273 | m_GameObject: {fileID: 1578799488} 274 | m_Enabled: 1 275 | serializedVersion: 2 276 | m_ClearFlags: 1 277 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 278 | m_NormalizedViewPortRect: 279 | serializedVersion: 2 280 | x: 0 281 | y: 0 282 | width: 1 283 | height: 1 284 | near clip plane: 0.3 285 | far clip plane: 1000 286 | field of view: 60 287 | orthographic: 0 288 | orthographic size: 5 289 | m_Depth: -1 290 | m_CullingMask: 291 | serializedVersion: 2 292 | m_Bits: 4294967295 293 | m_RenderingPath: -1 294 | m_TargetTexture: {fileID: 0} 295 | m_TargetDisplay: 0 296 | m_TargetEye: 3 297 | m_HDR: 1 298 | m_AllowMSAA: 1 299 | m_ForceIntoRT: 0 300 | m_OcclusionCulling: 1 301 | m_StereoConvergence: 10 302 | m_StereoSeparation: 0.022 303 | m_StereoMirrorMode: 0 304 | --- !u!4 &1578799493 305 | Transform: 306 | m_ObjectHideFlags: 0 307 | m_PrefabParentObject: {fileID: 0} 308 | m_PrefabInternal: {fileID: 0} 309 | m_GameObject: {fileID: 1578799488} 310 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 311 | m_LocalPosition: {x: 0, y: 1, z: -10} 312 | m_LocalScale: {x: 1, y: 1, z: 1} 313 | m_Children: [] 314 | m_Father: {fileID: 0} 315 | m_RootOrder: 0 316 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 317 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a2d20e4a0303bb419e4c6b258bb5399 3 | timeCreated: 1499702978 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce/RotateAnimatorOnce.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b471140328b267744b550b21bbdfa42b 3 | timeCreated: 1499719813 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 7400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce/RotateAnimatorOnce.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: RotateAnimatorOnce 9 | serializedVersion: 5 10 | m_AnimatorParameters: [] 11 | m_AnimatorLayers: 12 | - serializedVersion: 5 13 | m_Name: Base Layer 14 | m_StateMachine: {fileID: 1107379810546856550} 15 | m_Mask: {fileID: 0} 16 | m_Motions: [] 17 | m_Behaviours: [] 18 | m_BlendingMode: 0 19 | m_SyncedLayerIndex: -1 20 | m_DefaultWeight: 0 21 | m_IKPass: 0 22 | m_SyncedLayerAffectsTiming: 0 23 | m_Controller: {fileID: 9100000} 24 | --- !u!1102 &1102895856690584682 25 | AnimatorState: 26 | serializedVersion: 5 27 | m_ObjectHideFlags: 1 28 | m_PrefabParentObject: {fileID: 0} 29 | m_PrefabInternal: {fileID: 0} 30 | m_Name: RotateAnimatorOnce 31 | m_Speed: 1 32 | m_CycleOffset: 0 33 | m_Transitions: [] 34 | m_StateMachineBehaviours: [] 35 | m_Position: {x: 50, y: 50, z: 0} 36 | m_IKOnFeet: 0 37 | m_WriteDefaultValues: 1 38 | m_Mirror: 0 39 | m_SpeedParameterActive: 0 40 | m_MirrorParameterActive: 0 41 | m_CycleOffsetParameterActive: 0 42 | m_TimeParameterActive: 0 43 | m_Motion: {fileID: 7400000, guid: b471140328b267744b550b21bbdfa42b, type: 2} 44 | m_Tag: 45 | m_SpeedParameter: 46 | m_MirrorParameter: 47 | m_CycleOffsetParameter: 48 | m_TimeParameter: 49 | --- !u!1107 &1107379810546856550 50 | AnimatorStateMachine: 51 | serializedVersion: 5 52 | m_ObjectHideFlags: 1 53 | m_PrefabParentObject: {fileID: 0} 54 | m_PrefabInternal: {fileID: 0} 55 | m_Name: Base Layer 56 | m_ChildStates: 57 | - serializedVersion: 1 58 | m_State: {fileID: 1102895856690584682} 59 | m_Position: {x: 318, y: 11, z: 0} 60 | m_ChildStateMachines: [] 61 | m_AnyStateTransitions: [] 62 | m_EntryTransitions: [] 63 | m_StateMachineTransitions: {} 64 | m_StateMachineBehaviours: [] 65 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 66 | m_EntryPosition: {x: 50, y: 120, z: 0} 67 | m_ExitPosition: {x: 800, y: 120, z: 0} 68 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 69 | m_DefaultState: {fileID: 1102895856690584682} 70 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce/RotateAnimatorOnce.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f266c6e5fbe362445b5be495aa420638 3 | timeCreated: 1499716723 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 9100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce/RotateAnimatorOnce.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1341967805661704} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1341967805661704 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4645385144936590} 22 | - component: {fileID: 33230436311820440} 23 | - component: {fileID: 65023472968491936} 24 | - component: {fileID: 23015787009599532} 25 | - component: {fileID: 95272312736588580} 26 | m_Layer: 0 27 | m_Name: RotateAnimatorOnce 28 | m_TagString: Untagged 29 | m_Icon: {fileID: 0} 30 | m_NavMeshLayer: 0 31 | m_StaticEditorFlags: 0 32 | m_IsActive: 1 33 | --- !u!4 &4645385144936590 34 | Transform: 35 | m_ObjectHideFlags: 1 36 | m_PrefabParentObject: {fileID: 0} 37 | m_PrefabInternal: {fileID: 100100000} 38 | m_GameObject: {fileID: 1341967805661704} 39 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 40 | m_LocalPosition: {x: 0, y: 0, z: 0} 41 | m_LocalScale: {x: 1, y: 1, z: 1} 42 | m_Children: [] 43 | m_Father: {fileID: 0} 44 | m_RootOrder: 0 45 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 46 | --- !u!23 &23015787009599532 47 | MeshRenderer: 48 | m_ObjectHideFlags: 1 49 | m_PrefabParentObject: {fileID: 0} 50 | m_PrefabInternal: {fileID: 100100000} 51 | m_GameObject: {fileID: 1341967805661704} 52 | m_Enabled: 1 53 | m_CastShadows: 1 54 | m_ReceiveShadows: 1 55 | m_DynamicOccludee: 1 56 | m_MotionVectors: 1 57 | m_LightProbeUsage: 1 58 | m_ReflectionProbeUsage: 1 59 | m_Materials: 60 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 61 | m_StaticBatchInfo: 62 | firstSubMesh: 0 63 | subMeshCount: 0 64 | m_StaticBatchRoot: {fileID: 0} 65 | m_ProbeAnchor: {fileID: 0} 66 | m_LightProbeVolumeOverride: {fileID: 0} 67 | m_ScaleInLightmap: 1 68 | m_PreserveUVs: 1 69 | m_IgnoreNormalsForChartDetection: 0 70 | m_ImportantGI: 0 71 | m_StitchSeams: 0 72 | m_SelectedEditorRenderState: 3 73 | m_MinimumChartSize: 4 74 | m_AutoUVMaxDistance: 0.5 75 | m_AutoUVMaxAngle: 89 76 | m_LightmapParameters: {fileID: 0} 77 | m_SortingLayerID: 0 78 | m_SortingLayer: 0 79 | m_SortingOrder: 0 80 | --- !u!33 &33230436311820440 81 | MeshFilter: 82 | m_ObjectHideFlags: 1 83 | m_PrefabParentObject: {fileID: 0} 84 | m_PrefabInternal: {fileID: 100100000} 85 | m_GameObject: {fileID: 1341967805661704} 86 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 87 | --- !u!65 &65023472968491936 88 | BoxCollider: 89 | m_ObjectHideFlags: 1 90 | m_PrefabParentObject: {fileID: 0} 91 | m_PrefabInternal: {fileID: 100100000} 92 | m_GameObject: {fileID: 1341967805661704} 93 | m_Material: {fileID: 0} 94 | m_IsTrigger: 0 95 | m_Enabled: 1 96 | serializedVersion: 2 97 | m_Size: {x: 1, y: 1, z: 1} 98 | m_Center: {x: 0, y: 0, z: 0} 99 | --- !u!95 &95272312736588580 100 | Animator: 101 | serializedVersion: 3 102 | m_ObjectHideFlags: 1 103 | m_PrefabParentObject: {fileID: 0} 104 | m_PrefabInternal: {fileID: 100100000} 105 | m_GameObject: {fileID: 1341967805661704} 106 | m_Enabled: 1 107 | m_Avatar: {fileID: 0} 108 | m_Controller: {fileID: 9100000, guid: f266c6e5fbe362445b5be495aa420638, type: 2} 109 | m_CullingMode: 0 110 | m_UpdateMode: 0 111 | m_ApplyRootMotion: 0 112 | m_LinearVelocityBlending: 0 113 | m_WarningMessage: 114 | m_HasTransformHierarchy: 1 115 | m_AllowConstantClipSamplingOptimization: 1 116 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce/RotateAnimatorOnce.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7d944dacc227454f9f7b182c0f79331 3 | timeCreated: 1499724134 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce/RotateLegacyOnce.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 842d8f6b74f9b0d4daaed5496f9d5bc2 3 | timeCreated: 1499719813 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 7400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce/RotateLegacyOnce.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1538064715297094} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1538064715297094 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4116082255304898} 22 | - component: {fileID: 33160734106104084} 23 | - component: {fileID: 65449479563447892} 24 | - component: {fileID: 23484575331995812} 25 | - component: {fileID: 111682082938616202} 26 | m_Layer: 0 27 | m_Name: RotateLegacyOnce 28 | m_TagString: Untagged 29 | m_Icon: {fileID: 0} 30 | m_NavMeshLayer: 0 31 | m_StaticEditorFlags: 0 32 | m_IsActive: 1 33 | --- !u!4 &4116082255304898 34 | Transform: 35 | m_ObjectHideFlags: 1 36 | m_PrefabParentObject: {fileID: 0} 37 | m_PrefabInternal: {fileID: 100100000} 38 | m_GameObject: {fileID: 1538064715297094} 39 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 40 | m_LocalPosition: {x: 0, y: 0, z: 0} 41 | m_LocalScale: {x: 1, y: 1, z: 1} 42 | m_Children: [] 43 | m_Father: {fileID: 0} 44 | m_RootOrder: 0 45 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 46 | --- !u!23 &23484575331995812 47 | MeshRenderer: 48 | m_ObjectHideFlags: 1 49 | m_PrefabParentObject: {fileID: 0} 50 | m_PrefabInternal: {fileID: 100100000} 51 | m_GameObject: {fileID: 1538064715297094} 52 | m_Enabled: 1 53 | m_CastShadows: 1 54 | m_ReceiveShadows: 1 55 | m_DynamicOccludee: 1 56 | m_MotionVectors: 1 57 | m_LightProbeUsage: 1 58 | m_ReflectionProbeUsage: 1 59 | m_Materials: 60 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 61 | m_StaticBatchInfo: 62 | firstSubMesh: 0 63 | subMeshCount: 0 64 | m_StaticBatchRoot: {fileID: 0} 65 | m_ProbeAnchor: {fileID: 0} 66 | m_LightProbeVolumeOverride: {fileID: 0} 67 | m_ScaleInLightmap: 1 68 | m_PreserveUVs: 1 69 | m_IgnoreNormalsForChartDetection: 0 70 | m_ImportantGI: 0 71 | m_StitchSeams: 0 72 | m_SelectedEditorRenderState: 3 73 | m_MinimumChartSize: 4 74 | m_AutoUVMaxDistance: 0.5 75 | m_AutoUVMaxAngle: 89 76 | m_LightmapParameters: {fileID: 0} 77 | m_SortingLayerID: 0 78 | m_SortingLayer: 0 79 | m_SortingOrder: 0 80 | --- !u!33 &33160734106104084 81 | MeshFilter: 82 | m_ObjectHideFlags: 1 83 | m_PrefabParentObject: {fileID: 0} 84 | m_PrefabInternal: {fileID: 100100000} 85 | m_GameObject: {fileID: 1538064715297094} 86 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 87 | --- !u!65 &65449479563447892 88 | BoxCollider: 89 | m_ObjectHideFlags: 1 90 | m_PrefabParentObject: {fileID: 0} 91 | m_PrefabInternal: {fileID: 100100000} 92 | m_GameObject: {fileID: 1538064715297094} 93 | m_Material: {fileID: 0} 94 | m_IsTrigger: 0 95 | m_Enabled: 1 96 | serializedVersion: 2 97 | m_Size: {x: 1, y: 1, z: 1} 98 | m_Center: {x: 0, y: 0, z: 0} 99 | --- !u!111 &111682082938616202 100 | Animation: 101 | m_ObjectHideFlags: 1 102 | m_PrefabParentObject: {fileID: 0} 103 | m_PrefabInternal: {fileID: 100100000} 104 | m_GameObject: {fileID: 1538064715297094} 105 | m_Enabled: 1 106 | serializedVersion: 3 107 | m_Animation: {fileID: 7400000, guid: 842d8f6b74f9b0d4daaed5496f9d5bc2, type: 2} 108 | m_Animations: 109 | - {fileID: 7400000, guid: 842d8f6b74f9b0d4daaed5496f9d5bc2, type: 2} 110 | m_WrapMode: 0 111 | m_PlayAutomatically: 1 112 | m_AnimatePhysics: 0 113 | m_CullingType: 0 114 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce/RotateLegacyOnce.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1ffdb48f32e88844b033116595a2e73 3 | timeCreated: 1499724088 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce/RotateSimpleAnimationOnce.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1364076715903534} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1364076715903534 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4571146370560290} 22 | - component: {fileID: 33812149907794824} 23 | - component: {fileID: 65689843090748916} 24 | - component: {fileID: 23817231451851486} 25 | - component: {fileID: 95548609735069730} 26 | - component: {fileID: 114409330083510338} 27 | m_Layer: 0 28 | m_Name: RotateSimpleAnimationOnce 29 | m_TagString: Untagged 30 | m_Icon: {fileID: 0} 31 | m_NavMeshLayer: 0 32 | m_StaticEditorFlags: 0 33 | m_IsActive: 1 34 | --- !u!4 &4571146370560290 35 | Transform: 36 | m_ObjectHideFlags: 1 37 | m_PrefabParentObject: {fileID: 0} 38 | m_PrefabInternal: {fileID: 100100000} 39 | m_GameObject: {fileID: 1364076715903534} 40 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 41 | m_LocalPosition: {x: 0, y: 0, z: 0} 42 | m_LocalScale: {x: 1, y: 1, z: 1} 43 | m_Children: [] 44 | m_Father: {fileID: 0} 45 | m_RootOrder: 0 46 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 47 | --- !u!23 &23817231451851486 48 | MeshRenderer: 49 | m_ObjectHideFlags: 1 50 | m_PrefabParentObject: {fileID: 0} 51 | m_PrefabInternal: {fileID: 100100000} 52 | m_GameObject: {fileID: 1364076715903534} 53 | m_Enabled: 1 54 | m_CastShadows: 1 55 | m_ReceiveShadows: 1 56 | m_DynamicOccludee: 1 57 | m_MotionVectors: 1 58 | m_LightProbeUsage: 1 59 | m_ReflectionProbeUsage: 1 60 | m_Materials: 61 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 62 | m_StaticBatchInfo: 63 | firstSubMesh: 0 64 | subMeshCount: 0 65 | m_StaticBatchRoot: {fileID: 0} 66 | m_ProbeAnchor: {fileID: 0} 67 | m_LightProbeVolumeOverride: {fileID: 0} 68 | m_ScaleInLightmap: 1 69 | m_PreserveUVs: 1 70 | m_IgnoreNormalsForChartDetection: 0 71 | m_ImportantGI: 0 72 | m_StitchSeams: 0 73 | m_SelectedEditorRenderState: 3 74 | m_MinimumChartSize: 4 75 | m_AutoUVMaxDistance: 0.5 76 | m_AutoUVMaxAngle: 89 77 | m_LightmapParameters: {fileID: 0} 78 | m_SortingLayerID: 0 79 | m_SortingLayer: 0 80 | m_SortingOrder: 0 81 | --- !u!33 &33812149907794824 82 | MeshFilter: 83 | m_ObjectHideFlags: 1 84 | m_PrefabParentObject: {fileID: 0} 85 | m_PrefabInternal: {fileID: 100100000} 86 | m_GameObject: {fileID: 1364076715903534} 87 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 88 | --- !u!65 &65689843090748916 89 | BoxCollider: 90 | m_ObjectHideFlags: 1 91 | m_PrefabParentObject: {fileID: 0} 92 | m_PrefabInternal: {fileID: 100100000} 93 | m_GameObject: {fileID: 1364076715903534} 94 | m_Material: {fileID: 0} 95 | m_IsTrigger: 0 96 | m_Enabled: 1 97 | serializedVersion: 2 98 | m_Size: {x: 1, y: 1, z: 1} 99 | m_Center: {x: 0, y: 0, z: 0} 100 | --- !u!95 &95548609735069730 101 | Animator: 102 | serializedVersion: 3 103 | m_ObjectHideFlags: 1 104 | m_PrefabParentObject: {fileID: 0} 105 | m_PrefabInternal: {fileID: 100100000} 106 | m_GameObject: {fileID: 1364076715903534} 107 | m_Enabled: 1 108 | m_Avatar: {fileID: 0} 109 | m_Controller: {fileID: 0} 110 | m_CullingMode: 0 111 | m_UpdateMode: 0 112 | m_ApplyRootMotion: 0 113 | m_LinearVelocityBlending: 0 114 | m_WarningMessage: 115 | m_HasTransformHierarchy: 1 116 | m_AllowConstantClipSamplingOptimization: 1 117 | --- !u!114 &114409330083510338 118 | MonoBehaviour: 119 | m_ObjectHideFlags: 1 120 | m_PrefabParentObject: {fileID: 0} 121 | m_PrefabInternal: {fileID: 100100000} 122 | m_GameObject: {fileID: 1364076715903534} 123 | m_Enabled: 1 124 | m_EditorHideFlags: 0 125 | m_Script: {fileID: 11500000, guid: 3759e2aae0f7b9a47bb98fc64bf3c543, type: 3} 126 | m_Name: 127 | m_EditorClassIdentifier: 128 | clips: [] 129 | m_Clip: {fileID: 7400000, guid: b471140328b267744b550b21bbdfa42b, type: 2} 130 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/PlayOnce/RotateSimpleAnimationOnce.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35404a7e2d31d61408685b01188d5d5d 3 | timeCreated: 1499724112 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/RotateCubes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0868571ae84d814da290ff650e4ecb5 3 | folderAsset: yes 4 | timeCreated: 1499724018 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/RotateCubes/RotateAnimator.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9b50f078b62d8e449242b537084fdd2 3 | timeCreated: 1499703149 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 7400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/RotateCubes/RotateLegacy.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2eec5327fcbca549b19a79fcc523aa2 3 | timeCreated: 1499703092 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 7400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/RotateCubes/RotatingCubes.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c83eadf2c665b664a8a216632ee3047c 3 | timeCreated: 1499702978 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/TestUI.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class TestUI : MonoBehaviour { 6 | 7 | public GameObject[] Categories; 8 | public float fps; 9 | public int fpssamples; 10 | public int numInstances; 11 | private List m_Instances; 12 | // Use this for initialization 13 | void Start () 14 | { 15 | m_Instances = new List(); 16 | } 17 | 18 | // Update is called once per frame 19 | void Update () { 20 | 21 | } 22 | 23 | private void OnGUI() 24 | { 25 | if (Categories == null) 26 | return; 27 | 28 | GUILayout.BeginHorizontal(); 29 | foreach(var category in Categories) 30 | { 31 | if (GUILayout.Button(category.name)) 32 | { 33 | fpssamples = 0; 34 | foreach (var instance in m_Instances) 35 | { 36 | Destroy(instance); 37 | } 38 | 39 | for (int i = 0; i < numInstances; i++) 40 | { 41 | m_Instances.Add(Instantiate(category) as GameObject); 42 | } 43 | } 44 | } 45 | GUILayout.EndHorizontal(); 46 | 47 | var fpsCounter = new Rect(new Vector2(0.9F * Screen.width, 0.1f * Screen.height), new Vector2(0.1F * Screen.width, 0.1f * Screen.height)); 48 | float framerate = 1 / Time.deltaTime; 49 | fps = (1 * framerate + fpssamples * fps) / (1 + fpssamples); 50 | GUI.Label(fpsCounter, fps.ToString()); 51 | fpssamples = Mathf.Min(1000, fpssamples + 1); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PerformanceTests/TestUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a9da7454dab41842ad0833069495d6c 3 | timeCreated: 1499716825 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fd0b473e331a1149aeb7ba3a764f984 3 | folderAsset: yes 4 | timeCreated: 1494560075 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88f6a47f25f3cdf43a488a86696898aa 3 | folderAsset: yes 4 | timeCreated: 1502400582 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/BaseConditionsTests.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.TestTools; 3 | using NUnit.Framework; 4 | using System.Collections; 5 | 6 | public class BaseConditionsTests 7 | { 8 | [UnityTest] 9 | public IEnumerator AnimatePhysics_False_DoesntApplyVelocity([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 10 | { 11 | IAnimation animation = ComparativeTestFixture.InstantiateCube(type); 12 | var clip = Resources.Load("LinearX"); 13 | var clipInstance = Object.Instantiate(clip); 14 | clipInstance.legacy = animation.usesLegacy; 15 | 16 | var rb = animation.gameObject.AddComponent(); 17 | rb.useGravity = false; 18 | animation.gameObject.GetComponent().enabled = false; 19 | animation.animatePhysics = false; 20 | animation.AddClip(clipInstance, "test"); 21 | animation.Play("test"); 22 | 23 | yield return null; 24 | yield return null; 25 | Assert.AreEqual(0f, rb.velocity.x); 26 | Assert.AreEqual(0f, rb.velocity.z); 27 | 28 | } 29 | 30 | 31 | 32 | [UnityTest] 33 | public IEnumerator CullingMode_AlwaysAnimate_Animates_InvisibleObject([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 34 | { 35 | IAnimation animation = ComparativeTestFixture.InstantiateCube(type); 36 | var clip = Resources.Load("LinearX"); 37 | var clipInstance = Object.Instantiate(clip); 38 | clipInstance.legacy = animation.usesLegacy; 39 | 40 | animation.cullingMode = AnimatorCullingMode.AlwaysAnimate; 41 | animation.AddClip(clipInstance, "test"); 42 | animation.gameObject.GetComponent().enabled = false; 43 | animation.Play("test"); 44 | 45 | yield return null; 46 | yield return null; 47 | Assert.AreNotEqual(Vector3.zero, animation.gameObject.transform.localPosition); 48 | } 49 | 50 | [UnityTest] 51 | public IEnumerator CullingMode_CullCompletely_Doesnt_Animate_InvisibleObject([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 52 | { 53 | IAnimation animation = ComparativeTestFixture.InstantiateCube(type); 54 | var clip = Resources.Load("LinearX"); 55 | var clipInstance = Object.Instantiate(clip); 56 | clipInstance.legacy = animation.usesLegacy; 57 | 58 | animation.cullingMode = AnimatorCullingMode.CullCompletely; 59 | animation.AddClip(clipInstance, "test"); 60 | animation.gameObject.GetComponent().enabled = false; 61 | animation.Play("test"); 62 | 63 | yield return null; 64 | yield return null; 65 | Assert.AreEqual(Vector3.zero, animation.gameObject.transform.localPosition); 66 | } 67 | 68 | [Test] 69 | public void IsPlaying_BeforePlay_ReturnsFalse([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 70 | { 71 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 72 | var clip = Resources.Load("LinearX"); 73 | var clipInstance = Object.Instantiate(clip); 74 | clipInstance.legacy = animation.usesLegacy; 75 | 76 | animation.AddClip(clipInstance, "test"); 77 | Assert.AreEqual(false, animation.isPlaying); 78 | } 79 | 80 | [Test] 81 | public void IsPlaying_AfterPlay_ReturnsTrue([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 82 | { 83 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 84 | var clip = Resources.Load("LinearX"); 85 | var clipInstance = Object.Instantiate(clip); 86 | clipInstance.legacy = animation.usesLegacy; 87 | 88 | animation.AddClip(clipInstance, "test"); 89 | animation.Play("test"); 90 | Assert.AreEqual(true, animation.isPlaying); 91 | } 92 | 93 | [UnityTest] 94 | public IEnumerator IsPlaying_AfterStop_ReturnsFalse([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 95 | { 96 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 97 | var clip = Resources.Load("LinearX"); 98 | var clipInstance = Object.Instantiate(clip); 99 | clipInstance.legacy = animation.usesLegacy; 100 | 101 | animation.AddClip(clipInstance, "test"); 102 | animation.Play("test"); 103 | yield return null; 104 | animation.Stop(); 105 | Assert.AreEqual(false, animation.isPlaying); 106 | } 107 | 108 | [UnityTest] 109 | public IEnumerator IsPlaying_AfterClipDone_ReturnsFalse([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 110 | { 111 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 112 | var clip = Resources.Load("LinearX"); 113 | var clipInstance = Object.Instantiate(clip); 114 | clipInstance.legacy = animation.usesLegacy; 115 | clipInstance.wrapMode = WrapMode.Once; 116 | 117 | animation.AddClip(clipInstance, "test"); 118 | animation.Play("test"); 119 | yield return new WaitForSeconds(2f); 120 | Assert.AreEqual(false, animation.isPlaying); 121 | } 122 | 123 | [UnityTest] 124 | public IEnumerator IsPlaying_AfterCrossfadeDone_ReturnsFalse([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 125 | { 126 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 127 | var clip = Resources.Load("LinearX"); 128 | var clipInstance = Object.Instantiate(clip); 129 | clipInstance.legacy = animation.usesLegacy; 130 | clipInstance.wrapMode = WrapMode.Once; 131 | 132 | animation.AddClip(clipInstance, "test"); 133 | animation.AddClip(clipInstance, "test2"); 134 | animation.Play("test"); 135 | yield return new WaitForSeconds(0.2f); 136 | animation.CrossFade("test2", 1.5f); 137 | yield return new WaitForSeconds(2.0f); 138 | Assert.AreEqual(false, animation.isPlaying); 139 | } 140 | 141 | [Test] 142 | public void DefaultClip_DoesntPlay_When_IsPlayingAutomatically_IsFalse([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 143 | { 144 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 145 | var clip = Resources.Load("LinearX"); 146 | var clipInstance = Object.Instantiate(clip); 147 | clipInstance.legacy = animation.usesLegacy; 148 | animation.clip = clipInstance; 149 | animation.playAutomatically = false; 150 | 151 | Assert.AreEqual(false, animation.isPlaying); 152 | Assert.AreEqual(false, animation.IsPlaying(animation.clip.name)); 153 | } 154 | 155 | [Test] 156 | public void DefaultClip_Plays_When_IsPlayingAutomatically_IsTrue([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 157 | { 158 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 159 | var clip = Resources.Load("LinearX"); 160 | var clipInstance = Object.Instantiate(clip); 161 | clipInstance.legacy = animation.usesLegacy; 162 | animation.clip = clipInstance; 163 | animation.playAutomatically = true; 164 | 165 | var newGO = Object.Instantiate(animation.gameObject); 166 | animation = newGO.GetComponent(); 167 | 168 | Assert.AreEqual(true, animation.isPlaying); 169 | var defaultName = animation.usesLegacy ? animation.clip.name : "Default"; 170 | Assert.AreEqual(true, animation.IsPlaying(defaultName)); 171 | } 172 | 173 | [Test] 174 | public void PlayAutomatically_HasNoEffect_WhenThereIsNo_DefaultClip([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 175 | { 176 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 177 | animation.playAutomatically = true; 178 | 179 | var newGO = Object.Instantiate(animation.gameObject); 180 | animation = newGO.GetComponent(); 181 | 182 | Assert.AreEqual(false, animation.isPlaying); 183 | } 184 | 185 | [Test] 186 | public void PlayAutomatically_WithNo_DefaultClip_HasNoEffect_OnOtherClips([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 187 | { 188 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 189 | var clip = Resources.Load("LinearX"); 190 | var clipInstance = Object.Instantiate(clip); 191 | clipInstance.legacy = animation.usesLegacy; 192 | animation.playAutomatically = true; 193 | animation.AddClip(clipInstance, clipInstance.name); 194 | 195 | var newGO = Object.Instantiate(animation.gameObject); 196 | animation = newGO.GetComponent(); 197 | 198 | Assert.AreEqual(false, animation.isPlaying); 199 | } 200 | 201 | [Test] 202 | public void PlayAutomatically_With_DefaultClip_HasNoEffect_OnOtherClips([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 203 | { 204 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 205 | var clip = Resources.Load("LinearX"); 206 | var clipInstance = Object.Instantiate(clip); 207 | clipInstance.legacy = animation.usesLegacy; 208 | animation.clip = clipInstance; 209 | animation.playAutomatically = true; 210 | animation.AddClip(clipInstance, "OtherClip"); 211 | 212 | Assert.AreEqual(false, animation.IsPlaying("OtherClip")); 213 | } 214 | 215 | [Test] 216 | public void PlayAutomatically_BeforeSet_ReturnsTrue([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 217 | { 218 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 219 | Assert.AreEqual(true, animation.playAutomatically); 220 | } 221 | 222 | [Test] 223 | public void PlayAutomatically_AfterSet_True_ReturnsTrue([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 224 | { 225 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 226 | animation.playAutomatically = true; 227 | Assert.AreEqual(true, animation.playAutomatically); 228 | } 229 | 230 | [Test] 231 | public void PlayAutomatically_AfterSet_False_ReturnsFalse([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 232 | { 233 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 234 | animation.playAutomatically = false; 235 | Assert.AreEqual(false, animation.playAutomatically); 236 | } 237 | 238 | [UnityTest] 239 | public IEnumerator WrapMode_Default_UsesClipSetting([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 240 | { 241 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 242 | var clip = Resources.Load("LinearX"); 243 | var clipInstance = Object.Instantiate(clip); 244 | clipInstance.legacy = animation.usesLegacy; 245 | clipInstance.wrapMode = WrapMode.Loop; 246 | 247 | animation.wrapMode = WrapMode.Default; 248 | animation.AddClip(clipInstance, "test"); 249 | animation.Play("test"); 250 | 251 | yield return new WaitForSeconds(1.2f); 252 | Assert.AreEqual(true, animation.isPlaying); 253 | } 254 | 255 | [UnityTest] 256 | public IEnumerator WrapMode_OverridesClipsWithDefaultSetting([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 257 | { 258 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 259 | var clip = Resources.Load("LinearX"); 260 | var clipInstance = Object.Instantiate(clip); 261 | clipInstance.legacy = animation.usesLegacy; 262 | clipInstance.wrapMode = WrapMode.Default; 263 | 264 | animation.wrapMode = WrapMode.Loop; 265 | animation.AddClip(clipInstance, "test"); 266 | animation.Play("test"); 267 | 268 | yield return new WaitForSeconds(1.2f); 269 | Assert.AreEqual(true, animation.isPlaying); 270 | } 271 | 272 | [UnityTest] 273 | public IEnumerator WrapMode_DoesntOverrideClipsSetting([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 274 | { 275 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 276 | var clip = Resources.Load("LinearX"); 277 | var clipInstance = Object.Instantiate(clip); 278 | clipInstance.legacy = animation.usesLegacy; 279 | clipInstance.wrapMode = WrapMode.Once; 280 | 281 | animation.wrapMode = WrapMode.Loop; 282 | animation.AddClip(clipInstance, "test"); 283 | animation.Play("test"); 284 | 285 | yield return new WaitForSeconds(1.2f); 286 | Assert.AreEqual(false, animation.isPlaying); 287 | } 288 | } 289 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/BaseConditionsTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94d35051e65be294187c9630c79078d1 3 | timeCreated: 1494560140 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/ClipManagementTests.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.TestTools; 3 | using NUnit.Framework; 4 | using System.Collections; 5 | using System.Text.RegularExpressions; 6 | 7 | public class ClipManagementTests 8 | { 9 | public class GetClipCount 10 | { 11 | [Test] 12 | public void GetClipCount_BeforeAdd_ReturnsZero([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 13 | { 14 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 15 | Assert.AreEqual(0, animation.GetClipCount(), "Component should have no clips connected at this point"); 16 | } 17 | 18 | [Test] 19 | public void GetClipCount_AfterAddOne_ReturnsOne([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 20 | { 21 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 22 | var clip = Resources.Load("LinearX"); 23 | var clipInstance = Object.Instantiate(clip); 24 | 25 | clipInstance.legacy = animation.usesLegacy; 26 | animation.AddClip(clipInstance, "test"); 27 | 28 | Assert.AreEqual(1, animation.GetClipCount(), "Component should have 1 clip connected after add"); 29 | } 30 | 31 | [Test] 32 | public void GetClipCount_AfterRemoveSingleClip_ReturnsZero([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 33 | { 34 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 35 | var clip = Resources.Load("LinearX"); 36 | var clipInstance = Object.Instantiate(clip); 37 | 38 | clipInstance.legacy = animation.usesLegacy; 39 | animation.AddClip(clipInstance, "test"); 40 | animation.RemoveClip("test"); 41 | 42 | Assert.AreEqual(0, animation.GetClipCount(), "Component should have no clips after remove"); 43 | } 44 | } 45 | 46 | public class AddClip 47 | { 48 | [Test] 49 | public void AddClip_WithNullClip_Throws_NullReferenceException([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 50 | { 51 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 52 | Assert.Throws (() => { animation.AddClip(null, "test"); }); 53 | } 54 | 55 | [Test] 56 | public void AddClip_TwiceWithSameName_GetClipCount_ReturnsOne([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 57 | { 58 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 59 | var clip = Resources.Load("LinearX"); 60 | var clipInstance = Object.Instantiate(clip); 61 | clipInstance.legacy = animation.usesLegacy; 62 | 63 | animation.AddClip(clipInstance, "test"); 64 | LogAssert.ignoreFailingMessages = true; //The error message here is irrelevant 65 | animation.AddClip(clipInstance, "test"); 66 | LogAssert.ignoreFailingMessages = false; 67 | 68 | Assert.AreEqual(1, animation.GetClipCount(), "Component should have no clips after remove"); 69 | } 70 | 71 | [Test] 72 | public void AddClip_TwiceDifferentName_GetClipCount_ReturnsTwo([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 73 | { 74 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 75 | var clip = Resources.Load("LinearX"); 76 | var clipInstance = Object.Instantiate(clip); 77 | clipInstance.legacy = animation.usesLegacy; 78 | 79 | animation.AddClip(clipInstance, "test"); 80 | animation.AddClip(clipInstance, "test2"); 81 | Assert.AreEqual(2, animation.GetClipCount(), "Component should have no clips after remove"); 82 | } 83 | 84 | [Test] 85 | public void AddClip_WithSameName_AsClip_DoenstCreateNewClip([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 86 | { 87 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 88 | var clip = Resources.Load("LinearX"); 89 | var clipInstance = Object.Instantiate(clip); 90 | clipInstance.legacy = animation.usesLegacy; 91 | 92 | animation.AddClip(clipInstance, clipInstance.name); 93 | IAnimationState state = animation.GetState(clipInstance.name); 94 | Assert.AreEqual(clipInstance, state.clip, "Component should have no clips after remove"); 95 | } 96 | } 97 | 98 | public class RemoveClip_ByAnimationClip 99 | { 100 | [Test] 101 | public void RemoveClip_AnimationClip_WithNullClip_Throws_NullReferenceException([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 102 | { 103 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 104 | AnimationClip clip = null; 105 | Assert.Throws (() => { animation.RemoveClip(clip); }); 106 | } 107 | 108 | [Test] 109 | [Description("AddClip always duplicates clips in the Animation Component, making it very hard to remove clips")] 110 | public void RemoveClip_AnimationClip_RemovesClip([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 111 | { 112 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 113 | var clip = Resources.Load("LinearX"); 114 | var clipInstance = Object.Instantiate(clip); 115 | clipInstance.legacy = animation.usesLegacy; 116 | 117 | animation.AddClip(clipInstance, clipInstance.name); 118 | animation.RemoveClip(clipInstance); 119 | Assert.AreEqual(0, animation.GetClipCount(), "Component should have no clips after remove"); 120 | } 121 | 122 | [Test] 123 | public void RemoveClip_AnimationClip_DoesntRemoveUnrelatedClips([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 124 | { 125 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 126 | var clip = Resources.Load("LinearX"); 127 | var clip2 = Resources.Load("LinearY"); 128 | var clipInstance = Object.Instantiate(clip); 129 | clipInstance.legacy = animation.usesLegacy; 130 | var clipInstance2 = Object.Instantiate(clip2); 131 | clipInstance2.legacy = animation.usesLegacy; 132 | 133 | animation.AddClip(clipInstance, clipInstance.name); 134 | animation.AddClip(clipInstance2, clipInstance2.name); 135 | animation.RemoveClip(clipInstance); 136 | Assert.AreEqual(1, animation.GetClipCount(), "Component should still have 1 connected clip after remove"); 137 | Assert.NotNull(animation.GetState(clipInstance2.name)); 138 | } 139 | } 140 | 141 | public class RemoveClip_ByName 142 | { 143 | [Test] 144 | public void RemoveClip_ByName_WithEmptyName_Works([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 145 | { 146 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 147 | var clip = Resources.Load("LinearX"); 148 | var clipInstance = Object.Instantiate(clip); 149 | clipInstance.legacy = animation.usesLegacy; 150 | 151 | animation.AddClip(clipInstance, ""); 152 | animation.RemoveClip(""); 153 | Assert.AreEqual(0, animation.GetClipCount(), "Component should still have 1 connected clip after remove"); 154 | } 155 | 156 | [Test] 157 | public void RemoveClip_ByName_DoesntRemoveOtherClips([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 158 | { 159 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 160 | var clip = Resources.Load("LinearX"); 161 | var clipInstance = Object.Instantiate(clip); 162 | clipInstance.legacy = animation.usesLegacy; 163 | var legacyClip2 = Object.Instantiate(clipInstance); 164 | 165 | animation.AddClip(clipInstance, "test"); 166 | animation.AddClip(legacyClip2, "test2"); 167 | animation.RemoveClip("test"); 168 | Assert.AreEqual(1, animation.GetClipCount(), "Component should still have 1 connected clip after remove"); 169 | } 170 | 171 | [Test] 172 | public void RemoveClip_ByName_RemovesClip([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 173 | { 174 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 175 | var clip = Resources.Load("LinearX"); 176 | var clipInstance = Object.Instantiate(clip); 177 | clipInstance.legacy = animation.usesLegacy; 178 | 179 | animation.AddClip(clipInstance, "test"); 180 | animation.RemoveClip("test"); 181 | Assert.AreEqual(0, animation.GetClipCount(), "Component should still have 1 connected clip after remove"); 182 | } 183 | } 184 | 185 | public class RemoveClip 186 | { 187 | [Test] 188 | public void RemoveClip_Invalidates_ExistingState([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 189 | { 190 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 191 | var clip = Resources.Load("LinearX"); 192 | var clipInstance = Object.Instantiate(clip); 193 | clipInstance.legacy = animation.usesLegacy; 194 | 195 | animation.AddClip(clipInstance, clipInstance.name); 196 | IAnimationState state = animation.GetState(clipInstance.name); 197 | animation.RemoveClip(clipInstance); 198 | Assert.IsFalse(state.isValid); 199 | } 200 | } 201 | 202 | } 203 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/ClipManagementTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b00cae6d5f62bb41a1a48f5c48069fe 3 | timeCreated: 1494560140 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/ComparativeTestFixture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | class ComparativeTestFixture 8 | { 9 | private static System.Type[] Sources() 10 | { 11 | return new Type [] { typeof(AnimationProxy), typeof(SimpleAnimationProxy) }; 12 | } 13 | 14 | public static IAnimation Instantiate(System.Type type) 15 | { 16 | var go = new GameObject(); 17 | var component = go.AddComponent(type); 18 | return component as IAnimation; 19 | } 20 | 21 | public static IAnimation InstantiateCube(System.Type type) 22 | { 23 | var go = GameObject.CreatePrimitive(PrimitiveType.Cube); 24 | var component = go.AddComponent(type); 25 | return component as IAnimation; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/ComparativeTestFixture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98de67babe968c640aa589d5b3a449c2 3 | timeCreated: 1496940236 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/DifferencesTests.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.TestTools; 3 | using NUnit.Framework; 4 | using System.Collections; 5 | using System.Text.RegularExpressions; 6 | 7 | public class DifferencesTests 8 | { 9 | [Test] 10 | [Ignore("The Animation Component creates a new internal clip instance when a state has a different name than the name of the clip. This was deemed an undesirable behavior")] 11 | public void AddClip_WithNewName_CreatesNewClip([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 12 | { 13 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 14 | var clip = Resources.Load("LinearX"); 15 | var clipInstance = Object.Instantiate(clip); 16 | clipInstance.legacy = animation.usesLegacy; 17 | 18 | animation.AddClip(clipInstance, "NewName"); 19 | IAnimationState state = animation.GetState("NewName"); 20 | Assert.AreNotEqual(clipInstance, state.clip, "AddClip should have created a new clip instance"); 21 | } 22 | 23 | [Test] 24 | [Ignore("This is where the new component differs. Animation won't let you remove multiple states with the same clip, because it's not possible to have the same clip twice")] 25 | public void RemoveClip_AnimationClip_RemovesAllInstances([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 26 | { 27 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 28 | var clip = Resources.Load("LinearX"); 29 | var clipInstance = Object.Instantiate(clip); 30 | clipInstance.legacy = animation.usesLegacy; 31 | 32 | animation.AddClip(clipInstance, "test"); 33 | animation.AddClip(clipInstance, "test2"); 34 | animation.RemoveClip(clipInstance); 35 | Assert.AreEqual(0, animation.GetClipCount(), "Component should have no clips after remove"); 36 | } 37 | 38 | [UnityTest] 39 | [Ignore("Time does not advance on the frame on which Rewind is called on SimpleAnimation")] 40 | public IEnumerator Rewind_PlaysFrameZero([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 41 | { 42 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 43 | var clipX = Resources.Load("LinearX"); 44 | var clipInstanceX = Object.Instantiate(clipX); 45 | clipInstanceX.legacy = animation.usesLegacy; 46 | animation.AddClip(clipInstanceX, "ValidName"); 47 | animation.Play("ValidName"); 48 | yield return new WaitForSeconds(0.5f); 49 | Assert.AreNotEqual(0f, animation.gameObject.transform.localPosition.x); 50 | animation.Rewind("ValidName"); 51 | yield return null; 52 | Assert.AreEqual(0f, animation.gameObject.transform.localPosition.x); 53 | } 54 | 55 | [Test] 56 | [Ignore("Check were added to SimpleAnimation to prevent using invalid names")] 57 | public void Rewind_WithInvalidName_FailsOnCall([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 58 | { 59 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 60 | LogAssert.Expect(LogType.Error, new Regex("")); 61 | animation.Rewind("InvalidName"); 62 | } 63 | 64 | [Test] 65 | [Ignore("Check were added to SimpleAnimation to prevent using invalid names")] 66 | public void Stop_WithInvalidName_FailsOnCall([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 67 | { 68 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 69 | LogAssert.Expect(LogType.Error, new Regex("")); 70 | animation.Stop("InvalidName"); 71 | } 72 | 73 | [Test] 74 | [Ignore("The Animation Component accepts null as a valid name")] 75 | public void State_Name_NullString_Throws_ArgumentNullException([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 76 | { 77 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 78 | var clip = Resources.Load("LinearX"); 79 | var clipInstance = Object.Instantiate(clip); 80 | clipInstance.legacy = animation.usesLegacy; 81 | 82 | animation.AddClip(clipInstance, "ValidName"); 83 | IAnimationState state = animation.GetState("ValidName"); 84 | Assert.Throws(() => { state.name = null; }); 85 | } 86 | 87 | [UnityTest] 88 | [Ignore("Setting time guarantees you that the next automatic evaluation will use the time you supplied with Playables, whereas Animation Component will update the frame time")] 89 | public IEnumerator State_Time_SetTime_PreventsUpdatingTimeAutomatically([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 90 | { 91 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 92 | var clip = Resources.Load("LinearX"); 93 | var clipInstance = Object.Instantiate(clip); 94 | clipInstance.legacy = animation.usesLegacy; 95 | 96 | animation.AddClip(clipInstance, "ValidName"); 97 | IAnimationState state = animation.GetState("ValidName"); 98 | animation.Play(state.name); 99 | float time = Time.time; 100 | state.time = 0.1f; //empty run for the Animation component, probably a side effect of reenabling the component 101 | yield return null; 102 | 103 | state.time = 0.1f; 104 | yield return null; 105 | 106 | Assert.AreEqual(0.1f, state.time); 107 | } 108 | 109 | [UnityTest] 110 | [Ignore("The Animation Component doesn't advance on the first frame")] 111 | public IEnumerator State_Time_IsSynchronizedWith_GameTime([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 112 | { 113 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 114 | var clip = Resources.Load("LinearX"); 115 | var clipInstance = Object.Instantiate(clip); 116 | clipInstance.legacy = animation.usesLegacy; 117 | 118 | animation.AddClip(clipInstance, "ValidName"); 119 | IAnimationState state = animation.GetState("ValidName"); 120 | animation.Play(state.name); 121 | float previousTime = Time.time; 122 | yield return null; 123 | yield return null; 124 | yield return null; 125 | float elapsedTime = Time.time - previousTime; 126 | Assert.AreEqual(elapsedTime, state.time, 0.001f, "State time should be equal to elapsed time"); 127 | } 128 | 129 | [UnityTest] 130 | [Ignore("In the Animation Component, RemoveClip doesn't remove queued instances of the removed clip, whereas Stop stops both the queued instances and the playing instances. This inconsistency was deemed undesirable")] 131 | public IEnumerator Queue_RemoveClip_StopsQueuedClips([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 132 | { 133 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 134 | var clip = Resources.Load("LinearX"); 135 | var clipInstance = Object.Instantiate(clip); 136 | clipInstance.legacy = animation.usesLegacy; 137 | 138 | animation.AddClip(clipInstance, "PlayAndQueue"); 139 | animation.Play("PlayAndQueue"); 140 | animation.PlayQueued("PlayAndQueue", QueueMode.CompleteOthers); 141 | yield return null; 142 | animation.RemoveClip("PlayAndQueue"); 143 | Assert.IsFalse(animation.isPlaying); 144 | yield return null; 145 | Assert.IsFalse(animation.isPlaying); 146 | } 147 | 148 | [UnityTest] 149 | [Ignore("States that play backwards should still be Queue-compatible, which is not the case in the Animation Component")] 150 | public IEnumerator NegativeSpeed_Does_Trigger_Crossfade([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 151 | { 152 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 153 | var clip = Resources.Load("LinearX"); 154 | var clipInstance = Object.Instantiate(clip); 155 | clipInstance.legacy = animation.usesLegacy; 156 | 157 | animation.AddClip(clipInstance, "PlayBackwards"); 158 | animation.AddClip(clipInstance, "Crossfade"); 159 | IAnimationState state = animation.GetState("PlayBackwards"); 160 | state.enabled = true; 161 | state.time = 0.5f; 162 | state.speed = -1f; 163 | animation.PlayQueued("Crossfade", QueueMode.CompleteOthers); 164 | yield return new WaitForSeconds(0.5f); 165 | 166 | Assert.IsTrue(state.enabled); 167 | Assert.IsTrue(animation.IsPlaying("Crossfade")); 168 | } 169 | 170 | [UnityTest] 171 | [Ignore("The Animation Component doesn't apply velocities to rigidbodies with AnimatePhysics on")] 172 | public IEnumerator AnimatePhysics_True_AppliesVelocity([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 173 | { 174 | IAnimation animation = ComparativeTestFixture.InstantiateCube(type); 175 | var clip = Resources.Load("LinearX"); 176 | var clipInstance = Object.Instantiate(clip); 177 | clipInstance.legacy = animation.usesLegacy; 178 | 179 | var rb = animation.gameObject.AddComponent(); 180 | rb.useGravity = false; 181 | animation.animatePhysics = true; 182 | animation.AddClip(clipInstance, "test"); 183 | animation.Play("test"); 184 | 185 | yield return null; 186 | yield return new WaitForSeconds(0.3f); 187 | Assert.AreNotEqual(rb.velocity, Vector3.zero); 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/DifferencesTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b19f00406c66144ab1f66fe9c78fabb 3 | timeCreated: 1499370755 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/MiscTests.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.TestTools; 3 | using NUnit.Framework; 4 | using System.Collections; 5 | using System.Text.RegularExpressions; 6 | 7 | public class MiscTests 8 | { 9 | [UnityTest] 10 | public IEnumerator StateSpeed_Affects_WhenCrossfadeHappens([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 11 | { 12 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 13 | var clip = Resources.Load("LinearX"); 14 | var clipInstance = Object.Instantiate(clip); 15 | clipInstance.legacy = animation.usesLegacy; 16 | 17 | animation.AddClip(clipInstance, "PlaySlowly"); 18 | animation.AddClip(clipInstance, "Queued"); 19 | IAnimationState state = animation.GetState("PlaySlowly"); 20 | state.enabled = true; 21 | state.speed = 0.1f; 22 | animation.PlayQueued("Queued", QueueMode.CompleteOthers); 23 | 24 | //Wait for the original length of PlaySlowly 25 | yield return new WaitForSeconds(1.1f); 26 | Assert.IsFalse(animation.IsPlaying("Queued"), "Clip 'Queued' should not be playing yet. Speed is probably applied wrong."); 27 | state.speed = 1000.0f; 28 | yield return null; 29 | yield return null; 30 | Assert.IsTrue(animation.IsPlaying("Queued"), "Clip 'PlaySlowly' should now be done, and clip 'Queued' should have started playing."); 31 | } 32 | 33 | [UnityTest] 34 | public IEnumerator PlayQueue_WithLoopedAnimation_Prevents_StateAccess_OfOriginalState_FromWorking_Correctly([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 35 | { 36 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 37 | var clip = Resources.Load("LinearX"); 38 | var clipInstance = Object.Instantiate(clip); 39 | var loopedClipInstance = Object.Instantiate(clip); 40 | clipInstance.legacy = animation.usesLegacy; 41 | loopedClipInstance.legacy = animation.usesLegacy; 42 | loopedClipInstance.wrapMode = WrapMode.Loop; 43 | 44 | animation.AddClip(clipInstance, "FirstClip"); 45 | animation.AddClip(loopedClipInstance, "LoopedClip"); 46 | animation.Play("FirstClip"); 47 | animation.PlayQueued("LoopedClip", QueueMode.CompleteOthers); 48 | yield return new WaitForSeconds(1.1f); 49 | Assert.IsTrue(animation.IsPlaying("LoopedClip"), "Clip 'LoopedClip' should be playing"); 50 | IAnimationState state = animation.GetState("LoopedClip"); 51 | 52 | Assert.IsFalse(state.enabled, "We should be playing a copy of LoopedClip, not the LoopedClip State"); 53 | yield return new WaitForSeconds(1.1f); 54 | state = animation.GetState("LoopedClip"); 55 | Assert.IsFalse(state.enabled, "We should still be playing a copy of LoopedClip, not the LoopedClip State"); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/MiscTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6e209b2d0c68024ebd0ce0df3d50480 3 | timeCreated: 1499452822 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/PlaybackTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fd08db4a0ee3ce47b1e4f8a0913f89d 3 | timeCreated: 1494560140 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/QueueTests.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.TestTools; 3 | using NUnit.Framework; 4 | using System.Collections; 5 | using System.Text.RegularExpressions; 6 | 7 | public class QueueTests 8 | { 9 | [UnityTest] 10 | public IEnumerator Queue_Stop_Clip_StopsQueuedClip([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 11 | { 12 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 13 | var clip = Resources.Load("LinearX"); 14 | var clipInstance = Object.Instantiate(clip); 15 | clipInstance.legacy = animation.usesLegacy; 16 | 17 | animation.AddClip(clipInstance, "PlayAndQueue"); 18 | animation.Play("PlayAndQueue"); 19 | animation.PlayQueued("PlayAndQueue", QueueMode.CompleteOthers); 20 | yield return null; 21 | animation.Stop("PlayAndQueue"); 22 | Assert.IsFalse(animation.isPlaying); 23 | yield return null; 24 | //Queued animation would have started if it was going to. 25 | Assert.IsFalse(animation.isPlaying); 26 | } 27 | 28 | [UnityTest] 29 | public IEnumerator State_Enabled_DoesntCover_QueuedState([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 30 | { 31 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 32 | var clip = Resources.Load("LinearX"); 33 | var clipInstance = Object.Instantiate(clip); 34 | clipInstance.legacy = animation.usesLegacy; 35 | 36 | animation.AddClip(clipInstance, "PlayAndQueue"); 37 | animation.Play("PlayAndQueue"); 38 | animation.PlayQueued("PlayAndQueue", QueueMode.CompleteOthers); 39 | IAnimationState state = animation.GetState("PlayAndQueue"); 40 | Assert.IsTrue(state.enabled); 41 | yield return new WaitForSeconds(1.1f); 42 | Assert.IsFalse(state.enabled); 43 | } 44 | 45 | [UnityTest] 46 | public IEnumerator Queue_Looped_Clips_Block_QueuedAnimations([ValueSource(typeof(ComparativeTestFixture), "Sources")]System.Type type) 47 | { 48 | IAnimation animation = ComparativeTestFixture.Instantiate(type); 49 | var clip = Resources.Load("LinearX"); 50 | var clipInstance = Object.Instantiate(clip); 51 | clipInstance.legacy = animation.usesLegacy; 52 | clipInstance.wrapMode = WrapMode.Loop; 53 | 54 | animation.AddClip(clipInstance, "Play"); 55 | animation.AddClip(clipInstance, "Queued"); 56 | animation.Play("Play"); 57 | animation.PlayQueued("Queued", QueueMode.CompleteOthers); 58 | yield return new WaitForSeconds(1.1f); 59 | Assert.IsFalse(animation.IsPlaying("Queued")); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/QueueTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92ce3265af6ad694c9d214d1b4fd6adc 3 | timeCreated: 1499439871 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/ComparativeTests/StateAccessTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8cb3c934bf3f0534a8b954abe8c4984d 3 | timeCreated: 1498676303 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e443d0a02c421de4381e52acca42b6b8 3 | folderAsset: yes 4 | timeCreated: 1494560892 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources/FiresEvent.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: FiresEvent 9 | serializedVersion: 6 10 | m_Legacy: 0 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_EulerCurves: [] 16 | m_PositionCurves: [] 17 | m_ScaleCurves: [] 18 | m_FloatCurves: [] 19 | m_PPtrCurves: [] 20 | m_SampleRate: 60 21 | m_WrapMode: 0 22 | m_Bounds: 23 | m_Center: {x: 0, y: 0, z: 0} 24 | m_Extent: {x: 0, y: 0, z: 0} 25 | m_ClipBindingConstant: 26 | genericBindings: [] 27 | pptrCurveMapping: [] 28 | m_AnimationClipSettings: 29 | serializedVersion: 2 30 | m_AdditiveReferencePoseClip: {fileID: 0} 31 | m_AdditiveReferencePoseTime: 0 32 | m_StartTime: 0 33 | m_StopTime: 1 34 | m_OrientationOffsetY: 0 35 | m_Level: 0 36 | m_CycleOffset: 0 37 | m_HasAdditiveReferencePose: 0 38 | m_LoopTime: 0 39 | m_LoopBlend: 0 40 | m_LoopBlendOrientation: 0 41 | m_LoopBlendPositionY: 0 42 | m_LoopBlendPositionXZ: 0 43 | m_KeepOriginalOrientation: 0 44 | m_KeepOriginalPositionY: 1 45 | m_KeepOriginalPositionXZ: 0 46 | m_HeightFromFeet: 0 47 | m_Mirror: 0 48 | m_EditorCurves: [] 49 | m_EulerEditorCurves: [] 50 | m_HasGenericRootTransform: 0 51 | m_HasMotionFloatCurves: 0 52 | m_GenerateMotionCurves: 0 53 | m_Events: 54 | - time: 0.4 55 | functionName: Event 56 | data: 57 | objectReferenceParameter: {fileID: 0} 58 | floatParameter: 0 59 | intParameter: 0 60 | messageOptions: 0 61 | - time: 1 62 | functionName: Event 63 | data: 64 | objectReferenceParameter: {fileID: 0} 65 | floatParameter: 0 66 | intParameter: 0 67 | messageOptions: 0 68 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources/FiresEvent.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6daa07941d12d35499204edaf3412a35 3 | timeCreated: 1519669948 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 7400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources/LinearX.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: LinearX 9 | serializedVersion: 6 10 | m_Legacy: 0 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_EulerCurves: [] 16 | m_PositionCurves: 17 | - curve: 18 | serializedVersion: 2 19 | m_Curve: 20 | - serializedVersion: 2 21 | time: 0 22 | value: {x: 0, y: 0, z: 0} 23 | inSlope: {x: Infinity, y: Infinity, z: Infinity} 24 | outSlope: {x: 1, y: 0, z: 0} 25 | tangentMode: 0 26 | - serializedVersion: 2 27 | time: 1 28 | value: {x: 1, y: 0, z: 0} 29 | inSlope: {x: 1, y: -0, z: -0} 30 | outSlope: {x: Infinity, y: Infinity, z: Infinity} 31 | tangentMode: 0 32 | m_PreInfinity: 2 33 | m_PostInfinity: 2 34 | m_RotationOrder: 4 35 | path: 36 | m_ScaleCurves: [] 37 | m_FloatCurves: [] 38 | m_PPtrCurves: [] 39 | m_SampleRate: 60 40 | m_WrapMode: 1 41 | m_Bounds: 42 | m_Center: {x: 0, y: 0, z: 0} 43 | m_Extent: {x: 0, y: 0, z: 0} 44 | m_ClipBindingConstant: 45 | genericBindings: 46 | - serializedVersion: 2 47 | path: 0 48 | attribute: 1 49 | script: {fileID: 0} 50 | typeID: 4 51 | customType: 0 52 | isPPtrCurve: 0 53 | pptrCurveMapping: [] 54 | m_AnimationClipSettings: 55 | serializedVersion: 2 56 | m_AdditiveReferencePoseClip: {fileID: 0} 57 | m_AdditiveReferencePoseTime: 0 58 | m_StartTime: 0 59 | m_StopTime: 1 60 | m_OrientationOffsetY: 0 61 | m_Level: 0 62 | m_CycleOffset: 0 63 | m_HasAdditiveReferencePose: 0 64 | m_LoopTime: 1 65 | m_LoopBlend: 0 66 | m_LoopBlendOrientation: 0 67 | m_LoopBlendPositionY: 0 68 | m_LoopBlendPositionXZ: 0 69 | m_KeepOriginalOrientation: 0 70 | m_KeepOriginalPositionY: 1 71 | m_KeepOriginalPositionXZ: 0 72 | m_HeightFromFeet: 0 73 | m_Mirror: 0 74 | m_EditorCurves: 75 | - curve: 76 | serializedVersion: 2 77 | m_Curve: 78 | - serializedVersion: 2 79 | time: 0 80 | value: 0 81 | inSlope: Infinity 82 | outSlope: 1 83 | tangentMode: 69 84 | - serializedVersion: 2 85 | time: 1 86 | value: 1 87 | inSlope: 1 88 | outSlope: Infinity 89 | tangentMode: 69 90 | m_PreInfinity: 2 91 | m_PostInfinity: 2 92 | m_RotationOrder: 4 93 | attribute: m_LocalPosition.x 94 | path: 95 | classID: 4 96 | script: {fileID: 0} 97 | - curve: 98 | serializedVersion: 2 99 | m_Curve: 100 | - serializedVersion: 2 101 | time: 0 102 | value: 0 103 | inSlope: Infinity 104 | outSlope: 0 105 | tangentMode: 69 106 | - serializedVersion: 2 107 | time: 1 108 | value: 0 109 | inSlope: -0 110 | outSlope: Infinity 111 | tangentMode: 69 112 | m_PreInfinity: 2 113 | m_PostInfinity: 2 114 | m_RotationOrder: 4 115 | attribute: m_LocalPosition.y 116 | path: 117 | classID: 4 118 | script: {fileID: 0} 119 | - curve: 120 | serializedVersion: 2 121 | m_Curve: 122 | - serializedVersion: 2 123 | time: 0 124 | value: 0 125 | inSlope: Infinity 126 | outSlope: 0 127 | tangentMode: 69 128 | - serializedVersion: 2 129 | time: 1 130 | value: 0 131 | inSlope: -0 132 | outSlope: Infinity 133 | tangentMode: 69 134 | m_PreInfinity: 2 135 | m_PostInfinity: 2 136 | m_RotationOrder: 4 137 | attribute: m_LocalPosition.z 138 | path: 139 | classID: 4 140 | script: {fileID: 0} 141 | m_EulerEditorCurves: [] 142 | m_HasGenericRootTransform: 1 143 | m_HasMotionFloatCurves: 0 144 | m_GenerateMotionCurves: 0 145 | m_Events: [] 146 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources/LinearX.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfc925af54b7a044bbc0364b9157fc0d 3 | timeCreated: 1492542614 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 7400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources/LinearXLegacy.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: LinearXLegacy 9 | serializedVersion: 6 10 | m_Legacy: 1 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_EulerCurves: [] 16 | m_PositionCurves: 17 | - curve: 18 | serializedVersion: 2 19 | m_Curve: 20 | - serializedVersion: 2 21 | time: 0 22 | value: {x: 0, y: 0, z: 0} 23 | inSlope: {x: Infinity, y: Infinity, z: Infinity} 24 | outSlope: {x: 1, y: 0, z: 0} 25 | tangentMode: 0 26 | - serializedVersion: 2 27 | time: 1 28 | value: {x: 1, y: 0, z: 0} 29 | inSlope: {x: 1, y: -0, z: -0} 30 | outSlope: {x: Infinity, y: Infinity, z: Infinity} 31 | tangentMode: 0 32 | m_PreInfinity: 2 33 | m_PostInfinity: 2 34 | m_RotationOrder: 4 35 | path: 36 | m_ScaleCurves: [] 37 | m_FloatCurves: [] 38 | m_PPtrCurves: [] 39 | m_SampleRate: 60 40 | m_WrapMode: 1 41 | m_Bounds: 42 | m_Center: {x: 0, y: 0, z: 0} 43 | m_Extent: {x: 0, y: 0, z: 0} 44 | m_ClipBindingConstant: 45 | genericBindings: [] 46 | pptrCurveMapping: [] 47 | m_AnimationClipSettings: 48 | serializedVersion: 2 49 | m_AdditiveReferencePoseClip: {fileID: 0} 50 | m_AdditiveReferencePoseTime: 0 51 | m_StartTime: 0 52 | m_StopTime: 1 53 | m_OrientationOffsetY: 0 54 | m_Level: 0 55 | m_CycleOffset: 0 56 | m_HasAdditiveReferencePose: 0 57 | m_LoopTime: 1 58 | m_LoopBlend: 0 59 | m_LoopBlendOrientation: 0 60 | m_LoopBlendPositionY: 0 61 | m_LoopBlendPositionXZ: 0 62 | m_KeepOriginalOrientation: 0 63 | m_KeepOriginalPositionY: 1 64 | m_KeepOriginalPositionXZ: 0 65 | m_HeightFromFeet: 0 66 | m_Mirror: 0 67 | m_EditorCurves: 68 | - curve: 69 | serializedVersion: 2 70 | m_Curve: 71 | - serializedVersion: 2 72 | time: 0 73 | value: 0 74 | inSlope: Infinity 75 | outSlope: 1 76 | tangentMode: 69 77 | - serializedVersion: 2 78 | time: 1 79 | value: 1 80 | inSlope: 1 81 | outSlope: Infinity 82 | tangentMode: 69 83 | m_PreInfinity: 2 84 | m_PostInfinity: 2 85 | m_RotationOrder: 4 86 | attribute: m_LocalPosition.x 87 | path: 88 | classID: 4 89 | script: {fileID: 0} 90 | - curve: 91 | serializedVersion: 2 92 | m_Curve: 93 | - serializedVersion: 2 94 | time: 0 95 | value: 0 96 | inSlope: Infinity 97 | outSlope: 0 98 | tangentMode: 69 99 | - serializedVersion: 2 100 | time: 1 101 | value: 0 102 | inSlope: -0 103 | outSlope: Infinity 104 | tangentMode: 69 105 | m_PreInfinity: 2 106 | m_PostInfinity: 2 107 | m_RotationOrder: 4 108 | attribute: m_LocalPosition.y 109 | path: 110 | classID: 4 111 | script: {fileID: 0} 112 | - curve: 113 | serializedVersion: 2 114 | m_Curve: 115 | - serializedVersion: 2 116 | time: 0 117 | value: 0 118 | inSlope: Infinity 119 | outSlope: 0 120 | tangentMode: 69 121 | - serializedVersion: 2 122 | time: 1 123 | value: 0 124 | inSlope: -0 125 | outSlope: Infinity 126 | tangentMode: 69 127 | m_PreInfinity: 2 128 | m_PostInfinity: 2 129 | m_RotationOrder: 4 130 | attribute: m_LocalPosition.z 131 | path: 132 | classID: 4 133 | script: {fileID: 0} 134 | m_EulerEditorCurves: [] 135 | m_HasGenericRootTransform: 1 136 | m_HasMotionFloatCurves: 0 137 | m_GenerateMotionCurves: 0 138 | m_Events: [] 139 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources/LinearXLegacy.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e7cf6bd5ccd3f74e827f886ea59f0b1 3 | timeCreated: 1507816446 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 7400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources/LinearY.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: LinearY 9 | serializedVersion: 6 10 | m_Legacy: 0 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_EulerCurves: [] 16 | m_PositionCurves: 17 | - curve: 18 | serializedVersion: 2 19 | m_Curve: 20 | - serializedVersion: 2 21 | time: 0 22 | value: {x: 0, y: 0, z: 0} 23 | inSlope: {x: 0, y: 0, z: 0} 24 | outSlope: {x: 0, y: 1, z: 0} 25 | tangentMode: 0 26 | - serializedVersion: 2 27 | time: 1 28 | value: {x: 0, y: 1, z: 0} 29 | inSlope: {x: -0, y: 1, z: -0} 30 | outSlope: {x: 0, y: 0, z: 0} 31 | tangentMode: 0 32 | m_PreInfinity: 2 33 | m_PostInfinity: 2 34 | m_RotationOrder: 4 35 | path: 36 | m_ScaleCurves: [] 37 | m_FloatCurves: [] 38 | m_PPtrCurves: [] 39 | m_SampleRate: 60 40 | m_WrapMode: 0 41 | m_Bounds: 42 | m_Center: {x: 0, y: 0, z: 0} 43 | m_Extent: {x: 0, y: 0, z: 0} 44 | m_ClipBindingConstant: 45 | genericBindings: 46 | - serializedVersion: 2 47 | path: 0 48 | attribute: 1 49 | script: {fileID: 0} 50 | typeID: 4 51 | customType: 0 52 | isPPtrCurve: 0 53 | pptrCurveMapping: [] 54 | m_AnimationClipSettings: 55 | serializedVersion: 2 56 | m_AdditiveReferencePoseClip: {fileID: 0} 57 | m_AdditiveReferencePoseTime: 0 58 | m_StartTime: 0 59 | m_StopTime: 1 60 | m_OrientationOffsetY: 0 61 | m_Level: 0 62 | m_CycleOffset: 0 63 | m_HasAdditiveReferencePose: 0 64 | m_LoopTime: 1 65 | m_LoopBlend: 0 66 | m_LoopBlendOrientation: 0 67 | m_LoopBlendPositionY: 0 68 | m_LoopBlendPositionXZ: 0 69 | m_KeepOriginalOrientation: 0 70 | m_KeepOriginalPositionY: 1 71 | m_KeepOriginalPositionXZ: 0 72 | m_HeightFromFeet: 0 73 | m_Mirror: 0 74 | m_EditorCurves: 75 | - curve: 76 | serializedVersion: 2 77 | m_Curve: 78 | - serializedVersion: 2 79 | time: 0 80 | value: 0 81 | inSlope: 0 82 | outSlope: 0 83 | tangentMode: 69 84 | - serializedVersion: 2 85 | time: 1 86 | value: 0 87 | inSlope: -0 88 | outSlope: 0 89 | tangentMode: 69 90 | m_PreInfinity: 2 91 | m_PostInfinity: 2 92 | m_RotationOrder: 4 93 | attribute: m_LocalPosition.x 94 | path: 95 | classID: 4 96 | script: {fileID: 0} 97 | - curve: 98 | serializedVersion: 2 99 | m_Curve: 100 | - serializedVersion: 2 101 | time: 0 102 | value: 0 103 | inSlope: 0 104 | outSlope: 1 105 | tangentMode: 69 106 | - serializedVersion: 2 107 | time: 1 108 | value: 1 109 | inSlope: 1 110 | outSlope: 0 111 | tangentMode: 69 112 | m_PreInfinity: 2 113 | m_PostInfinity: 2 114 | m_RotationOrder: 4 115 | attribute: m_LocalPosition.y 116 | path: 117 | classID: 4 118 | script: {fileID: 0} 119 | - curve: 120 | serializedVersion: 2 121 | m_Curve: 122 | - serializedVersion: 2 123 | time: 0 124 | value: 0 125 | inSlope: 0 126 | outSlope: 0 127 | tangentMode: 69 128 | - serializedVersion: 2 129 | time: 1 130 | value: 0 131 | inSlope: -0 132 | outSlope: 0 133 | tangentMode: 69 134 | m_PreInfinity: 2 135 | m_PostInfinity: 2 136 | m_RotationOrder: 4 137 | attribute: m_LocalPosition.z 138 | path: 139 | classID: 4 140 | script: {fileID: 0} 141 | m_EulerEditorCurves: [] 142 | m_HasGenericRootTransform: 1 143 | m_HasMotionFloatCurves: 0 144 | m_GenerateMotionCurves: 0 145 | m_Events: [] 146 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources/LinearY.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6ad4075bbce8ce4d8f9a0d44b3328f4 3 | timeCreated: 1492542687 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 7400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources/LinearZ.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: LinearZ 9 | serializedVersion: 6 10 | m_Legacy: 0 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_EulerCurves: [] 16 | m_PositionCurves: 17 | - curve: 18 | serializedVersion: 2 19 | m_Curve: 20 | - serializedVersion: 2 21 | time: 0 22 | value: {x: 0, y: 0, z: 0} 23 | inSlope: {x: 0, y: 0, z: 0} 24 | outSlope: {x: 0, y: 0, z: 0} 25 | tangentMode: 0 26 | - serializedVersion: 2 27 | time: 1 28 | value: {x: 0, y: 0, z: 1} 29 | inSlope: {x: 0, y: 0, z: 0} 30 | outSlope: {x: 0, y: 0, z: 0} 31 | tangentMode: 0 32 | m_PreInfinity: 2 33 | m_PostInfinity: 2 34 | m_RotationOrder: 4 35 | path: 36 | m_ScaleCurves: [] 37 | m_FloatCurves: [] 38 | m_PPtrCurves: [] 39 | m_SampleRate: 60 40 | m_WrapMode: 0 41 | m_Bounds: 42 | m_Center: {x: 0, y: 0, z: 0} 43 | m_Extent: {x: 0, y: 0, z: 0} 44 | m_ClipBindingConstant: 45 | genericBindings: 46 | - serializedVersion: 2 47 | path: 0 48 | attribute: 1 49 | script: {fileID: 0} 50 | typeID: 4 51 | customType: 0 52 | isPPtrCurve: 0 53 | pptrCurveMapping: [] 54 | m_AnimationClipSettings: 55 | serializedVersion: 2 56 | m_AdditiveReferencePoseClip: {fileID: 0} 57 | m_AdditiveReferencePoseTime: 0 58 | m_StartTime: 0 59 | m_StopTime: 1 60 | m_OrientationOffsetY: 0 61 | m_Level: 0 62 | m_CycleOffset: 0 63 | m_HasAdditiveReferencePose: 0 64 | m_LoopTime: 1 65 | m_LoopBlend: 0 66 | m_LoopBlendOrientation: 0 67 | m_LoopBlendPositionY: 0 68 | m_LoopBlendPositionXZ: 0 69 | m_KeepOriginalOrientation: 0 70 | m_KeepOriginalPositionY: 1 71 | m_KeepOriginalPositionXZ: 0 72 | m_HeightFromFeet: 0 73 | m_Mirror: 0 74 | m_EditorCurves: 75 | - curve: 76 | serializedVersion: 2 77 | m_Curve: 78 | - serializedVersion: 2 79 | time: 0 80 | value: 0 81 | inSlope: 0 82 | outSlope: 0 83 | tangentMode: 136 84 | - serializedVersion: 2 85 | time: 1 86 | value: 0 87 | inSlope: 0 88 | outSlope: 0 89 | tangentMode: 136 90 | m_PreInfinity: 2 91 | m_PostInfinity: 2 92 | m_RotationOrder: 4 93 | attribute: m_LocalPosition.x 94 | path: 95 | classID: 4 96 | script: {fileID: 0} 97 | - curve: 98 | serializedVersion: 2 99 | m_Curve: 100 | - serializedVersion: 2 101 | time: 0 102 | value: 0 103 | inSlope: 0 104 | outSlope: 0 105 | tangentMode: 136 106 | - serializedVersion: 2 107 | time: 1 108 | value: 0 109 | inSlope: 0 110 | outSlope: 0 111 | tangentMode: 136 112 | m_PreInfinity: 2 113 | m_PostInfinity: 2 114 | m_RotationOrder: 4 115 | attribute: m_LocalPosition.y 116 | path: 117 | classID: 4 118 | script: {fileID: 0} 119 | - curve: 120 | serializedVersion: 2 121 | m_Curve: 122 | - serializedVersion: 2 123 | time: 0 124 | value: 0 125 | inSlope: 0 126 | outSlope: 0 127 | tangentMode: 136 128 | - serializedVersion: 2 129 | time: 1 130 | value: 1 131 | inSlope: 0 132 | outSlope: 0 133 | tangentMode: 136 134 | m_PreInfinity: 2 135 | m_PostInfinity: 2 136 | m_RotationOrder: 4 137 | attribute: m_LocalPosition.z 138 | path: 139 | classID: 4 140 | script: {fileID: 0} 141 | m_EulerEditorCurves: [] 142 | m_HasGenericRootTransform: 1 143 | m_HasMotionFloatCurves: 0 144 | m_GenerateMotionCurves: 0 145 | m_Events: [] 146 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources/LinearZ.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b6ab153d3e5b6441b29261e07fbc9c4 3 | timeCreated: 1492542878 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 7400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources/WithSimpleAnimation.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &8787524063794857361 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 8787524063794857368} 12 | - component: {fileID: 8787524063794857371} 13 | - component: {fileID: 8787524063794857370} 14 | - component: {fileID: 8787524063794857365} 15 | - component: {fileID: 8787524063794857367} 16 | - component: {fileID: 8787524063794857366} 17 | m_Layer: 0 18 | m_Name: WithSimpleAnimation 19 | m_TagString: Untagged 20 | m_Icon: {fileID: 0} 21 | m_NavMeshLayer: 0 22 | m_StaticEditorFlags: 0 23 | m_IsActive: 1 24 | --- !u!4 &8787524063794857368 25 | Transform: 26 | m_ObjectHideFlags: 0 27 | m_CorrespondingSourceObject: {fileID: 0} 28 | m_PrefabInstance: {fileID: 0} 29 | m_PrefabAsset: {fileID: 0} 30 | m_GameObject: {fileID: 8787524063794857361} 31 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 32 | m_LocalPosition: {x: 0, y: 0, z: 0} 33 | m_LocalScale: {x: 1, y: 1, z: 1} 34 | m_Children: [] 35 | m_Father: {fileID: 0} 36 | m_RootOrder: 0 37 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 38 | --- !u!33 &8787524063794857371 39 | MeshFilter: 40 | m_ObjectHideFlags: 0 41 | m_CorrespondingSourceObject: {fileID: 0} 42 | m_PrefabInstance: {fileID: 0} 43 | m_PrefabAsset: {fileID: 0} 44 | m_GameObject: {fileID: 8787524063794857361} 45 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 46 | --- !u!23 &8787524063794857370 47 | MeshRenderer: 48 | m_ObjectHideFlags: 0 49 | m_CorrespondingSourceObject: {fileID: 0} 50 | m_PrefabInstance: {fileID: 0} 51 | m_PrefabAsset: {fileID: 0} 52 | m_GameObject: {fileID: 8787524063794857361} 53 | m_Enabled: 1 54 | m_CastShadows: 1 55 | m_ReceiveShadows: 1 56 | m_DynamicOccludee: 1 57 | m_MotionVectors: 1 58 | m_LightProbeUsage: 1 59 | m_ReflectionProbeUsage: 1 60 | m_RenderingLayerMask: 1 61 | m_RendererPriority: 0 62 | m_Materials: 63 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 64 | m_StaticBatchInfo: 65 | firstSubMesh: 0 66 | subMeshCount: 0 67 | m_StaticBatchRoot: {fileID: 0} 68 | m_ProbeAnchor: {fileID: 0} 69 | m_LightProbeVolumeOverride: {fileID: 0} 70 | m_ScaleInLightmap: 1 71 | m_PreserveUVs: 0 72 | m_IgnoreNormalsForChartDetection: 0 73 | m_ImportantGI: 0 74 | m_StitchLightmapSeams: 1 75 | m_SelectedEditorRenderState: 3 76 | m_MinimumChartSize: 4 77 | m_AutoUVMaxDistance: 0.5 78 | m_AutoUVMaxAngle: 89 79 | m_LightmapParameters: {fileID: 0} 80 | m_SortingLayerID: 0 81 | m_SortingLayer: 0 82 | m_SortingOrder: 0 83 | --- !u!65 &8787524063794857365 84 | BoxCollider: 85 | m_ObjectHideFlags: 0 86 | m_CorrespondingSourceObject: {fileID: 0} 87 | m_PrefabInstance: {fileID: 0} 88 | m_PrefabAsset: {fileID: 0} 89 | m_GameObject: {fileID: 8787524063794857361} 90 | m_Material: {fileID: 0} 91 | m_IsTrigger: 0 92 | m_Enabled: 1 93 | serializedVersion: 2 94 | m_Size: {x: 1, y: 1, z: 1} 95 | m_Center: {x: 0, y: 0, z: 0} 96 | --- !u!95 &8787524063794857367 97 | Animator: 98 | serializedVersion: 3 99 | m_ObjectHideFlags: 0 100 | m_CorrespondingSourceObject: {fileID: 0} 101 | m_PrefabInstance: {fileID: 0} 102 | m_PrefabAsset: {fileID: 0} 103 | m_GameObject: {fileID: 8787524063794857361} 104 | m_Enabled: 1 105 | m_Avatar: {fileID: 0} 106 | m_Controller: {fileID: 0} 107 | m_CullingMode: 1 108 | m_UpdateMode: 0 109 | m_ApplyRootMotion: 0 110 | m_LinearVelocityBlending: 0 111 | m_WarningMessage: 112 | m_HasTransformHierarchy: 1 113 | m_AllowConstantClipSamplingOptimization: 1 114 | m_KeepAnimatorControllerStateOnDisable: 0 115 | --- !u!114 &8787524063794857366 116 | MonoBehaviour: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | m_GameObject: {fileID: 8787524063794857361} 122 | m_Enabled: 1 123 | m_EditorHideFlags: 0 124 | m_Script: {fileID: 11500000, guid: 3759e2aae0f7b9a47bb98fc64bf3c543, type: 3} 125 | m_Name: 126 | m_EditorClassIdentifier: 127 | m_PlayAutomatically: 1 128 | m_AnimatePhysics: 0 129 | m_CullingMode: 1 130 | m_WrapMode: 0 131 | m_Clip: {fileID: 0} 132 | m_States: 133 | - clip: {fileID: 0} 134 | name: Default 135 | defaultState: 1 136 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/Resources/WithSimpleAnimation.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e932bd603cbef5540ad872fdcd320722 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/SimpleAnimationTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.TestTools; 5 | using Object = UnityEngine.Object; 6 | using NUnit.Framework; 7 | using System.Collections; 8 | 9 | public class SimpleAnimationTests 10 | { 11 | static SimpleAnimation Instantiate() 12 | { 13 | var go = new GameObject(); 14 | return go.AddComponent(); 15 | } 16 | public class GetStates 17 | { 18 | [Test] 19 | public void GetStates_WithNoStates_IEnumerator_MoveNext_ReturnsFalse() 20 | { 21 | SimpleAnimation animation = Instantiate(); 22 | IEnumerable states = animation.GetStates(); 23 | var it = states.GetEnumerator(); 24 | Assert.IsFalse(it.MoveNext()); 25 | } 26 | 27 | [Test] 28 | public void GetStates_WithNoStates_IEnumerator_Current_Throws() 29 | { 30 | SimpleAnimation animation = Instantiate(); 31 | IEnumerable states = animation.GetStates(); 32 | var it = states.GetEnumerator(); 33 | Assert.Throws(() => { SimpleAnimation.State state = it.Current; }); 34 | } 35 | 36 | [Test] 37 | public void GetStates_WithSingleState_IEnumerator_Returns_ValidState() 38 | { 39 | SimpleAnimation animation = Instantiate(); 40 | var clip = Resources.Load("LinearX"); 41 | var clipInstance = Object.Instantiate(clip); 42 | 43 | animation.AddClip(clipInstance, "SingleClip"); 44 | IEnumerable states = animation.GetStates(); 45 | var it = states.GetEnumerator(); 46 | it.MoveNext(); 47 | SimpleAnimation.State state = it.Current; 48 | Assert.AreEqual("SingleClip", state.name); 49 | } 50 | 51 | [Test] 52 | public void GetStates_ModifyStates_IEnumerator_MoveNext_Throws() 53 | { 54 | SimpleAnimation animation = Instantiate(); 55 | var clip = Resources.Load("LinearX"); 56 | var clipInstance = Object.Instantiate(clip); 57 | 58 | animation.AddClip(clipInstance, "SingleClip"); 59 | IEnumerable states = animation.GetStates(); 60 | var it = states.GetEnumerator(); 61 | animation.RemoveState("SingleClip"); 62 | Assert.Throws(() => { it.MoveNext(); }); 63 | } 64 | } 65 | 66 | public class PrefabBased 67 | { 68 | [UnityTest] 69 | public IEnumerator PlayAutomatically_False_DoesNotMoveObject() 70 | { 71 | var prefab = Resources.Load("WithSimpleAnimation"); 72 | var simpleAnim = prefab.GetComponent(); 73 | simpleAnim.playAutomatically = false; 74 | var instance = GameObject.Instantiate(prefab); 75 | yield return new WaitForSeconds(0.1f); 76 | Assert.Zero(instance.transform.position.magnitude); 77 | 78 | yield return null; 79 | } 80 | 81 | [UnityTest] 82 | public IEnumerator PlayAutomatically_True_DoesMoveObject() 83 | { 84 | var prefab = Resources.Load("WithSimpleAnimation"); 85 | prefab.GetComponent().playAutomatically = true; 86 | var instance = GameObject.Instantiate(prefab); 87 | yield return new WaitForSeconds(0.1f); 88 | Assert.Zero(instance.transform.position.magnitude); 89 | 90 | yield return null; 91 | } 92 | } 93 | 94 | public class LegacyClips 95 | { 96 | [Test] 97 | public void SetClip_WithLegacyClip_Throws_ArgumentException() 98 | { 99 | SimpleAnimation animation = Instantiate(); 100 | var clip = new AnimationClip(); 101 | clip.legacy = true; 102 | Assert.Throws(() => { animation.clip = clip; }); 103 | } 104 | 105 | [Test] 106 | public void AddClip_WithLegacyClip_Throws_ArgumentException() 107 | { 108 | SimpleAnimation animation = Instantiate(); 109 | var clip = new AnimationClip(); 110 | clip.legacy = true; 111 | Assert.Throws(() => { animation.AddClip(clip, "DefaultName");}); 112 | } 113 | 114 | [Test] 115 | public void AddState_WithLegacyClip_Throws_ArgumentException() 116 | { 117 | SimpleAnimation animation = Instantiate(); 118 | var clip = new AnimationClip(); 119 | clip.legacy = true; 120 | Assert.Throws(() => { animation.AddState(clip, "DefaultName"); }); 121 | } 122 | } 123 | 124 | 125 | //Event Receiver for FiresEvent AnimationClip 126 | public class ReceivesEvent : MonoBehaviour 127 | { 128 | public int eventCount; 129 | 130 | void Event() 131 | { 132 | eventCount++; 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/PlaymodeTests/SimpleAnimationTests.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c4dfe8c4d18124458dbd9a5c201a9f2 3 | timeCreated: 1502400329 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/SimpleAnimation-Tests.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SimpleAnimation-Tests", 3 | "references": [ 4 | "SimpleAnimationComponent" 5 | ], 6 | "optionalUnityReferences": [ 7 | "TestAssemblies" 8 | ], 9 | "includePlatforms": [], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [] 16 | } -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/SimpleAnimation-Tests.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c66b2379592b6f342ab84dff25cdc77d 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/SimpleAnimationProxy.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [RequireComponent(typeof(SimpleAnimation))] 6 | public class SimpleAnimationProxy : MonoBehaviour, IAnimation 7 | { 8 | private class SimpleAnimationStateProxy: IAnimationState 9 | { 10 | public SimpleAnimationStateProxy(SimpleAnimation.State state) 11 | { 12 | m_State = state; 13 | } 14 | 15 | private SimpleAnimation.State m_State; 16 | 17 | public bool enabled 18 | { 19 | get { return m_State.enabled; } 20 | set { m_State.enabled = value; } 21 | } 22 | 23 | public bool isValid 24 | { 25 | get { return m_State.isValid; } 26 | } 27 | 28 | public float time 29 | { 30 | get { return m_State.time; } 31 | set { m_State.time = value; } 32 | } 33 | public float normalizedTime 34 | { 35 | get { return m_State.normalizedTime; } 36 | set { m_State.normalizedTime = value; } 37 | } 38 | public float speed 39 | { 40 | get { return m_State.speed; } 41 | set { m_State.speed = value; } 42 | } 43 | 44 | public string name 45 | { 46 | get { return m_State.name; } 47 | set { m_State.name = value; } 48 | } 49 | public float weight 50 | { 51 | get { return m_State.weight; } 52 | set { m_State.weight = value; } 53 | } 54 | public float length 55 | { 56 | get { return m_State.length; } 57 | } 58 | 59 | public AnimationClip clip 60 | { 61 | get { return m_State.clip; } 62 | } 63 | 64 | public WrapMode wrapMode 65 | { 66 | get { return m_State.wrapMode; } 67 | set { m_State.wrapMode = value; } 68 | } 69 | } 70 | 71 | private SimpleAnimation m_SimpleAnimation; 72 | 73 | private SimpleAnimation impl 74 | { 75 | get 76 | { 77 | if (m_SimpleAnimation == null) 78 | { 79 | m_SimpleAnimation = GetComponent(); 80 | } 81 | return m_SimpleAnimation; 82 | } 83 | } 84 | 85 | public bool animatePhysics 86 | { 87 | get { return impl.animatePhysics; } 88 | set { impl.animatePhysics = value; } 89 | } 90 | 91 | public AnimatorCullingMode cullingMode 92 | { 93 | get 94 | { 95 | return impl.cullingMode; 96 | } 97 | 98 | set 99 | { 100 | impl.cullingMode = value; 101 | } 102 | } 103 | 104 | public bool isPlaying 105 | { 106 | get { return impl.isPlaying; } 107 | } 108 | 109 | public bool playAutomatically 110 | { 111 | get { return impl.playAutomatically; } 112 | set { impl.playAutomatically = value; } 113 | } 114 | 115 | public WrapMode wrapMode 116 | { 117 | get { return impl.wrapMode; } 118 | set { impl.wrapMode = value; } 119 | } 120 | 121 | public AnimationClip clip 122 | { 123 | get { return impl.clip; } 124 | set { impl.clip = value; } 125 | } 126 | 127 | public bool usesLegacy 128 | { 129 | get { return false; } 130 | } 131 | new public GameObject gameObject 132 | { 133 | get { return impl.gameObject; } 134 | } 135 | 136 | public void AddClip(AnimationClip clip, string newName) 137 | { 138 | impl.AddClip(clip, newName); 139 | } 140 | 141 | public void Blend(string state, float targetWeight, float fadeLength) 142 | { 143 | impl.Blend(state, targetWeight, fadeLength); 144 | } 145 | 146 | public void CrossFade(string state, float fadeLength) 147 | { 148 | impl.CrossFade(state, fadeLength); 149 | } 150 | 151 | public void CrossFadeQueued(string state, float fadeLength, QueueMode queueMode) 152 | { 153 | impl.CrossFadeQueued(state, fadeLength, queueMode); 154 | } 155 | 156 | public int GetClipCount() 157 | { 158 | return impl.GetClipCount(); 159 | } 160 | 161 | public bool IsPlaying(string stateName) 162 | { 163 | return impl.IsPlaying(stateName); 164 | } 165 | 166 | public void Stop() 167 | { 168 | impl.Stop(); 169 | } 170 | 171 | public void Stop(string stateName) 172 | { 173 | impl.Stop(stateName); 174 | } 175 | 176 | public void Sample() 177 | { 178 | impl.Sample(); 179 | } 180 | 181 | public bool Play() 182 | { 183 | return impl.Play(); 184 | } 185 | 186 | public bool Play(string stateName) 187 | { 188 | return impl.Play(stateName); 189 | } 190 | 191 | public void PlayQueued(string stateName, QueueMode queueMode) 192 | { 193 | impl.PlayQueued(stateName, queueMode); 194 | } 195 | 196 | public void RemoveClip(AnimationClip clip) 197 | { 198 | impl.RemoveClip(clip); 199 | } 200 | 201 | public void RemoveClip(string stateName) 202 | { 203 | impl.RemoveState(stateName); 204 | } 205 | 206 | public void Rewind() 207 | { 208 | impl.Rewind(); 209 | } 210 | 211 | public void Rewind(string stateName) 212 | { 213 | impl.Rewind(stateName); 214 | } 215 | 216 | public IAnimationState GetState(string stateName) 217 | { 218 | SimpleAnimation.State state = impl[stateName]; 219 | if (state != null) 220 | return new SimpleAnimationStateProxy(state); 221 | 222 | return null; 223 | } 224 | 225 | public IAnimationState this[string name] 226 | { 227 | get { return GetState(name); } 228 | } 229 | 230 | 231 | } 232 | -------------------------------------------------------------------------------- /Assets/SimpleAnimationComponent/Tests/SimpleAnimationProxy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3879189febbd4043b9dd6392d965c15 3 | timeCreated: 1499690070 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Unity Technologies 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SimpleAnimation 2 | 3 | This is a sample that shows how to use Playable Graphs to animate objects in a manner similar to the Animation Component. 4 | 5 | ## This repository is archived. The last compatible version tested is Unity 2018.3, though we expect the code to still be compatible with Unity 2019.3. 6 | --------------------------------------------------------------------------------