diff --git a/AnimationPath/Assets/AnimationPath/Editor/AnimationPathPoint.cs b/AnimationPath/Assets/AnimationPath/Editor/AnimationPathPoint.cs index a3e81a3..ed6952a 100644 --- a/AnimationPath/Assets/AnimationPath/Editor/AnimationPathPoint.cs +++ b/AnimationPath/Assets/AnimationPath/Editor/AnimationPathPoint.cs @@ -19,8 +19,16 @@ public AnimationPathPoint(Keyframe keyframeX, Keyframe keyframeY, Keyframe keyfr position = new Vector3(keyframeX.value, keyframeY.value, keyframeZ.value); inTangent = new Vector3(keyframeX.inTangent, keyframeY.inTangent, keyframeZ.inTangent); outTangent = new Vector3(keyframeX.outTangent, keyframeY.outTangent, keyframeZ.outTangent); +#pragma warning disable CS0618 // 类型或成员已过时 + +#pragma warning disable CS0618 // 类型或成员已过时 tangentMode = new[] {keyframeX.tangentMode, keyframeY.tangentMode, keyframeZ.tangentMode}; +#pragma warning restore CS0618 // 类型或成员已过时 + +#pragma warning disable CS0618 // 类型或成员已过时 +#pragma warning restore CS0618 // 类型或成员已过时 } +#pragma warning restore CS0618 // 类型或成员已过时 public static void CalcTangents(AnimationPathPoint pathPoint, AnimationPathPoint nextPathPoint, out Vector3 startTangent, out Vector3 endTangent) @@ -39,40 +47,52 @@ public static void CalcTangents(AnimationPathPoint pathPoint, AnimationPathPoint endTangent.z -= (dx * nextPathPoint.inTangent.z * 1 / 3); } - public static List MakePoints(AnimationCurve curveX, AnimationCurve curveY, AnimationCurve curveZ) + public static List MakePoints(AnimationCurve curveX, AnimationCurve curveY, AnimationCurve curveZ, Vector3 initPosition) { List points = new List(); List times = new List(); - for (int i = 0; i < curveX.length; i++) + if (curveX != null) { - if (!times.Contains(curveX.keys[i].time)) + for (int i = 0; i < curveX.length; i++) { - times.Add(curveX.keys[i].time); + if (!times.Contains(curveX.keys[i].time)) + { + times.Add(curveX.keys[i].time); + } } } - for (int i = 0; i < curveY.length; i++) + + if (curveY != null) { - if (!times.Contains(curveY.keys[i].time)) + for (int i = 0; i < curveY.length; i++) { - times.Add(curveY.keys[i].time); + if (!times.Contains(curveY.keys[i].time)) + { + times.Add(curveY.keys[i].time); + } } } - for (int i = 0; i < curveZ.length; i++) + + if (curveZ != null) { - if (!times.Contains(curveZ.keys[i].time)) + for (int i = 0; i < curveZ.length; i++) { - times.Add(curveZ.keys[i].time); + if (!times.Contains(curveZ.keys[i].time)) + { + times.Add(curveZ.keys[i].time); + } } } + times.Sort(); for (int i = 0; i < times.Count; i++) { float time = times[i]; AnimationPathPoint pathPoint = new AnimationPathPoint( - GetKeyframeAtTime(curveX, time), - GetKeyframeAtTime(curveY, time), - GetKeyframeAtTime(curveZ, time) + GetKeyframeAtTime(curveX, time, initPosition.x), + GetKeyframeAtTime(curveY, time, initPosition.y), + GetKeyframeAtTime(curveZ, time, initPosition.z) ); points.Add(pathPoint); } @@ -80,8 +100,13 @@ public static List MakePoints(AnimationCurve curveX, Animati return points; } - private static Keyframe GetKeyframeAtTime(AnimationCurve curve, float time) + private static Keyframe GetKeyframeAtTime(AnimationCurve curve, float time, float initVal) { + if (curve == null) + { + return new Keyframe(time, initVal); + } + for (int j = 0; j < curve.length; j++) { if (Mathf.Approximately(curve.keys[j].time, time)) @@ -140,8 +165,15 @@ public static void ModifyPointTangent(AnimationPathPoint pathPoint, AnimationPat private static void ModifyCurveAtKeyframe(AnimationCurve curve, float time, float value, float inTangent, float outTangent, int tangentMode, int leftRight) { + if (curve == null) + { + return; + } + Keyframe keyframe = new Keyframe(time, value, inTangent, outTangent); +#pragma warning disable CS0618 // 类型或成员已过时 keyframe.tangentMode = tangentMode; +#pragma warning restore CS0618 // 类型或成员已过时 ModifyPointTangentMode(ref keyframe, leftRight); for (int j = 0; j < curve.length; j++) diff --git a/AnimationPath/Assets/AnimationPath/Editor/AnimationPathSceneGUI.cs b/AnimationPath/Assets/AnimationPath/Editor/AnimationPathSceneGUI.cs index 014b341..0bfba4d 100644 --- a/AnimationPath/Assets/AnimationPath/Editor/AnimationPathSceneGUI.cs +++ b/AnimationPath/Assets/AnimationPath/Editor/AnimationPathSceneGUI.cs @@ -93,11 +93,15 @@ public static void OpenSceneTool(GameObject go) } InitPointsInfo(); - AnimationWindowUtil.SetOnClipSelectionChanged(onClipSelectionChanged); + AnimationWindowUtil.SetOnFrameRateChange(onClipSelectionChanged); AnimationUtility.onCurveWasModified += OnCurveWasModified; if (keepShow) { +#if UNITY_2019_1_OR_NEWER + SceneView.duringSceneGui += OnSceneViewGUI; +#else SceneView.onSceneGUIDelegate = (SceneView.OnSceneFunc)Delegate.Combine(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(OnSceneViewGUI)); +#endif } enabled = true; @@ -108,20 +112,34 @@ private static void CloseSceneTool() { selectedPointIndex = -1; enabled = false; - AnimationWindowUtil.SetOnClipSelectionChanged(onClipSelectionChanged, true); + AnimationWindowUtil.SetOnFrameRateChange(onClipSelectionChanged, true); AnimationUtility.onCurveWasModified -= OnCurveWasModified; + + +#if UNITY_2019_1_OR_NEWER + SceneView.duringSceneGui -= OnSceneViewGUI; +#else SceneView.onSceneGUIDelegate = (SceneView.OnSceneFunc)Delegate.RemoveAll(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(OnSceneViewGUI)); +#endif SceneView.RepaintAll(); } public static void SetKeepShow(bool show) { keepShow = show; +#if UNITY_2019_1_OR_NEWER + SceneView.duringSceneGui -= OnSceneViewGUI; + if (keepShow) + { + SceneView.duringSceneGui += OnSceneViewGUI; + } +#else SceneView.onSceneGUIDelegate = (SceneView.OnSceneFunc)Delegate.RemoveAll(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(OnSceneViewGUI)); if (keepShow) { SceneView.onSceneGUIDelegate = (SceneView.OnSceneFunc)Delegate.Combine(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(OnSceneViewGUI)); } +#endif SceneView.RepaintAll(); } @@ -155,14 +173,32 @@ private static bool InitPointsInfo() AnimationCurve curveX = AnimationUtility.GetEditorCurve(activeAnimationClip, EditorCurveBinding.FloatCurve(inPath, inType, "m_LocalPosition.x")); AnimationCurve curveY = AnimationUtility.GetEditorCurve(activeAnimationClip, EditorCurveBinding.FloatCurve(inPath, inType, "m_LocalPosition.y")); AnimationCurve curveZ = AnimationUtility.GetEditorCurve(activeAnimationClip, EditorCurveBinding.FloatCurve(inPath, inType, "m_LocalPosition.z")); + Vector3 initPosition = activeRootGameObject.transform.localPosition; if (curveX == null || curveY == null || curveZ == null) { - //Debug.LogError(activeGameObject.name + " 必须要有完整的 Position 动画曲线!"); - return false; + // 有可能是UI的动画 + var rt = activeRootGameObject.transform.GetComponent(); + if (rt) + { + inType = typeof(RectTransform); + curveX = AnimationUtility.GetEditorCurve(activeAnimationClip, EditorCurveBinding.FloatCurve(inPath, inType, "m_AnchoredPosition.x")); + curveY = AnimationUtility.GetEditorCurve(activeAnimationClip, EditorCurveBinding.FloatCurve(inPath, inType, "m_AnchoredPosition.y")); + curveZ = AnimationUtility.GetEditorCurve(activeAnimationClip, EditorCurveBinding.FloatCurve(inPath, inType, "m_AnchoredPosition.z")); + initPosition = rt.anchoredPosition; + + if (curveX == null && curveY == null && curveZ == null) + { + return false; + } + } + else + { + return false; + } } - animationPoints = AnimationPathPoint.MakePoints(curveX, curveY, curveZ); + animationPoints = AnimationPathPoint.MakePoints(curveX, curveY, curveZ, initPosition); return true; } @@ -239,7 +275,11 @@ private static void DrawSceneViewGUI() float pointHandleSize = HandleUtility.GetHandleSize(position) * 0.04f; float pointPickSize = pointHandleSize * 0.7f; Handles.Label(position, " Point " + i); +#if UNITY_5_6_OR_NEWER + if (Handles.Button(position, handleRotation, pointHandleSize, pointPickSize, Handles.DotHandleCap)) +#else if (Handles.Button(position, handleRotation, pointHandleSize, pointPickSize, Handles.DotCap)) +#endif { selectedPointIndex = pointIndex; if (Selection.activeGameObject != activeGameObject) @@ -260,7 +300,11 @@ private static void DrawSceneViewGUI() if (i != 0) { Handles.DrawLine(position, pathPoint.worldInTangent); +#if UNITY_5_6_OR_NEWER + if (Handles.Button(pathPoint.worldInTangent, handleRotation, pointHandleSize, pointPickSize, Handles.DotHandleCap)) +#else if (Handles.Button(pathPoint.worldInTangent, handleRotation, pointHandleSize, pointPickSize, Handles.DotCap)) +#endif { selectedPointIndex = inIndex; } @@ -279,7 +323,11 @@ private static void DrawSceneViewGUI() if (i != numPos - 1) { Handles.DrawLine(position, pathPoint.worldOutTangent); +#if UNITY_5_6_OR_NEWER + if (Handles.Button(pathPoint.worldOutTangent, handleRotation, pointHandleSize, pointPickSize, Handles.DotHandleCap)) +#else if (Handles.Button(pathPoint.worldOutTangent, handleRotation, pointHandleSize, pointPickSize, Handles.DotCap)) +#endif { selectedPointIndex = outIndex; } @@ -307,7 +355,7 @@ private static void OnCurveWasModified(AnimationClip clip, EditorCurveBinding bi reloadPointsInfo = true; } - private static void onClipSelectionChanged() + private static void onClipSelectionChanged(float frameRate) { if (enabled && !keepShow) { @@ -360,15 +408,45 @@ private static bool SetPointTangent(int pointIndex, Vector3 worldTangent, bool i if (curveX == null || curveY == null || curveZ == null) { - return false; + var rt = activeRootGameObject.transform.GetComponent(); + if (rt) + { + inType = typeof(RectTransform); + bindingX = EditorCurveBinding.FloatCurve(inPath, inType, "m_AnchoredPosition.x"); + bindingY = EditorCurveBinding.FloatCurve(inPath, inType, "m_AnchoredPosition.y"); + bindingZ = EditorCurveBinding.FloatCurve(inPath, inType, "m_AnchoredPosition.z"); + curveX = AnimationUtility.GetEditorCurve(activeAnimationClip, bindingX); + curveY = AnimationUtility.GetEditorCurve(activeAnimationClip, bindingY); + curveZ = AnimationUtility.GetEditorCurve(activeAnimationClip, bindingZ); + + if (curveX == null && curveY == null && curveZ == null) + { + return false; + } + } + else + { + return false; + } } AnimationPathPoint.ModifyPointTangent(pathPoint, nextPathPoint, offset, isInTangent, curveX, curveY, curveZ); Undo.RegisterCompleteObjectUndo(activeAnimationClip, "Edit Curve"); - AnimationUtility.SetEditorCurve(activeAnimationClip, bindingX, curveX); - AnimationUtility.SetEditorCurve(activeAnimationClip, bindingY, curveY); - AnimationUtility.SetEditorCurve(activeAnimationClip, bindingZ, curveZ); + if (curveX != null) + { + AnimationUtility.SetEditorCurve(activeAnimationClip, bindingX, curveX); + } + + if (curveY != null) + { + AnimationUtility.SetEditorCurve(activeAnimationClip, bindingY, curveY); + } + + if (curveZ != null) + { + AnimationUtility.SetEditorCurve(activeAnimationClip, bindingZ, curveZ); + } AnimationWindowUtil.Repaint(); return true; diff --git a/AnimationPath/Assets/AnimationPath/Editor/AnimationWindowReflect.cs b/AnimationPath/Assets/AnimationPath/Editor/AnimationWindowReflect.cs index ff86d19..c1e0ace 100644 --- a/AnimationPath/Assets/AnimationPath/Editor/AnimationWindowReflect.cs +++ b/AnimationPath/Assets/AnimationPath/Editor/AnimationWindowReflect.cs @@ -17,6 +17,7 @@ public class AnimationWindowReflect private object m_AnimEditor; private object m_AnimationWindowState; private object m_AnimationWindowSelection; + private object m_AnimationWindowSelectionItem; private PropertyInfo m_playingInfo; private PropertyInfo m_recordingInfo; private PropertyInfo m_currentTimeInfo; @@ -25,6 +26,9 @@ public class AnimationWindowReflect private FieldInfo m_onClipSelectionChangedInfo; private Func m_CurrentTimeGetFunc; private MethodInfo m_ResampleAnimationMethod; + private MethodInfo m_UpdateClipMethodInfo; + private MethodInfo m_StartRecordingethodInfo; + private FieldInfo m_onFrameRateChangeInfo; private Assembly assembly { @@ -95,7 +99,13 @@ public EditorWindow firstAnimationWindow { if (m_FirstAnimationWindow == null) { - MethodInfo getAllAnimationWindowsInfo = animationWindowType.GetMethod("GetAllAnimationWindows", BindingFlags.Public | BindingFlags.Static); + MethodInfo getAllAnimationWindowsInfo = animationWindowType.GetMethod("GetAllAnimationWindows", +#if UNITY_2020_2_OR_NEWER + BindingFlags.NonPublic +#else + BindingFlags.Public +#endif + | BindingFlags.Static); IList animationWindows = getAllAnimationWindowsInfo.Invoke(null, null) as IList; if (animationWindows.Count > 0) { @@ -154,6 +164,22 @@ private object animationWindowSelection } } + private object animationWindowSelectionItem + { + get + { + if (m_AnimationWindowSelectionItem == null) + { + PropertyInfo selectionInfo = animationWindowStateType.GetProperty("selectedItem", BindingFlags.Instance | BindingFlags.Public); + if (animationWindowState != null) + { + m_AnimationWindowSelectionItem = selectionInfo.GetValue(animationWindowState, null); + } + } + return m_AnimationWindowSelectionItem; + } + } + private PropertyInfo playingInfo { get @@ -171,10 +197,14 @@ private PropertyInfo playingInfo /// public bool playing { - get { return (bool) playingInfo.GetValue(animationWindowState, null); } + get { return (bool)playingInfo.GetValue(animationWindowState, null); } +#if UNITY_5_6_OR_NEWER + set { } +#else set { playingInfo.SetValue(animationWindowState, value, null); } +#endif } - + private PropertyInfo recordingInfo { get @@ -193,7 +223,21 @@ private PropertyInfo recordingInfo public bool recording { get { return (bool)recordingInfo.GetValue(animationWindowState, null); } +#if UNITY_5_6_OR_NEWER + set + { + if (value) + { + StartRecording(); + } + else + { + AnimationMode.StopAnimationMode(); + } + } +#else set { recordingInfo.SetValue(animationWindowState, value, null); } +#endif } private PropertyInfo currentTimeInfo @@ -241,7 +285,7 @@ private PropertyInfo activeRootGameObjectInfo /// public GameObject activeRootGameObject { - get { return (GameObject) activeRootGameObjectInfo.GetValue(animationWindowState, null); } + get { return (GameObject)activeRootGameObjectInfo.GetValue(animationWindowState, null); } } private PropertyInfo activeAnimationClipInfo @@ -261,8 +305,12 @@ private PropertyInfo activeAnimationClipInfo /// public AnimationClip activeAnimationClip { - get { return (AnimationClip) activeAnimationClipInfo.GetValue(animationWindowState, null); } - set { activeAnimationClipInfo.SetValue(animationWindowState, value, null);} + get { return (AnimationClip)activeAnimationClipInfo.GetValue(animationWindowState, null); } +#if UNITY_5_4_OR_NEWER + set { UpdateClip(animationWindowSelectionItem, value); } +#else + set { activeAnimationClipInfo.SetValue(animationWindowState, value, null); } +#endif } private FieldInfo onClipSelectionChangedInfo @@ -281,6 +329,19 @@ private FieldInfo onClipSelectionChangedInfo } } + private FieldInfo onFrameRateChangeInfo + { + get + { + if (m_onFrameRateChangeInfo == null) + { + m_onFrameRateChangeInfo = animationWindowStateType.GetField("onFrameRateChange", BindingFlags.Instance | BindingFlags.Public); + } + + return m_onFrameRateChangeInfo; + } + } + /// /// 动画片段切换事件 /// @@ -294,13 +355,40 @@ public Action onClipSelectionChanged set { onClipSelectionChangedInfo.SetValue(animationWindowState, value);} #endif } - + + public Action onFrameRateChange + { + get { return (Action)onFrameRateChangeInfo.GetValue(animationWindowState); } + set { onFrameRateChangeInfo.SetValue(animationWindowState, value); } + } + public void ResampleAnimation() { +#if UNITY_5_6_OR_NEWER +#else if (m_ResampleAnimationMethod == null) { m_ResampleAnimationMethod = animationWindowStateType.GetMethod("ResampleAnimation", BindingFlags.Instance | BindingFlags.Public); } m_ResampleAnimationMethod.Invoke(animationWindowState, null); +#endif + } + + private void UpdateClip(object itemToUpdate, AnimationClip newClip) + { + if (m_UpdateClipMethodInfo == null) + { + m_UpdateClipMethodInfo = animationWindowSelectionType.GetMethod("UpdateClip", BindingFlags.Instance | BindingFlags.Public); + } + m_UpdateClipMethodInfo.Invoke(animationWindowSelection, new[] { itemToUpdate, newClip }); + } + + private void StartRecording() + { + if (m_StartRecordingethodInfo == null) + { + m_StartRecordingethodInfo = animationWindowStateType.GetMethod("StartRecording", BindingFlags.Instance | BindingFlags.Public); + } + m_StartRecordingethodInfo.Invoke(animationWindowState, null); } } diff --git a/AnimationPath/Assets/AnimationPath/Editor/AnimationWindowUtil.cs b/AnimationPath/Assets/AnimationPath/Editor/AnimationWindowUtil.cs index 0df9582..ab8e88b 100644 --- a/AnimationPath/Assets/AnimationPath/Editor/AnimationWindowUtil.cs +++ b/AnimationPath/Assets/AnimationPath/Editor/AnimationWindowUtil.cs @@ -97,6 +97,28 @@ public static bool SetActiveAnimationClip(string clipName) return true; } + /// + /// 设置动画窗口的当前动画片段项 + /// + /// + public static bool SetActiveAnimationClip(AnimationClip clip) + { + AnimationWindowReflect animationWindowReflect = GetAnimationWindowReflect(); + if (!animationWindowReflect.firstAnimationWindow) + { + return false; + } + GameObject activeRootGameObject = animationWindowReflect.activeRootGameObject; + if (activeRootGameObject == null) + { + Debug.Log("没有动画 activeRootGameObject!"); + return false; + } + + animationWindowReflect.activeAnimationClip = clip; + return true; + } + /// /// 获取当前活动的动画片段 /// @@ -128,6 +150,23 @@ public static void SetOnClipSelectionChanged(Action onClipSelectionChangedAction animationWindowReflect.onClipSelectionChanged = onClipSelectionChanged; } + public static void SetOnFrameRateChange(Action onFrameRateChangeAction, bool removeOnly = false) + { + AnimationWindowReflect animationWindowReflect = GetAnimationWindowReflect(); + if (!animationWindowReflect.firstAnimationWindow) + { + return; + } + + Action onFrameRateChange = animationWindowReflect.onFrameRateChange; + onFrameRateChange = (Action)Delegate.RemoveAll(onFrameRateChange, onFrameRateChangeAction); + if (!removeOnly) + { + onFrameRateChange = (Action)Delegate.Combine(onFrameRateChange, onFrameRateChangeAction); + } + animationWindowReflect.onFrameRateChange = onFrameRateChange; + } + public static void SetCurrentTime(float time) { AnimationWindowReflect animationWindowReflect = GetAnimationWindowReflect(); @@ -137,9 +176,11 @@ public static void SetCurrentTime(float time) } animationWindowReflect.currentTime = time; +#if !UNITY_5_6_OR_NEWER animationWindowReflect.recording = true; animationWindowReflect.playing = false; animationWindowReflect.ResampleAnimation(); +#endif animationWindowReflect.firstAnimationWindow.Repaint(); } @@ -165,7 +206,7 @@ public static void Repaint() animationWindowReflect.firstAnimationWindow.Repaint(); } - private static AnimationWindowReflect GetAnimationWindowReflect() + public static AnimationWindowReflect GetAnimationWindowReflect() { AnimationWindowReflect animationWindowReflect = new AnimationWindowReflect(); if (!animationWindowReflect.firstAnimationWindow) diff --git a/AnimationPath/Assets/AnimationPath/Editor/CurveUtil.cs b/AnimationPath/Assets/AnimationPath/Editor/CurveUtil.cs index f968c62..985d10e 100644 --- a/AnimationPath/Assets/AnimationPath/Editor/CurveUtil.cs +++ b/AnimationPath/Assets/AnimationPath/Editor/CurveUtil.cs @@ -14,30 +14,45 @@ public static void SetKeyBroken(ref Keyframe key, bool broken) { if (broken) { +#pragma warning disable CS0618 // 类型或成员已过时 key.tangentMode |= 1; +#pragma warning restore CS0618 // 类型或成员已过时 } else { +#pragma warning disable CS0618 // 类型或成员已过时 key.tangentMode &= -2; +#pragma warning restore CS0618 // 类型或成员已过时 } } public static bool GetKeyBroken(Keyframe key) { +#pragma warning disable CS0618 // 类型或成员已过时 return (key.tangentMode & 1) != 0; +#pragma warning restore CS0618 // 类型或成员已过时 } public static void SetKeyTangentMode(ref Keyframe key, int leftRight, TangentMode mode) { if (leftRight == 0) { +#pragma warning disable CS0618 // 类型或成员已过时 key.tangentMode &= -7; +#pragma warning restore CS0618 // 类型或成员已过时 +#pragma warning disable CS0618 // 类型或成员已过时 key.tangentMode |= (int)((int)mode << 1); +#pragma warning restore CS0618 // 类型或成员已过时 } else { +#pragma warning disable CS0618 // 类型或成员已过时 key.tangentMode &= -25; +#pragma warning restore CS0618 // 类型或成员已过时 + +#pragma warning disable CS0618 // 类型或成员已过时 key.tangentMode |= (int)((int)mode << 3); +#pragma warning restore CS0618 // 类型或成员已过时 } if (GetKeyTangentMode(key, leftRight) != mode) { @@ -49,8 +64,12 @@ public static TangentMode GetKeyTangentMode(Keyframe key, int leftRight) { if (leftRight == 0) { +#pragma warning disable CS0618 // 类型或成员已过时 return (TangentMode)((key.tangentMode & 6) >> 1); +#pragma warning restore CS0618 // 类型或成员已过时 } +#pragma warning disable CS0618 // 类型或成员已过时 return (TangentMode)((key.tangentMode & 24) >> 3); +#pragma warning restore CS0618 // 类型或成员已过时 } } diff --git a/AnimationPath/Assets/AnimationPathDemo/Demo.unity b/AnimationPath/Assets/AnimationPathDemo/Demo.unity index e6b85bf..b0891e2 100644 --- a/AnimationPath/Assets/AnimationPathDemo/Demo.unity +++ b/AnimationPath/Assets/AnimationPathDemo/Demo.unity @@ -1,19 +1,19 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 -SceneSettings: +OcclusionCullingSettings: m_ObjectHideFlags: 0 - m_PVSData: - m_PVSObjectsArray: [] - m_PVSPortalsArray: [] + serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 smallestHole: 0.25 backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 9 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} m_HaloStrength: 0.5 m_FlareStrength: 1 @@ -37,63 +38,90 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.4465785, g: 0.49641222, b: 0.57481694, a: 1} + m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 11 m_GIWorkflowMode: 0 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 m_IndirectOutputScale: 1 m_AlbedoBoost: 1 - m_TemporalCoherenceThreshold: 1 m_EnvironmentLightingMode: 0 m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 10 m_Resolution: 2 m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 + m_AtlasSize: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 1 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 m_LightingDataAsset: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_UseShadowmask: 0 --- !u!196 &4 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 + agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 agentSlope: 45 agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 - accuratePlacement: 0 minRegionArea: 2 - cellSize: 0.16666667 manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} --- !u!1 &153832268 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - 4: {fileID: 153832269} - - 114: {fileID: 153832270} + - component: {fileID: 153832269} + - component: {fileID: 153832270} m_Layer: 0 m_Name: Offset m_TagString: Untagged @@ -104,21 +132,23 @@ GameObject: --- !u!4 &153832269 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 153832268} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 360, y: 360, z: 360} m_Children: [] m_Father: {fileID: 723627131} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 360, y: 360, z: 360} --- !u!114 &153832270 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 153832268} m_Enabled: 1 m_EditorHideFlags: 0 @@ -128,12 +158,13 @@ MonoBehaviour: --- !u!1 &208111431 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - 4: {fileID: 208111432} - - 114: {fileID: 208111433} + - component: {fileID: 208111432} + - component: {fileID: 208111433} m_Layer: 0 m_Name: Child m_TagString: Untagged @@ -144,21 +175,23 @@ GameObject: --- !u!4 &208111432 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 208111431} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -20.6, y: 9.2, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 584304370} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &208111433 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 208111431} m_Enabled: 1 m_EditorHideFlags: 0 @@ -168,13 +201,14 @@ MonoBehaviour: --- !u!1 &366563633 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - 4: {fileID: 366563636} - - 95: {fileID: 366563635} - - 114: {fileID: 366563634} + - component: {fileID: 366563636} + - component: {fileID: 366563635} + - component: {fileID: 366563634} m_Layer: 0 m_Name: Demo1 m_TagString: Untagged @@ -185,8 +219,9 @@ GameObject: --- !u!114 &366563634 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 366563633} m_Enabled: 1 m_EditorHideFlags: 0 @@ -197,8 +232,9 @@ MonoBehaviour: Animator: serializedVersion: 3 m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 366563633} m_Enabled: 1 m_Avatar: {fileID: 0} @@ -210,28 +246,138 @@ Animator: m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 --- !u!4 &366563636 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 366563633} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0.382979, z: -0, w: 0.9237571} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: -45.037003, z: 0} +--- !u!1 &502810185 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 502810186} + - component: {fileID: 502810190} + - component: {fileID: 502810189} + - component: {fileID: 502810188} + - component: {fileID: 502810187} + m_Layer: 5 + m_Name: Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &502810186 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 502810185} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 880631770} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -52, y: -277.5} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &502810187 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 502810185} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ab9eb02f344d7814baab2eafdbccf659, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!95 &502810188 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 502810185} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 4c34ff358bec6b8478646245c177179f, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &502810189 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 502810185} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &502810190 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 502810185} + m_CullTransparentMesh: 0 --- !u!1 &584304368 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - 4: {fileID: 584304370} - - 95: {fileID: 584304369} + - component: {fileID: 584304370} + - component: {fileID: 584304369} m_Layer: 0 m_Name: Demo3 m_TagString: Untagged @@ -243,8 +389,9 @@ GameObject: Animator: serializedVersion: 3 m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 584304368} m_Enabled: 1 m_Avatar: {fileID: 0} @@ -256,30 +403,33 @@ Animator: m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 --- !u!4 &584304370 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 584304368} m_LocalRotation: {x: 0.12146058, y: 0.7148771, z: -0.15692946, w: 0.67050076} m_LocalPosition: {x: -41.9, y: 23.3, z: 11.4} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 22.7834, y: 93.208595, z: -2.2865} m_Children: - {fileID: 208111432} m_Father: {fileID: 0} m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 22.7834, y: 93.208595, z: -2.2865} --- !u!1 &596332300 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - 4: {fileID: 596332301} - - 95: {fileID: 596332303} - - 114: {fileID: 596332302} + - component: {fileID: 596332301} + - component: {fileID: 596332303} + - component: {fileID: 596332302} m_Layer: 0 m_Name: Demo1copy m_TagString: Untagged @@ -290,21 +440,23 @@ GameObject: --- !u!4 &596332301 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 596332300} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 11.892427, y: -10.635793, z: -4.4474087} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 1929818029} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: -185.49599, z: 0} --- !u!114 &596332302 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 596332300} m_Enabled: 1 m_EditorHideFlags: 0 @@ -315,8 +467,9 @@ MonoBehaviour: Animator: serializedVersion: 3 m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 596332300} m_Enabled: 1 m_Avatar: {fileID: 0} @@ -328,15 +481,17 @@ Animator: m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 --- !u!1 &651317355 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - 4: {fileID: 651317357} - - 108: {fileID: 651317356} + - component: {fileID: 651317357} + - component: {fileID: 651317356} m_Layer: 0 m_Name: Directional Light m_TagString: Untagged @@ -347,11 +502,12 @@ GameObject: --- !u!108 &651317356 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 651317355} m_Enabled: 1 - serializedVersion: 6 + serializedVersion: 8 m_Type: 1 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 @@ -361,6 +517,7 @@ Light: m_Shadows: m_Type: 2 m_Resolution: -1 + m_CustomResolution: -1 m_Strength: 1 m_Bias: 0.05 m_NormalBias: 0.4 @@ -373,32 +530,37 @@ Light: serializedVersion: 2 m_Bits: 4294967295 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 - m_AreaSize: {x: 1, y: 1} --- !u!4 &651317357 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 651317355} m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605} m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} --- !u!1 &723627129 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - 4: {fileID: 723627131} - - 95: {fileID: 723627130} + - component: {fileID: 723627131} + - component: {fileID: 723627130} m_Layer: 0 m_Name: Demo5 m_TagString: Untagged @@ -410,8 +572,9 @@ GameObject: Animator: serializedVersion: 3 m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 723627129} m_Enabled: 1 m_Avatar: {fileID: 0} @@ -423,32 +586,134 @@ Animator: m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 --- !u!4 &723627131 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 723627129} m_LocalRotation: {x: -0.075912066, y: 0.7298552, z: 0.054658044, w: 0.6771715} m_LocalPosition: {x: -41.9, y: 23.3, z: 11.4} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: -10.521, y: 94.4861, z: -2.1441} m_Children: - {fileID: 153832269} m_Father: {fileID: 0} m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: -10.521, y: 94.4861, z: -2.1441} +--- !u!1 &880631766 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 880631770} + - component: {fileID: 880631769} + - component: {fileID: 880631768} + - component: {fileID: 880631767} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &880631767 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 880631766} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &880631768 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 880631766} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &880631769 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 880631766} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &880631770 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 880631766} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 502810186} + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} --- !u!1 &1185661358 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - 4: {fileID: 1185661363} - - 20: {fileID: 1185661362} - - 92: {fileID: 1185661361} - - 124: {fileID: 1185661360} - - 81: {fileID: 1185661359} + - component: {fileID: 1185661363} + - component: {fileID: 1185661362} + - component: {fileID: 1185661361} + - component: {fileID: 1185661360} + - component: {fileID: 1185661359} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -459,34 +724,43 @@ GameObject: --- !u!81 &1185661359 AudioListener: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1185661358} m_Enabled: 1 --- !u!124 &1185661360 Behaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1185661358} m_Enabled: 1 --- !u!92 &1185661361 Behaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1185661358} m_Enabled: 1 --- !u!20 &1185661362 Camera: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1185661358} m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} + m_projectionMatrixMode: 1 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_GateFitMode: 2 + m_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -507,33 +781,37 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 0 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 - m_StereoMirrorMode: 0 --- !u!4 &1185661363 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1185661358} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 1, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1651166903 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - 4: {fileID: 1651166906} - - 95: {fileID: 1651166905} - - 114: {fileID: 1651166904} + - component: {fileID: 1651166906} + - component: {fileID: 1651166905} + - component: {fileID: 1651166904} m_Layer: 0 m_Name: Demo4 m_TagString: Untagged @@ -544,8 +822,9 @@ GameObject: --- !u!114 &1651166904 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1651166903} m_Enabled: 1 m_EditorHideFlags: 0 @@ -556,8 +835,9 @@ MonoBehaviour: Animator: serializedVersion: 3 m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1651166903} m_Enabled: 1 m_Avatar: {fileID: 0} @@ -569,27 +849,30 @@ Animator: m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 --- !u!4 &1651166906 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1651166903} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -24.25187, y: 7.943733, z: 8.820229} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1929818028 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 m_Component: - - 4: {fileID: 1929818029} + - component: {fileID: 1929818029} m_Layer: 0 m_Name: Demo2 m_TagString: Untagged @@ -600,14 +883,81 @@ GameObject: --- !u!4 &1929818029 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1929818028} m_LocalRotation: {x: 0.0693066, y: -0.76325476, z: -0.0731877, w: 0.6381867} m_LocalPosition: {x: -4.52, y: 11.21, z: -11.2} m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: -1.3328999, y: -100.0653, z: -11.4939995} m_Children: - {fileID: 596332301} m_Father: {fileID: 0} m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: -1.3328999, y: -100.0653, z: -11.4939995} +--- !u!1 &2050563098 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2050563101} + - component: {fileID: 2050563100} + - component: {fileID: 2050563099} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2050563099 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2050563098} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &2050563100 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2050563098} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &2050563101 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2050563098} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/AnimationPath/Assets/AnimationPathDemo/Demo7.anim b/AnimationPath/Assets/AnimationPathDemo/Demo7.anim new file mode 100644 index 0000000..263d95e --- /dev/null +++ b/AnimationPath/Assets/AnimationPathDemo/Demo7.anim @@ -0,0 +1,215 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Demo7 + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -253 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 227 + inSlope: 430.51547 + outSlope: 430.51547 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.6166667 + value: 443 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_AnchoredPosition.x + path: + classID: 224 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -32 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 136 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.6166667 + value: -155 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_AnchoredPosition.y + path: + classID: 224 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 1460864421 + script: {fileID: 0} + typeID: 224 + customType: 28 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 538195251 + script: {fileID: 0} + typeID: 224 + customType: 28 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1.6166667 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -253 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 227 + inSlope: 430.51547 + outSlope: 430.51547 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.6166667 + value: 443 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_AnchoredPosition.x + path: + classID: 224 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -32 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 136 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.6166667 + value: -155 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_AnchoredPosition.y + path: + classID: 224 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/AnimationPath/Assets/AnimationPathDemo/Demo7.anim.meta b/AnimationPath/Assets/AnimationPathDemo/Demo7.anim.meta new file mode 100644 index 0000000..eb9041e --- /dev/null +++ b/AnimationPath/Assets/AnimationPathDemo/Demo7.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a9bab079a6100384a8d974165e032103 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/AnimationPath/Assets/AnimationPathDemo/Image.controller b/AnimationPath/Assets/AnimationPathDemo/Image.controller new file mode 100644 index 0000000..55496b8 --- /dev/null +++ b/AnimationPath/Assets/AnimationPathDemo/Image.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Image + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 1107291846637854700} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &1102997611356298940 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Demo7 + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: a9bab079a6100384a8d974165e032103, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &1107291846637854700 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 1102997611356298940} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 1102997611356298940} diff --git a/AnimationPath/Assets/AnimationPathDemo/Image.controller.meta b/AnimationPath/Assets/AnimationPathDemo/Image.controller.meta new file mode 100644 index 0000000..7d1859c --- /dev/null +++ b/AnimationPath/Assets/AnimationPathDemo/Image.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4c34ff358bec6b8478646245c177179f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/AnimationPath/Assets/TangentToConstant/Editor.meta b/AnimationPath/Assets/TangentToConstant/Editor.meta new file mode 100644 index 0000000..f2a4bfd --- /dev/null +++ b/AnimationPath/Assets/TangentToConstant/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 02d0a2ddbb9be154994c71d12a4b78ff +folderAsset: yes +timeCreated: 1533197525 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/AnimationPath/Assets/TangentToConstant/Editor/AnimationKeyframeTangentToConstantWindow.cs b/AnimationPath/Assets/TangentToConstant/Editor/AnimationKeyframeTangentToConstantWindow.cs new file mode 100644 index 0000000..5139c3f --- /dev/null +++ b/AnimationPath/Assets/TangentToConstant/Editor/AnimationKeyframeTangentToConstantWindow.cs @@ -0,0 +1,227 @@ +using System; +using System.Collections.Generic; +using System.IO; +using UnityEditor; +using UnityEngine; + +public class AnimationKeyframeTangentToConstantWindow : EditorWindow +{ + public static Action onClipCopyModify; + + [MenuItem("Tool/动画瞬帧工具")] + public static void Init() + { + EditorWindow editorWindow = GetWindow(true, "动画瞬切帧工具"); + editorWindow.minSize = new Vector2(160f, 30f); + editorWindow.maxSize = new Vector2(editorWindow.minSize.x, editorWindow.minSize.y); + } + + private void OnGUI() + { + EditorGUILayout.BeginHorizontal(); + if (GUILayout.Button("瞬切", "LargeButton", GUILayout.Width(150f))) + { + DoKeyframeTangentToConstant(); + } + EditorGUILayout.EndHorizontal(); + } + + private void DoKeyframeTangentToConstant() + { + AnimationWindowReflect animationWindowReflect = AnimationWindowUtil.GetAnimationWindowReflect(); + if (!animationWindowReflect.firstAnimationWindow) + { + SimpleDisplayDialog("Animation 窗口没有打开"); + return; + } + + AnimationClip activeAnimationClip = animationWindowReflect.activeAnimationClip; + if (activeAnimationClip == null) + { + SimpleDisplayDialog("Animation 窗口没有任何动画片段"); + return; + } + + float currentTime = animationWindowReflect.currentTime; + if ((activeAnimationClip.hideFlags & HideFlags.NotEditable) != HideFlags.None) + { + // FBX 动画则自动执行拷贝 + AnimationClip oldClip = activeAnimationClip; + activeAnimationClip = CopyAnimationClipAsset(activeAnimationClip); + animationWindowReflect.activeAnimationClip = activeAnimationClip; + animationWindowReflect.currentTime = currentTime; + if (onClipCopyModify != null) + { + onClipCopyModify(oldClip, activeAnimationClip); + } + } + + KeyframeTangentToConstant(activeAnimationClip, currentTime); + animationWindowReflect.firstAnimationWindow.Repaint(); + } + + private static void SimpleDisplayDialog(string text) + { + EditorUtility.DisplayDialog("提示", text, "确定"); + } + + /// + /// 参照 ProjectWindowUtil.DuplicateSelectedAssets + /// + /// + /// + private static AnimationClip CopyAnimationClipAsset(AnimationClip clip) + { + string assetPath = AssetDatabase.GetAssetPath(clip); + string path = AssetDatabase.GenerateUniqueAssetPath(Path.Combine(Path.GetDirectoryName(assetPath), + Path.GetFileNameWithoutExtension(assetPath)) + ".anim"); + AnimationClip animationClip2 = new AnimationClip(); + EditorUtility.CopySerialized(clip, animationClip2); + AssetDatabase.CreateAsset(animationClip2, path); + AssetDatabase.ImportAsset(path); + + if (Selection.activeObject == clip) + { + Selection.activeObject = animationClip2; + } + return animationClip2; + } + + private static void KeyframeTangentToConstant(AnimationClip clip, float time) + { + Undo.RegisterCompleteObjectUndo(clip, "Keyframe Tangent To Constant"); + EditorCurveBinding[] curveBindings = AnimationUtility.GetCurveBindings(clip); + SetInterpolation(clip, curveBindings, Mode.RawEuler); + curveBindings = AnimationUtility.GetCurveBindings(clip); + foreach (var curveBinding in curveBindings) + { + AnimationCurve animationCurve = AnimationUtility.GetEditorCurve(clip, curveBinding); + for (var i = 0; i < animationCurve.keys.Length; i++) + { + var keyframe = animationCurve.keys[i]; + if (Mathf.Approximately(keyframe.time, time)) + { + AnimationUtility.SetKeyRightTangentMode(animationCurve, i, AnimationUtility.TangentMode.Constant); + } + } + + AnimationUtility.SetEditorCurve(clip, curveBinding, animationCurve); + } + } + + private enum Mode + { + Baked, + NonBaked, + RawQuaternions, + RawEuler, + Undefined, + } + + private static bool IsTransformType(System.Type type) + { + return type == typeof(Transform) || type == typeof(RectTransform); + } + + private static Mode GetModeFromCurveData(EditorCurveBinding data) + { + if (IsTransformType(data.type) && data.propertyName.StartsWith("localEulerAngles")) + { + if (data.propertyName.StartsWith("localEulerAnglesBaked")) + return Mode.Baked; + return data.propertyName.StartsWith("localEulerAnglesRaw") ? Mode.RawEuler : Mode.NonBaked; + } + return IsTransformType(data.type) && data.propertyName.StartsWith("m_LocalRotation") ? Mode.RawQuaternions : Mode.Undefined; + } + + private static string GetPrefixForInterpolation(Mode newInterpolationMode) + { + if (newInterpolationMode == Mode.Baked) + return "localEulerAnglesBaked"; + if (newInterpolationMode == Mode.NonBaked) + return "localEulerAngles"; + if (newInterpolationMode == Mode.RawEuler) + return "localEulerAnglesRaw"; + if (newInterpolationMode == Mode.RawQuaternions) + return "m_LocalRotation"; + return null; + } + + private static EditorCurveBinding RemapAnimationBindingForRotationCurves(EditorCurveBinding curveBinding, AnimationClip clip) + { + if (!IsTransformType(curveBinding.type)) + return curveBinding; + Mode modeFromCurveData = GetModeFromCurveData(curveBinding); + if (modeFromCurveData == Mode.Undefined) + return curveBinding; + string str = curveBinding.propertyName.Split('.')[1]; + EditorCurveBinding binding = curveBinding; + if (modeFromCurveData != Mode.NonBaked) + { + binding.propertyName = GetPrefixForInterpolation(Mode.NonBaked) + "." + str; + if (AnimationUtility.GetEditorCurve(clip, binding) != null) + return binding; + } + if (modeFromCurveData != Mode.Baked) + { + binding.propertyName = GetPrefixForInterpolation(Mode.Baked) + "." + str; + if (AnimationUtility.GetEditorCurve(clip, binding) != null) + return binding; + } + if (modeFromCurveData != Mode.RawEuler) + { + binding.propertyName = GetPrefixForInterpolation(Mode.RawEuler) + "." + str; + if (AnimationUtility.GetEditorCurve(clip, binding) != null) + return binding; + } + return curveBinding; + } + + /// + /// 参照 RotationCurveInterpolation.SetInterpolation + /// + /// + private static void SetInterpolation(AnimationClip clip, EditorCurveBinding[] curveBindings, Mode newInterpolationMode) + { + List list1 = new List(); + List list2 = new List(); + List list3 = new List(); + foreach (var curveBinding in curveBindings) + { + EditorCurveBinding editorCurveBinding = RemapAnimationBindingForRotationCurves(curveBinding, clip); + switch (GetModeFromCurveData(editorCurveBinding)) + { + case Mode.Undefined: + break; + case Mode.RawQuaternions: + break; + default: + AnimationCurve editorCurve = AnimationUtility.GetEditorCurve(clip, editorCurveBinding); + if (editorCurve != null) + { + string propertyName = editorCurveBinding.propertyName; + string str = GetPrefixForInterpolation(newInterpolationMode) + '.' + propertyName[propertyName.Length - 1]; + list1.Add(new EditorCurveBinding() + { + propertyName = str, + type = editorCurveBinding.type, + path = editorCurveBinding.path + }); + list2.Add(editorCurve); + list3.Add(new EditorCurveBinding() + { + propertyName = editorCurveBinding.propertyName, + type = editorCurveBinding.type, + path = editorCurveBinding.path + }); + } + break; + } + } + + foreach (EditorCurveBinding binding in list3) + AnimationUtility.SetEditorCurve(clip, binding, null); + foreach (EditorCurveBinding binding in list1) + AnimationUtility.SetEditorCurve(clip, binding, list2[list1.IndexOf(binding)]); + } +} diff --git a/AnimationPath/Assets/TangentToConstant/Editor/AnimationKeyframeTangentToConstantWindow.cs.meta b/AnimationPath/Assets/TangentToConstant/Editor/AnimationKeyframeTangentToConstantWindow.cs.meta new file mode 100644 index 0000000..3791fb2 --- /dev/null +++ b/AnimationPath/Assets/TangentToConstant/Editor/AnimationKeyframeTangentToConstantWindow.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: dad9a6176d376124e8132333d413ab14 +timeCreated: 1533197525 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AnimationPath/ProjectSettings/ProjectVersion.txt b/AnimationPath/ProjectSettings/ProjectVersion.txt index c35bf9d..140ac27 100644 --- a/AnimationPath/ProjectSettings/ProjectVersion.txt +++ b/AnimationPath/ProjectSettings/ProjectVersion.txt @@ -1,2 +1 @@ -m_EditorVersion: 5.3.4p5 -m_StandardAssetsVersion: 0 +m_EditorVersion: 5.6.3p2 diff --git a/AnimationPath/ProjectSettings/UnityAdsSettings.asset b/AnimationPath/ProjectSettings/UnityAdsSettings.asset deleted file mode 100644 index 224050c..0000000 --- a/AnimationPath/ProjectSettings/UnityAdsSettings.asset +++ /dev/null @@ -1,11 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!292 &1 -UnityAdsSettings: - m_ObjectHideFlags: 0 - m_Enabled: 0 - m_InitializeOnStartup: 1 - m_TestMode: 0 - m_EnabledPlatforms: 4294967295 - m_IosGameId: - m_AndroidGameId: diff --git a/AnimationPath/ProjectSettings/UnityConnectSettings.asset b/AnimationPath/ProjectSettings/UnityConnectSettings.asset index 9b7a578..ec1ab29 100644 --- a/AnimationPath/ProjectSettings/UnityConnectSettings.asset +++ b/AnimationPath/ProjectSettings/UnityConnectSettings.asset @@ -3,6 +3,15 @@ --- !u!310 &1 UnityConnectSettings: m_ObjectHideFlags: 0 + m_Enabled: 0 + m_TestMode: 0 + m_TestEventUrl: + m_TestConfigUrl: + m_TestInitMode: 0 + CrashReportingSettings: + m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes + m_Enabled: 0 + m_CaptureEditorExceptions: 1 UnityPurchasingSettings: m_Enabled: 0 m_TestMode: 0 @@ -12,3 +21,12 @@ UnityConnectSettings: m_TestMode: 0 m_TestEventUrl: m_TestConfigUrl: + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_EnabledPlatforms: 4294967295 + m_IosGameId: + m_AndroidGameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/Images/1.gif b/Images/1.gif new file mode 100644 index 0000000..dfc882f Binary files /dev/null and b/Images/1.gif differ diff --git a/Images/2.png b/Images/2.png new file mode 100644 index 0000000..1348add Binary files /dev/null and b/Images/2.png differ diff --git a/Images/3.png b/Images/3.png new file mode 100644 index 0000000..95f427d Binary files /dev/null and b/Images/3.png differ diff --git a/Images/4.png b/Images/4.png new file mode 100644 index 0000000..cce8a93 Binary files /dev/null and b/Images/4.png differ diff --git a/Images/5.png b/Images/5.png new file mode 100644 index 0000000..5856f7b Binary files /dev/null and b/Images/5.png differ diff --git a/Images/6.gif b/Images/6.gif new file mode 100644 index 0000000..2bfd038 Binary files /dev/null and b/Images/6.gif differ diff --git a/Images/7.png b/Images/7.png new file mode 100644 index 0000000..2e0859b Binary files /dev/null and b/Images/7.png differ diff --git a/README.md b/README.md index 2489579..e09a310 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,18 @@ ## 目标 实现实时的动画路径预览,快速定位关键帧,方便编辑切线。 -![这里写图片描述](http://img.blog.csdn.net/20160923125753925) +![](./Images/1.gif) ## 解决 为了可以实时预览动画路径,那么就需要获得当前 Animation 窗口的动画数据,但是 Unity 不开放操作 Animation 窗口类,只能通过反射来处理。 创建的 AnimationWindowUtil 类,即是为了与 Animation 窗口的数据进行交互。 -![这里写图片描述](http://img.blog.csdn.net/20160923125839777) +![](./Images/2.png) -![这里写图片描述](http://img.blog.csdn.net/20160923125855184) +![](./Images/3.png) 动画数据里面存储的是使用埃尔米特(Hermite)曲线公式的值,它是使用各个顶点的斜率来构建曲线,这也造成了在 Animation 窗口编辑切线的不便,没法精确控制斜率的值。 -![这里写图片描述](http://img.blog.csdn.net/20160923125916660) +![](./Images/4.png) 合适的方式是使用贝塞尔(Bézier)曲线,它提供了两个控制点来调整切线,控制点的位置比起控制斜率的值大小来的直观方便多了。好在这两种曲线公式是可以转换的,Hermite 曲线转换成 Bézier 曲线步骤如下: ``` @@ -27,15 +27,15 @@ P3(b) = P1(h) 转换完成之后,则可通过绘制 Bézier 曲线,将动画路径展现出来。 -![这里写图片描述](http://img.blog.csdn.net/20160923130104068) +![](./Images/5.png) 绘制的绿色点是每个关键帧的位置,点中绿色点,即可直接在 Animation 窗口定位到当前关键帧,方便直接立即编辑。点中绿色点时,会在该点的旁边出现灰色控制点,直接点中控制点,就可以直接调整该点的切线了。 -![这里写图片描述](http://img.blog.csdn.net/20160923130117240) +![](./Images/6.gif) 这样来调整切线比在 Animation 窗口里面进行调整斜率方便的多了。切线调整完成后,通过 Bézier 曲线转换成 Hermite 曲线,来写回动画数据。 -![这里写图片描述](http://img.blog.csdn.net/20160923130023296) +![](./Images/7.png) 当关键帧过多时,可能会遮挡住曲线的走向绘制,特别是在转弯的地方,故也提供关闭显示关键帧点的功能。