diff --git a/Assets/MyGame/Scenes/UIScene.unity b/Assets/MyGame/Scenes/UIScene.unity index c12f6204f..2846c403f 100644 --- a/Assets/MyGame/Scenes/UIScene.unity +++ b/Assets/MyGame/Scenes/UIScene.unity @@ -201,6 +201,838 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 17528174} m_CullTransparentMesh: 1 +--- !u!1001 &52465885 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1106451914} + m_Modifications: + - target: {fileID: 1709254077376921, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_Name + value: Game177_zhubajie_skill + objectReference: {fileID: 0} + - target: {fileID: 1709254077376921, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4007513189690300, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -6.0818944 + objectReference: {fileID: 0} + - target: {fileID: 4007513189690300, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.3403816 + objectReference: {fileID: 0} + - target: {fileID: 4007513189690300, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -30.344975 + objectReference: {fileID: 0} + - target: {fileID: 4009931292380359, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0010761023 + objectReference: {fileID: 0} + - target: {fileID: 4009931292380359, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0007329583 + objectReference: {fileID: 0} + - target: {fileID: 4009931292380359, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -89.99195 + objectReference: {fileID: 0} + - target: {fileID: 4026196548002408, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 4026196548002408, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 89.9999 + objectReference: {fileID: 0} + - target: {fileID: 4026196548002408, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -46.945877 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -34.982517 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.48925003 + objectReference: {fileID: 0} + - target: {fileID: 4045458335737618, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4045458335737618, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4045458335737618, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4045458335737618, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4045458335737618, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4045458335737618, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4045458335737618, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4045458335737618, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4045458335737618, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4045458335737618, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4085275382694935, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.46773645 + objectReference: {fileID: 0} + - target: {fileID: 4085275382694935, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.2458267 + objectReference: {fileID: 0} + - target: {fileID: 4085275382694935, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -20.578613 + objectReference: {fileID: 0} + - target: {fileID: 4094320201520353, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -19.43673 + objectReference: {fileID: 0} + - target: {fileID: 4094320201520353, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 47.577766 + objectReference: {fileID: 0} + - target: {fileID: 4094320201520353, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 163.50114 + objectReference: {fileID: 0} + - target: {fileID: 4121005239445321, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -73.56942 + objectReference: {fileID: 0} + - target: {fileID: 4121005239445321, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -130.94386 + objectReference: {fileID: 0} + - target: {fileID: 4121005239445321, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 123.67935 + objectReference: {fileID: 0} + - target: {fileID: 4123703392571528, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000019746126 + objectReference: {fileID: 0} + - target: {fileID: 4123703392571528, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000017277766 + objectReference: {fileID: 0} + - target: {fileID: 4123703392571528, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00000024683249 + objectReference: {fileID: 0} + - target: {fileID: 4132862189046193, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4132862189046193, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4132862189046193, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.2267558e-28 + objectReference: {fileID: 0} + - target: {fileID: 4149520701623706, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.9644961 + objectReference: {fileID: 0} + - target: {fileID: 4149520701623706, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.2479272 + objectReference: {fileID: 0} + - target: {fileID: 4149520701623706, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -94.7086 + objectReference: {fileID: 0} + - target: {fileID: 4150646884989824, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000017788648 + objectReference: {fileID: 0} + - target: {fileID: 4150646884989824, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000004826527 + objectReference: {fileID: 0} + - target: {fileID: 4150646884989824, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 47.11092 + objectReference: {fileID: 0} + - target: {fileID: 4167524263268962, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -41.351234 + objectReference: {fileID: 0} + - target: {fileID: 4167524263268962, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 74.76391 + objectReference: {fileID: 0} + - target: {fileID: 4167524263268962, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -81.1474 + objectReference: {fileID: 0} + - target: {fileID: 4190181876552715, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -30.396294 + objectReference: {fileID: 0} + - target: {fileID: 4190181876552715, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -95.691444 + objectReference: {fileID: 0} + - target: {fileID: 4190181876552715, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -106.950554 + objectReference: {fileID: 0} + - target: {fileID: 4194081240383615, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -10.145207 + objectReference: {fileID: 0} + - target: {fileID: 4194081240383615, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.950996 + objectReference: {fileID: 0} + - target: {fileID: 4194081240383615, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -28.656433 + objectReference: {fileID: 0} + - target: {fileID: 4208575754630950, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -73.10477 + objectReference: {fileID: 0} + - target: {fileID: 4208575754630950, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -132.41263 + objectReference: {fileID: 0} + - target: {fileID: 4208575754630950, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.191562 + objectReference: {fileID: 0} + - target: {fileID: 4231814100211528, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000014809618 + objectReference: {fileID: 0} + - target: {fileID: 4231814100211528, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.88541e-11 + objectReference: {fileID: 0} + - target: {fileID: 4231814100211528, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000009872967 + objectReference: {fileID: 0} + - target: {fileID: 4240571728440943, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000017822196 + objectReference: {fileID: 0} + - target: {fileID: 4240571728440943, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00016308235 + objectReference: {fileID: 0} + - target: {fileID: 4240571728440943, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -89.312775 + objectReference: {fileID: 0} + - target: {fileID: 4264357844037074, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.8225765 + objectReference: {fileID: 0} + - target: {fileID: 4264357844037074, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.681803 + objectReference: {fileID: 0} + - target: {fileID: 4264357844037074, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -32.64236 + objectReference: {fileID: 0} + - target: {fileID: 4279359913592680, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -9.014968 + objectReference: {fileID: 0} + - target: {fileID: 4279359913592680, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -170.76657 + objectReference: {fileID: 0} + - target: {fileID: 4279359913592680, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -74.61397 + objectReference: {fileID: 0} + - target: {fileID: 4292246286975720, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.050854772 + objectReference: {fileID: 0} + - target: {fileID: 4292246286975720, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.041339368 + objectReference: {fileID: 0} + - target: {fileID: 4292246286975720, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -88.604385 + objectReference: {fileID: 0} + - target: {fileID: 4295428814336086, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.00952 + objectReference: {fileID: 0} + - target: {fileID: 4295428814336086, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.84422 + objectReference: {fileID: 0} + - target: {fileID: 4295428814336086, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 97.53625 + objectReference: {fileID: 0} + - target: {fileID: 4328299215684997, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.99033356 + objectReference: {fileID: 0} + - target: {fileID: 4328299215684997, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 90.017204 + objectReference: {fileID: 0} + - target: {fileID: 4328299215684997, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 5.164422 + objectReference: {fileID: 0} + - target: {fileID: 4354824845356902, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.0145025 + objectReference: {fileID: 0} + - target: {fileID: 4354824845356902, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.761904 + objectReference: {fileID: 0} + - target: {fileID: 4354824845356902, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -16.68082 + objectReference: {fileID: 0} + - target: {fileID: 4356319167443197, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.8839704e-12 + objectReference: {fileID: 0} + - target: {fileID: 4356319167443197, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000008145276 + objectReference: {fileID: 0} + - target: {fileID: 4356319167443197, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000026820762 + objectReference: {fileID: 0} + - target: {fileID: 4370222726513266, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000005776992 + objectReference: {fileID: 0} + - target: {fileID: 4370222726513266, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000569819 + objectReference: {fileID: 0} + - target: {fileID: 4370222726513266, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 110.77576 + objectReference: {fileID: 0} + - target: {fileID: 4384403120170545, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000058905066 + objectReference: {fileID: 0} + - target: {fileID: 4384403120170545, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000001010301 + objectReference: {fileID: 0} + - target: {fileID: 4384403120170545, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 99.732124 + objectReference: {fileID: 0} + - target: {fileID: 4386943702330414, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393105877652414, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -5.87581e-14 + objectReference: {fileID: 0} + - target: {fileID: 4393105877652414, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000019746083 + objectReference: {fileID: 0} + - target: {fileID: 4393105877652414, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000019746126 + objectReference: {fileID: 0} + - target: {fileID: 4408345039935966, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4408345039935966, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.38825452 + objectReference: {fileID: 0} + - target: {fileID: 4431740505123533, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 23.89734 + objectReference: {fileID: 0} + - target: {fileID: 4431740505123533, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.2853637 + objectReference: {fileID: 0} + - target: {fileID: 4431740505123533, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 54.93299 + objectReference: {fileID: 0} + - target: {fileID: 4450391854282655, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.00921 + objectReference: {fileID: 0} + - target: {fileID: 4450391854282655, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 165.15631 + objectReference: {fileID: 0} + - target: {fileID: 4450391854282655, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 82.46345 + objectReference: {fileID: 0} + - target: {fileID: 4492842699383957, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.153166 + objectReference: {fileID: 0} + - target: {fileID: 4492842699383957, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 64.04344 + objectReference: {fileID: 0} + - target: {fileID: 4492842699383957, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 14.40704 + objectReference: {fileID: 0} + - target: {fileID: 4499726237547504, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -11.8189535 + objectReference: {fileID: 0} + - target: {fileID: 4499726237547504, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -77.28314 + objectReference: {fileID: 0} + - target: {fileID: 4499726237547504, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -179.56259 + objectReference: {fileID: 0} + - target: {fileID: 4533803739292891, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.46585685 + objectReference: {fileID: 0} + - target: {fileID: 4533803739292891, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.2447343 + objectReference: {fileID: 0} + - target: {fileID: 4533803739292891, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -20.577736 + objectReference: {fileID: 0} + - target: {fileID: 4534704304255049, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -73.10467 + objectReference: {fileID: 0} + - target: {fileID: 4534704304255049, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -47.587036 + objectReference: {fileID: 0} + - target: {fileID: 4534704304255049, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 173.80803 + objectReference: {fileID: 0} + - target: {fileID: 4552309709192268, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.029519796 + objectReference: {fileID: 0} + - target: {fileID: 4552309709192268, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.0978216 + objectReference: {fileID: 0} + - target: {fileID: 4552309709192268, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.5082207 + objectReference: {fileID: 0} + - target: {fileID: 4571878917323452, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000049364587 + objectReference: {fileID: 0} + - target: {fileID: 4571878917323452, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000019746215 + objectReference: {fileID: 0} + - target: {fileID: 4571878917323452, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.3845207e-22 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.2589672 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.008870162 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -45.26718 + objectReference: {fileID: 0} + - target: {fileID: 4574190619683098, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.0463731 + objectReference: {fileID: 0} + - target: {fileID: 4574190619683098, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.26230982 + objectReference: {fileID: 0} + - target: {fileID: 4574190619683098, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 11.479114 + objectReference: {fileID: 0} + - target: {fileID: 4574304967836189, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -15.277742 + objectReference: {fileID: 0} + - target: {fileID: 4574304967836189, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.8132992 + objectReference: {fileID: 0} + - target: {fileID: 4574304967836189, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -81.8672 + objectReference: {fileID: 0} + - target: {fileID: 4601984538237284, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000074047983 + objectReference: {fileID: 0} + - target: {fileID: 4601984538237284, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.9420287e-13 + objectReference: {fileID: 0} + - target: {fileID: 4601984538237284, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4611579644537198, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 4611579644537198, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.34404 + objectReference: {fileID: 0} + - target: {fileID: 4611579644537198, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4617365563186364, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00034329525 + objectReference: {fileID: 0} + - target: {fileID: 4617365563186364, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000005289638 + objectReference: {fileID: 0} + - target: {fileID: 4617365563186364, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.30968243 + objectReference: {fileID: 0} + - target: {fileID: 4630643969539439, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 11.975648 + objectReference: {fileID: 0} + - target: {fileID: 4630643969539439, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -171.19727 + objectReference: {fileID: 0} + - target: {fileID: 4630643969539439, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -96.22176 + objectReference: {fileID: 0} + - target: {fileID: 4633296557590524, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -8.37587 + objectReference: {fileID: 0} + - target: {fileID: 4633296557590524, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 38.648026 + objectReference: {fileID: 0} + - target: {fileID: 4633296557590524, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.667625 + objectReference: {fileID: 0} + - target: {fileID: 4641631609468814, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -10.57563 + objectReference: {fileID: 0} + - target: {fileID: 4641631609468814, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -7.260186 + objectReference: {fileID: 0} + - target: {fileID: 4641631609468814, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.1599965 + objectReference: {fileID: 0} + - target: {fileID: 4651560128206891, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -10.510144 + objectReference: {fileID: 0} + - target: {fileID: 4651560128206891, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 21.118294 + objectReference: {fileID: 0} + - target: {fileID: 4651560128206891, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -88.3003 + objectReference: {fileID: 0} + - target: {fileID: 4658330495870062, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -12.769428 + objectReference: {fileID: 0} + - target: {fileID: 4658330495870062, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -40.291634 + objectReference: {fileID: 0} + - target: {fileID: 4658330495870062, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -10.622028 + objectReference: {fileID: 0} + - target: {fileID: 4690175861776792, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.4799557 + objectReference: {fileID: 0} + - target: {fileID: 4690175861776792, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.738938 + objectReference: {fileID: 0} + - target: {fileID: 4690175861776792, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -31.132404 + objectReference: {fileID: 0} + - target: {fileID: 4693062532245359, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000001974612 + objectReference: {fileID: 0} + - target: {fileID: 4693062532245359, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000009873063 + objectReference: {fileID: 0} + - target: {fileID: 4693062532245359, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4699617135816954, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.822372 + objectReference: {fileID: 0} + - target: {fileID: 4699617135816954, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 169.31808 + objectReference: {fileID: 0} + - target: {fileID: 4699617135816954, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -147.35751 + objectReference: {fileID: 0} + - target: {fileID: 4703931505913403, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000021519727 + objectReference: {fileID: 0} + - target: {fileID: 4703931505913403, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000013931785 + objectReference: {fileID: 0} + - target: {fileID: 4703931505913403, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 54.695957 + objectReference: {fileID: 0} + - target: {fileID: 4704330047573733, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.13990766 + objectReference: {fileID: 0} + - target: {fileID: 4704330047573733, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.5593584 + objectReference: {fileID: 0} + - target: {fileID: 4704330047573733, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.56334 + objectReference: {fileID: 0} + - target: {fileID: 4743393880019028, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -57.26631 + objectReference: {fileID: 0} + - target: {fileID: 4743393880019028, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -55.269444 + objectReference: {fileID: 0} + - target: {fileID: 4743393880019028, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 35.821846 + objectReference: {fileID: 0} + - target: {fileID: 4770005084341472, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 8.800306 + objectReference: {fileID: 0} + - target: {fileID: 4770005084341472, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -10.9162 + objectReference: {fileID: 0} + - target: {fileID: 4770005084341472, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -22.22805 + objectReference: {fileID: 0} + - target: {fileID: 4785330607447594, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.7693973 + objectReference: {fileID: 0} + - target: {fileID: 4785330607447594, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -17.035578 + objectReference: {fileID: 0} + - target: {fileID: 4785330607447594, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -62.75249 + objectReference: {fileID: 0} + - target: {fileID: 4799762105739359, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.4486393 + objectReference: {fileID: 0} + - target: {fileID: 4799762105739359, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.27237764 + objectReference: {fileID: 0} + - target: {fileID: 4799762105739359, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 13.970079 + objectReference: {fileID: 0} + - target: {fileID: 4806657225351454, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 51.294727 + objectReference: {fileID: 0} + - target: {fileID: 4806657225351454, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -36.65807 + objectReference: {fileID: 0} + - target: {fileID: 4806657225351454, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -2.7533023 + objectReference: {fileID: 0} + - target: {fileID: 4829625606037309, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.5208653 + objectReference: {fileID: 0} + - target: {fileID: 4829625606037309, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.3657169 + objectReference: {fileID: 0} + - target: {fileID: 4829625606037309, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 14.515098 + objectReference: {fileID: 0} + - target: {fileID: 4855482821919830, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.632185 + objectReference: {fileID: 0} + - target: {fileID: 4855482821919830, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 81.33502 + objectReference: {fileID: 0} + - target: {fileID: 4855482821919830, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 166.97845 + objectReference: {fileID: 0} + - target: {fileID: 4880619614767448, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 69.46652 + objectReference: {fileID: 0} + - target: {fileID: 4880619614767448, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -22.534197 + objectReference: {fileID: 0} + - target: {fileID: 4880619614767448, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -25.811161 + objectReference: {fileID: 0} + - target: {fileID: 4964469411310401, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4969505138979683, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000019746033 + objectReference: {fileID: 0} + - target: {fileID: 4969505138979683, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000004936678 + objectReference: {fileID: 0} + - target: {fileID: 4969505138979683, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -180 + objectReference: {fileID: 0} + - target: {fileID: 4976365255789935, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000053916563 + objectReference: {fileID: 0} + - target: {fileID: 4976365255789935, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.9999 + objectReference: {fileID: 0} + - target: {fileID: 4976365255789935, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -110.52265 + objectReference: {fileID: 0} + - target: {fileID: 4998874197659892, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000026820528 + objectReference: {fileID: 0} + - target: {fileID: 4998874197659892, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000012204524 + objectReference: {fileID: 0} + - target: {fileID: 4998874197659892, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.2213316 + objectReference: {fileID: 0} + - target: {fileID: 111215879266689626, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, + type: 3} + propertyPath: m_AnimatePhysics + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, type: 3} +--- !u!4 &52465886 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4045458335737618, guid: 02e32a5dbdf10494fb82dc592e4ac6e5, + type: 3} + m_PrefabInstance: {fileID: 52465885} + m_PrefabAsset: {fileID: 0} --- !u!1 &142979407 GameObject: m_ObjectHideFlags: 0 @@ -1010,6 +1842,833 @@ BoxCollider2D: serializedVersion: 2 m_Size: {x: 18.704224, y: 70.2} m_EdgeRadius: 0 +--- !u!1001 &399178228 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1106451914} + m_Modifications: + - target: {fileID: 1709254077376921, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_Name + value: Game177_zhubajie_skill_meihuo + objectReference: {fileID: 0} + - target: {fileID: 1709254077376921, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4007513189690300, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000016795098 + objectReference: {fileID: 0} + - target: {fileID: 4007513189690300, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000005487862 + objectReference: {fileID: 0} + - target: {fileID: 4007513189690300, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 41.70571 + objectReference: {fileID: 0} + - target: {fileID: 4009931292380359, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.8558605 + objectReference: {fileID: 0} + - target: {fileID: 4009931292380359, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -168.27199 + objectReference: {fileID: 0} + - target: {fileID: 4009931292380359, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -30.489532 + objectReference: {fileID: 0} + - target: {fileID: 4011164340880974, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.00955 + objectReference: {fileID: 0} + - target: {fileID: 4011164340880974, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.844337 + objectReference: {fileID: 0} + - target: {fileID: 4011164340880974, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 97.53611 + objectReference: {fileID: 0} + - target: {fileID: 4026196548002408, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.052992642 + objectReference: {fileID: 0} + - target: {fileID: 4026196548002408, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -35.34033 + objectReference: {fileID: 0} + - target: {fileID: 4026196548002408, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.33398768 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4056248600188076, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.00923 + objectReference: {fileID: 0} + - target: {fileID: 4056248600188076, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 165.15623 + objectReference: {fileID: 0} + - target: {fileID: 4056248600188076, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 82.46354 + objectReference: {fileID: 0} + - target: {fileID: 4085275382694935, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -83.49563 + objectReference: {fileID: 0} + - target: {fileID: 4085275382694935, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 176.22655 + objectReference: {fileID: 0} + - target: {fileID: 4085275382694935, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 161.1131 + objectReference: {fileID: 0} + - target: {fileID: 4121005239445321, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 13.153866 + objectReference: {fileID: 0} + - target: {fileID: 4121005239445321, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -76.013885 + objectReference: {fileID: 0} + - target: {fileID: 4121005239445321, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -169.46819 + objectReference: {fileID: 0} + - target: {fileID: 4123703392571528, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -5.8053265 + objectReference: {fileID: 0} + - target: {fileID: 4123703392571528, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.4487925 + objectReference: {fileID: 0} + - target: {fileID: 4123703392571528, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -65.140495 + objectReference: {fileID: 0} + - target: {fileID: 4132862189046193, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 52.620667 + objectReference: {fileID: 0} + - target: {fileID: 4132862189046193, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 41.91087 + objectReference: {fileID: 0} + - target: {fileID: 4132862189046193, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 99.28652 + objectReference: {fileID: 0} + - target: {fileID: 4149520701623706, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.271144 + objectReference: {fileID: 0} + - target: {fileID: 4149520701623706, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.039817836 + objectReference: {fileID: 0} + - target: {fileID: 4149520701623706, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -9.759822 + objectReference: {fileID: 0} + - target: {fileID: 4150646884989824, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000021464796 + objectReference: {fileID: 0} + - target: {fileID: 4150646884989824, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000021464102 + objectReference: {fileID: 0} + - target: {fileID: 4150646884989824, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000005365835 + objectReference: {fileID: 0} + - target: {fileID: 4190181876552715, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.22672231 + objectReference: {fileID: 0} + - target: {fileID: 4190181876552715, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.0576046 + objectReference: {fileID: 0} + - target: {fileID: 4190181876552715, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -33.368687 + objectReference: {fileID: 0} + - target: {fileID: 4194081240383615, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.22672787 + objectReference: {fileID: 0} + - target: {fileID: 4194081240383615, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.0575998 + objectReference: {fileID: 0} + - target: {fileID: 4194081240383615, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -12.537048 + objectReference: {fileID: 0} + - target: {fileID: 4208575754630950, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -63.742672 + objectReference: {fileID: 0} + - target: {fileID: 4208575754630950, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -24.483011 + objectReference: {fileID: 0} + - target: {fileID: 4208575754630950, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 148.26341 + objectReference: {fileID: 0} + - target: {fileID: 4231814100211528, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 58.05738 + objectReference: {fileID: 0} + - target: {fileID: 4231814100211528, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -61.96148 + objectReference: {fileID: 0} + - target: {fileID: 4231814100211528, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -53.662327 + objectReference: {fileID: 0} + - target: {fileID: 4232094423628703, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 4232094423628703, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.34398 + objectReference: {fileID: 0} + - target: {fileID: 4232094423628703, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4240571728440943, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.46712384 + objectReference: {fileID: 0} + - target: {fileID: 4240571728440943, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.2457595 + objectReference: {fileID: 0} + - target: {fileID: 4240571728440943, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -50.632183 + objectReference: {fileID: 0} + - target: {fileID: 4264357844037074, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.264425 + objectReference: {fileID: 0} + - target: {fileID: 4264357844037074, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -20.692596 + objectReference: {fileID: 0} + - target: {fileID: 4264357844037074, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.9067354 + objectReference: {fileID: 0} + - target: {fileID: 4279359913592680, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -18.55708 + objectReference: {fileID: 0} + - target: {fileID: 4279359913592680, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 21.784565 + objectReference: {fileID: 0} + - target: {fileID: 4279359913592680, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 56.457523 + objectReference: {fileID: 0} + - target: {fileID: 4292246286975720, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.591571 + objectReference: {fileID: 0} + - target: {fileID: 4292246286975720, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 178.91461 + objectReference: {fileID: 0} + - target: {fileID: 4292246286975720, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -27.265116 + objectReference: {fileID: 0} + - target: {fileID: 4295428814336086, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00034395687 + objectReference: {fileID: 0} + - target: {fileID: 4295428814336086, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000057500183 + objectReference: {fileID: 0} + - target: {fileID: 4295428814336086, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.3096829 + objectReference: {fileID: 0} + - target: {fileID: 4328299215684997, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000080492043 + objectReference: {fileID: 0} + - target: {fileID: 4328299215684997, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000026747143 + objectReference: {fileID: 0} + - target: {fileID: 4328299215684997, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4354824845356902, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.4671338 + objectReference: {fileID: 0} + - target: {fileID: 4354824845356902, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.2457532 + objectReference: {fileID: 0} + - target: {fileID: 4354824845356902, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -29.801666 + objectReference: {fileID: 0} + - target: {fileID: 4356319167443197, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.786831 + objectReference: {fileID: 0} + - target: {fileID: 4356319167443197, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -12.469305 + objectReference: {fileID: 0} + - target: {fileID: 4356319167443197, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.23479807 + objectReference: {fileID: 0} + - target: {fileID: 4370222726513266, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.88276577 + objectReference: {fileID: 0} + - target: {fileID: 4370222726513266, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.12974328 + objectReference: {fileID: 0} + - target: {fileID: 4370222726513266, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -85.89474 + objectReference: {fileID: 0} + - target: {fileID: 4384403120170545, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -89.98736 + objectReference: {fileID: 0} + - target: {fileID: 4384403120170545, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 89.99995 + objectReference: {fileID: 0} + - target: {fileID: 4386943702330414, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4386943702330414, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.38825405 + objectReference: {fileID: 0} + - target: {fileID: 4393105877652414, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000024228766 + objectReference: {fileID: 0} + - target: {fileID: 4393105877652414, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000012110119 + objectReference: {fileID: 0} + - target: {fileID: 4393105877652414, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 78.59014 + objectReference: {fileID: 0} + - target: {fileID: 4408345039935966, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.52911437 + objectReference: {fileID: 0} + - target: {fileID: 4408345039935966, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.4700941 + objectReference: {fileID: 0} + - target: {fileID: 4408345039935966, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -65.43611 + objectReference: {fileID: 0} + - target: {fileID: 4431740505123533, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -5.642776 + objectReference: {fileID: 0} + - target: {fileID: 4431740505123533, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 4.422143 + objectReference: {fileID: 0} + - target: {fileID: 4431740505123533, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -10.365067 + objectReference: {fileID: 0} + - target: {fileID: 4450391854282655, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000026498758 + objectReference: {fileID: 0} + - target: {fileID: 4450391854282655, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000013266738 + objectReference: {fileID: 0} + - target: {fileID: 4450391854282655, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.22133185 + objectReference: {fileID: 0} + - target: {fileID: 4492842699383957, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00019279325 + objectReference: {fileID: 0} + - target: {fileID: 4492842699383957, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.5625517 + objectReference: {fileID: 0} + - target: {fileID: 4492842699383957, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -35.680405 + objectReference: {fileID: 0} + - target: {fileID: 4499726237547504, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000365935 + objectReference: {fileID: 0} + - target: {fileID: 4499726237547504, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.99986 + objectReference: {fileID: 0} + - target: {fileID: 4499726237547504, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -110.52262 + objectReference: {fileID: 0} + - target: {fileID: 4534704304255049, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00004540463 + objectReference: {fileID: 0} + - target: {fileID: 4534704304255049, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000759202 + objectReference: {fileID: 0} + - target: {fileID: 4534704304255049, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -15.219107 + objectReference: {fileID: 0} + - target: {fileID: 4552309709192268, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -26.471016 + objectReference: {fileID: 0} + - target: {fileID: 4552309709192268, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.315833 + objectReference: {fileID: 0} + - target: {fileID: 4552309709192268, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.6428237 + objectReference: {fileID: 0} + - target: {fileID: 4570723408815475, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.0667801 + objectReference: {fileID: 0} + - target: {fileID: 4570723408815475, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 37.654404 + objectReference: {fileID: 0} + - target: {fileID: 4570723408815475, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.2582715 + objectReference: {fileID: 0} + - target: {fileID: 4571878917323452, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -8.186497 + objectReference: {fileID: 0} + - target: {fileID: 4571878917323452, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.4817438 + objectReference: {fileID: 0} + - target: {fileID: 4571878917323452, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -22.86285 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -57.26631 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -55.269432 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 35.821827 + objectReference: {fileID: 0} + - target: {fileID: 4574190619683098, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000002682936 + objectReference: {fileID: 0} + - target: {fileID: 4574190619683098, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000059114524 + objectReference: {fileID: 0} + - target: {fileID: 4574190619683098, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.9197517e-12 + objectReference: {fileID: 0} + - target: {fileID: 4574304967836189, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000026829355 + objectReference: {fileID: 0} + - target: {fileID: 4574304967836189, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000047587582 + objectReference: {fileID: 0} + - target: {fileID: 4574304967836189, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4592460329389196, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.89791024 + objectReference: {fileID: 0} + - target: {fileID: 4592460329389196, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.644494 + objectReference: {fileID: 0} + - target: {fileID: 4592460329389196, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.287066 + objectReference: {fileID: 0} + - target: {fileID: 4601984538237284, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -15.78012 + objectReference: {fileID: 0} + - target: {fileID: 4601984538237284, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 84.48119 + objectReference: {fileID: 0} + - target: {fileID: 4601984538237284, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 175.07408 + objectReference: {fileID: 0} + - target: {fileID: 4611579644537198, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0001954226 + objectReference: {fileID: 0} + - target: {fileID: 4611579644537198, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.5625497 + objectReference: {fileID: 0} + - target: {fileID: 4611579644537198, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -13.768884 + objectReference: {fileID: 0} + - target: {fileID: 4617365563186364, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.2218253e-11 + objectReference: {fileID: 0} + - target: {fileID: 4617365563186364, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.0712526e-11 + objectReference: {fileID: 0} + - target: {fileID: 4630643969539439, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -20.411266 + objectReference: {fileID: 0} + - target: {fileID: 4630643969539439, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 30.134468 + objectReference: {fileID: 0} + - target: {fileID: 4630643969539439, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -61.128162 + objectReference: {fileID: 0} + - target: {fileID: 4633296557590524, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -30.396326 + objectReference: {fileID: 0} + - target: {fileID: 4633296557590524, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -95.691505 + objectReference: {fileID: 0} + - target: {fileID: 4633296557590524, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -106.95053 + objectReference: {fileID: 0} + - target: {fileID: 4651560128206891, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 17.80113 + objectReference: {fileID: 0} + - target: {fileID: 4651560128206891, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 23.44772 + objectReference: {fileID: 0} + - target: {fileID: 4651560128206891, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 14.119797 + objectReference: {fileID: 0} + - target: {fileID: 4658330495870062, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.822339 + objectReference: {fileID: 0} + - target: {fileID: 4658330495870062, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 169.31805 + objectReference: {fileID: 0} + - target: {fileID: 4658330495870062, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -147.35754 + objectReference: {fileID: 0} + - target: {fileID: 4690175861776792, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 83.27012 + objectReference: {fileID: 0} + - target: {fileID: 4690175861776792, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 112.71902 + objectReference: {fileID: 0} + - target: {fileID: 4690175861776792, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 128.9172 + objectReference: {fileID: 0} + - target: {fileID: 4693062532245359, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000037278394 + objectReference: {fileID: 0} + - target: {fileID: 4693062532245359, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000014850303 + objectReference: {fileID: 0} + - target: {fileID: 4693062532245359, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 63.442398 + objectReference: {fileID: 0} + - target: {fileID: 4699617135816954, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.8227093 + objectReference: {fileID: 0} + - target: {fileID: 4699617135816954, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.5499387 + objectReference: {fileID: 0} + - target: {fileID: 4699617135816954, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.019418 + objectReference: {fileID: 0} + - target: {fileID: 4703931505913403, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.822612 + objectReference: {fileID: 0} + - target: {fileID: 4703931505913403, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.68179 + objectReference: {fileID: 0} + - target: {fileID: 4703931505913403, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -32.642384 + objectReference: {fileID: 0} + - target: {fileID: 4704330047573733, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000005628487 + objectReference: {fileID: 0} + - target: {fileID: 4704330047573733, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000028091356 + objectReference: {fileID: 0} + - target: {fileID: 4704330047573733, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 35.187366 + objectReference: {fileID: 0} + - target: {fileID: 4770005084341472, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000021465332 + objectReference: {fileID: 0} + - target: {fileID: 4770005084341472, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000010732819 + objectReference: {fileID: 0} + - target: {fileID: 4770005084341472, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.513757e-15 + objectReference: {fileID: 0} + - target: {fileID: 4771092198208730, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.6675053 + objectReference: {fileID: 0} + - target: {fileID: 4771092198208730, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.650857 + objectReference: {fileID: 0} + - target: {fileID: 4771092198208730, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.0845394 + objectReference: {fileID: 0} + - target: {fileID: 4785330607447594, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -73.98506 + objectReference: {fileID: 0} + - target: {fileID: 4785330607447594, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 40.931053 + objectReference: {fileID: 0} + - target: {fileID: 4785330607447594, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 27.236147 + objectReference: {fileID: 0} + - target: {fileID: 4799762105739359, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.9002556 + objectReference: {fileID: 0} + - target: {fileID: 4799762105739359, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -20.999937 + objectReference: {fileID: 0} + - target: {fileID: 4799762105739359, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -62.98614 + objectReference: {fileID: 0} + - target: {fileID: 4806657225351454, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -5.5352345 + objectReference: {fileID: 0} + - target: {fileID: 4806657225351454, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -39.539528 + objectReference: {fileID: 0} + - target: {fileID: 4806657225351454, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.5696087 + objectReference: {fileID: 0} + - target: {fileID: 4829625606037309, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000076294215 + objectReference: {fileID: 0} + - target: {fileID: 4829625606037309, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00010681133 + objectReference: {fileID: 0} + - target: {fileID: 4829625606037309, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -90.000206 + objectReference: {fileID: 0} + - target: {fileID: 4855482821919830, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.52911794 + objectReference: {fileID: 0} + - target: {fileID: 4855482821919830, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.4701011 + objectReference: {fileID: 0} + - target: {fileID: 4855482821919830, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -36.640594 + objectReference: {fileID: 0} + - target: {fileID: 4964469411310401, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4964469411310401, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4964469411310401, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.0000021464102 + objectReference: {fileID: 0} + - target: {fileID: 4969505138979683, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -31.04735 + objectReference: {fileID: 0} + - target: {fileID: 4969505138979683, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 121.83272 + objectReference: {fileID: 0} + - target: {fileID: 4969505138979683, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -74.52473 + objectReference: {fileID: 0} + - target: {fileID: 4976365255789935, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -67.14037 + objectReference: {fileID: 0} + - target: {fileID: 4976365255789935, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -158.00308 + objectReference: {fileID: 0} + - target: {fileID: 4976365255789935, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 20.539894 + objectReference: {fileID: 0} + - target: {fileID: 4992816746925483, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4998874197659892, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.805325 + objectReference: {fileID: 0} + - target: {fileID: 4998874197659892, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.448792 + objectReference: {fileID: 0} + - target: {fileID: 4998874197659892, guid: 60d3a66017042d4468ee615393e9a208, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -43.23015 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 60d3a66017042d4468ee615393e9a208, type: 3} +--- !u!4 &399178229 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4043919389829319, guid: 60d3a66017042d4468ee615393e9a208, + type: 3} + m_PrefabInstance: {fileID: 399178228} + m_PrefabAsset: {fileID: 0} --- !u!1 &441163902 GameObject: m_ObjectHideFlags: 0 @@ -1042,6 +2701,857 @@ Transform: - {fileID: 1931237645} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &455012351 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1106451914} + m_Modifications: + - target: {fileID: 1709254077376921, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_Name + value: Game177_zhubajie_skill03 + objectReference: {fileID: 0} + - target: {fileID: 1709254077376921, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4007513189690300, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000010666453 + objectReference: {fileID: 0} + - target: {fileID: 4007513189690300, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -7.8267617e-13 + objectReference: {fileID: 0} + - target: {fileID: 4007513189690300, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000001333309 + objectReference: {fileID: 0} + - target: {fileID: 4009931292380359, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -89.99691 + objectReference: {fileID: 0} + - target: {fileID: 4009931292380359, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 89.99995 + objectReference: {fileID: 0} + - target: {fileID: 4066778049879928, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00029622985 + objectReference: {fileID: 0} + - target: {fileID: 4066778049879928, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000020122054 + objectReference: {fileID: 0} + - target: {fileID: 4066778049879928, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.3096544 + objectReference: {fileID: 0} + - target: {fileID: 4085275382694935, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.196083e-12 + objectReference: {fileID: 0} + - target: {fileID: 4085275382694935, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000008799824 + objectReference: {fileID: 0} + - target: {fileID: 4085275382694935, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.00002652369 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.47010607 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -18.814177 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.7067989 + objectReference: {fileID: 0} + - target: {fileID: 4121005239445321, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4121005239445321, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4123703392571528, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 23.567982 + objectReference: {fileID: 0} + - target: {fileID: 4123703392571528, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -33.01157 + objectReference: {fileID: 0} + - target: {fileID: 4123703392571528, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 57.961178 + objectReference: {fileID: 0} + - target: {fileID: 4132862189046193, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.048974 + objectReference: {fileID: 0} + - target: {fileID: 4132862189046193, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.9530807 + objectReference: {fileID: 0} + - target: {fileID: 4132862189046193, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -30.109993 + objectReference: {fileID: 0} + - target: {fileID: 4150646884989824, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 42.48309 + objectReference: {fileID: 0} + - target: {fileID: 4150646884989824, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -58.69396 + objectReference: {fileID: 0} + - target: {fileID: 4150646884989824, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 4.057522 + objectReference: {fileID: 0} + - target: {fileID: 4167524263268962, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.46758774 + objectReference: {fileID: 0} + - target: {fileID: 4167524263268962, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.2439083 + objectReference: {fileID: 0} + - target: {fileID: 4167524263268962, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -20.57739 + objectReference: {fileID: 0} + - target: {fileID: 4187454977326620, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.5283823 + objectReference: {fileID: 0} + - target: {fileID: 4187454977326620, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -14.418428 + objectReference: {fileID: 0} + - target: {fileID: 4187454977326620, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.6187751 + objectReference: {fileID: 0} + - target: {fileID: 4190181876552715, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000003609764 + objectReference: {fileID: 0} + - target: {fileID: 4190181876552715, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000038696076 + objectReference: {fileID: 0} + - target: {fileID: 4190181876552715, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 36.074986 + objectReference: {fileID: 0} + - target: {fileID: 4194081240383615, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.822368 + objectReference: {fileID: 0} + - target: {fileID: 4194081240383615, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 169.31808 + objectReference: {fileID: 0} + - target: {fileID: 4194081240383615, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -147.35751 + objectReference: {fileID: 0} + - target: {fileID: 4208575754630950, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.03603177 + objectReference: {fileID: 0} + - target: {fileID: 4208575754630950, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.028593358 + objectReference: {fileID: 0} + - target: {fileID: 4208575754630950, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -89.63209 + objectReference: {fileID: 0} + - target: {fileID: 4231814100211528, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000038663144 + objectReference: {fileID: 0} + - target: {fileID: 4231814100211528, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.99988 + objectReference: {fileID: 0} + - target: {fileID: 4231814100211528, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -110.52262 + objectReference: {fileID: 0} + - target: {fileID: 4232094423628703, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4232094423628703, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.6467727e-28 + objectReference: {fileID: 0} + - target: {fileID: 4240571728440943, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 62.150528 + objectReference: {fileID: 0} + - target: {fileID: 4240571728440943, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -55.35708 + objectReference: {fileID: 0} + - target: {fileID: 4240571728440943, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -62.052162 + objectReference: {fileID: 0} + - target: {fileID: 4264357844037074, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -12.524241 + objectReference: {fileID: 0} + - target: {fileID: 4264357844037074, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.628577 + objectReference: {fileID: 0} + - target: {fileID: 4264357844037074, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -26.948528 + objectReference: {fileID: 0} + - target: {fileID: 4275549183895104, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000057953384 + objectReference: {fileID: 0} + - target: {fileID: 4275549183895104, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00002652369 + objectReference: {fileID: 0} + - target: {fileID: 4275549183895104, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000057953293 + objectReference: {fileID: 0} + - target: {fileID: 4295428814336086, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000001333308 + objectReference: {fileID: 0} + - target: {fileID: 4295428814336086, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.5256318e-12 + objectReference: {fileID: 0} + - target: {fileID: 4295428814336086, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4328299215684997, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.9675813 + objectReference: {fileID: 0} + - target: {fileID: 4328299215684997, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.619775 + objectReference: {fileID: 0} + - target: {fileID: 4328299215684997, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -58.837315 + objectReference: {fileID: 0} + - target: {fileID: 4354824845356902, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.82262 + objectReference: {fileID: 0} + - target: {fileID: 4354824845356902, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.681797 + objectReference: {fileID: 0} + - target: {fileID: 4354824845356902, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -32.64239 + objectReference: {fileID: 0} + - target: {fileID: 4356319167443197, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000009249086 + objectReference: {fileID: 0} + - target: {fileID: 4356319167443197, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000055555074 + objectReference: {fileID: 0} + - target: {fileID: 4356319167443197, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.6998887 + objectReference: {fileID: 0} + - target: {fileID: 4370222726513266, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -29.552975 + objectReference: {fileID: 0} + - target: {fileID: 4370222726513266, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 22.83824 + objectReference: {fileID: 0} + - target: {fileID: 4370222726513266, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 85.30621 + objectReference: {fileID: 0} + - target: {fileID: 4386943702330414, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000020468253 + objectReference: {fileID: 0} + - target: {fileID: 4386943702330414, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00013641066 + objectReference: {fileID: 0} + - target: {fileID: 4386943702330414, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -89.312805 + objectReference: {fileID: 0} + - target: {fileID: 4393105877652414, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00019981846 + objectReference: {fileID: 0} + - target: {fileID: 4393105877652414, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00006618121 + objectReference: {fileID: 0} + - target: {fileID: 4393105877652414, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.2112494 + objectReference: {fileID: 0} + - target: {fileID: 4408345039935966, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.46742454 + objectReference: {fileID: 0} + - target: {fileID: 4408345039935966, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.2459054 + objectReference: {fileID: 0} + - target: {fileID: 4408345039935966, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -20.579092 + objectReference: {fileID: 0} + - target: {fileID: 4431740505123533, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000003333262 + objectReference: {fileID: 0} + - target: {fileID: 4431740505123533, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000010666444 + objectReference: {fileID: 0} + - target: {fileID: 4431740505123533, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 9.5350905e-14 + objectReference: {fileID: 0} + - target: {fileID: 4450391854282655, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -30.396294 + objectReference: {fileID: 0} + - target: {fileID: 4450391854282655, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -95.691444 + objectReference: {fileID: 0} + - target: {fileID: 4450391854282655, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -106.950554 + objectReference: {fileID: 0} + - target: {fileID: 4492842699383957, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -47.5747 + objectReference: {fileID: 0} + - target: {fileID: 4492842699383957, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -108.199844 + objectReference: {fileID: 0} + - target: {fileID: 4492842699383957, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 104.60665 + objectReference: {fileID: 0} + - target: {fileID: 4499726237547504, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000028749398 + objectReference: {fileID: 0} + - target: {fileID: 4499726237547504, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.8167256e-13 + objectReference: {fileID: 0} + - target: {fileID: 4499726237547504, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00000006666533 + objectReference: {fileID: 0} + - target: {fileID: 4528911807818478, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 4528911807818478, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.34406 + objectReference: {fileID: 0} + - target: {fileID: 4528911807818478, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4533803739292891, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -19.327192 + objectReference: {fileID: 0} + - target: {fileID: 4533803739292891, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -11.211695 + objectReference: {fileID: 0} + - target: {fileID: 4533803739292891, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -33.359894 + objectReference: {fileID: 0} + - target: {fileID: 4534704304255049, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.4630933 + objectReference: {fileID: 0} + - target: {fileID: 4534704304255049, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -179.54823 + objectReference: {fileID: 0} + - target: {fileID: 4534704304255049, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.2703977 + objectReference: {fileID: 0} + - target: {fileID: 4552309709192268, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000114628776 + objectReference: {fileID: 0} + - target: {fileID: 4552309709192268, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00017256252 + objectReference: {fileID: 0} + - target: {fileID: 4552309709192268, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -90.00022 + objectReference: {fileID: 0} + - target: {fileID: 4561126880652180, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000000046083017 + objectReference: {fileID: 0} + - target: {fileID: 4561126880652180, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.1187008e-11 + objectReference: {fileID: 0} + - target: {fileID: 4561126880652180, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.38828257 + objectReference: {fileID: 0} + - target: {fileID: 4570723408815475, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4571878917323452, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000014999674 + objectReference: {fileID: 0} + - target: {fileID: 4571878917323452, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000010666453 + objectReference: {fileID: 0} + - target: {fileID: 4571878917323452, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4574190619683098, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 19.379484 + objectReference: {fileID: 0} + - target: {fileID: 4574190619683098, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.229118 + objectReference: {fileID: 0} + - target: {fileID: 4574190619683098, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -44.741165 + objectReference: {fileID: 0} + - target: {fileID: 4574304967836189, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -23.010878 + objectReference: {fileID: 0} + - target: {fileID: 4574304967836189, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -11.67823 + objectReference: {fileID: 0} + - target: {fileID: 4574304967836189, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -51.375042 + objectReference: {fileID: 0} + - target: {fileID: 4592460329389196, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.00954 + objectReference: {fileID: 0} + - target: {fileID: 4592460329389196, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.844151 + objectReference: {fileID: 0} + - target: {fileID: 4592460329389196, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 97.53627 + objectReference: {fileID: 0} + - target: {fileID: 4601984538237284, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.587307 + objectReference: {fileID: 0} + - target: {fileID: 4601984538237284, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 17.31615 + objectReference: {fileID: 0} + - target: {fileID: 4601984538237284, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -12.689597 + objectReference: {fileID: 0} + - target: {fileID: 4611579644537198, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000021332871 + objectReference: {fileID: 0} + - target: {fileID: 4611579644537198, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.5256221e-12 + objectReference: {fileID: 0} + - target: {fileID: 4611579644537198, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -180 + objectReference: {fileID: 0} + - target: {fileID: 4617365563186364, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -48.46003 + objectReference: {fileID: 0} + - target: {fileID: 4617365563186364, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 105.244316 + objectReference: {fileID: 0} + - target: {fileID: 4617365563186364, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -84.98092 + objectReference: {fileID: 0} + - target: {fileID: 4630643969539439, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -57.26631 + objectReference: {fileID: 0} + - target: {fileID: 4630643969539439, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -55.269436 + objectReference: {fileID: 0} + - target: {fileID: 4630643969539439, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 35.82184 + objectReference: {fileID: 0} + - target: {fileID: 4633296557590524, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -6.929175 + objectReference: {fileID: 0} + - target: {fileID: 4633296557590524, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.6244135 + objectReference: {fileID: 0} + - target: {fileID: 4633296557590524, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -32.091328 + objectReference: {fileID: 0} + - target: {fileID: 4641631609468814, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.098939e-12 + objectReference: {fileID: 0} + - target: {fileID: 4641631609468814, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000010666472 + objectReference: {fileID: 0} + - target: {fileID: 4641631609468814, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.0000031999323 + objectReference: {fileID: 0} + - target: {fileID: 4651560128206891, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000031447935 + objectReference: {fileID: 0} + - target: {fileID: 4651560128206891, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000061278286 + objectReference: {fileID: 0} + - target: {fileID: 4651560128206891, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 58.993042 + objectReference: {fileID: 0} + - target: {fileID: 4658330495870062, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -73.10468 + objectReference: {fileID: 0} + - target: {fileID: 4658330495870062, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -47.586987 + objectReference: {fileID: 0} + - target: {fileID: 4658330495870062, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 173.80795 + objectReference: {fileID: 0} + - target: {fileID: 4690175861776792, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -10.968735 + objectReference: {fileID: 0} + - target: {fileID: 4690175861776792, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 71.833 + objectReference: {fileID: 0} + - target: {fileID: 4690175861776792, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -178.2389 + objectReference: {fileID: 0} + - target: {fileID: 4693062532245359, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 4693062532245359, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000008995264 + objectReference: {fileID: 0} + - target: {fileID: 4693062532245359, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4699617135816954, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00010777326 + objectReference: {fileID: 0} + - target: {fileID: 4699617135816954, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00013483831 + objectReference: {fileID: 0} + - target: {fileID: 4699617135816954, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -10.92882 + objectReference: {fileID: 0} + - target: {fileID: 4703931505913403, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 6.074406 + objectReference: {fileID: 0} + - target: {fileID: 4703931505913403, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 36.864372 + objectReference: {fileID: 0} + - target: {fileID: 4703931505913403, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -25.32254 + objectReference: {fileID: 0} + - target: {fileID: 4704330047573733, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.59560317 + objectReference: {fileID: 0} + - target: {fileID: 4704330047573733, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 29.728127 + objectReference: {fileID: 0} + - target: {fileID: 4704330047573733, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 11.553762 + objectReference: {fileID: 0} + - target: {fileID: 4770005084341472, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.9423687 + objectReference: {fileID: 0} + - target: {fileID: 4770005084341472, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -76.35646 + objectReference: {fileID: 0} + - target: {fileID: 4770005084341472, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -151.76863 + objectReference: {fileID: 0} + - target: {fileID: 4771092198208730, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.00922 + objectReference: {fileID: 0} + - target: {fileID: 4771092198208730, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 165.15651 + objectReference: {fileID: 0} + - target: {fileID: 4771092198208730, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 82.46323 + objectReference: {fileID: 0} + - target: {fileID: 4785330607447594, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 15.43487 + objectReference: {fileID: 0} + - target: {fileID: 4785330607447594, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -23.293888 + objectReference: {fileID: 0} + - target: {fileID: 4785330607447594, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -30.244848 + objectReference: {fileID: 0} + - target: {fileID: 4799762105739359, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -9.926629 + objectReference: {fileID: 0} + - target: {fileID: 4799762105739359, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 171.17152 + objectReference: {fileID: 0} + - target: {fileID: 4799762105739359, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -23.998253 + objectReference: {fileID: 0} + - target: {fileID: 4806657225351454, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -73.104805 + objectReference: {fileID: 0} + - target: {fileID: 4806657225351454, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -132.41277 + objectReference: {fileID: 0} + - target: {fileID: 4806657225351454, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.191704 + objectReference: {fileID: 0} + - target: {fileID: 4824317463469755, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4824317463469755, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4824317463469755, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.22135457 + objectReference: {fileID: 0} + - target: {fileID: 4829625606037309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000024786757 + objectReference: {fileID: 0} + - target: {fileID: 4829625606037309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000009016685 + objectReference: {fileID: 0} + - target: {fileID: 4829625606037309, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 66.61218 + objectReference: {fileID: 0} + - target: {fileID: 4855482821919830, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000019438173 + objectReference: {fileID: 0} + - target: {fileID: 4855482821919830, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000013034151 + objectReference: {fileID: 0} + - target: {fileID: 4855482821919830, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 16.11012 + objectReference: {fileID: 0} + - target: {fileID: 4880619614767448, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.4762285 + objectReference: {fileID: 0} + - target: {fileID: 4880619614767448, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 15.213713 + objectReference: {fileID: 0} + - target: {fileID: 4880619614767448, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -18.784235 + objectReference: {fileID: 0} + - target: {fileID: 4964469411310401, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 17.090042 + objectReference: {fileID: 0} + - target: {fileID: 4964469411310401, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -25.071901 + objectReference: {fileID: 0} + - target: {fileID: 4964469411310401, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -58.546955 + objectReference: {fileID: 0} + - target: {fileID: 4969505138979683, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 17.08988 + objectReference: {fileID: 0} + - target: {fileID: 4969505138979683, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 57.434975 + objectReference: {fileID: 0} + - target: {fileID: 4969505138979683, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -2.18462 + objectReference: {fileID: 0} + - target: {fileID: 4976365255789935, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000010990807 + objectReference: {fileID: 0} + - target: {fileID: 4976365255789935, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000003223235 + objectReference: {fileID: 0} + - target: {fileID: 4976365255789935, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -10.497199 + objectReference: {fileID: 0} + - target: {fileID: 4998874197659892, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.4680344 + objectReference: {fileID: 0} + - target: {fileID: 4998874197659892, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.5016879 + objectReference: {fileID: 0} + - target: {fileID: 4998874197659892, guid: f785d27c20836824ca5e0483aec2be32, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.5195146 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f785d27c20836824ca5e0483aec2be32, type: 3} +--- !u!4 &455012352 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4572839542275309, guid: f785d27c20836824ca5e0483aec2be32, + type: 3} + m_PrefabInstance: {fileID: 455012351} + m_PrefabAsset: {fileID: 0} --- !u!1 &492562954 GameObject: m_ObjectHideFlags: 0 @@ -1564,6 +4074,2586 @@ MonoBehaviour: m_EditorClassIdentifier: preloadLabel: XJMH image: {fileID: 142979409} +--- !u!1001 &741769755 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 763264655} + m_Modifications: + - target: {fileID: 1709254077376921, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_Name + value: Game177_changE + objectReference: {fileID: 0} + - target: {fileID: 1709254077376921, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4000342987746139, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 16.430973 + objectReference: {fileID: 0} + - target: {fileID: 4000342987746139, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.7711143 + objectReference: {fileID: 0} + - target: {fileID: 4000342987746139, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.1359982 + objectReference: {fileID: 0} + - target: {fileID: 4003750186790624, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.15902308 + objectReference: {fileID: 0} + - target: {fileID: 4003750186790624, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.456694 + objectReference: {fileID: 0} + - target: {fileID: 4003750186790624, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.287727 + objectReference: {fileID: 0} + - target: {fileID: 4016782227057731, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00011575739 + objectReference: {fileID: 0} + - target: {fileID: 4016782227057731, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.99995 + objectReference: {fileID: 0} + - target: {fileID: 4016782227057731, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -97.21934 + objectReference: {fileID: 0} + - target: {fileID: 4020314340478216, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -74.12356 + objectReference: {fileID: 0} + - target: {fileID: 4020314340478216, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 118.51095 + objectReference: {fileID: 0} + - target: {fileID: 4020314340478216, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -121.200745 + objectReference: {fileID: 0} + - target: {fileID: 4023566878023198, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.264966 + objectReference: {fileID: 0} + - target: {fileID: 4023566878023198, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.817361 + objectReference: {fileID: 0} + - target: {fileID: 4023566878023198, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.221798 + objectReference: {fileID: 0} + - target: {fileID: 4031343952073922, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.12161744 + objectReference: {fileID: 0} + - target: {fileID: 4031343952073922, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -4.94066 + objectReference: {fileID: 0} + - target: {fileID: 4031343952073922, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.025671408 + objectReference: {fileID: 0} + - target: {fileID: 4031355914570132, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 39.075294 + objectReference: {fileID: 0} + - target: {fileID: 4031355914570132, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -21.791534 + objectReference: {fileID: 0} + - target: {fileID: 4031355914570132, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -136.37866 + objectReference: {fileID: 0} + - target: {fileID: 4033903555039309, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.9386096 + objectReference: {fileID: 0} + - target: {fileID: 4033903555039309, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.8546844 + objectReference: {fileID: 0} + - target: {fileID: 4033903555039309, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.5005455 + objectReference: {fileID: 0} + - target: {fileID: 4036828218548272, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000041509215 + objectReference: {fileID: 0} + - target: {fileID: 4036828218548272, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000080064706 + objectReference: {fileID: 0} + - target: {fileID: 4036828218548272, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 79.329994 + objectReference: {fileID: 0} + - target: {fileID: 4041287186795109, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.6428795 + objectReference: {fileID: 0} + - target: {fileID: 4041287186795109, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.1393425 + objectReference: {fileID: 0} + - target: {fileID: 4041287186795109, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 33.28631 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.27503026 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.186186 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -2.4107459 + objectReference: {fileID: 0} + - target: {fileID: 4041608817324026, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.6970574 + objectReference: {fileID: 0} + - target: {fileID: 4041608817324026, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -13.4079895 + objectReference: {fileID: 0} + - target: {fileID: 4041608817324026, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 21.727655 + objectReference: {fileID: 0} + - target: {fileID: 4044586276341600, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 50.30466 + objectReference: {fileID: 0} + - target: {fileID: 4044586276341600, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -177.60037 + objectReference: {fileID: 0} + - target: {fileID: 4044586276341600, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -147.88306 + objectReference: {fileID: 0} + - target: {fileID: 4045646810609841, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 80.912186 + objectReference: {fileID: 0} + - target: {fileID: 4045646810609841, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -89.991264 + objectReference: {fileID: 0} + - target: {fileID: 4045646810609841, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -177.67621 + objectReference: {fileID: 0} + - target: {fileID: 4055535033279528, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -46.04782 + objectReference: {fileID: 0} + - target: {fileID: 4055535033279528, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 80.710815 + objectReference: {fileID: 0} + - target: {fileID: 4055535033279528, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 114.19876 + objectReference: {fileID: 0} + - target: {fileID: 4056435115414594, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -35.156364 + objectReference: {fileID: 0} + - target: {fileID: 4056435115414594, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -26.835432 + objectReference: {fileID: 0} + - target: {fileID: 4056435115414594, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -15.62544 + objectReference: {fileID: 0} + - target: {fileID: 4067212629291419, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000076730134 + objectReference: {fileID: 0} + - target: {fileID: 4067212629291419, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000004791575 + objectReference: {fileID: 0} + - target: {fileID: 4067212629291419, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 91.34812 + objectReference: {fileID: 0} + - target: {fileID: 4071519224935516, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 31.885487 + objectReference: {fileID: 0} + - target: {fileID: 4071519224935516, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.4452274 + objectReference: {fileID: 0} + - target: {fileID: 4071519224935516, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -23.288254 + objectReference: {fileID: 0} + - target: {fileID: 4075864462779534, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.0831125 + objectReference: {fileID: 0} + - target: {fileID: 4075864462779534, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.6556501 + objectReference: {fileID: 0} + - target: {fileID: 4075864462779534, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.0055122 + objectReference: {fileID: 0} + - target: {fileID: 4077469347768860, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.3828254 + objectReference: {fileID: 0} + - target: {fileID: 4077469347768860, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -13.731027 + objectReference: {fileID: 0} + - target: {fileID: 4077469347768860, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -13.009008 + objectReference: {fileID: 0} + - target: {fileID: 4081524457781149, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -69.76887 + objectReference: {fileID: 0} + - target: {fileID: 4081524457781149, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 138.83156 + objectReference: {fileID: 0} + - target: {fileID: 4081524457781149, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -62.81451 + objectReference: {fileID: 0} + - target: {fileID: 4081920422494107, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000015341202 + objectReference: {fileID: 0} + - target: {fileID: 4081920422494107, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.2969304e-12 + objectReference: {fileID: 0} + - target: {fileID: 4081920422494107, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000048353068 + objectReference: {fileID: 0} + - target: {fileID: 4083485975560739, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -46.96152 + objectReference: {fileID: 0} + - target: {fileID: 4083485975560739, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 91.03408 + objectReference: {fileID: 0} + - target: {fileID: 4083485975560739, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -102.89052 + objectReference: {fileID: 0} + - target: {fileID: 4085134620244786, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.0597016e-14 + objectReference: {fileID: 0} + - target: {fileID: 4085134620244786, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000012894153 + objectReference: {fileID: 0} + - target: {fileID: 4085134620244786, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4094283985748868, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.8445145 + objectReference: {fileID: 0} + - target: {fileID: 4094283985748868, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -12.859634 + objectReference: {fileID: 0} + - target: {fileID: 4094283985748868, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 9.207921 + objectReference: {fileID: 0} + - target: {fileID: 4096597530611644, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -56.606762 + objectReference: {fileID: 0} + - target: {fileID: 4096597530611644, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -23.196085 + objectReference: {fileID: 0} + - target: {fileID: 4096597530611644, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -169.32913 + objectReference: {fileID: 0} + - target: {fileID: 4102543447223915, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.697948 + objectReference: {fileID: 0} + - target: {fileID: 4102543447223915, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.1723918 + objectReference: {fileID: 0} + - target: {fileID: 4102543447223915, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -96.59489 + objectReference: {fileID: 0} + - target: {fileID: 4105912343260855, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.2280606 + objectReference: {fileID: 0} + - target: {fileID: 4105912343260855, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.77029324 + objectReference: {fileID: 0} + - target: {fileID: 4105912343260855, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -12.121031 + objectReference: {fileID: 0} + - target: {fileID: 4117307842306080, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00002810357 + objectReference: {fileID: 0} + - target: {fileID: 4117307842306080, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.7667853e-12 + objectReference: {fileID: 0} + - target: {fileID: 4117307842306080, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00001276237 + objectReference: {fileID: 0} + - target: {fileID: 4119337346424409, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -6.2678537 + objectReference: {fileID: 0} + - target: {fileID: 4119337346424409, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -30.12201 + objectReference: {fileID: 0} + - target: {fileID: 4119337346424409, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 40.316708 + objectReference: {fileID: 0} + - target: {fileID: 4124577934639600, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.9198404 + objectReference: {fileID: 0} + - target: {fileID: 4124577934639600, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.9373684 + objectReference: {fileID: 0} + - target: {fileID: 4124577934639600, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.40949 + objectReference: {fileID: 0} + - target: {fileID: 4126508818681447, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00008961201 + objectReference: {fileID: 0} + - target: {fileID: 4126508818681447, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00004915547 + objectReference: {fileID: 0} + - target: {fileID: 4126508818681447, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -82.780655 + objectReference: {fileID: 0} + - target: {fileID: 4129116114662800, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000016117694 + objectReference: {fileID: 0} + - target: {fileID: 4129116114662800, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000012894154 + objectReference: {fileID: 0} + - target: {fileID: 4129116114662800, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000005641192 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -6.871425 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -53.108715 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 156.40265 + objectReference: {fileID: 0} + - target: {fileID: 4134286944189183, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -77.211655 + objectReference: {fileID: 0} + - target: {fileID: 4134286944189183, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -88.017944 + objectReference: {fileID: 0} + - target: {fileID: 4134286944189183, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 177.84465 + objectReference: {fileID: 0} + - target: {fileID: 4147706149845817, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.10953534 + objectReference: {fileID: 0} + - target: {fileID: 4147706149845817, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.4347994 + objectReference: {fileID: 0} + - target: {fileID: 4147706149845817, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.4888182 + objectReference: {fileID: 0} + - target: {fileID: 4151117949762783, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.0677075 + objectReference: {fileID: 0} + - target: {fileID: 4151117949762783, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.452183 + objectReference: {fileID: 0} + - target: {fileID: 4151117949762783, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.0382775 + objectReference: {fileID: 0} + - target: {fileID: 4161079637499176, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.8222733 + objectReference: {fileID: 0} + - target: {fileID: 4161079637499176, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.9876232 + objectReference: {fileID: 0} + - target: {fileID: 4161079637499176, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.017346859 + objectReference: {fileID: 0} + - target: {fileID: 4161342230376464, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.79203796 + objectReference: {fileID: 0} + - target: {fileID: 4161342230376464, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 4.3497887 + objectReference: {fileID: 0} + - target: {fileID: 4161342230376464, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 5.894495 + objectReference: {fileID: 0} + - target: {fileID: 4171308771648913, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.76110595 + objectReference: {fileID: 0} + - target: {fileID: 4171308771648913, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.892288 + objectReference: {fileID: 0} + - target: {fileID: 4171308771648913, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -11.619186 + objectReference: {fileID: 0} + - target: {fileID: 4173334745350128, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.12587343 + objectReference: {fileID: 0} + - target: {fileID: 4173334745350128, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.041828442 + objectReference: {fileID: 0} + - target: {fileID: 4173334745350128, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.2320683 + objectReference: {fileID: 0} + - target: {fileID: 4173644300073267, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000021197457 + objectReference: {fileID: 0} + - target: {fileID: 4173644300073267, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000055239246 + objectReference: {fileID: 0} + - target: {fileID: 4173644300073267, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 10.9904 + objectReference: {fileID: 0} + - target: {fileID: 4202048797312955, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.35426593 + objectReference: {fileID: 0} + - target: {fileID: 4202048797312955, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.458284 + objectReference: {fileID: 0} + - target: {fileID: 4202048797312955, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -12.882641 + objectReference: {fileID: 0} + - target: {fileID: 4208269818966246, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.2145185 + objectReference: {fileID: 0} + - target: {fileID: 4208269818966246, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.8205993 + objectReference: {fileID: 0} + - target: {fileID: 4208269818966246, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 16.769712 + objectReference: {fileID: 0} + - target: {fileID: 4222568209840903, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 79.96168 + objectReference: {fileID: 0} + - target: {fileID: 4222568209840903, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -173.35904 + objectReference: {fileID: 0} + - target: {fileID: 4222568209840903, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 163.63324 + objectReference: {fileID: 0} + - target: {fileID: 4228214996573471, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 20.7144 + objectReference: {fileID: 0} + - target: {fileID: 4228214996573471, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -175.76727 + objectReference: {fileID: 0} + - target: {fileID: 4228214996573471, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 10.570048 + objectReference: {fileID: 0} + - target: {fileID: 4231676679060417, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.2806168 + objectReference: {fileID: 0} + - target: {fileID: 4231676679060417, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -161.06001 + objectReference: {fileID: 0} + - target: {fileID: 4231676679060417, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -22.458218 + objectReference: {fileID: 0} + - target: {fileID: 4232415838589296, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.264151 + objectReference: {fileID: 0} + - target: {fileID: 4232415838589296, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -23.159742 + objectReference: {fileID: 0} + - target: {fileID: 4232415838589296, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 10.698955 + objectReference: {fileID: 0} + - target: {fileID: 4232720755092366, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.7637682 + objectReference: {fileID: 0} + - target: {fileID: 4232720755092366, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -7.803027 + objectReference: {fileID: 0} + - target: {fileID: 4232720755092366, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.7724667 + objectReference: {fileID: 0} + - target: {fileID: 4239265225482239, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.3277326 + objectReference: {fileID: 0} + - target: {fileID: 4239265225482239, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.1870594 + objectReference: {fileID: 0} + - target: {fileID: 4239265225482239, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.29194844 + objectReference: {fileID: 0} + - target: {fileID: 4246380077148219, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4246380077148219, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4246887588868771, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000025788304 + objectReference: {fileID: 0} + - target: {fileID: 4246887588868771, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.1581563e-22 + objectReference: {fileID: 0} + - target: {fileID: 4246887588868771, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4249237965167194, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 7.3061247 + objectReference: {fileID: 0} + - target: {fileID: 4249237965167194, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 4.817219 + objectReference: {fileID: 0} + - target: {fileID: 4249237965167194, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 8.207734 + objectReference: {fileID: 0} + - target: {fileID: 4250083484182041, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 16.841402 + objectReference: {fileID: 0} + - target: {fileID: 4250083484182041, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -24.343302 + objectReference: {fileID: 0} + - target: {fileID: 4250083484182041, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -18.453012 + objectReference: {fileID: 0} + - target: {fileID: 4260713349338959, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.3568151 + objectReference: {fileID: 0} + - target: {fileID: 4260713349338959, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.408238 + objectReference: {fileID: 0} + - target: {fileID: 4260713349338959, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 25.798529 + objectReference: {fileID: 0} + - target: {fileID: 4290791091168379, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.782664 + objectReference: {fileID: 0} + - target: {fileID: 4290791091168379, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 11.06281 + objectReference: {fileID: 0} + - target: {fileID: 4290791091168379, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 33.706734 + objectReference: {fileID: 0} + - target: {fileID: 4291547872775986, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4291547872775986, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000054800153 + objectReference: {fileID: 0} + - target: {fileID: 4293769854670634, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.013675 + objectReference: {fileID: 0} + - target: {fileID: 4293769854670634, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 165.63477 + objectReference: {fileID: 0} + - target: {fileID: 4293769854670634, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 50.061157 + objectReference: {fileID: 0} + - target: {fileID: 4299931057912216, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.5238878 + objectReference: {fileID: 0} + - target: {fileID: 4299931057912216, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.5468406 + objectReference: {fileID: 0} + - target: {fileID: 4299931057912216, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.1302436 + objectReference: {fileID: 0} + - target: {fileID: 4321515599905260, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.542846 + objectReference: {fileID: 0} + - target: {fileID: 4321515599905260, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -162.16544 + objectReference: {fileID: 0} + - target: {fileID: 4321515599905260, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 14.455347 + objectReference: {fileID: 0} + - target: {fileID: 4322008579206753, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000029070608 + objectReference: {fileID: 0} + - target: {fileID: 4322008579206753, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00002810359 + objectReference: {fileID: 0} + - target: {fileID: 4322008579206753, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.00005620714 + objectReference: {fileID: 0} + - target: {fileID: 4329075794784248, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000016117693 + objectReference: {fileID: 0} + - target: {fileID: 4329075794784248, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000012894154 + objectReference: {fileID: 0} + - target: {fileID: 4329075794784248, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4329446674688094, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 79.98617 + objectReference: {fileID: 0} + - target: {fileID: 4329446674688094, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -173.8658 + objectReference: {fileID: 0} + - target: {fileID: 4329446674688094, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -166.97083 + objectReference: {fileID: 0} + - target: {fileID: 4330820015962899, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0043261442 + objectReference: {fileID: 0} + - target: {fileID: 4330820015962899, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.1199775 + objectReference: {fileID: 0} + - target: {fileID: 4330820015962899, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.34901103 + objectReference: {fileID: 0} + - target: {fileID: 4337165658744233, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -79.173416 + objectReference: {fileID: 0} + - target: {fileID: 4337165658744233, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -172.69029 + objectReference: {fileID: 0} + - target: {fileID: 4337165658744233, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 32.71234 + objectReference: {fileID: 0} + - target: {fileID: 4344618938641724, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 51.819958 + objectReference: {fileID: 0} + - target: {fileID: 4344618938641724, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 161.55083 + objectReference: {fileID: 0} + - target: {fileID: 4344618938641724, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 159.10596 + objectReference: {fileID: 0} + - target: {fileID: 4346445019804701, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -73.206154 + objectReference: {fileID: 0} + - target: {fileID: 4346445019804701, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -117.82404 + objectReference: {fileID: 0} + - target: {fileID: 4346445019804701, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 61.048946 + objectReference: {fileID: 0} + - target: {fileID: 4349979204078785, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000034298773 + objectReference: {fileID: 0} + - target: {fileID: 4349979204078785, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000048653906 + objectReference: {fileID: 0} + - target: {fileID: 4349979204078785, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 11.510298 + objectReference: {fileID: 0} + - target: {fileID: 4350143044813081, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4350143044813081, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4350408777337066, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00008842795 + objectReference: {fileID: 0} + - target: {fileID: 4350408777337066, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000051217106 + objectReference: {fileID: 0} + - target: {fileID: 4350408777337066, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -82.780655 + objectReference: {fileID: 0} + - target: {fileID: 4356700911858394, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 7.8400626 + objectReference: {fileID: 0} + - target: {fileID: 4356700911858394, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -4.5148635 + objectReference: {fileID: 0} + - target: {fileID: 4356700911858394, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 41.990253 + objectReference: {fileID: 0} + - target: {fileID: 4360591974699550, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.240555 + objectReference: {fileID: 0} + - target: {fileID: 4360591974699550, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -12.260853 + objectReference: {fileID: 0} + - target: {fileID: 4360591974699550, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -157.9924 + objectReference: {fileID: 0} + - target: {fileID: 4364392939154294, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.546295e-15 + objectReference: {fileID: 0} + - target: {fileID: 4364392939154294, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000042308946 + objectReference: {fileID: 0} + - target: {fileID: 4364392939154294, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.0000003626481 + objectReference: {fileID: 0} + - target: {fileID: 4365773988297632, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00002810346 + objectReference: {fileID: 0} + - target: {fileID: 4365773988297632, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00010223075 + objectReference: {fileID: 0} + - target: {fileID: 4365773988297632, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.00008057425 + objectReference: {fileID: 0} + - target: {fileID: 4370081907136253, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.3318186 + objectReference: {fileID: 0} + - target: {fileID: 4370081907136253, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.1685252 + objectReference: {fileID: 0} + - target: {fileID: 4370081907136253, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.573092 + objectReference: {fileID: 0} + - target: {fileID: 4370485308309611, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10.111385 + objectReference: {fileID: 0} + - target: {fileID: 4370485308309611, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.18764 + objectReference: {fileID: 0} + - target: {fileID: 4370485308309611, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 9.151491 + objectReference: {fileID: 0} + - target: {fileID: 4372353275341440, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000030682055 + objectReference: {fileID: 0} + - target: {fileID: 4372353275341440, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000012755098 + objectReference: {fileID: 0} + - target: {fileID: 4372353275341440, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.31487793 + objectReference: {fileID: 0} + - target: {fileID: 4382656168358062, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 61.461254 + objectReference: {fileID: 0} + - target: {fileID: 4382656168358062, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.4258862 + objectReference: {fileID: 0} + - target: {fileID: 4382656168358062, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 19.489065 + objectReference: {fileID: 0} + - target: {fileID: 4384784573714692, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00002681416 + objectReference: {fileID: 0} + - target: {fileID: 4384784573714692, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.7292416e-11 + objectReference: {fileID: 0} + - target: {fileID: 4384784573714692, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000049891853 + objectReference: {fileID: 0} + - target: {fileID: 4385730263066598, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.7216296 + objectReference: {fileID: 0} + - target: {fileID: 4385730263066598, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.069012344 + objectReference: {fileID: 0} + - target: {fileID: 4385730263066598, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -18.6936 + objectReference: {fileID: 0} + - target: {fileID: 4386568470988373, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.0753505 + objectReference: {fileID: 0} + - target: {fileID: 4386568470988373, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 7.8375907 + objectReference: {fileID: 0} + - target: {fileID: 4386568470988373, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.12804478 + objectReference: {fileID: 0} + - target: {fileID: 4387228018655110, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000021326598 + objectReference: {fileID: 0} + - target: {fileID: 4387228018655110, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000000039736744 + objectReference: {fileID: 0} + - target: {fileID: 4387228018655110, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.6963823 + objectReference: {fileID: 0} + - target: {fileID: 4391225667286877, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.3203864 + objectReference: {fileID: 0} + - target: {fileID: 4391225667286877, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -13.205517 + objectReference: {fileID: 0} + - target: {fileID: 4391225667286877, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 5.6844707 + objectReference: {fileID: 0} + - target: {fileID: 4401109917237556, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.6545972 + objectReference: {fileID: 0} + - target: {fileID: 4401109917237556, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.5272443 + objectReference: {fileID: 0} + - target: {fileID: 4401109917237556, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.1587114 + objectReference: {fileID: 0} + - target: {fileID: 4401429660297866, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.30983782 + objectReference: {fileID: 0} + - target: {fileID: 4401429660297866, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -4.1213145 + objectReference: {fileID: 0} + - target: {fileID: 4401429660297866, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 25.250702 + objectReference: {fileID: 0} + - target: {fileID: 4403529848822963, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 17.768906 + objectReference: {fileID: 0} + - target: {fileID: 4403529848822963, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 18.01251 + objectReference: {fileID: 0} + - target: {fileID: 4403529848822963, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -40.647526 + objectReference: {fileID: 0} + - target: {fileID: 4405989028062321, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.7755032 + objectReference: {fileID: 0} + - target: {fileID: 4405989028062321, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -16.045618 + objectReference: {fileID: 0} + - target: {fileID: 4405989028062321, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -29.131712 + objectReference: {fileID: 0} + - target: {fileID: 4410049401584812, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.59289604 + objectReference: {fileID: 0} + - target: {fileID: 4410049401584812, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000064405035 + objectReference: {fileID: 0} + - target: {fileID: 4410049401584812, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4413603344295461, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.0597016e-14 + objectReference: {fileID: 0} + - target: {fileID: 4413603344295461, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000012894153 + objectReference: {fileID: 0} + - target: {fileID: 4413603344295461, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4415925016355036, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4415925016355036, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4417625065123525, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -11.497313 + objectReference: {fileID: 0} + - target: {fileID: 4417625065123525, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -4.2103157 + objectReference: {fileID: 0} + - target: {fileID: 4417625065123525, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.327934 + objectReference: {fileID: 0} + - target: {fileID: 4422702022971346, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.5181152 + objectReference: {fileID: 0} + - target: {fileID: 4422702022971346, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 176.75449 + objectReference: {fileID: 0} + - target: {fileID: 4422702022971346, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -29.93351 + objectReference: {fileID: 0} + - target: {fileID: 4428560594236482, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.323828 + objectReference: {fileID: 0} + - target: {fileID: 4428560594236482, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.931171 + objectReference: {fileID: 0} + - target: {fileID: 4428560594236482, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 19.436174 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4432271528610696, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.3696055 + objectReference: {fileID: 0} + - target: {fileID: 4432271528610696, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -12.253956 + objectReference: {fileID: 0} + - target: {fileID: 4432271528610696, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 4.4377646 + objectReference: {fileID: 0} + - target: {fileID: 4433881075115309, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -55.796814 + objectReference: {fileID: 0} + - target: {fileID: 4433881075115309, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 115.66672 + objectReference: {fileID: 0} + - target: {fileID: 4433881075115309, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 112.932076 + objectReference: {fileID: 0} + - target: {fileID: 4450063812975771, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.2907484 + objectReference: {fileID: 0} + - target: {fileID: 4450063812975771, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -23.70808 + objectReference: {fileID: 0} + - target: {fileID: 4450063812975771, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 10.741094 + objectReference: {fileID: 0} + - target: {fileID: 4458735412797113, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -30.036882 + objectReference: {fileID: 0} + - target: {fileID: 4458735412797113, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 37.795563 + objectReference: {fileID: 0} + - target: {fileID: 4458735412797113, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 106.917244 + objectReference: {fileID: 0} + - target: {fileID: 4459598911568433, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -13.605494 + objectReference: {fileID: 0} + - target: {fileID: 4459598911568433, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.4670105 + objectReference: {fileID: 0} + - target: {fileID: 4459598911568433, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.625073 + objectReference: {fileID: 0} + - target: {fileID: 4463395028392447, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -71.99774 + objectReference: {fileID: 0} + - target: {fileID: 4463395028392447, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 142.69333 + objectReference: {fileID: 0} + - target: {fileID: 4463395028392447, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 56.256622 + objectReference: {fileID: 0} + - target: {fileID: 4463579974499585, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 84.0087 + objectReference: {fileID: 0} + - target: {fileID: 4463579974499585, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 49.217255 + objectReference: {fileID: 0} + - target: {fileID: 4463579974499585, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 72.450455 + objectReference: {fileID: 0} + - target: {fileID: 4493949256727870, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4493949256727870, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.00002810357 + objectReference: {fileID: 0} + - target: {fileID: 4494345407022765, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -6.0604115 + objectReference: {fileID: 0} + - target: {fileID: 4494345407022765, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.3800073 + objectReference: {fileID: 0} + - target: {fileID: 4494345407022765, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.6584864 + objectReference: {fileID: 0} + - target: {fileID: 4500050402096248, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00001189144 + objectReference: {fileID: 0} + - target: {fileID: 4500050402096248, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4502609866597578, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.410931 + objectReference: {fileID: 0} + - target: {fileID: 4502609866597578, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.544026 + objectReference: {fileID: 0} + - target: {fileID: 4502609866597578, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -15.892247 + objectReference: {fileID: 0} + - target: {fileID: 4504506843557392, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.0508711 + objectReference: {fileID: 0} + - target: {fileID: 4504506843557392, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.341714 + objectReference: {fileID: 0} + - target: {fileID: 4504506843557392, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -14.602878 + objectReference: {fileID: 0} + - target: {fileID: 4505490946690937, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.4613023 + objectReference: {fileID: 0} + - target: {fileID: 4505490946690937, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.904903 + objectReference: {fileID: 0} + - target: {fileID: 4505490946690937, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.0705748 + objectReference: {fileID: 0} + - target: {fileID: 4505682267929073, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.4652243 + objectReference: {fileID: 0} + - target: {fileID: 4505682267929073, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -20.521439 + objectReference: {fileID: 0} + - target: {fileID: 4505682267929073, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -25.634052 + objectReference: {fileID: 0} + - target: {fileID: 4507522976744791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000009897967 + objectReference: {fileID: 0} + - target: {fileID: 4507522976744791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000018401468 + objectReference: {fileID: 0} + - target: {fileID: 4507522976744791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 20.222462 + objectReference: {fileID: 0} + - target: {fileID: 4510073901028830, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.4708357 + objectReference: {fileID: 0} + - target: {fileID: 4510073901028830, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -14.029893 + objectReference: {fileID: 0} + - target: {fileID: 4510073901028830, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 37.109024 + objectReference: {fileID: 0} + - target: {fileID: 4510800835404288, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.2144823 + objectReference: {fileID: 0} + - target: {fileID: 4510800835404288, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.9997149 + objectReference: {fileID: 0} + - target: {fileID: 4510800835404288, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.7429123 + objectReference: {fileID: 0} + - target: {fileID: 4517377532936435, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.30792403 + objectReference: {fileID: 0} + - target: {fileID: 4517377532936435, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.041772 + objectReference: {fileID: 0} + - target: {fileID: 4517377532936435, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.13300717 + objectReference: {fileID: 0} + - target: {fileID: 4518639523470932, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.29681814 + objectReference: {fileID: 0} + - target: {fileID: 4518639523470932, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -10.014883 + objectReference: {fileID: 0} + - target: {fileID: 4518639523470932, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -2.6982584 + objectReference: {fileID: 0} + - target: {fileID: 4519819979147140, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.5929112 + objectReference: {fileID: 0} + - target: {fileID: 4519819979147140, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4519819979147140, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4521597976012101, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 12.481548 + objectReference: {fileID: 0} + - target: {fileID: 4521597976012101, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 13.561207 + objectReference: {fileID: 0} + - target: {fileID: 4521597976012101, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 40.705887 + objectReference: {fileID: 0} + - target: {fileID: 4534964404139401, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 7.606997 + objectReference: {fileID: 0} + - target: {fileID: 4534964404139401, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 18.449339 + objectReference: {fileID: 0} + - target: {fileID: 4534964404139401, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -2.558353 + objectReference: {fileID: 0} + - target: {fileID: 4536148047902537, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.4414895 + objectReference: {fileID: 0} + - target: {fileID: 4536148047902537, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 175.57147 + objectReference: {fileID: 0} + - target: {fileID: 4536148047902537, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 45.712254 + objectReference: {fileID: 0} + - target: {fileID: 4539572024531195, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.2106106 + objectReference: {fileID: 0} + - target: {fileID: 4539572024531195, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.5223212 + objectReference: {fileID: 0} + - target: {fileID: 4539572024531195, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.99638355 + objectReference: {fileID: 0} + - target: {fileID: 4543023241981873, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 11.107834 + objectReference: {fileID: 0} + - target: {fileID: 4543023241981873, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -46.166233 + objectReference: {fileID: 0} + - target: {fileID: 4543023241981873, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 33.63374 + objectReference: {fileID: 0} + - target: {fileID: 4543584136297381, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000012894154 + objectReference: {fileID: 0} + - target: {fileID: 4543584136297381, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.5790784e-22 + objectReference: {fileID: 0} + - target: {fileID: 4543584136297381, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4544837802452058, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 31.114672 + objectReference: {fileID: 0} + - target: {fileID: 4544837802452058, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -14.843173 + objectReference: {fileID: 0} + - target: {fileID: 4544837802452058, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -42.58998 + objectReference: {fileID: 0} + - target: {fileID: 4545683990359770, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.3786297 + objectReference: {fileID: 0} + - target: {fileID: 4545683990359770, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -14.785211 + objectReference: {fileID: 0} + - target: {fileID: 4545683990359770, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 16.807905 + objectReference: {fileID: 0} + - target: {fileID: 4547349145286502, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00005620714 + objectReference: {fileID: 0} + - target: {fileID: 4547349145286502, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000002981767 + objectReference: {fileID: 0} + - target: {fileID: 4547349145286502, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4548862692844868, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.1442285 + objectReference: {fileID: 0} + - target: {fileID: 4548862692844868, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.342905 + objectReference: {fileID: 0} + - target: {fileID: 4548862692844868, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 22.435966 + objectReference: {fileID: 0} + - target: {fileID: 4554240831246011, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 50.650955 + objectReference: {fileID: 0} + - target: {fileID: 4554240831246011, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 156.13527 + objectReference: {fileID: 0} + - target: {fileID: 4554240831246011, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -58.03935 + objectReference: {fileID: 0} + - target: {fileID: 4556043395114336, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000016237807 + objectReference: {fileID: 0} + - target: {fileID: 4556043395114336, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.5778918e-34 + objectReference: {fileID: 0} + - target: {fileID: 4556043395114336, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.4608867e-28 + objectReference: {fileID: 0} + - target: {fileID: 4559203567323380, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000002578831 + objectReference: {fileID: 0} + - target: {fileID: 4559203567323380, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000064470765 + objectReference: {fileID: 0} + - target: {fileID: 4559203567323380, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.00000064470765 + objectReference: {fileID: 0} + - target: {fileID: 4562080017223558, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000003078881 + objectReference: {fileID: 0} + - target: {fileID: 4562080017223558, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000002201471 + objectReference: {fileID: 0} + - target: {fileID: 4562080017223558, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -109.75108 + objectReference: {fileID: 0} + - target: {fileID: 4566389953100910, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000033905933 + objectReference: {fileID: 0} + - target: {fileID: 4566389953100910, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.4770593e-11 + objectReference: {fileID: 0} + - target: {fileID: 4566389953100910, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00003164946 + objectReference: {fileID: 0} + - target: {fileID: 4573076885614623, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.9387087 + objectReference: {fileID: 0} + - target: {fileID: 4573076885614623, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 4.4825144 + objectReference: {fileID: 0} + - target: {fileID: 4573076885614623, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -15.3488655 + objectReference: {fileID: 0} + - target: {fileID: 4578880696632637, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4578880696632637, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4580109562975512, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -26.39763 + objectReference: {fileID: 0} + - target: {fileID: 4580109562975512, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 9.623608 + objectReference: {fileID: 0} + - target: {fileID: 4580109562975512, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.7733241 + objectReference: {fileID: 0} + - target: {fileID: 4583788928901705, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000050997915 + objectReference: {fileID: 0} + - target: {fileID: 4583788928901705, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000021866198 + objectReference: {fileID: 0} + - target: {fileID: 4583788928901705, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.3148701 + objectReference: {fileID: 0} + - target: {fileID: 4587083680832752, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 21.759779 + objectReference: {fileID: 0} + - target: {fileID: 4587083680832752, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.531286 + objectReference: {fileID: 0} + - target: {fileID: 4587083680832752, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 5.531313 + objectReference: {fileID: 0} + - target: {fileID: 4616352195932608, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -11.265233 + objectReference: {fileID: 0} + - target: {fileID: 4616352195932608, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -50.400757 + objectReference: {fileID: 0} + - target: {fileID: 4616352195932608, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -21.589914 + objectReference: {fileID: 0} + - target: {fileID: 4616761771223058, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4616761771223058, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.0597016e-14 + objectReference: {fileID: 0} + - target: {fileID: 4630063386271700, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -60.43381 + objectReference: {fileID: 0} + - target: {fileID: 4630063386271700, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 93.142914 + objectReference: {fileID: 0} + - target: {fileID: 4630063386271700, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 75.04743 + objectReference: {fileID: 0} + - target: {fileID: 4632179142322292, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -29.37802 + objectReference: {fileID: 0} + - target: {fileID: 4632179142322292, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.8693223 + objectReference: {fileID: 0} + - target: {fileID: 4632179142322292, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.5227766 + objectReference: {fileID: 0} + - target: {fileID: 4634112529866277, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.45087457 + objectReference: {fileID: 0} + - target: {fileID: 4634112529866277, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -19.852541 + objectReference: {fileID: 0} + - target: {fileID: 4634112529866277, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -2.0539083 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000005545969 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000037824657 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 21.219734 + objectReference: {fileID: 0} + - target: {fileID: 4644357204029367, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 33.79569 + objectReference: {fileID: 0} + - target: {fileID: 4644357204029367, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 9.050762 + objectReference: {fileID: 0} + - target: {fileID: 4644357204029367, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 23.612556 + objectReference: {fileID: 0} + - target: {fileID: 4663898806329775, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.7606151 + objectReference: {fileID: 0} + - target: {fileID: 4663898806329775, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -21.16057 + objectReference: {fileID: 0} + - target: {fileID: 4663898806329775, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 30.610802 + objectReference: {fileID: 0} + - target: {fileID: 4667785438668446, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.2570475 + objectReference: {fileID: 0} + - target: {fileID: 4667785438668446, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.396168 + objectReference: {fileID: 0} + - target: {fileID: 4667785438668446, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -17.449223 + objectReference: {fileID: 0} + - target: {fileID: 4670321012828500, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.6432317 + objectReference: {fileID: 0} + - target: {fileID: 4670321012828500, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -25.101883 + objectReference: {fileID: 0} + - target: {fileID: 4670321012828500, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 160.8775 + objectReference: {fileID: 0} + - target: {fileID: 4681721672847880, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00002810357 + objectReference: {fileID: 0} + - target: {fileID: 4681721672847880, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000064470447 + objectReference: {fileID: 0} + - target: {fileID: 4681721672847880, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000019854151 + objectReference: {fileID: 0} + - target: {fileID: 4688331903957256, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.886916 + objectReference: {fileID: 0} + - target: {fileID: 4688331903957256, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -26.859512 + objectReference: {fileID: 0} + - target: {fileID: 4688331903957256, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -44.718204 + objectReference: {fileID: 0} + - target: {fileID: 4691570808825369, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -30.10854 + objectReference: {fileID: 0} + - target: {fileID: 4691570808825369, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -11.913877 + objectReference: {fileID: 0} + - target: {fileID: 4691570808825369, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -41.17268 + objectReference: {fileID: 0} + - target: {fileID: 4692131138185966, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.4305964 + objectReference: {fileID: 0} + - target: {fileID: 4692131138185966, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 9.38925 + objectReference: {fileID: 0} + - target: {fileID: 4692131138185966, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 14.360158 + objectReference: {fileID: 0} + - target: {fileID: 4696792502030561, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 62.517513 + objectReference: {fileID: 0} + - target: {fileID: 4696792502030561, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 17.498013 + objectReference: {fileID: 0} + - target: {fileID: 4696792502030561, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 18.408236 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalPosition.z + value: 200 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4703850765261885, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.9141241 + objectReference: {fileID: 0} + - target: {fileID: 4703850765261885, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.708255 + objectReference: {fileID: 0} + - target: {fileID: 4703850765261885, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.661419 + objectReference: {fileID: 0} + - target: {fileID: 4704877758540679, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 12.163572 + objectReference: {fileID: 0} + - target: {fileID: 4704877758540679, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -111.998 + objectReference: {fileID: 0} + - target: {fileID: 4704877758540679, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -169.34769 + objectReference: {fileID: 0} + - target: {fileID: 4712091639049384, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.9594864e-15 + objectReference: {fileID: 0} + - target: {fileID: 4712091639049384, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -180 + objectReference: {fileID: 0} + - target: {fileID: 4712091639049384, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 13.101974 + objectReference: {fileID: 0} + - target: {fileID: 4714397710475260, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 13.402355 + objectReference: {fileID: 0} + - target: {fileID: 4714397710475260, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.6366844 + objectReference: {fileID: 0} + - target: {fileID: 4714397710475260, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.0654864 + objectReference: {fileID: 0} + - target: {fileID: 4722550256369544, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.0200706 + objectReference: {fileID: 0} + - target: {fileID: 4722550256369544, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -11.17768 + objectReference: {fileID: 0} + - target: {fileID: 4722550256369544, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -18.230865 + objectReference: {fileID: 0} + - target: {fileID: 4729152026894248, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000041134022 + objectReference: {fileID: 0} + - target: {fileID: 4729152026894248, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000007732477 + objectReference: {fileID: 0} + - target: {fileID: 4729152026894248, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000022782908 + objectReference: {fileID: 0} + - target: {fileID: 4729442808604298, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4729442808604298, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4729821067651183, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 4729821067651183, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 89.99992 + objectReference: {fileID: 0} + - target: {fileID: 4731059169969419, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4731059169969419, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000032235386 + objectReference: {fileID: 0} + - target: {fileID: 4731059169969419, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4734143864522482, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00014271289 + objectReference: {fileID: 0} + - target: {fileID: 4734143864522482, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000034184627 + objectReference: {fileID: 0} + - target: {fileID: 4734143864522482, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.23341693 + objectReference: {fileID: 0} + - target: {fileID: 4739268104783211, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.16960141 + objectReference: {fileID: 0} + - target: {fileID: 4739268104783211, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -4.4696193 + objectReference: {fileID: 0} + - target: {fileID: 4739268104783211, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 5.6975727 + objectReference: {fileID: 0} + - target: {fileID: 4743905223825669, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000052467207 + objectReference: {fileID: 0} + - target: {fileID: 4743905223825669, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00012401167 + objectReference: {fileID: 0} + - target: {fileID: 4743905223825669, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000069227 + objectReference: {fileID: 0} + - target: {fileID: 4749950996922467, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -8.34901 + objectReference: {fileID: 0} + - target: {fileID: 4749950996922467, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 176.51633 + objectReference: {fileID: 0} + - target: {fileID: 4749950996922467, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 142.39493 + objectReference: {fileID: 0} + - target: {fileID: 4751888446361502, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00005620716 + objectReference: {fileID: 0} + - target: {fileID: 4751888446361502, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000049247115 + objectReference: {fileID: 0} + - target: {fileID: 4751888446361502, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000030682382 + objectReference: {fileID: 0} + - target: {fileID: 4754026925822528, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000064470714 + objectReference: {fileID: 0} + - target: {fileID: 4754026925822528, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000021758879 + objectReference: {fileID: 0} + - target: {fileID: 4754026925822528, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4760480127920944, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -66.9767 + objectReference: {fileID: 0} + - target: {fileID: 4760480127920944, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.527195 + objectReference: {fileID: 0} + - target: {fileID: 4760480127920944, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 126.390564 + objectReference: {fileID: 0} + - target: {fileID: 4766709239876273, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000006447076 + objectReference: {fileID: 0} + - target: {fileID: 4766709239876273, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000012894154 + objectReference: {fileID: 0} + - target: {fileID: 4766709239876273, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.0000025788308 + objectReference: {fileID: 0} + - target: {fileID: 4777414246829702, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -51.44461 + objectReference: {fileID: 0} + - target: {fileID: 4777414246829702, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -104.07968 + objectReference: {fileID: 0} + - target: {fileID: 4777414246829702, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 97.34745 + objectReference: {fileID: 0} + - target: {fileID: 4782439640980787, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.697722 + objectReference: {fileID: 0} + - target: {fileID: 4782439640980787, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -178.82756 + objectReference: {fileID: 0} + - target: {fileID: 4782439640980787, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -83.405106 + objectReference: {fileID: 0} + - target: {fileID: 4785416887765914, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -37.023914 + objectReference: {fileID: 0} + - target: {fileID: 4785416887765914, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 72.25267 + objectReference: {fileID: 0} + - target: {fileID: 4785416887765914, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 66.65632 + objectReference: {fileID: 0} + - target: {fileID: 4799881864385010, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000013568257 + objectReference: {fileID: 0} + - target: {fileID: 4799881864385010, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000064470817 + objectReference: {fileID: 0} + - target: {fileID: 4799881864385010, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 4.580924e-21 + objectReference: {fileID: 0} + - target: {fileID: 4805829819301007, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000050097296 + objectReference: {fileID: 0} + - target: {fileID: 4805829819301007, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000053562253 + objectReference: {fileID: 0} + - target: {fileID: 4805829819301007, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00009429439 + objectReference: {fileID: 0} + - target: {fileID: 4817105377731967, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -8.318008 + objectReference: {fileID: 0} + - target: {fileID: 4817105377731967, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -32.490555 + objectReference: {fileID: 0} + - target: {fileID: 4817105377731967, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -25.647724 + objectReference: {fileID: 0} + - target: {fileID: 4825818419884204, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -15.513014 + objectReference: {fileID: 0} + - target: {fileID: 4825818419884204, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 71.6263 + objectReference: {fileID: 0} + - target: {fileID: 4825818419884204, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 155.59198 + objectReference: {fileID: 0} + - target: {fileID: 4827586244175853, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000085418606 + objectReference: {fileID: 0} + - target: {fileID: 4827586244175853, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000036592867 + objectReference: {fileID: 0} + - target: {fileID: 4827586244175853, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 13.396002 + objectReference: {fileID: 0} + - target: {fileID: 4838352681112328, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.816243 + objectReference: {fileID: 0} + - target: {fileID: 4838352681112328, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.53176 + objectReference: {fileID: 0} + - target: {fileID: 4838352681112328, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 14.611567 + objectReference: {fileID: 0} + - target: {fileID: 4844361126439134, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -70.98927 + objectReference: {fileID: 0} + - target: {fileID: 4844361126439134, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.538844 + objectReference: {fileID: 0} + - target: {fileID: 4844361126439134, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 111.604034 + objectReference: {fileID: 0} + - target: {fileID: 4851449666512103, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -79.045944 + objectReference: {fileID: 0} + - target: {fileID: 4851449666512103, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 87.558334 + objectReference: {fileID: 0} + - target: {fileID: 4851449666512103, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -73.93858 + objectReference: {fileID: 0} + - target: {fileID: 4855622808019284, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00005401657 + objectReference: {fileID: 0} + - target: {fileID: 4855622808019284, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000005249322 + objectReference: {fileID: 0} + - target: {fileID: 4855622808019284, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.19183269 + objectReference: {fileID: 0} + - target: {fileID: 4857328259384655, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 4857328259384655, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.101991184 + objectReference: {fileID: 0} + - target: {fileID: 4869070488215218, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.03312546 + objectReference: {fileID: 0} + - target: {fileID: 4869070488215218, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.669116 + objectReference: {fileID: 0} + - target: {fileID: 4869070488215218, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.1559806 + objectReference: {fileID: 0} + - target: {fileID: 4869737159367836, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.5929112 + objectReference: {fileID: 0} + - target: {fileID: 4869737159367836, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000008418973 + objectReference: {fileID: 0} + - target: {fileID: 4869737159367836, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000009768773 + objectReference: {fileID: 0} + - target: {fileID: 4870947366518887, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 6.5625954 + objectReference: {fileID: 0} + - target: {fileID: 4870947366518887, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.5760779 + objectReference: {fileID: 0} + - target: {fileID: 4870947366518887, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 155.28648 + objectReference: {fileID: 0} + - target: {fileID: 4878983242975409, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000014505924 + objectReference: {fileID: 0} + - target: {fileID: 4878983242975409, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000012894154 + objectReference: {fileID: 0} + - target: {fileID: 4878983242975409, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4891995844532801, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -52.00141 + objectReference: {fileID: 0} + - target: {fileID: 4891995844532801, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -84.9855 + objectReference: {fileID: 0} + - target: {fileID: 4891995844532801, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -95.027794 + objectReference: {fileID: 0} + - target: {fileID: 4894225446638996, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.2035587 + objectReference: {fileID: 0} + - target: {fileID: 4894225446638996, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -22.6095 + objectReference: {fileID: 0} + - target: {fileID: 4894225446638996, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 25.676071 + objectReference: {fileID: 0} + - target: {fileID: 4894352506636257, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -8.36042 + objectReference: {fileID: 0} + - target: {fileID: 4894352506636257, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -84.47553 + objectReference: {fileID: 0} + - target: {fileID: 4894352506636257, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 76.43217 + objectReference: {fileID: 0} + - target: {fileID: 4904400124545405, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 16.670746 + objectReference: {fileID: 0} + - target: {fileID: 4904400124545405, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -91.69519 + objectReference: {fileID: 0} + - target: {fileID: 4904400124545405, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 109.80719 + objectReference: {fileID: 0} + - target: {fileID: 4907165584567512, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.7540017 + objectReference: {fileID: 0} + - target: {fileID: 4907165584567512, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -4.987185 + objectReference: {fileID: 0} + - target: {fileID: 4907165584567512, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.9986415 + objectReference: {fileID: 0} + - target: {fileID: 4910201747455131, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000024880035 + objectReference: {fileID: 0} + - target: {fileID: 4910201747455131, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000032235391 + objectReference: {fileID: 0} + - target: {fileID: 4910201747455131, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00001018354 + objectReference: {fileID: 0} + - target: {fileID: 4911451331743778, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 38.81911 + objectReference: {fileID: 0} + - target: {fileID: 4911451331743778, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -71.080536 + objectReference: {fileID: 0} + - target: {fileID: 4911451331743778, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 80.197716 + objectReference: {fileID: 0} + - target: {fileID: 4919715546813240, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.0582297 + objectReference: {fileID: 0} + - target: {fileID: 4919715546813240, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -129.10646 + objectReference: {fileID: 0} + - target: {fileID: 4919715546813240, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 32.89703 + objectReference: {fileID: 0} + - target: {fileID: 4931825979905961, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.2684141 + objectReference: {fileID: 0} + - target: {fileID: 4931825979905961, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.5238254 + objectReference: {fileID: 0} + - target: {fileID: 4931825979905961, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.1462066 + objectReference: {fileID: 0} + - target: {fileID: 4934287144746640, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.5298085 + objectReference: {fileID: 0} + - target: {fileID: 4934287144746640, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 20.937084 + objectReference: {fileID: 0} + - target: {fileID: 4934287144746640, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 29.397923 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 65.47519 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 73.25546 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -52.199303 + objectReference: {fileID: 0} + - target: {fileID: 4949593803130734, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.45848e-13 + objectReference: {fileID: 0} + - target: {fileID: 4949593803130734, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000051576603 + objectReference: {fileID: 0} + - target: {fileID: 4949593803130734, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000029011835 + objectReference: {fileID: 0} + - target: {fileID: 4951712121405908, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 66.74449 + objectReference: {fileID: 0} + - target: {fileID: 4951712121405908, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.8616477 + objectReference: {fileID: 0} + - target: {fileID: 4951712121405908, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 14.898514 + objectReference: {fileID: 0} + - target: {fileID: 4952320105404285, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000040294222 + objectReference: {fileID: 0} + - target: {fileID: 4952320105404285, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -4.934619e-23 + objectReference: {fileID: 0} + - target: {fileID: 4952320105404285, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -180 + objectReference: {fileID: 0} + - target: {fileID: 4952854571839949, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 35.192516 + objectReference: {fileID: 0} + - target: {fileID: 4952854571839949, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -92.761955 + objectReference: {fileID: 0} + - target: {fileID: 4952854571839949, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 73.77118 + objectReference: {fileID: 0} + - target: {fileID: 4958492976087124, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.5929112 + objectReference: {fileID: 0} + - target: {fileID: 4958492976087124, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.2580186e-16 + objectReference: {fileID: 0} + - target: {fileID: 4958492976087124, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.3133017e-14 + objectReference: {fileID: 0} + - target: {fileID: 4960577952585462, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -73.12779 + objectReference: {fileID: 0} + - target: {fileID: 4960577952585462, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -68.95262 + objectReference: {fileID: 0} + - target: {fileID: 4960577952585462, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 129.17407 + objectReference: {fileID: 0} + - target: {fileID: 4962713294667487, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 11.378325 + objectReference: {fileID: 0} + - target: {fileID: 4962713294667487, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -10.568762 + objectReference: {fileID: 0} + - target: {fileID: 4962713294667487, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 22.909933 + objectReference: {fileID: 0} + - target: {fileID: 4964675957374274, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00011575739 + objectReference: {fileID: 0} + - target: {fileID: 4964675957374274, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.99995 + objectReference: {fileID: 0} + - target: {fileID: 4964675957374274, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -97.21934 + objectReference: {fileID: 0} + - target: {fileID: 4964822413698908, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0010779389 + objectReference: {fileID: 0} + - target: {fileID: 4964822413698908, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00005103748 + objectReference: {fileID: 0} + - target: {fileID: 4964822413698908, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 9.309187 + objectReference: {fileID: 0} + - target: {fileID: 4975779338151784, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -62.23132 + objectReference: {fileID: 0} + - target: {fileID: 4975779338151784, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -145.93114 + objectReference: {fileID: 0} + - target: {fileID: 4975779338151784, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 4.4001374 + objectReference: {fileID: 0} + - target: {fileID: 4985908891298522, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -78.07843 + objectReference: {fileID: 0} + - target: {fileID: 4985908891298522, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 151.7155 + objectReference: {fileID: 0} + - target: {fileID: 4985908891298522, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 42.593655 + objectReference: {fileID: 0} + - target: {fileID: 4988340220343945, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 20.493832 + objectReference: {fileID: 0} + - target: {fileID: 4988340220343945, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -14.649167 + objectReference: {fileID: 0} + - target: {fileID: 4988340220343945, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -126.752716 + objectReference: {fileID: 0} + - target: {fileID: 4989434536655964, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000006070798 + objectReference: {fileID: 0} + - target: {fileID: 4989434536655964, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000021613973 + objectReference: {fileID: 0} + - target: {fileID: 4989434536655964, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -85.50981 + objectReference: {fileID: 0} + - target: {fileID: 4990702214508331, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 8.984197 + objectReference: {fileID: 0} + - target: {fileID: 4990702214508331, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.085125 + objectReference: {fileID: 0} + - target: {fileID: 4990702214508331, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 157.52565 + objectReference: {fileID: 0} + - target: {fileID: 4993076962757715, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000010828245 + objectReference: {fileID: 0} + - target: {fileID: 4993076962757715, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000003868246 + objectReference: {fileID: 0} + - target: {fileID: 4993076962757715, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000013084721 + objectReference: {fileID: 0} + - target: {fileID: 4996317296757491, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.678443 + objectReference: {fileID: 0} + - target: {fileID: 4996317296757491, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 9.160654 + objectReference: {fileID: 0} + - target: {fileID: 4996317296757491, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 14.038442 + objectReference: {fileID: 0} + - target: {fileID: 4998495239010246, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4998495239010246, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4998495239010246, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000006447077 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 1484755779879834, guid: d52c461779f3a1548a3f4543a5f1860d, + type: 3} + insertIndex: -1 + addedObject: {fileID: 741769758} + m_SourcePrefab: {fileID: 100100000, guid: d52c461779f3a1548a3f4543a5f1860d, type: 3} +--- !u!4 &741769756 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4697715728111791, guid: d52c461779f3a1548a3f4543a5f1860d, + type: 3} + m_PrefabInstance: {fileID: 741769755} + m_PrefabAsset: {fileID: 0} +--- !u!1 &741769757 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1484755779879834, guid: d52c461779f3a1548a3f4543a5f1860d, + type: 3} + m_PrefabInstance: {fileID: 741769755} + m_PrefabAsset: {fileID: 0} +--- !u!114 &741769758 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 741769757} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 3 + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_LightLayerMask: 1 + m_RenderingLayers: 1 + m_CustomShadowLayers: 0 + m_ShadowLayerMask: 1 + m_ShadowRenderingLayers: 1 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 --- !u!1 &757015530 GameObject: m_ObjectHideFlags: 0 @@ -1641,6 +6731,41 @@ BoxCollider2D: serializedVersion: 2 m_Size: {x: 112.25, y: 11.973297} m_EdgeRadius: 0 +--- !u!1 &763264654 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 763264655} + m_Layer: 0 + m_Name: Change + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &763264655 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 763264654} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 20.382545, y: -5.2387156, z: 36.536854} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 741769756} + - {fileID: 1698507951} + - {fileID: 1259351770} + - {fileID: 1409594559} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!224 &766322182 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, @@ -1833,6 +6958,41 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} +--- !u!1 &1106451913 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1106451914} + m_Layer: 0 + m_Name: zhubajie + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1106451914 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1106451913} + serializedVersion: 2 + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1840983957} + - {fileID: 52465886} + - {fileID: 455012352} + - {fileID: 399178229} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1215410151 GameObject: m_ObjectHideFlags: 0 @@ -1908,6 +7068,4632 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1215410151} m_CullTransparentMesh: 1 +--- !u!1001 &1259351769 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 763264655} + m_Modifications: + - target: {fileID: 1709254077376921, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_Name + value: Game177_changE_skill_dead + objectReference: {fileID: 0} + - target: {fileID: 1709254077376921, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4000342987746139, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 8.790045 + objectReference: {fileID: 0} + - target: {fileID: 4000342987746139, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 8.289417 + objectReference: {fileID: 0} + - target: {fileID: 4000342987746139, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 20.805683 + objectReference: {fileID: 0} + - target: {fileID: 4003750186790624, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -77.50946 + objectReference: {fileID: 0} + - target: {fileID: 4003750186790624, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 105.67528 + objectReference: {fileID: 0} + - target: {fileID: 4003750186790624, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 48.081924 + objectReference: {fileID: 0} + - target: {fileID: 4007271993718322, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000006077174 + objectReference: {fileID: 0} + - target: {fileID: 4007271993718322, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000091157614 + objectReference: {fileID: 0} + - target: {fileID: 4007271993718322, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.397615e-22 + objectReference: {fileID: 0} + - target: {fileID: 4016782227057731, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000015762669 + objectReference: {fileID: 0} + - target: {fileID: 4016782227057731, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000012154348 + objectReference: {fileID: 0} + - target: {fileID: 4016782227057731, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000000987541 + objectReference: {fileID: 0} + - target: {fileID: 4020314340478216, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 15.415797 + objectReference: {fileID: 0} + - target: {fileID: 4020314340478216, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -42.94543 + objectReference: {fileID: 0} + - target: {fileID: 4020314340478216, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 12.480891 + objectReference: {fileID: 0} + - target: {fileID: 4023566878023198, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 7.222222 + objectReference: {fileID: 0} + - target: {fileID: 4023566878023198, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -32.926098 + objectReference: {fileID: 0} + - target: {fileID: 4023566878023198, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 18.683926 + objectReference: {fileID: 0} + - target: {fileID: 4031355914570132, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4033903555039309, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.996975 + objectReference: {fileID: 0} + - target: {fileID: 4033903555039309, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 157.42998 + objectReference: {fileID: 0} + - target: {fileID: 4033903555039309, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 36.13864 + objectReference: {fileID: 0} + - target: {fileID: 4036828218548272, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00005648415 + objectReference: {fileID: 0} + - target: {fileID: 4036828218548272, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.071195e-12 + objectReference: {fileID: 0} + - target: {fileID: 4036828218548272, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000053175336 + objectReference: {fileID: 0} + - target: {fileID: 4041287186795109, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -44.705517 + objectReference: {fileID: 0} + - target: {fileID: 4041287186795109, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -92.85339 + objectReference: {fileID: 0} + - target: {fileID: 4041287186795109, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -29.527227 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -76.566635 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -26.580381 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 14.587437 + objectReference: {fileID: 0} + - target: {fileID: 4041608817324026, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -11.262323 + objectReference: {fileID: 0} + - target: {fileID: 4041608817324026, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 17.091038 + objectReference: {fileID: 0} + - target: {fileID: 4041608817324026, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -24.964388 + objectReference: {fileID: 0} + - target: {fileID: 4044586276341600, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000004937704 + objectReference: {fileID: 0} + - target: {fileID: 4044586276341600, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.046943e-23 + objectReference: {fileID: 0} + - target: {fileID: 4044586276341600, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4045646810609841, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.979141 + objectReference: {fileID: 0} + - target: {fileID: 4045646810609841, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 17.786358 + objectReference: {fileID: 0} + - target: {fileID: 4045646810609841, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 41.178894 + objectReference: {fileID: 0} + - target: {fileID: 4055535033279528, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00011917617 + objectReference: {fileID: 0} + - target: {fileID: 4055535033279528, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.99992 + objectReference: {fileID: 0} + - target: {fileID: 4055535033279528, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -97.219345 + objectReference: {fileID: 0} + - target: {fileID: 4067212629291419, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.7082696 + objectReference: {fileID: 0} + - target: {fileID: 4067212629291419, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 11.395052 + objectReference: {fileID: 0} + - target: {fileID: 4067212629291419, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -24.504505 + objectReference: {fileID: 0} + - target: {fileID: 4071519224935516, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -8.998796 + objectReference: {fileID: 0} + - target: {fileID: 4071519224935516, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 34.41951 + objectReference: {fileID: 0} + - target: {fileID: 4071519224935516, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.5377114 + objectReference: {fileID: 0} + - target: {fileID: 4077469347768860, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 6.538055 + objectReference: {fileID: 0} + - target: {fileID: 4077469347768860, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -24.872461 + objectReference: {fileID: 0} + - target: {fileID: 4077469347768860, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 21.357029 + objectReference: {fileID: 0} + - target: {fileID: 4081524457781149, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000010170875 + objectReference: {fileID: 0} + - target: {fileID: 4081524457781149, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.7205826e-12 + objectReference: {fileID: 0} + - target: {fileID: 4081524457781149, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000016551909 + objectReference: {fileID: 0} + - target: {fileID: 4081920422494107, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 20.027727 + objectReference: {fileID: 0} + - target: {fileID: 4081920422494107, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -25.837091 + objectReference: {fileID: 0} + - target: {fileID: 4081920422494107, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -13.685169 + objectReference: {fileID: 0} + - target: {fileID: 4083485975560739, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.2113743 + objectReference: {fileID: 0} + - target: {fileID: 4083485975560739, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.88578224 + objectReference: {fileID: 0} + - target: {fileID: 4083485975560739, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 30.416317 + objectReference: {fileID: 0} + - target: {fileID: 4085134620244786, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000010262639 + objectReference: {fileID: 0} + - target: {fileID: 4085134620244786, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000013884674 + objectReference: {fileID: 0} + - target: {fileID: 4085134620244786, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 12.118995 + objectReference: {fileID: 0} + - target: {fileID: 4094283985748868, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00008972336 + objectReference: {fileID: 0} + - target: {fileID: 4094283985748868, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000048961585 + objectReference: {fileID: 0} + - target: {fileID: 4094283985748868, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -82.780655 + objectReference: {fileID: 0} + - target: {fileID: 4096597530611644, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000018289506 + objectReference: {fileID: 0} + - target: {fileID: 4096597530611644, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000011153695 + objectReference: {fileID: 0} + - target: {fileID: 4096597530611644, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.4575644 + objectReference: {fileID: 0} + - target: {fileID: 4102543447223915, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -6.6581864 + objectReference: {fileID: 0} + - target: {fileID: 4102543447223915, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -47.391727 + objectReference: {fileID: 0} + - target: {fileID: 4102543447223915, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.716209 + objectReference: {fileID: 0} + - target: {fileID: 4105912343260855, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000015192923 + objectReference: {fileID: 0} + - target: {fileID: 4105912343260855, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000004254023 + objectReference: {fileID: 0} + - target: {fileID: 4105912343260855, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000012297887 + objectReference: {fileID: 0} + - target: {fileID: 4117307842306080, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000015192936 + objectReference: {fileID: 0} + - target: {fileID: 4117307842306080, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.8605982e-23 + objectReference: {fileID: 0} + - target: {fileID: 4117307842306080, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4119337346424409, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4119337346424409, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000018231525 + objectReference: {fileID: 0} + - target: {fileID: 4119337346424409, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4124577934639600, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -9.11013 + objectReference: {fileID: 0} + - target: {fileID: 4124577934639600, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -39.31826 + objectReference: {fileID: 0} + - target: {fileID: 4124577934639600, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.3515434 + objectReference: {fileID: 0} + - target: {fileID: 4126508818681447, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.22721726 + objectReference: {fileID: 0} + - target: {fileID: 4126508818681447, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.997358 + objectReference: {fileID: 0} + - target: {fileID: 4126508818681447, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -10.21564 + objectReference: {fileID: 0} + - target: {fileID: 4129116114662800, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 15.524784 + objectReference: {fileID: 0} + - target: {fileID: 4129116114662800, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -4.0731688 + objectReference: {fileID: 0} + - target: {fileID: 4129116114662800, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -17.281872 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.811199 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.1359732 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 18.594494 + objectReference: {fileID: 0} + - target: {fileID: 4134286944189183, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -51.063995 + objectReference: {fileID: 0} + - target: {fileID: 4134286944189183, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -88.15982 + objectReference: {fileID: 0} + - target: {fileID: 4134286944189183, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -136.24837 + objectReference: {fileID: 0} + - target: {fileID: 4147706149845817, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.752644 + objectReference: {fileID: 0} + - target: {fileID: 4147706149845817, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 43.247887 + objectReference: {fileID: 0} + - target: {fileID: 4147706149845817, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 17.211433 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalPosition.z + value: 150 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4151117949762783, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.6431906 + objectReference: {fileID: 0} + - target: {fileID: 4151117949762783, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 25.73897 + objectReference: {fileID: 0} + - target: {fileID: 4151117949762783, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 5.63694 + objectReference: {fileID: 0} + - target: {fileID: 4171308771648913, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00006325657 + objectReference: {fileID: 0} + - target: {fileID: 4171308771648913, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.321013 + objectReference: {fileID: 0} + - target: {fileID: 4171308771648913, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000014895279 + objectReference: {fileID: 0} + - target: {fileID: 4173334745350128, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -77.785706 + objectReference: {fileID: 0} + - target: {fileID: 4173334745350128, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 82.13933 + objectReference: {fileID: 0} + - target: {fileID: 4173334745350128, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -53.626465 + objectReference: {fileID: 0} + - target: {fileID: 4173644300073267, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 18.80084 + objectReference: {fileID: 0} + - target: {fileID: 4173644300073267, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -43.399796 + objectReference: {fileID: 0} + - target: {fileID: 4173644300073267, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -16.464573 + objectReference: {fileID: 0} + - target: {fileID: 4202048797312955, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.4416077 + objectReference: {fileID: 0} + - target: {fileID: 4202048797312955, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -41.761177 + objectReference: {fileID: 0} + - target: {fileID: 4202048797312955, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.914078 + objectReference: {fileID: 0} + - target: {fileID: 4208269818966246, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4208269818966246, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4208269818966246, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4222568209840903, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 30.991652 + objectReference: {fileID: 0} + - target: {fileID: 4222568209840903, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 37.444393 + objectReference: {fileID: 0} + - target: {fileID: 4222568209840903, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 38.075863 + objectReference: {fileID: 0} + - target: {fileID: 4228214996573471, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4228214996573471, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4228214996573471, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000024308697 + objectReference: {fileID: 0} + - target: {fileID: 4231676679060417, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000024705173 + objectReference: {fileID: 0} + - target: {fileID: 4231676679060417, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000011763611 + objectReference: {fileID: 0} + - target: {fileID: 4231676679060417, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -14.841903 + objectReference: {fileID: 0} + - target: {fileID: 4232415838589296, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.1186514 + objectReference: {fileID: 0} + - target: {fileID: 4232415838589296, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -39.654873 + objectReference: {fileID: 0} + - target: {fileID: 4232415838589296, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -23.458866 + objectReference: {fileID: 0} + - target: {fileID: 4232720755092366, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000028242075 + objectReference: {fileID: 0} + - target: {fileID: 4232720755092366, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000030385723 + objectReference: {fileID: 0} + - target: {fileID: 4232720755092366, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4239265225482239, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -81.39106 + objectReference: {fileID: 0} + - target: {fileID: 4239265225482239, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 54.559643 + objectReference: {fileID: 0} + - target: {fileID: 4239265225482239, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 34.40685 + objectReference: {fileID: 0} + - target: {fileID: 4246887588868771, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000020653999 + objectReference: {fileID: 0} + - target: {fileID: 4246887588868771, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000001823153 + objectReference: {fileID: 0} + - target: {fileID: 4246887588868771, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4249237965167194, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4249237965167194, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4249237965167194, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000024308702 + objectReference: {fileID: 0} + - target: {fileID: 4250083484182041, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 7.677449 + objectReference: {fileID: 0} + - target: {fileID: 4250083484182041, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -32.24243 + objectReference: {fileID: 0} + - target: {fileID: 4250083484182041, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 20.082577 + objectReference: {fileID: 0} + - target: {fileID: 4260713349338959, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -32.35324 + objectReference: {fileID: 0} + - target: {fileID: 4260713349338959, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 105.917496 + objectReference: {fileID: 0} + - target: {fileID: 4260713349338959, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 166.95242 + objectReference: {fileID: 0} + - target: {fileID: 4290791091168379, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.17252502 + objectReference: {fileID: 0} + - target: {fileID: 4290791091168379, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.831768 + objectReference: {fileID: 0} + - target: {fileID: 4290791091168379, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 26.838676 + objectReference: {fileID: 0} + - target: {fileID: 4291547872775986, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 58.038864 + objectReference: {fileID: 0} + - target: {fileID: 4291547872775986, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 65.61063 + objectReference: {fileID: 0} + - target: {fileID: 4291547872775986, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 156.50552 + objectReference: {fileID: 0} + - target: {fileID: 4299931057912216, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000035838533 + objectReference: {fileID: 0} + - target: {fileID: 4299931057912216, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00001351332 + objectReference: {fileID: 0} + - target: {fileID: 4299931057912216, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000012297894 + objectReference: {fileID: 0} + - target: {fileID: 4321515599905260, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 6.215877 + objectReference: {fileID: 0} + - target: {fileID: 4321515599905260, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 33.42102 + objectReference: {fileID: 0} + - target: {fileID: 4321515599905260, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.8280907 + objectReference: {fileID: 0} + - target: {fileID: 4322008579206753, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -46.34309 + objectReference: {fileID: 0} + - target: {fileID: 4322008579206753, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -58.16848 + objectReference: {fileID: 0} + - target: {fileID: 4322008579206753, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -98.943275 + objectReference: {fileID: 0} + - target: {fileID: 4329075794784248, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000010018945 + objectReference: {fileID: 0} + - target: {fileID: 4329075794784248, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4329075794784248, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4329446674688094, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 28.966682 + objectReference: {fileID: 0} + - target: {fileID: 4329446674688094, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -11.053423 + objectReference: {fileID: 0} + - target: {fileID: 4329446674688094, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.252035 + objectReference: {fileID: 0} + - target: {fileID: 4330820015962899, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.187773 + objectReference: {fileID: 0} + - target: {fileID: 4330820015962899, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.0072389 + objectReference: {fileID: 0} + - target: {fileID: 4330820015962899, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -15.672156 + objectReference: {fileID: 0} + - target: {fileID: 4337165658744233, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.838971 + objectReference: {fileID: 0} + - target: {fileID: 4337165658744233, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 18.565313 + objectReference: {fileID: 0} + - target: {fileID: 4337165658744233, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 39.566208 + objectReference: {fileID: 0} + - target: {fileID: 4344618938641724, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 25.771658 + objectReference: {fileID: 0} + - target: {fileID: 4344618938641724, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.520621 + objectReference: {fileID: 0} + - target: {fileID: 4344618938641724, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.690859 + objectReference: {fileID: 0} + - target: {fileID: 4346445019804701, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00011917617 + objectReference: {fileID: 0} + - target: {fileID: 4346445019804701, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.99992 + objectReference: {fileID: 0} + - target: {fileID: 4346445019804701, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -97.219345 + objectReference: {fileID: 0} + - target: {fileID: 4349979204078785, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 6.173886 + objectReference: {fileID: 0} + - target: {fileID: 4349979204078785, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 30.088072 + objectReference: {fileID: 0} + - target: {fileID: 4349979204078785, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -30.607037 + objectReference: {fileID: 0} + - target: {fileID: 4350143044813081, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 31.370947 + objectReference: {fileID: 0} + - target: {fileID: 4350143044813081, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -76.399864 + objectReference: {fileID: 0} + - target: {fileID: 4350143044813081, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -159.97029 + objectReference: {fileID: 0} + - target: {fileID: 4350408777337066, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000009929438 + objectReference: {fileID: 0} + - target: {fileID: 4350408777337066, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000009984326 + objectReference: {fileID: 0} + - target: {fileID: 4350408777337066, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.0214257 + objectReference: {fileID: 0} + - target: {fileID: 4353891062718048, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -7.9142604 + objectReference: {fileID: 0} + - target: {fileID: 4353891062718048, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.764314 + objectReference: {fileID: 0} + - target: {fileID: 4353891062718048, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 19.918894 + objectReference: {fileID: 0} + - target: {fileID: 4360591974699550, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.2160869 + objectReference: {fileID: 0} + - target: {fileID: 4360591974699550, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -40.537457 + objectReference: {fileID: 0} + - target: {fileID: 4360591974699550, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -17.062016 + objectReference: {fileID: 0} + - target: {fileID: 4364392939154294, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000010393214 + objectReference: {fileID: 0} + - target: {fileID: 4364392939154294, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000013336394 + objectReference: {fileID: 0} + - target: {fileID: 4364392939154294, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.967164 + objectReference: {fileID: 0} + - target: {fileID: 4365773988297632, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 6.5240545 + objectReference: {fileID: 0} + - target: {fileID: 4365773988297632, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -22.625288 + objectReference: {fileID: 0} + - target: {fileID: 4365773988297632, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 28.528446 + objectReference: {fileID: 0} + - target: {fileID: 4370081907136253, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -64.13305 + objectReference: {fileID: 0} + - target: {fileID: 4370081907136253, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -34.853107 + objectReference: {fileID: 0} + - target: {fileID: 4370081907136253, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -123.7177 + objectReference: {fileID: 0} + - target: {fileID: 4370485308309611, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10.005685 + objectReference: {fileID: 0} + - target: {fileID: 4370485308309611, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -64.53468 + objectReference: {fileID: 0} + - target: {fileID: 4370485308309611, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 24.528427 + objectReference: {fileID: 0} + - target: {fileID: 4372353275341440, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 12.432683 + objectReference: {fileID: 0} + - target: {fileID: 4372353275341440, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -40.508957 + objectReference: {fileID: 0} + - target: {fileID: 4372353275341440, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.7168665 + objectReference: {fileID: 0} + - target: {fileID: 4382656168358062, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000005835277 + objectReference: {fileID: 0} + - target: {fileID: 4382656168358062, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.3232976e-10 + objectReference: {fileID: 0} + - target: {fileID: 4382656168358062, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.358482 + objectReference: {fileID: 0} + - target: {fileID: 4384784573714692, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -6.621977e-14 + objectReference: {fileID: 0} + - target: {fileID: 4384784573714692, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000029626221 + objectReference: {fileID: 0} + - target: {fileID: 4384784573714692, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000009115761 + objectReference: {fileID: 0} + - target: {fileID: 4386568470988373, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -64.7951 + objectReference: {fileID: 0} + - target: {fileID: 4386568470988373, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 46.645206 + objectReference: {fileID: 0} + - target: {fileID: 4386568470988373, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 44.456264 + objectReference: {fileID: 0} + - target: {fileID: 4387228018655110, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 31.77532 + objectReference: {fileID: 0} + - target: {fileID: 4387228018655110, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 170.88658 + objectReference: {fileID: 0} + - target: {fileID: 4387228018655110, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -165.77768 + objectReference: {fileID: 0} + - target: {fileID: 4391225667286877, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -7.0144644 + objectReference: {fileID: 0} + - target: {fileID: 4391225667286877, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 12.602182 + objectReference: {fileID: 0} + - target: {fileID: 4391225667286877, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 15.159277 + objectReference: {fileID: 0} + - target: {fileID: 4401109917237556, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 15.09345 + objectReference: {fileID: 0} + - target: {fileID: 4401109917237556, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -165.90828 + objectReference: {fileID: 0} + - target: {fileID: 4401109917237556, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -78.29464 + objectReference: {fileID: 0} + - target: {fileID: 4401429660297866, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 59.929527 + objectReference: {fileID: 0} + - target: {fileID: 4401429660297866, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -75.90386 + objectReference: {fileID: 0} + - target: {fileID: 4401429660297866, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 119.8639 + objectReference: {fileID: 0} + - target: {fileID: 4403529848822963, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 58.742863 + objectReference: {fileID: 0} + - target: {fileID: 4403529848822963, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -141.23213 + objectReference: {fileID: 0} + - target: {fileID: 4403529848822963, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -161.63171 + objectReference: {fileID: 0} + - target: {fileID: 4405989028062321, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.4424036 + objectReference: {fileID: 0} + - target: {fileID: 4405989028062321, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -41.349182 + objectReference: {fileID: 0} + - target: {fileID: 4405989028062321, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 5.506017 + objectReference: {fileID: 0} + - target: {fileID: 4410049401584812, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -10.368358 + objectReference: {fileID: 0} + - target: {fileID: 4410049401584812, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 46.134308 + objectReference: {fileID: 0} + - target: {fileID: 4410049401584812, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -14.981055 + objectReference: {fileID: 0} + - target: {fileID: 4413603344295461, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 25.967842 + objectReference: {fileID: 0} + - target: {fileID: 4413603344295461, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -129.04051 + objectReference: {fileID: 0} + - target: {fileID: 4413603344295461, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -108.76792 + objectReference: {fileID: 0} + - target: {fileID: 4415925016355036, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000028242077 + objectReference: {fileID: 0} + - target: {fileID: 4415925016355036, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000036462998 + objectReference: {fileID: 0} + - target: {fileID: 4415925016355036, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000029837323 + objectReference: {fileID: 0} + - target: {fileID: 4417625065123525, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4422702022971346, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -81.037796 + objectReference: {fileID: 0} + - target: {fileID: 4422702022971346, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -108.042755 + objectReference: {fileID: 0} + - target: {fileID: 4422702022971346, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -100.95942 + objectReference: {fileID: 0} + - target: {fileID: 4428560594236482, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000028242075 + objectReference: {fileID: 0} + - target: {fileID: 4428560594236482, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000027347269 + objectReference: {fileID: 0} + - target: {fileID: 4428560594236482, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000006077165 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.236843 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -14.602448 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 5.736218 + objectReference: {fileID: 0} + - target: {fileID: 4432271528610696, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000049137318 + objectReference: {fileID: 0} + - target: {fileID: 4432271528610696, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 9.888719 + objectReference: {fileID: 0} + - target: {fileID: 4432271528610696, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00002571337 + objectReference: {fileID: 0} + - target: {fileID: 4433881075115309, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 17.676743 + objectReference: {fileID: 0} + - target: {fileID: 4433881075115309, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.647929 + objectReference: {fileID: 0} + - target: {fileID: 4433881075115309, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.036215 + objectReference: {fileID: 0} + - target: {fileID: 4450063812975771, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 32.751736 + objectReference: {fileID: 0} + - target: {fileID: 4450063812975771, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -33.191963 + objectReference: {fileID: 0} + - target: {fileID: 4450063812975771, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -29.572403 + objectReference: {fileID: 0} + - target: {fileID: 4450889307774998, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000015328134 + objectReference: {fileID: 0} + - target: {fileID: 4450889307774998, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000016922193 + objectReference: {fileID: 0} + - target: {fileID: 4450889307774998, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -113.008286 + objectReference: {fileID: 0} + - target: {fileID: 4458735412797113, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.11519901 + objectReference: {fileID: 0} + - target: {fileID: 4458735412797113, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.4100385 + objectReference: {fileID: 0} + - target: {fileID: 4458735412797113, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.1201785 + objectReference: {fileID: 0} + - target: {fileID: 4463395028392447, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.4794564 + objectReference: {fileID: 0} + - target: {fileID: 4463395028392447, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.735888 + objectReference: {fileID: 0} + - target: {fileID: 4463395028392447, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -101.75205 + objectReference: {fileID: 0} + - target: {fileID: 4463579974499585, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.98901e-15 + objectReference: {fileID: 0} + - target: {fileID: 4463579974499585, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.3396306e-21 + objectReference: {fileID: 0} + - target: {fileID: 4463579974499585, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000009867016 + objectReference: {fileID: 0} + - target: {fileID: 4484755779879834, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 21.284285 + objectReference: {fileID: 0} + - target: {fileID: 4484755779879834, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -167.74805 + objectReference: {fileID: 0} + - target: {fileID: 4484755779879834, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -32.0689 + objectReference: {fileID: 0} + - target: {fileID: 4493949256727870, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 7.4622946 + objectReference: {fileID: 0} + - target: {fileID: 4493949256727870, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -41.71642 + objectReference: {fileID: 0} + - target: {fileID: 4493949256727870, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -17.26995 + objectReference: {fileID: 0} + - target: {fileID: 4494345407022765, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 65.75564 + objectReference: {fileID: 0} + - target: {fileID: 4494345407022765, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -59.66639 + objectReference: {fileID: 0} + - target: {fileID: 4494345407022765, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -150.53152 + objectReference: {fileID: 0} + - target: {fileID: 4500050402096248, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.22722168 + objectReference: {fileID: 0} + - target: {fileID: 4500050402096248, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.9973567 + objectReference: {fileID: 0} + - target: {fileID: 4500050402096248, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 9.416337 + objectReference: {fileID: 0} + - target: {fileID: 4502609866597578, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.298491 + objectReference: {fileID: 0} + - target: {fileID: 4502609866597578, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -93.65622 + objectReference: {fileID: 0} + - target: {fileID: 4502609866597578, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 88.49854 + objectReference: {fileID: 0} + - target: {fileID: 4504506843557392, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 19.956093 + objectReference: {fileID: 0} + - target: {fileID: 4504506843557392, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -40.35186 + objectReference: {fileID: 0} + - target: {fileID: 4504506843557392, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.12112045 + objectReference: {fileID: 0} + - target: {fileID: 4505490946690937, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -10.7799015 + objectReference: {fileID: 0} + - target: {fileID: 4505490946690937, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.372278 + objectReference: {fileID: 0} + - target: {fileID: 4505490946690937, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -150.0756 + objectReference: {fileID: 0} + - target: {fileID: 4505682267929073, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4505682267929073, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4505682267929073, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.0000012154348 + objectReference: {fileID: 0} + - target: {fileID: 4507522976744791, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4507522976744791, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000006077174 + objectReference: {fileID: 0} + - target: {fileID: 4507522976744791, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4510073901028830, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -19.051598 + objectReference: {fileID: 0} + - target: {fileID: 4510073901028830, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -132.93428 + objectReference: {fileID: 0} + - target: {fileID: 4510073901028830, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.3810596 + objectReference: {fileID: 0} + - target: {fileID: 4510800835404288, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -56.325966 + objectReference: {fileID: 0} + - target: {fileID: 4510800835404288, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 64.141716 + objectReference: {fileID: 0} + - target: {fileID: 4510800835404288, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 145.82076 + objectReference: {fileID: 0} + - target: {fileID: 4517377532936435, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.5601387 + objectReference: {fileID: 0} + - target: {fileID: 4517377532936435, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 40.607708 + objectReference: {fileID: 0} + - target: {fileID: 4517377532936435, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 31.14647 + objectReference: {fileID: 0} + - target: {fileID: 4518639523470932, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00007207197 + objectReference: {fileID: 0} + - target: {fileID: 4518639523470932, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4518639523470932, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4519819979147140, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000014121058 + objectReference: {fileID: 0} + - target: {fileID: 4519819979147140, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 9.273051e-12 + objectReference: {fileID: 0} + - target: {fileID: 4519819979147140, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.00005648415 + objectReference: {fileID: 0} + - target: {fileID: 4521597976012101, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000141210385 + objectReference: {fileID: 0} + - target: {fileID: 4521597976012101, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000007596526 + objectReference: {fileID: 0} + - target: {fileID: 4521597976012101, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4527248355756736, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -86.88719 + objectReference: {fileID: 0} + - target: {fileID: 4527248355756736, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -124.7411 + objectReference: {fileID: 0} + - target: {fileID: 4527248355756736, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -140.65201 + objectReference: {fileID: 0} + - target: {fileID: 4536148047902537, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 7.9482813 + objectReference: {fileID: 0} + - target: {fileID: 4536148047902537, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -16.724073 + objectReference: {fileID: 0} + - target: {fileID: 4536148047902537, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.6434033 + objectReference: {fileID: 0} + - target: {fileID: 4543023241981873, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000531753 + objectReference: {fileID: 0} + - target: {fileID: 4543023241981873, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000028242075 + objectReference: {fileID: 0} + - target: {fileID: 4543023241981873, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4543584136297381, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 19.535818 + objectReference: {fileID: 0} + - target: {fileID: 4543584136297381, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -42.99399 + objectReference: {fileID: 0} + - target: {fileID: 4543584136297381, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -18.314873 + objectReference: {fileID: 0} + - target: {fileID: 4544837802452058, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -9.297027 + objectReference: {fileID: 0} + - target: {fileID: 4544837802452058, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -38.593075 + objectReference: {fileID: 0} + - target: {fileID: 4544837802452058, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -12.003066 + objectReference: {fileID: 0} + - target: {fileID: 4545683990359770, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4545683990359770, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4545683990359770, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000012154348 + objectReference: {fileID: 0} + - target: {fileID: 4547349145286502, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -33.884636 + objectReference: {fileID: 0} + - target: {fileID: 4547349145286502, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.738368 + objectReference: {fileID: 0} + - target: {fileID: 4547349145286502, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.5955806 + objectReference: {fileID: 0} + - target: {fileID: 4548862692844868, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.855402 + objectReference: {fileID: 0} + - target: {fileID: 4548862692844868, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -35.766453 + objectReference: {fileID: 0} + - target: {fileID: 4548862692844868, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 26.229834 + objectReference: {fileID: 0} + - target: {fileID: 4556043395114336, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 31.801678 + objectReference: {fileID: 0} + - target: {fileID: 4556043395114336, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -38.050934 + objectReference: {fileID: 0} + - target: {fileID: 4556043395114336, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.725848 + objectReference: {fileID: 0} + - target: {fileID: 4559203567323380, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000020630757 + objectReference: {fileID: 0} + - target: {fileID: 4559203567323380, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000006256077 + objectReference: {fileID: 0} + - target: {fileID: 4559203567323380, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 16.772732 + objectReference: {fileID: 0} + - target: {fileID: 4562080017223558, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -85.28468 + objectReference: {fileID: 0} + - target: {fileID: 4562080017223558, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 137.4202 + objectReference: {fileID: 0} + - target: {fileID: 4562080017223558, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 28.039665 + objectReference: {fileID: 0} + - target: {fileID: 4566389953100910, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.248879 + objectReference: {fileID: 0} + - target: {fileID: 4566389953100910, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -33.741364 + objectReference: {fileID: 0} + - target: {fileID: 4566389953100910, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 16.252375 + objectReference: {fileID: 0} + - target: {fileID: 4573076885614623, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000023278908 + objectReference: {fileID: 0} + - target: {fileID: 4573076885614623, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000003850595 + objectReference: {fileID: 0} + - target: {fileID: 4573076885614623, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 56.054104 + objectReference: {fileID: 0} + - target: {fileID: 4578880696632637, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -67.79104 + objectReference: {fileID: 0} + - target: {fileID: 4578880696632637, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 161.11414 + objectReference: {fileID: 0} + - target: {fileID: 4578880696632637, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 83.571465 + objectReference: {fileID: 0} + - target: {fileID: 4580109562975512, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -11.383799 + objectReference: {fileID: 0} + - target: {fileID: 4580109562975512, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 165.13211 + objectReference: {fileID: 0} + - target: {fileID: 4580109562975512, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -121.73786 + objectReference: {fileID: 0} + - target: {fileID: 4583788928901705, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -87.149155 + objectReference: {fileID: 0} + - target: {fileID: 4583788928901705, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -49.35961 + objectReference: {fileID: 0} + - target: {fileID: 4583788928901705, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 30.26828 + objectReference: {fileID: 0} + - target: {fileID: 4616352195932608, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.898544 + objectReference: {fileID: 0} + - target: {fileID: 4616352195932608, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -98.36786 + objectReference: {fileID: 0} + - target: {fileID: 4616352195932608, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 119.256775 + objectReference: {fileID: 0} + - target: {fileID: 4616761771223058, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -18.811045 + objectReference: {fileID: 0} + - target: {fileID: 4616761771223058, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 12.209452 + objectReference: {fileID: 0} + - target: {fileID: 4616761771223058, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -19.121647 + objectReference: {fileID: 0} + - target: {fileID: 4632179142322292, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 84.813644 + objectReference: {fileID: 0} + - target: {fileID: 4632179142322292, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 133.90448 + objectReference: {fileID: 0} + - target: {fileID: 4632179142322292, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 164.20717 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -66.87539 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -111.18017 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -170.76845 + objectReference: {fileID: 0} + - target: {fileID: 4644357204029367, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -78.84718 + objectReference: {fileID: 0} + - target: {fileID: 4644357204029367, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 65.58601 + objectReference: {fileID: 0} + - target: {fileID: 4644357204029367, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -47.918976 + objectReference: {fileID: 0} + - target: {fileID: 4657558218238974, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.805694 + objectReference: {fileID: 0} + - target: {fileID: 4657558218238974, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.865243 + objectReference: {fileID: 0} + - target: {fileID: 4657558218238974, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.998667 + objectReference: {fileID: 0} + - target: {fileID: 4663898806329775, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 13.40929 + objectReference: {fileID: 0} + - target: {fileID: 4663898806329775, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -28.46875 + objectReference: {fileID: 0} + - target: {fileID: 4663898806329775, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -35.38941 + objectReference: {fileID: 0} + - target: {fileID: 4681721672847880, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -37.22631 + objectReference: {fileID: 0} + - target: {fileID: 4681721672847880, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 61.310543 + objectReference: {fileID: 0} + - target: {fileID: 4681721672847880, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -29.489002 + objectReference: {fileID: 0} + - target: {fileID: 4688331903957256, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000026648977 + objectReference: {fileID: 0} + - target: {fileID: 4688331903957256, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000014826386 + objectReference: {fileID: 0} + - target: {fileID: 4688331903957256, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 10.431036 + objectReference: {fileID: 0} + - target: {fileID: 4689224686120706, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000015192932 + objectReference: {fileID: 0} + - target: {fileID: 4689224686120706, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000006077173 + objectReference: {fileID: 0} + - target: {fileID: 4689224686120706, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4691570808825369, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.317598 + objectReference: {fileID: 0} + - target: {fileID: 4691570808825369, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -39.3987 + objectReference: {fileID: 0} + - target: {fileID: 4691570808825369, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.3335395 + objectReference: {fileID: 0} + - target: {fileID: 4696792502030561, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000018231523 + objectReference: {fileID: 0} + - target: {fileID: 4696792502030561, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.2327177e-22 + objectReference: {fileID: 0} + - target: {fileID: 4696792502030561, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -180 + objectReference: {fileID: 0} + - target: {fileID: 4696919880513765, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -5.819739 + objectReference: {fileID: 0} + - target: {fileID: 4696919880513765, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -175.859 + objectReference: {fileID: 0} + - target: {fileID: 4696919880513765, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -27.607307 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000001666429 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000001691361 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 69.447075 + objectReference: {fileID: 0} + - target: {fileID: 4704877758540679, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -6.4748234e-13 + objectReference: {fileID: 0} + - target: {fileID: 4704877758540679, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000033424467 + objectReference: {fileID: 0} + - target: {fileID: 4704877758540679, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000012297885 + objectReference: {fileID: 0} + - target: {fileID: 4719897623072781, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000012000186 + objectReference: {fileID: 0} + - target: {fileID: 4719897623072781, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00001639608 + objectReference: {fileID: 0} + - target: {fileID: 4719897623072781, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -90.029396 + objectReference: {fileID: 0} + - target: {fileID: 4722550256369544, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722550256369544, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000045578741 + objectReference: {fileID: 0} + - target: {fileID: 4722550256369544, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4729442808604298, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00008972336 + objectReference: {fileID: 0} + - target: {fileID: 4729442808604298, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000048961585 + objectReference: {fileID: 0} + - target: {fileID: 4729442808604298, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -82.780655 + objectReference: {fileID: 0} + - target: {fileID: 4729821067651183, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.714411 + objectReference: {fileID: 0} + - target: {fileID: 4729821067651183, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.270421 + objectReference: {fileID: 0} + - target: {fileID: 4729821067651183, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -34.559975 + objectReference: {fileID: 0} + - target: {fileID: 4731059169969419, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -10.5519705 + objectReference: {fileID: 0} + - target: {fileID: 4731059169969419, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.9228115 + objectReference: {fileID: 0} + - target: {fileID: 4731059169969419, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.102613 + objectReference: {fileID: 0} + - target: {fileID: 4739268104783211, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -54.96149 + objectReference: {fileID: 0} + - target: {fileID: 4739268104783211, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -87.03619 + objectReference: {fileID: 0} + - target: {fileID: 4739268104783211, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -179.26225 + objectReference: {fileID: 0} + - target: {fileID: 4743905223825669, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -78.46597 + objectReference: {fileID: 0} + - target: {fileID: 4743905223825669, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 128.46169 + objectReference: {fileID: 0} + - target: {fileID: 4743905223825669, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 90.28404 + objectReference: {fileID: 0} + - target: {fileID: 4751888446361502, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.43338943 + objectReference: {fileID: 0} + - target: {fileID: 4751888446361502, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 7.7464066 + objectReference: {fileID: 0} + - target: {fileID: 4751888446361502, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 28.231838 + objectReference: {fileID: 0} + - target: {fileID: 4754026925822528, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.82553 + objectReference: {fileID: 0} + - target: {fileID: 4754026925822528, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -39.168922 + objectReference: {fileID: 0} + - target: {fileID: 4754026925822528, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 11.1009035 + objectReference: {fileID: 0} + - target: {fileID: 4760480127920944, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.7129219 + objectReference: {fileID: 0} + - target: {fileID: 4760480127920944, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.4815555 + objectReference: {fileID: 0} + - target: {fileID: 4760480127920944, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.477149 + objectReference: {fileID: 0} + - target: {fileID: 4766709239876273, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.98901e-15 + objectReference: {fileID: 0} + - target: {fileID: 4766709239876273, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.953914e-22 + objectReference: {fileID: 0} + - target: {fileID: 4766709239876273, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000024308697 + objectReference: {fileID: 0} + - target: {fileID: 4777414246829702, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 13.284814 + objectReference: {fileID: 0} + - target: {fileID: 4777414246829702, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 169.9551 + objectReference: {fileID: 0} + - target: {fileID: 4777414246829702, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 159.33388 + objectReference: {fileID: 0} + - target: {fileID: 4782439640980787, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.790012 + objectReference: {fileID: 0} + - target: {fileID: 4782439640980787, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.2957945 + objectReference: {fileID: 0} + - target: {fileID: 4782439640980787, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.398517 + objectReference: {fileID: 0} + - target: {fileID: 4785416887765914, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.06263572 + objectReference: {fileID: 0} + - target: {fileID: 4785416887765914, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.15006664 + objectReference: {fileID: 0} + - target: {fileID: 4785416887765914, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.397662 + objectReference: {fileID: 0} + - target: {fileID: 4799881864385010, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.5747206 + objectReference: {fileID: 0} + - target: {fileID: 4799881864385010, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -21.65421 + objectReference: {fileID: 0} + - target: {fileID: 4799881864385010, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 18.603582 + objectReference: {fileID: 0} + - target: {fileID: 4805829819301007, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.5969777 + objectReference: {fileID: 0} + - target: {fileID: 4805829819301007, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 17.656364 + objectReference: {fileID: 0} + - target: {fileID: 4805829819301007, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -25.914955 + objectReference: {fileID: 0} + - target: {fileID: 4817105377731967, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.9554906 + objectReference: {fileID: 0} + - target: {fileID: 4817105377731967, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -20.226908 + objectReference: {fileID: 0} + - target: {fileID: 4817105377731967, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 24.756607 + objectReference: {fileID: 0} + - target: {fileID: 4825818419884204, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000003798235 + objectReference: {fileID: 0} + - target: {fileID: 4825818419884204, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000036463045 + objectReference: {fileID: 0} + - target: {fileID: 4825818419884204, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -9.989008e-15 + objectReference: {fileID: 0} + - target: {fileID: 4827586244175853, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 33.941593 + objectReference: {fileID: 0} + - target: {fileID: 4827586244175853, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -45.00107 + objectReference: {fileID: 0} + - target: {fileID: 4827586244175853, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -81.249115 + objectReference: {fileID: 0} + - target: {fileID: 4838352681112328, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.4566045e-12 + objectReference: {fileID: 0} + - target: {fileID: 4838352681112328, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000027347287 + objectReference: {fileID: 0} + - target: {fileID: 4838352681112328, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000030517576 + objectReference: {fileID: 0} + - target: {fileID: 4844361126439134, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -5.609474 + objectReference: {fileID: 0} + - target: {fileID: 4844361126439134, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -21.943918 + objectReference: {fileID: 0} + - target: {fileID: 4844361126439134, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -39.17986 + objectReference: {fileID: 0} + - target: {fileID: 4845025230388998, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.6334 + objectReference: {fileID: 0} + - target: {fileID: 4845025230388998, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -131.87878 + objectReference: {fileID: 0} + - target: {fileID: 4845025230388998, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 121.77516 + objectReference: {fileID: 0} + - target: {fileID: 4851449666512103, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000037982345 + objectReference: {fileID: 0} + - target: {fileID: 4851449666512103, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000036463055 + objectReference: {fileID: 0} + - target: {fileID: 4851449666512103, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000024308708 + objectReference: {fileID: 0} + - target: {fileID: 4869737159367836, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 13.234786 + objectReference: {fileID: 0} + - target: {fileID: 4869737159367836, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.7793145 + objectReference: {fileID: 0} + - target: {fileID: 4869737159367836, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 30.004238 + objectReference: {fileID: 0} + - target: {fileID: 4870947366518887, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000006458331 + objectReference: {fileID: 0} + - target: {fileID: 4870947366518887, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000945673 + objectReference: {fileID: 0} + - target: {fileID: 4870947366518887, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -10.940004 + objectReference: {fileID: 0} + - target: {fileID: 4878983242975409, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.8652234 + objectReference: {fileID: 0} + - target: {fileID: 4878983242975409, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 158.43457 + objectReference: {fileID: 0} + - target: {fileID: 4878983242975409, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.3058 + objectReference: {fileID: 0} + - target: {fileID: 4891995844532801, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.3806745 + objectReference: {fileID: 0} + - target: {fileID: 4891995844532801, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -19.42756 + objectReference: {fileID: 0} + - target: {fileID: 4891995844532801, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.672298 + objectReference: {fileID: 0} + - target: {fileID: 4894225446638996, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -74.388985 + objectReference: {fileID: 0} + - target: {fileID: 4894225446638996, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -19.825506 + objectReference: {fileID: 0} + - target: {fileID: 4894225446638996, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.460081 + objectReference: {fileID: 0} + - target: {fileID: 4894352506636257, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.6514797 + objectReference: {fileID: 0} + - target: {fileID: 4894352506636257, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -16.344866 + objectReference: {fileID: 0} + - target: {fileID: 4894352506636257, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 25.642906 + objectReference: {fileID: 0} + - target: {fileID: 4904400124545405, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.9348106 + objectReference: {fileID: 0} + - target: {fileID: 4904400124545405, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -38.83769 + objectReference: {fileID: 0} + - target: {fileID: 4904400124545405, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 17.28191 + objectReference: {fileID: 0} + - target: {fileID: 4910201747455131, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -34.425972 + objectReference: {fileID: 0} + - target: {fileID: 4910201747455131, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -70.30581 + objectReference: {fileID: 0} + - target: {fileID: 4910201747455131, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -100.845924 + objectReference: {fileID: 0} + - target: {fileID: 4911451331743778, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 8.665334 + objectReference: {fileID: 0} + - target: {fileID: 4911451331743778, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 23.182161 + objectReference: {fileID: 0} + - target: {fileID: 4911451331743778, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 11.744844 + objectReference: {fileID: 0} + - target: {fileID: 4934287144746640, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4934287144746640, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000019940726 + objectReference: {fileID: 0} + - target: {fileID: 4934287144746640, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -5.7352505 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -7.6540804 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 21.653563 + objectReference: {fileID: 0} + - target: {fileID: 4949593803130734, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.4925023 + objectReference: {fileID: 0} + - target: {fileID: 4949593803130734, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -32.795155 + objectReference: {fileID: 0} + - target: {fileID: 4949593803130734, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 40.56283 + objectReference: {fileID: 0} + - target: {fileID: 4951712121405908, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 56.186165 + objectReference: {fileID: 0} + - target: {fileID: 4951712121405908, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -12.64797 + objectReference: {fileID: 0} + - target: {fileID: 4951712121405908, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.0931344 + objectReference: {fileID: 0} + - target: {fileID: 4952320105404285, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -80.97417 + objectReference: {fileID: 0} + - target: {fileID: 4952320105404285, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 40.2302 + objectReference: {fileID: 0} + - target: {fileID: 4952320105404285, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 131.98032 + objectReference: {fileID: 0} + - target: {fileID: 4952854571839949, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -19.184065 + objectReference: {fileID: 0} + - target: {fileID: 4952854571839949, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -17.614836 + objectReference: {fileID: 0} + - target: {fileID: 4952854571839949, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -24.340843 + objectReference: {fileID: 0} + - target: {fileID: 4958492976087124, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.628178 + objectReference: {fileID: 0} + - target: {fileID: 4958492976087124, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 25.803394 + objectReference: {fileID: 0} + - target: {fileID: 4958492976087124, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 16.065826 + objectReference: {fileID: 0} + - target: {fileID: 4960577952585462, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 7.3398943 + objectReference: {fileID: 0} + - target: {fileID: 4960577952585462, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -11.902644 + objectReference: {fileID: 0} + - target: {fileID: 4960577952585462, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 20.256783 + objectReference: {fileID: 0} + - target: {fileID: 4962713294667487, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.6419106e-12 + objectReference: {fileID: 0} + - target: {fileID: 4962713294667487, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000003443336 + objectReference: {fileID: 0} + - target: {fileID: 4962713294667487, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000028242075 + objectReference: {fileID: 0} + - target: {fileID: 4964675957374274, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 64.40062 + objectReference: {fileID: 0} + - target: {fileID: 4964675957374274, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -102.66281 + objectReference: {fileID: 0} + - target: {fileID: 4964675957374274, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -88.95704 + objectReference: {fileID: 0} + - target: {fileID: 4964822413698908, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.029727334 + objectReference: {fileID: 0} + - target: {fileID: 4964822413698908, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.623248 + objectReference: {fileID: 0} + - target: {fileID: 4964822413698908, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.15777147 + objectReference: {fileID: 0} + - target: {fileID: 4965908813272002, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000029603632 + objectReference: {fileID: 0} + - target: {fileID: 4965908813272002, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000079451286 + objectReference: {fileID: 0} + - target: {fileID: 4965908813272002, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 69.93298 + objectReference: {fileID: 0} + - target: {fileID: 4975779338151784, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.7819867 + objectReference: {fileID: 0} + - target: {fileID: 4975779338151784, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -33.635963 + objectReference: {fileID: 0} + - target: {fileID: 4975779338151784, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 9.522527 + objectReference: {fileID: 0} + - target: {fileID: 4985908891298522, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 6.479427 + objectReference: {fileID: 0} + - target: {fileID: 4985908891298522, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -22.646544 + objectReference: {fileID: 0} + - target: {fileID: 4985908891298522, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 25.431927 + objectReference: {fileID: 0} + - target: {fileID: 4989434536655964, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -31.306541 + objectReference: {fileID: 0} + - target: {fileID: 4989434536655964, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -147.33907 + objectReference: {fileID: 0} + - target: {fileID: 4989434536655964, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 104.82505 + objectReference: {fileID: 0} + - target: {fileID: 4993076962757715, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.3307593 + objectReference: {fileID: 0} + - target: {fileID: 4993076962757715, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -7.6798077 + objectReference: {fileID: 0} + - target: {fileID: 4993076962757715, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -174.60349 + objectReference: {fileID: 0} + - target: {fileID: 4996317296757491, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4996317296757491, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000030385868 + objectReference: {fileID: 0} + - target: {fileID: 4996317296757491, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4998495239010246, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 80.37712 + objectReference: {fileID: 0} + - target: {fileID: 4998495239010246, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -83.64722 + objectReference: {fileID: 0} + - target: {fileID: 4998495239010246, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 127.41058 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 70c41b93845a0544a82f07bae9eed1c7, type: 3} +--- !u!4 &1259351770 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4148353818683595, guid: 70c41b93845a0544a82f07bae9eed1c7, + type: 3} + m_PrefabInstance: {fileID: 1259351769} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1409594558 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 763264655} + m_Modifications: + - target: {fileID: 1709254077376921, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_Name + value: Game177_changE_stage + objectReference: {fileID: 0} + - target: {fileID: 1709254077376921, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4000342987746139, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.16765074 + objectReference: {fileID: 0} + - target: {fileID: 4000342987746139, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.2905618 + objectReference: {fileID: 0} + - target: {fileID: 4000342987746139, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.896552 + objectReference: {fileID: 0} + - target: {fileID: 4003750186790624, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000048663518 + objectReference: {fileID: 0} + - target: {fileID: 4003750186790624, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 9.88872 + objectReference: {fileID: 0} + - target: {fileID: 4003750186790624, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00003429223 + objectReference: {fileID: 0} + - target: {fileID: 4007271993718322, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -86.97153 + objectReference: {fileID: 0} + - target: {fileID: 4007271993718322, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -130.28606 + objectReference: {fileID: 0} + - target: {fileID: 4007271993718322, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -32.91425 + objectReference: {fileID: 0} + - target: {fileID: 4016852445014956, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -7.352493 + objectReference: {fileID: 0} + - target: {fileID: 4016852445014956, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.138621 + objectReference: {fileID: 0} + - target: {fileID: 4016852445014956, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.184226 + objectReference: {fileID: 0} + - target: {fileID: 4020314340478216, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.7642034 + objectReference: {fileID: 0} + - target: {fileID: 4020314340478216, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 12.891267 + objectReference: {fileID: 0} + - target: {fileID: 4020314340478216, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.32579345 + objectReference: {fileID: 0} + - target: {fileID: 4023566878023198, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.499939 + objectReference: {fileID: 0} + - target: {fileID: 4023566878023198, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.958746 + objectReference: {fileID: 0} + - target: {fileID: 4023566878023198, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.981569 + objectReference: {fileID: 0} + - target: {fileID: 4033903555039309, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00004577637 + objectReference: {fileID: 0} + - target: {fileID: 4033903555039309, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000015258765 + objectReference: {fileID: 0} + - target: {fileID: 4033903555039309, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000030517576 + objectReference: {fileID: 0} + - target: {fileID: 4036828218548272, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 18.103455 + objectReference: {fileID: 0} + - target: {fileID: 4036828218548272, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 21.280764 + objectReference: {fileID: 0} + - target: {fileID: 4036828218548272, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -41.831272 + objectReference: {fileID: 0} + - target: {fileID: 4041287186795109, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.06266534 + objectReference: {fileID: 0} + - target: {fileID: 4041287186795109, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.1500665 + objectReference: {fileID: 0} + - target: {fileID: 4041287186795109, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.3976629 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.47030923 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.2743814 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.6950793 + objectReference: {fileID: 0} + - target: {fileID: 4041608817324026, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -65.595024 + objectReference: {fileID: 0} + - target: {fileID: 4041608817324026, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 87.58596 + objectReference: {fileID: 0} + - target: {fileID: 4041608817324026, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -96.37421 + objectReference: {fileID: 0} + - target: {fileID: 4045646810609841, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -74.75217 + objectReference: {fileID: 0} + - target: {fileID: 4045646810609841, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -32.174576 + objectReference: {fileID: 0} + - target: {fileID: 4045646810609841, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -170.3477 + objectReference: {fileID: 0} + - target: {fileID: 4055535033279528, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000012558401 + objectReference: {fileID: 0} + - target: {fileID: 4055535033279528, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000055878836 + objectReference: {fileID: 0} + - target: {fileID: 4055535033279528, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 13.898733 + objectReference: {fileID: 0} + - target: {fileID: 4066338149260220, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -65.13282 + objectReference: {fileID: 0} + - target: {fileID: 4066338149260220, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -99.018295 + objectReference: {fileID: 0} + - target: {fileID: 4066338149260220, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 142.39972 + objectReference: {fileID: 0} + - target: {fileID: 4067212629291419, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00011800437 + objectReference: {fileID: 0} + - target: {fileID: 4067212629291419, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.99992 + objectReference: {fileID: 0} + - target: {fileID: 4067212629291419, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -97.219345 + objectReference: {fileID: 0} + - target: {fileID: 4071519224935516, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 34.58763 + objectReference: {fileID: 0} + - target: {fileID: 4071519224935516, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -48.957005 + objectReference: {fileID: 0} + - target: {fileID: 4071519224935516, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 16.397886 + objectReference: {fileID: 0} + - target: {fileID: 4075864462779534, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000036285364 + objectReference: {fileID: 0} + - target: {fileID: 4075864462779534, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.0813893e-11 + objectReference: {fileID: 0} + - target: {fileID: 4075864462779534, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000017075485 + objectReference: {fileID: 0} + - target: {fileID: 4077469347768860, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.4339021 + objectReference: {fileID: 0} + - target: {fileID: 4077469347768860, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.66351557 + objectReference: {fileID: 0} + - target: {fileID: 4077469347768860, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -10.580386 + objectReference: {fileID: 0} + - target: {fileID: 4081524457781149, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.022652 + objectReference: {fileID: 0} + - target: {fileID: 4081524457781149, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 8.426951 + objectReference: {fileID: 0} + - target: {fileID: 4081524457781149, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -16.047974 + objectReference: {fileID: 0} + - target: {fileID: 4081920422494107, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -12.993668 + objectReference: {fileID: 0} + - target: {fileID: 4081920422494107, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.814446 + objectReference: {fileID: 0} + - target: {fileID: 4081920422494107, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -12.906357 + objectReference: {fileID: 0} + - target: {fileID: 4083485975560739, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -58.664288 + objectReference: {fileID: 0} + - target: {fileID: 4083485975560739, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -48.95934 + objectReference: {fileID: 0} + - target: {fileID: 4083485975560739, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -169.13217 + objectReference: {fileID: 0} + - target: {fileID: 4094283985748868, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000008537736 + objectReference: {fileID: 0} + - target: {fileID: 4094283985748868, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000034151076 + objectReference: {fileID: 0} + - target: {fileID: 4094283985748868, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.0355792e-12 + objectReference: {fileID: 0} + - target: {fileID: 4096597530611644, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.476233 + objectReference: {fileID: 0} + - target: {fileID: 4096597530611644, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -13.52801 + objectReference: {fileID: 0} + - target: {fileID: 4096597530611644, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.7237353 + objectReference: {fileID: 0} + - target: {fileID: 4102543447223915, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -59.765408 + objectReference: {fileID: 0} + - target: {fileID: 4102543447223915, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -136.61652 + objectReference: {fileID: 0} + - target: {fileID: 4102543447223915, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.09709537 + objectReference: {fileID: 0} + - target: {fileID: 4105912343260855, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 7.817503e-17 + objectReference: {fileID: 0} + - target: {fileID: 4105912343260855, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000042688777 + objectReference: {fileID: 0} + - target: {fileID: 4105912343260855, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.035529e-12 + objectReference: {fileID: 0} + - target: {fileID: 4112815651697755, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000017075441 + objectReference: {fileID: 0} + - target: {fileID: 4112815651697755, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000034150964 + objectReference: {fileID: 0} + - target: {fileID: 4112815651697755, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4119337346424409, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00008898268 + objectReference: {fileID: 0} + - target: {fileID: 4119337346424409, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000050251234 + objectReference: {fileID: 0} + - target: {fileID: 4119337346424409, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -82.780655 + objectReference: {fileID: 0} + - target: {fileID: 4124577934639600, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.264087 + objectReference: {fileID: 0} + - target: {fileID: 4124577934639600, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.506947 + objectReference: {fileID: 0} + - target: {fileID: 4124577934639600, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.6300642 + objectReference: {fileID: 0} + - target: {fileID: 4126508818681447, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 70.62246 + objectReference: {fileID: 0} + - target: {fileID: 4126508818681447, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -38.797718 + objectReference: {fileID: 0} + - target: {fileID: 4126508818681447, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -40.68862 + objectReference: {fileID: 0} + - target: {fileID: 4129116114662800, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.0156524 + objectReference: {fileID: 0} + - target: {fileID: 4129116114662800, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 15.983116 + objectReference: {fileID: 0} + - target: {fileID: 4129116114662800, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.325794 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.0779456 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.7631953 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 15.803973 + objectReference: {fileID: 0} + - target: {fileID: 4134286944189183, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000006830189 + objectReference: {fileID: 0} + - target: {fileID: 4134286944189183, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.1805526e-12 + objectReference: {fileID: 0} + - target: {fileID: 4134286944189183, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00002668042 + objectReference: {fileID: 0} + - target: {fileID: 4147706149845817, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -11.578361 + objectReference: {fileID: 0} + - target: {fileID: 4147706149845817, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -18.40155 + objectReference: {fileID: 0} + - target: {fileID: 4147706149845817, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.4489807 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 89.99991 + objectReference: {fileID: 0} + - target: {fileID: 4151117949762783, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.6349473 + objectReference: {fileID: 0} + - target: {fileID: 4151117949762783, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.25804597 + objectReference: {fileID: 0} + - target: {fileID: 4151117949762783, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.0554607 + objectReference: {fileID: 0} + - target: {fileID: 4171308771648913, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.2625232 + objectReference: {fileID: 0} + - target: {fileID: 4171308771648913, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 8.571398 + objectReference: {fileID: 0} + - target: {fileID: 4171308771648913, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.4912083 + objectReference: {fileID: 0} + - target: {fileID: 4173334745350128, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 20.773994 + objectReference: {fileID: 0} + - target: {fileID: 4173334745350128, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -18.684158 + objectReference: {fileID: 0} + - target: {fileID: 4173334745350128, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -63.502647 + objectReference: {fileID: 0} + - target: {fileID: 4173644300073267, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -43.651966 + objectReference: {fileID: 0} + - target: {fileID: 4173644300073267, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 34.21603 + objectReference: {fileID: 0} + - target: {fileID: 4173644300073267, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 166.49039 + objectReference: {fileID: 0} + - target: {fileID: 4195931274935818, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.8864403 + objectReference: {fileID: 0} + - target: {fileID: 4195931274935818, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -13.623184 + objectReference: {fileID: 0} + - target: {fileID: 4195931274935818, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 36.091343 + objectReference: {fileID: 0} + - target: {fileID: 4197515695889172, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000096671265 + objectReference: {fileID: 0} + - target: {fileID: 4197515695889172, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000781535 + objectReference: {fileID: 0} + - target: {fileID: 4197515695889172, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -113.00828 + objectReference: {fileID: 0} + - target: {fileID: 4201141531394087, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -12.729126 + objectReference: {fileID: 0} + - target: {fileID: 4201141531394087, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -174.51419 + objectReference: {fileID: 0} + - target: {fileID: 4201141531394087, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -41.692657 + objectReference: {fileID: 0} + - target: {fileID: 4202048797312955, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.1483127 + objectReference: {fileID: 0} + - target: {fileID: 4202048797312955, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.87294644 + objectReference: {fileID: 0} + - target: {fileID: 4202048797312955, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.393204 + objectReference: {fileID: 0} + - target: {fileID: 4208269818966246, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000010672187 + objectReference: {fileID: 0} + - target: {fileID: 4208269818966246, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.6843565e-13 + objectReference: {fileID: 0} + - target: {fileID: 4208269818966246, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000030517576 + objectReference: {fileID: 0} + - target: {fileID: 4222568209840903, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.1796095 + objectReference: {fileID: 0} + - target: {fileID: 4222568209840903, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.8865633 + objectReference: {fileID: 0} + - target: {fileID: 4222568209840903, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.0554252 + objectReference: {fileID: 0} + - target: {fileID: 4228214996573471, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000085377394 + objectReference: {fileID: 0} + - target: {fileID: 4228214996573471, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.27222324e-14 + objectReference: {fileID: 0} + - target: {fileID: 4228214996573471, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4231676679060417, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000010245281 + objectReference: {fileID: 0} + - target: {fileID: 4231676679060417, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.816666e-12 + objectReference: {fileID: 0} + - target: {fileID: 4231676679060417, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000021344336 + objectReference: {fileID: 0} + - target: {fileID: 4232415838589296, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.15465398 + objectReference: {fileID: 0} + - target: {fileID: 4232415838589296, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.9383616 + objectReference: {fileID: 0} + - target: {fileID: 4232415838589296, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.365008 + objectReference: {fileID: 0} + - target: {fileID: 4232720755092366, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.8783553 + objectReference: {fileID: 0} + - target: {fileID: 4232720755092366, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.177215 + objectReference: {fileID: 0} + - target: {fileID: 4232720755092366, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -12.421373 + objectReference: {fileID: 0} + - target: {fileID: 4239265225482239, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000001654189 + objectReference: {fileID: 0} + - target: {fileID: 4239265225482239, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000022995196 + objectReference: {fileID: 0} + - target: {fileID: 4239265225482239, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.00005464151 + objectReference: {fileID: 0} + - target: {fileID: 4246887588868771, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 26.217823 + objectReference: {fileID: 0} + - target: {fileID: 4246887588868771, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.905681 + objectReference: {fileID: 0} + - target: {fileID: 4246887588868771, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.33269453 + objectReference: {fileID: 0} + - target: {fileID: 4249237965167194, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.5105655 + objectReference: {fileID: 0} + - target: {fileID: 4249237965167194, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.3811216 + objectReference: {fileID: 0} + - target: {fileID: 4249237965167194, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -2.1142633 + objectReference: {fileID: 0} + - target: {fileID: 4250083484182041, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 33.453648 + objectReference: {fileID: 0} + - target: {fileID: 4250083484182041, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -100.576965 + objectReference: {fileID: 0} + - target: {fileID: 4250083484182041, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 91.96202 + objectReference: {fileID: 0} + - target: {fileID: 4260713349338959, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000017075429 + objectReference: {fileID: 0} + - target: {fileID: 4260713349338959, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000010672142 + objectReference: {fileID: 0} + - target: {fileID: 4260713349338959, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -180 + objectReference: {fileID: 0} + - target: {fileID: 4290791091168379, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -59.50533 + objectReference: {fileID: 0} + - target: {fileID: 4290791091168379, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -149.98328 + objectReference: {fileID: 0} + - target: {fileID: 4290791091168379, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -17.938934 + objectReference: {fileID: 0} + - target: {fileID: 4291547872775986, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 36.986393 + objectReference: {fileID: 0} + - target: {fileID: 4291547872775986, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 177.61678 + objectReference: {fileID: 0} + - target: {fileID: 4291547872775986, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -152.77644 + objectReference: {fileID: 0} + - target: {fileID: 4299931057912216, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.3137383 + objectReference: {fileID: 0} + - target: {fileID: 4299931057912216, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.873322 + objectReference: {fileID: 0} + - target: {fileID: 4299931057912216, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.5649078 + objectReference: {fileID: 0} + - target: {fileID: 4321515599905260, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -11.042341 + objectReference: {fileID: 0} + - target: {fileID: 4321515599905260, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.4711177 + objectReference: {fileID: 0} + - target: {fileID: 4321515599905260, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 5.4058456 + objectReference: {fileID: 0} + - target: {fileID: 4322008579206753, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000013020045 + objectReference: {fileID: 0} + - target: {fileID: 4322008579206753, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.716193e-12 + objectReference: {fileID: 0} + - target: {fileID: 4322008579206753, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000011952829 + objectReference: {fileID: 0} + - target: {fileID: 4329075794784248, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00011800437 + objectReference: {fileID: 0} + - target: {fileID: 4329075794784248, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.99992 + objectReference: {fileID: 0} + - target: {fileID: 4329075794784248, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -97.219345 + objectReference: {fileID: 0} + - target: {fileID: 4329446674688094, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -52.724243 + objectReference: {fileID: 0} + - target: {fileID: 4329446674688094, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 76.93774 + objectReference: {fileID: 0} + - target: {fileID: 4329446674688094, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 77.565414 + objectReference: {fileID: 0} + - target: {fileID: 4330820015962899, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.7295085 + objectReference: {fileID: 0} + - target: {fileID: 4330820015962899, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.3441677 + objectReference: {fileID: 0} + - target: {fileID: 4330820015962899, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.2891542 + objectReference: {fileID: 0} + - target: {fileID: 4337165658744233, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.56929964 + objectReference: {fileID: 0} + - target: {fileID: 4337165658744233, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.0831854 + objectReference: {fileID: 0} + - target: {fileID: 4337165658744233, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 14.484472 + objectReference: {fileID: 0} + - target: {fileID: 4346445019804701, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -71.73981 + objectReference: {fileID: 0} + - target: {fileID: 4346445019804701, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 134.61174 + objectReference: {fileID: 0} + - target: {fileID: 4346445019804701, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -104.63334 + objectReference: {fileID: 0} + - target: {fileID: 4349979204078785, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 15.13669 + objectReference: {fileID: 0} + - target: {fileID: 4349979204078785, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.7927155 + objectReference: {fileID: 0} + - target: {fileID: 4349979204078785, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.9380355 + objectReference: {fileID: 0} + - target: {fileID: 4353891062718048, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -72.86283 + objectReference: {fileID: 0} + - target: {fileID: 4353891062718048, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -62.96187 + objectReference: {fileID: 0} + - target: {fileID: 4353891062718048, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 116.22106 + objectReference: {fileID: 0} + - target: {fileID: 4360591974699550, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -73.67336 + objectReference: {fileID: 0} + - target: {fileID: 4360591974699550, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -119.27789 + objectReference: {fileID: 0} + - target: {fileID: 4360591974699550, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -18.456423 + objectReference: {fileID: 0} + - target: {fileID: 4364392939154294, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 7.0813403 + objectReference: {fileID: 0} + - target: {fileID: 4364392939154294, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.986661 + objectReference: {fileID: 0} + - target: {fileID: 4364392939154294, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -31.508215 + objectReference: {fileID: 0} + - target: {fileID: 4365773988297632, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 36.767117 + objectReference: {fileID: 0} + - target: {fileID: 4365773988297632, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -77.29485 + objectReference: {fileID: 0} + - target: {fileID: 4365773988297632, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 72.66125 + objectReference: {fileID: 0} + - target: {fileID: 4370081907136253, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000004135469 + objectReference: {fileID: 0} + - target: {fileID: 4370081907136253, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -7.7029084e-13 + objectReference: {fileID: 0} + - target: {fileID: 4370081907136253, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000010672169 + objectReference: {fileID: 0} + - target: {fileID: 4370485308309611, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -23.39702 + objectReference: {fileID: 0} + - target: {fileID: 4370485308309611, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.976073 + objectReference: {fileID: 0} + - target: {fileID: 4370485308309611, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -63.030994 + objectReference: {fileID: 0} + - target: {fileID: 4372353275341440, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.79344505 + objectReference: {fileID: 0} + - target: {fileID: 4372353275341440, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.46742743 + objectReference: {fileID: 0} + - target: {fileID: 4372353275341440, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -16.718063 + objectReference: {fileID: 0} + - target: {fileID: 4384784573714692, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.547688 + objectReference: {fileID: 0} + - target: {fileID: 4384784573714692, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 176.49408 + objectReference: {fileID: 0} + - target: {fileID: 4384784573714692, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -74.404854 + objectReference: {fileID: 0} + - target: {fileID: 4386568470988373, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -21.367188 + objectReference: {fileID: 0} + - target: {fileID: 4386568470988373, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 143.26332 + objectReference: {fileID: 0} + - target: {fileID: 4386568470988373, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -79.701454 + objectReference: {fileID: 0} + - target: {fileID: 4387228018655110, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -82.59119 + objectReference: {fileID: 0} + - target: {fileID: 4387228018655110, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 107.11951 + objectReference: {fileID: 0} + - target: {fileID: 4387228018655110, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -98.004265 + objectReference: {fileID: 0} + - target: {fileID: 4391225667286877, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -74.85637 + objectReference: {fileID: 0} + - target: {fileID: 4391225667286877, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -36.574253 + objectReference: {fileID: 0} + - target: {fileID: 4391225667286877, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -170.0917 + objectReference: {fileID: 0} + - target: {fileID: 4401109917237556, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000027320755 + objectReference: {fileID: 0} + - target: {fileID: 4401109917237556, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000014514154 + objectReference: {fileID: 0} + - target: {fileID: 4401429660297866, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.42312855 + objectReference: {fileID: 0} + - target: {fileID: 4401429660297866, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 15.395682 + objectReference: {fileID: 0} + - target: {fileID: 4401429660297866, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 176.79526 + objectReference: {fileID: 0} + - target: {fileID: 4403529848822963, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00002326532 + objectReference: {fileID: 0} + - target: {fileID: 4403529848822963, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000072570783 + objectReference: {fileID: 0} + - target: {fileID: 4403529848822963, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.4033343e-14 + objectReference: {fileID: 0} + - target: {fileID: 4405989028062321, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.3886086 + objectReference: {fileID: 0} + - target: {fileID: 4405989028062321, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -4.3956456 + objectReference: {fileID: 0} + - target: {fileID: 4405989028062321, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.1282469 + objectReference: {fileID: 0} + - target: {fileID: 4407886329842316, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 19.461246 + objectReference: {fileID: 0} + - target: {fileID: 4407886329842316, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 15.79075 + objectReference: {fileID: 0} + - target: {fileID: 4407886329842316, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -40.65683 + objectReference: {fileID: 0} + - target: {fileID: 4410049401584812, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -8.608015 + objectReference: {fileID: 0} + - target: {fileID: 4410049401584812, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -36.112965 + objectReference: {fileID: 0} + - target: {fileID: 4410049401584812, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -11.14489 + objectReference: {fileID: 0} + - target: {fileID: 4415925016355036, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000051895063 + objectReference: {fileID: 0} + - target: {fileID: 4415925016355036, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000047578656 + objectReference: {fileID: 0} + - target: {fileID: 4415925016355036, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 33.448383 + objectReference: {fileID: 0} + - target: {fileID: 4416529295595857, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000042684485 + objectReference: {fileID: 0} + - target: {fileID: 4416529295595857, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000000006090886 + objectReference: {fileID: 0} + - target: {fileID: 4416529295595857, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 90.81761 + objectReference: {fileID: 0} + - target: {fileID: 4422702022971346, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00008898268 + objectReference: {fileID: 0} + - target: {fileID: 4422702022971346, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000050251234 + objectReference: {fileID: 0} + - target: {fileID: 4422702022971346, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -82.780655 + objectReference: {fileID: 0} + - target: {fileID: 4428560594236482, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -5.4234977 + objectReference: {fileID: 0} + - target: {fileID: 4428560594236482, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 13.259659 + objectReference: {fileID: 0} + - target: {fileID: 4428560594236482, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 15.6330185 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.585358 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.7669706 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.03696529 + objectReference: {fileID: 0} + - target: {fileID: 4432271528610696, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.5413854 + objectReference: {fileID: 0} + - target: {fileID: 4432271528610696, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 12.825565 + objectReference: {fileID: 0} + - target: {fileID: 4432271528610696, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.704429 + objectReference: {fileID: 0} + - target: {fileID: 4433881075115309, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000022417095 + objectReference: {fileID: 0} + - target: {fileID: 4433881075115309, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000053950903 + objectReference: {fileID: 0} + - target: {fileID: 4433881075115309, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -16.05569 + objectReference: {fileID: 0} + - target: {fileID: 4446691751160785, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 15.578266 + objectReference: {fileID: 0} + - target: {fileID: 4446691751160785, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.016611814 + objectReference: {fileID: 0} + - target: {fileID: 4446691751160785, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 26.960608 + objectReference: {fileID: 0} + - target: {fileID: 4450063812975771, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.88639325 + objectReference: {fileID: 0} + - target: {fileID: 4450063812975771, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 28.051926 + objectReference: {fileID: 0} + - target: {fileID: 4450063812975771, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -2.3324227 + objectReference: {fileID: 0} + - target: {fileID: 4450889307774998, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4450889307774998, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000017075484 + objectReference: {fileID: 0} + - target: {fileID: 4458735412797113, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.9786024 + objectReference: {fileID: 0} + - target: {fileID: 4458735412797113, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -21.994484 + objectReference: {fileID: 0} + - target: {fileID: 4458735412797113, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -20.89821 + objectReference: {fileID: 0} + - target: {fileID: 4463395028392447, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4463395028392447, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000027320755 + objectReference: {fileID: 0} + - target: {fileID: 4463579974499585, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 49.77144 + objectReference: {fileID: 0} + - target: {fileID: 4463579974499585, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -76.39715 + objectReference: {fileID: 0} + - target: {fileID: 4463579974499585, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -37.421062 + objectReference: {fileID: 0} + - target: {fileID: 4484755779879834, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 26.898357 + objectReference: {fileID: 0} + - target: {fileID: 4484755779879834, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -4.1084213 + objectReference: {fileID: 0} + - target: {fileID: 4484755779879834, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 26.284655 + objectReference: {fileID: 0} + - target: {fileID: 4493949256727870, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.78847694 + objectReference: {fileID: 0} + - target: {fileID: 4493949256727870, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.9608183 + objectReference: {fileID: 0} + - target: {fileID: 4493949256727870, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -13.701114 + objectReference: {fileID: 0} + - target: {fileID: 4494345407022765, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -73.55412 + objectReference: {fileID: 0} + - target: {fileID: 4494345407022765, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 116.33695 + objectReference: {fileID: 0} + - target: {fileID: 4494345407022765, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -26.697021 + objectReference: {fileID: 0} + - target: {fileID: 4502609866597578, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00002148056 + objectReference: {fileID: 0} + - target: {fileID: 4502609866597578, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000034217795 + objectReference: {fileID: 0} + - target: {fileID: 4502609866597578, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 10.431038 + objectReference: {fileID: 0} + - target: {fileID: 4504506843557392, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.79473794 + objectReference: {fileID: 0} + - target: {fileID: 4504506843557392, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 28.624557 + objectReference: {fileID: 0} + - target: {fileID: 4504506843557392, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -2.0297484 + objectReference: {fileID: 0} + - target: {fileID: 4505490946690937, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00008252119 + objectReference: {fileID: 0} + - target: {fileID: 4505490946690937, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.321039 + objectReference: {fileID: 0} + - target: {fileID: 4505490946690937, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000028098928 + objectReference: {fileID: 0} + - target: {fileID: 4505682267929073, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.4033426e-14 + objectReference: {fileID: 0} + - target: {fileID: 4505682267929073, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.2278534e-21 + objectReference: {fileID: 0} + - target: {fileID: 4505682267929073, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00002134435 + objectReference: {fileID: 0} + - target: {fileID: 4507522976744791, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 81.579384 + objectReference: {fileID: 0} + - target: {fileID: 4507522976744791, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 93.170044 + objectReference: {fileID: 0} + - target: {fileID: 4507522976744791, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 74.86164 + objectReference: {fileID: 0} + - target: {fileID: 4510073901028830, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.71292555 + objectReference: {fileID: 0} + - target: {fileID: 4510073901028830, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.481583 + objectReference: {fileID: 0} + - target: {fileID: 4510073901028830, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.477143 + objectReference: {fileID: 0} + - target: {fileID: 4510800835404288, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000059764143 + objectReference: {fileID: 0} + - target: {fileID: 4517377532936435, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -5.511253 + objectReference: {fileID: 0} + - target: {fileID: 4517377532936435, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -14.338615 + objectReference: {fileID: 0} + - target: {fileID: 4517377532936435, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.41608948 + objectReference: {fileID: 0} + - target: {fileID: 4518639523470932, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.6416924 + objectReference: {fileID: 0} + - target: {fileID: 4518639523470932, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.8347477 + objectReference: {fileID: 0} + - target: {fileID: 4518639523470932, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 15.074513 + objectReference: {fileID: 0} + - target: {fileID: 4519819979147140, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.1555398 + objectReference: {fileID: 0} + - target: {fileID: 4519819979147140, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -29.476768 + objectReference: {fileID: 0} + - target: {fileID: 4519819979147140, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 11.084792 + objectReference: {fileID: 0} + - target: {fileID: 4521597976012101, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.9591183 + objectReference: {fileID: 0} + - target: {fileID: 4521597976012101, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.4085379 + objectReference: {fileID: 0} + - target: {fileID: 4521597976012101, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.716628 + objectReference: {fileID: 0} + - target: {fileID: 4527248355756736, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -13.144931 + objectReference: {fileID: 0} + - target: {fileID: 4527248355756736, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 4.780454 + objectReference: {fileID: 0} + - target: {fileID: 4527248355756736, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 20.600847 + objectReference: {fileID: 0} + - target: {fileID: 4536148047902537, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.2145137 + objectReference: {fileID: 0} + - target: {fileID: 4536148047902537, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -4.0422196 + objectReference: {fileID: 0} + - target: {fileID: 4536148047902537, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.8735569 + objectReference: {fileID: 0} + - target: {fileID: 4543023241981873, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.6014051 + objectReference: {fileID: 0} + - target: {fileID: 4543023241981873, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.5313587 + objectReference: {fileID: 0} + - target: {fileID: 4543023241981873, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -9.286371 + objectReference: {fileID: 0} + - target: {fileID: 4543584136297381, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 19.174381 + objectReference: {fileID: 0} + - target: {fileID: 4543584136297381, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.4225714 + objectReference: {fileID: 0} + - target: {fileID: 4543584136297381, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.8374078 + objectReference: {fileID: 0} + - target: {fileID: 4544837802452058, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 13.351981 + objectReference: {fileID: 0} + - target: {fileID: 4544837802452058, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -10.966172 + objectReference: {fileID: 0} + - target: {fileID: 4544837802452058, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.770559 + objectReference: {fileID: 0} + - target: {fileID: 4545683990359770, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000004482312 + objectReference: {fileID: 0} + - target: {fileID: 4545683990359770, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000013660384 + objectReference: {fileID: 0} + - target: {fileID: 4545683990359770, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000007683961 + objectReference: {fileID: 0} + - target: {fileID: 4547349145286502, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -12.843643 + objectReference: {fileID: 0} + - target: {fileID: 4547349145286502, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.5220581 + objectReference: {fileID: 0} + - target: {fileID: 4547349145286502, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -179.42535 + objectReference: {fileID: 0} + - target: {fileID: 4548862692844868, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -11.422402 + objectReference: {fileID: 0} + - target: {fileID: 4548862692844868, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -157.85542 + objectReference: {fileID: 0} + - target: {fileID: 4548862692844868, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -23.975506 + objectReference: {fileID: 0} + - target: {fileID: 4556043395114336, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.559793 + objectReference: {fileID: 0} + - target: {fileID: 4556043395114336, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.0878105 + objectReference: {fileID: 0} + - target: {fileID: 4556043395114336, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -14.646037 + objectReference: {fileID: 0} + - target: {fileID: 4559203567323380, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000002332386 + objectReference: {fileID: 0} + - target: {fileID: 4559203567323380, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000024945703 + objectReference: {fileID: 0} + - target: {fileID: 4559203567323380, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -46.924377 + objectReference: {fileID: 0} + - target: {fileID: 4562080017223558, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.27486113 + objectReference: {fileID: 0} + - target: {fileID: 4562080017223558, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.07628 + objectReference: {fileID: 0} + - target: {fileID: 4562080017223558, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.4504719 + objectReference: {fileID: 0} + - target: {fileID: 4566389953100910, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.9417922 + objectReference: {fileID: 0} + - target: {fileID: 4566389953100910, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.61693 + objectReference: {fileID: 0} + - target: {fileID: 4566389953100910, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.1145735 + objectReference: {fileID: 0} + - target: {fileID: 4578716238308850, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000000853774 + objectReference: {fileID: 0} + - target: {fileID: 4578716238308850, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000017075472 + objectReference: {fileID: 0} + - target: {fileID: 4578716238308850, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000008537736 + objectReference: {fileID: 0} + - target: {fileID: 4578880696632637, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.7900133 + objectReference: {fileID: 0} + - target: {fileID: 4578880696632637, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.2957964 + objectReference: {fileID: 0} + - target: {fileID: 4578880696632637, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.398518 + objectReference: {fileID: 0} + - target: {fileID: 4580109562975512, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.0711375e-12 + objectReference: {fileID: 0} + - target: {fileID: 4580109562975512, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000017075441 + objectReference: {fileID: 0} + - target: {fileID: 4580109562975512, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4583788928901705, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000025583618 + objectReference: {fileID: 0} + - target: {fileID: 4583788928901705, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000032817698 + objectReference: {fileID: 0} + - target: {fileID: 4583788928901705, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.457576 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalPosition.z + value: 200 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4616352195932608, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000053360845 + objectReference: {fileID: 0} + - target: {fileID: 4616352195932608, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4616352195932608, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4616761771223058, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00005464151 + objectReference: {fileID: 0} + - target: {fileID: 4616761771223058, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.5137873e-12 + objectReference: {fileID: 0} + - target: {fileID: 4616761771223058, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000006830201 + objectReference: {fileID: 0} + - target: {fileID: 4632179142322292, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -28.951054 + objectReference: {fileID: 0} + - target: {fileID: 4632179142322292, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 82.19862 + objectReference: {fileID: 0} + - target: {fileID: 4632179142322292, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 154.91356 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 65.48986 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -103.66593 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 76.94698 + objectReference: {fileID: 0} + - target: {fileID: 4644357204029367, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000013660394 + objectReference: {fileID: 0} + - target: {fileID: 4644357204029367, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.5137873e-12 + objectReference: {fileID: 0} + - target: {fileID: 4644357204029367, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000027320755 + objectReference: {fileID: 0} + - target: {fileID: 4657558218238974, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 13.704994 + objectReference: {fileID: 0} + - target: {fileID: 4657558218238974, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -7.8432627 + objectReference: {fileID: 0} + - target: {fileID: 4657558218238974, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -23.055202 + objectReference: {fileID: 0} + - target: {fileID: 4663898806329775, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.011116759 + objectReference: {fileID: 0} + - target: {fileID: 4663898806329775, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.703894 + objectReference: {fileID: 0} + - target: {fileID: 4663898806329775, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.597574 + objectReference: {fileID: 0} + - target: {fileID: 4688331903957256, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.7600186 + objectReference: {fileID: 0} + - target: {fileID: 4688331903957256, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.5300717 + objectReference: {fileID: 0} + - target: {fileID: 4688331903957256, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.2793076 + objectReference: {fileID: 0} + - target: {fileID: 4689224686120706, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -76.24385 + objectReference: {fileID: 0} + - target: {fileID: 4689224686120706, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -114.76769 + objectReference: {fileID: 0} + - target: {fileID: 4689224686120706, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 44.841614 + objectReference: {fileID: 0} + - target: {fileID: 4691570808825369, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.4233057 + objectReference: {fileID: 0} + - target: {fileID: 4691570808825369, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 18.84313 + objectReference: {fileID: 0} + - target: {fileID: 4691570808825369, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 4.73351 + objectReference: {fileID: 0} + - target: {fileID: 4696792502030561, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000008537769 + objectReference: {fileID: 0} + - target: {fileID: 4696792502030561, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000017075472 + objectReference: {fileID: 0} + - target: {fileID: 4696792502030561, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -180 + objectReference: {fileID: 0} + - target: {fileID: 4696919880513765, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000008110851 + objectReference: {fileID: 0} + - target: {fileID: 4696919880513765, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.5711946e-12 + objectReference: {fileID: 0} + - target: {fileID: 4696919880513765, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000011099054 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000002134434 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000017075441 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.0355694e-12 + objectReference: {fileID: 0} + - target: {fileID: 4704877758540679, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000030517576 + objectReference: {fileID: 0} + - target: {fileID: 4704877758540679, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.1368684e-12 + objectReference: {fileID: 0} + - target: {fileID: 4704877758540679, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000002134434 + objectReference: {fileID: 0} + - target: {fileID: 4719897623072781, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000015794812 + objectReference: {fileID: 0} + - target: {fileID: 4719897623072781, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000053360964 + objectReference: {fileID: 0} + - target: {fileID: 4719897623072781, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722550256369544, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.1307206 + objectReference: {fileID: 0} + - target: {fileID: 4722550256369544, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.888561 + objectReference: {fileID: 0} + - target: {fileID: 4722550256369544, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.6284947 + objectReference: {fileID: 0} + - target: {fileID: 4729442808604298, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 62.722607 + objectReference: {fileID: 0} + - target: {fileID: 4729442808604298, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -128.64824 + objectReference: {fileID: 0} + - target: {fileID: 4729442808604298, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -121.65189 + objectReference: {fileID: 0} + - target: {fileID: 4729821067651183, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 69.42185 + objectReference: {fileID: 0} + - target: {fileID: 4729821067651183, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -74.99594 + objectReference: {fileID: 0} + - target: {fileID: 4729821067651183, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 88.736885 + objectReference: {fileID: 0} + - target: {fileID: 4731059169969419, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.64922607 + objectReference: {fileID: 0} + - target: {fileID: 4731059169969419, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -178.94357 + objectReference: {fileID: 0} + - target: {fileID: 4731059169969419, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 19.490747 + objectReference: {fileID: 0} + - target: {fileID: 4739268104783211, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000027320755 + objectReference: {fileID: 0} + - target: {fileID: 4739268104783211, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000683019 + objectReference: {fileID: 0} + - target: {fileID: 4739268104783211, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000005976414 + objectReference: {fileID: 0} + - target: {fileID: 4743905223825669, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 80.84937 + objectReference: {fileID: 0} + - target: {fileID: 4743905223825669, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 111.27987 + objectReference: {fileID: 0} + - target: {fileID: 4743905223825669, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 18.172733 + objectReference: {fileID: 0} + - target: {fileID: 4751888446361502, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -70.18218 + objectReference: {fileID: 0} + - target: {fileID: 4751888446361502, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 61.51034 + objectReference: {fileID: 0} + - target: {fileID: 4751888446361502, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 106.56555 + objectReference: {fileID: 0} + - target: {fileID: 4754026925822528, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.2505241 + objectReference: {fileID: 0} + - target: {fileID: 4754026925822528, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 7.9112577 + objectReference: {fileID: 0} + - target: {fileID: 4754026925822528, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.9058003 + objectReference: {fileID: 0} + - target: {fileID: 4760480127920944, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.8365029 + objectReference: {fileID: 0} + - target: {fileID: 4760480127920944, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 23.447788 + objectReference: {fileID: 0} + - target: {fileID: 4760480127920944, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -11.675157 + objectReference: {fileID: 0} + - target: {fileID: 4766709239876273, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000017153136 + objectReference: {fileID: 0} + - target: {fileID: 4766709239876273, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000013775268 + objectReference: {fileID: 0} + - target: {fileID: 4766709239876273, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -2.533584 + objectReference: {fileID: 0} + - target: {fileID: 4777414246829702, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000003654753 + objectReference: {fileID: 0} + - target: {fileID: 4777414246829702, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000011050163 + objectReference: {fileID: 0} + - target: {fileID: 4777414246829702, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 43.38754 + objectReference: {fileID: 0} + - target: {fileID: 4782439640980787, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -7.155519 + objectReference: {fileID: 0} + - target: {fileID: 4782439640980787, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -7.9064736 + objectReference: {fileID: 0} + - target: {fileID: 4782439640980787, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.6771204 + objectReference: {fileID: 0} + - target: {fileID: 4785416887765914, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.3380527 + objectReference: {fileID: 0} + - target: {fileID: 4785416887765914, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.2178974 + objectReference: {fileID: 0} + - target: {fileID: 4785416887765914, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 24.993893 + objectReference: {fileID: 0} + - target: {fileID: 4799881864385010, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -78.32792 + objectReference: {fileID: 0} + - target: {fileID: 4799881864385010, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 118.31172 + objectReference: {fileID: 0} + - target: {fileID: 4799881864385010, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 54.488945 + objectReference: {fileID: 0} + - target: {fileID: 4805829819301007, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -86.94321 + objectReference: {fileID: 0} + - target: {fileID: 4805829819301007, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 108.58495 + objectReference: {fileID: 0} + - target: {fileID: 4805829819301007, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 82.81303 + objectReference: {fileID: 0} + - target: {fileID: 4817105377731967, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.47257257 + objectReference: {fileID: 0} + - target: {fileID: 4817105377731967, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.40739474 + objectReference: {fileID: 0} + - target: {fileID: 4817105377731967, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -10.958986 + objectReference: {fileID: 0} + - target: {fileID: 4825818419884204, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 80.22459 + objectReference: {fileID: 0} + - target: {fileID: 4825818419884204, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 110.37354 + objectReference: {fileID: 0} + - target: {fileID: 4825818419884204, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 111.60691 + objectReference: {fileID: 0} + - target: {fileID: 4827586244175853, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000051226293 + objectReference: {fileID: 0} + - target: {fileID: 4827586244175853, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000027320755 + objectReference: {fileID: 0} + - target: {fileID: 4827586244175853, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000027320755 + objectReference: {fileID: 0} + - target: {fileID: 4832474124979885, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000019844858 + objectReference: {fileID: 0} + - target: {fileID: 4832474124979885, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000006535616 + objectReference: {fileID: 0} + - target: {fileID: 4832474124979885, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 16.890461 + objectReference: {fileID: 0} + - target: {fileID: 4838352681112328, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000017075549 + objectReference: {fileID: 0} + - target: {fileID: 4838352681112328, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000085377746 + objectReference: {fileID: 0} + - target: {fileID: 4838352681112328, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00000085377 + objectReference: {fileID: 0} + - target: {fileID: 4844361126439134, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -6.1025853 + objectReference: {fileID: 0} + - target: {fileID: 4844361126439134, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.3504877 + objectReference: {fileID: 0} + - target: {fileID: 4844361126439134, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -23.171164 + objectReference: {fileID: 0} + - target: {fileID: 4845025230388998, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 7.2890344 + objectReference: {fileID: 0} + - target: {fileID: 4845025230388998, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.208686 + objectReference: {fileID: 0} + - target: {fileID: 4845025230388998, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 19.588696 + objectReference: {fileID: 0} + - target: {fileID: 4851449666512103, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 23.353973 + objectReference: {fileID: 0} + - target: {fileID: 4851449666512103, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 17.324448 + objectReference: {fileID: 0} + - target: {fileID: 4851449666512103, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 30.433237 + objectReference: {fileID: 0} + - target: {fileID: 4869737159367836, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -15.574255 + objectReference: {fileID: 0} + - target: {fileID: 4869737159367836, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 140.05215 + objectReference: {fileID: 0} + - target: {fileID: 4869737159367836, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -141.79341 + objectReference: {fileID: 0} + - target: {fileID: 4870947366518887, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 31.053658 + objectReference: {fileID: 0} + - target: {fileID: 4870947366518887, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 171.24963 + objectReference: {fileID: 0} + - target: {fileID: 4870947366518887, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 176.50523 + objectReference: {fileID: 0} + - target: {fileID: 4878983242975409, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.2272169 + objectReference: {fileID: 0} + - target: {fileID: 4878983242975409, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.99735785 + objectReference: {fileID: 0} + - target: {fileID: 4878983242975409, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -27.437107 + objectReference: {fileID: 0} + - target: {fileID: 4891995844532801, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -27.847742 + objectReference: {fileID: 0} + - target: {fileID: 4891995844532801, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -14.406756 + objectReference: {fileID: 0} + - target: {fileID: 4891995844532801, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 4.713751 + objectReference: {fileID: 0} + - target: {fileID: 4894225446638996, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.11519615 + objectReference: {fileID: 0} + - target: {fileID: 4894225446638996, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.4100637 + objectReference: {fileID: 0} + - target: {fileID: 4894225446638996, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.1201708 + objectReference: {fileID: 0} + - target: {fileID: 4894352506636257, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.38404518 + objectReference: {fileID: 0} + - target: {fileID: 4894352506636257, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 12.461406 + objectReference: {fileID: 0} + - target: {fileID: 4894352506636257, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.0521135 + objectReference: {fileID: 0} + - target: {fileID: 4904079258986964, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000003046578 + objectReference: {fileID: 0} + - target: {fileID: 4904079258986964, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000005931531 + objectReference: {fileID: 0} + - target: {fileID: 4904079258986964, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -113.008286 + objectReference: {fileID: 0} + - target: {fileID: 4904400124545405, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.35278216 + objectReference: {fileID: 0} + - target: {fileID: 4904400124545405, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.005776316 + objectReference: {fileID: 0} + - target: {fileID: 4904400124545405, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.659646 + objectReference: {fileID: 0} + - target: {fileID: 4910201747455131, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000010245277 + objectReference: {fileID: 0} + - target: {fileID: 4911451331743778, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000011136319 + objectReference: {fileID: 0} + - target: {fileID: 4911451331743778, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000016776389 + objectReference: {fileID: 0} + - target: {fileID: 4911451331743778, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -24.417883 + objectReference: {fileID: 0} + - target: {fileID: 4932862749439555, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.3142729 + objectReference: {fileID: 0} + - target: {fileID: 4932862749439555, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -162.353 + objectReference: {fileID: 0} + - target: {fileID: 4932862749439555, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -11.493894 + objectReference: {fileID: 0} + - target: {fileID: 4934287144746640, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 74.365746 + objectReference: {fileID: 0} + - target: {fileID: 4934287144746640, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -52.593945 + objectReference: {fileID: 0} + - target: {fileID: 4934287144746640, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -21.065615 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000027320755 + objectReference: {fileID: 0} + - target: {fileID: 4949593803130734, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.650911 + objectReference: {fileID: 0} + - target: {fileID: 4949593803130734, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -14.275526 + objectReference: {fileID: 0} + - target: {fileID: 4949593803130734, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.6446233 + objectReference: {fileID: 0} + - target: {fileID: 4951712121405908, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4951712121405908, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4952320105404285, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.029695313 + objectReference: {fileID: 0} + - target: {fileID: 4952320105404285, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.623262 + objectReference: {fileID: 0} + - target: {fileID: 4952320105404285, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.15773405 + objectReference: {fileID: 0} + - target: {fileID: 4958492976087124, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 26.11948 + objectReference: {fileID: 0} + - target: {fileID: 4958492976087124, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -22.62608 + objectReference: {fileID: 0} + - target: {fileID: 4958492976087124, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -24.839346 + objectReference: {fileID: 0} + - target: {fileID: 4960577952585462, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -16.902813 + objectReference: {fileID: 0} + - target: {fileID: 4960577952585462, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 13.549893 + objectReference: {fileID: 0} + - target: {fileID: 4960577952585462, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 9.000523 + objectReference: {fileID: 0} + - target: {fileID: 4962713294667487, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 20.121864 + objectReference: {fileID: 0} + - target: {fileID: 4962713294667487, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.5333443 + objectReference: {fileID: 0} + - target: {fileID: 4962713294667487, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -102.61232 + objectReference: {fileID: 0} + - target: {fileID: 4964822413698908, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.2770476 + objectReference: {fileID: 0} + - target: {fileID: 4964822413698908, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.6181264 + objectReference: {fileID: 0} + - target: {fileID: 4964822413698908, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 8.407334 + objectReference: {fileID: 0} + - target: {fileID: 4965908813272002, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -88.474525 + objectReference: {fileID: 0} + - target: {fileID: 4965908813272002, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -28.347984 + objectReference: {fileID: 0} + - target: {fileID: 4965908813272002, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -154.93468 + objectReference: {fileID: 0} + - target: {fileID: 4975779338151784, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.1616689 + objectReference: {fileID: 0} + - target: {fileID: 4975779338151784, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.045753628 + objectReference: {fileID: 0} + - target: {fileID: 4975779338151784, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -9.358731 + objectReference: {fileID: 0} + - target: {fileID: 4985908891298522, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -49.366116 + objectReference: {fileID: 0} + - target: {fileID: 4985908891298522, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -52.1399 + objectReference: {fileID: 0} + - target: {fileID: 4985908891298522, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -136.92732 + objectReference: {fileID: 0} + - target: {fileID: 4989434536655964, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000027320755 + objectReference: {fileID: 0} + - target: {fileID: 4989434536655964, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000008537648 + objectReference: {fileID: 0} + - target: {fileID: 4989434536655964, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00003639209 + objectReference: {fileID: 0} + - target: {fileID: 4993076962757715, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -17.446846 + objectReference: {fileID: 0} + - target: {fileID: 4993076962757715, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.673047 + objectReference: {fileID: 0} + - target: {fileID: 4993076962757715, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -47.724617 + objectReference: {fileID: 0} + - target: {fileID: 4996317296757491, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.358838 + objectReference: {fileID: 0} + - target: {fileID: 4996317296757491, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.30898613 + objectReference: {fileID: 0} + - target: {fileID: 4996317296757491, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -10.298197 + objectReference: {fileID: 0} + - target: {fileID: 4998495239010246, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 26.992064 + objectReference: {fileID: 0} + - target: {fileID: 4998495239010246, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -110.00631 + objectReference: {fileID: 0} + - target: {fileID: 4998495239010246, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -173.07037 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 1051f203e6a58a343aa56f1d1f0963f8, type: 3} +--- !u!4 &1409594559 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4603576887721950, guid: 1051f203e6a58a343aa56f1d1f0963f8, + type: 3} + m_PrefabInstance: {fileID: 1409594558} + m_PrefabAsset: {fileID: 0} --- !u!1 &1424607925 GameObject: m_ObjectHideFlags: 0 @@ -1985,6 +11771,4153 @@ BoxCollider2D: serializedVersion: 2 m_Size: {x: 18.704224, y: 70.2} m_EdgeRadius: 0 +--- !u!1001 &1566995047 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1709254077376921, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_Name + value: Game177_zhubajie_shipo_skill + objectReference: {fileID: 0} + - target: {fileID: 1709254077376921, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4007513189690300, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000068494984 + objectReference: {fileID: 0} + - target: {fileID: 4007513189690300, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000021309538 + objectReference: {fileID: 0} + - target: {fileID: 4007513189690300, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.0000048707516 + objectReference: {fileID: 0} + - target: {fileID: 4009931292380359, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10.27897 + objectReference: {fileID: 0} + - target: {fileID: 4009931292380359, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.157668 + objectReference: {fileID: 0} + - target: {fileID: 4009931292380359, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.171833 + objectReference: {fileID: 0} + - target: {fileID: 4026196548002408, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000002226152 + objectReference: {fileID: 0} + - target: {fileID: 4026196548002408, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000014127354 + objectReference: {fileID: 0} + - target: {fileID: 4026196548002408, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 60.633736 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -89.99427 + objectReference: {fileID: 0} + - target: {fileID: 4043919389829319, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 89.99995 + objectReference: {fileID: 0} + - target: {fileID: 4066778049879928, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4085275382694935, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00035766308 + objectReference: {fileID: 0} + - target: {fileID: 4085275382694935, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0006188826 + objectReference: {fileID: 0} + - target: {fileID: 4085275382694935, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -77.78128 + objectReference: {fileID: 0} + - target: {fileID: 4094320201520353, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -26.256695 + objectReference: {fileID: 0} + - target: {fileID: 4094320201520353, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -173.31346 + objectReference: {fileID: 0} + - target: {fileID: 4094320201520353, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -11.781397 + objectReference: {fileID: 0} + - target: {fileID: 4121005239445321, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.4675884 + objectReference: {fileID: 0} + - target: {fileID: 4121005239445321, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.2453964 + objectReference: {fileID: 0} + - target: {fileID: 4121005239445321, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -20.578382 + objectReference: {fileID: 0} + - target: {fileID: 4123703392571528, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000031827035 + objectReference: {fileID: 0} + - target: {fileID: 4123703392571528, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000009855742 + objectReference: {fileID: 0} + - target: {fileID: 4123703392571528, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 46.023155 + objectReference: {fileID: 0} + - target: {fileID: 4132862189046193, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 16.267122 + objectReference: {fileID: 0} + - target: {fileID: 4132862189046193, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -17.070831 + objectReference: {fileID: 0} + - target: {fileID: 4132862189046193, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -12.501368 + objectReference: {fileID: 0} + - target: {fileID: 4149520701623706, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 13.112578 + objectReference: {fileID: 0} + - target: {fileID: 4149520701623706, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -161.87402 + objectReference: {fileID: 0} + - target: {fileID: 4149520701623706, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.6569915 + objectReference: {fileID: 0} + - target: {fileID: 4150646884989824, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.22673157 + objectReference: {fileID: 0} + - target: {fileID: 4150646884989824, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.057598 + objectReference: {fileID: 0} + - target: {fileID: 4150646884989824, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.3127878 + objectReference: {fileID: 0} + - target: {fileID: 4167524263268962, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000030442277 + objectReference: {fileID: 0} + - target: {fileID: 4167524263268962, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000012176853 + objectReference: {fileID: 0} + - target: {fileID: 4167524263268962, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4190181876552715, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000028237711 + objectReference: {fileID: 0} + - target: {fileID: 4190181876552715, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000000075261866 + objectReference: {fileID: 0} + - target: {fileID: 4190181876552715, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.2213305 + objectReference: {fileID: 0} + - target: {fileID: 4194081240383615, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.177084e-12 + objectReference: {fileID: 0} + - target: {fileID: 4194081240383615, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.4513951e-12 + objectReference: {fileID: 0} + - target: {fileID: 4194081240383615, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.00000030442342 + objectReference: {fileID: 0} + - target: {fileID: 4208575754630950, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000045683228 + objectReference: {fileID: 0} + - target: {fileID: 4208575754630950, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.99986 + objectReference: {fileID: 0} + - target: {fileID: 4208575754630950, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -110.52262 + objectReference: {fileID: 0} + - target: {fileID: 4231814100211528, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0012080031 + objectReference: {fileID: 0} + - target: {fileID: 4231814100211528, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0012221975 + objectReference: {fileID: 0} + - target: {fileID: 4231814100211528, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -76.81503 + objectReference: {fileID: 0} + - target: {fileID: 4240571728440943, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.802959e-10 + objectReference: {fileID: 0} + - target: {fileID: 4240571728440943, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000000056120335 + objectReference: {fileID: 0} + - target: {fileID: 4240571728440943, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.38825545 + objectReference: {fileID: 0} + - target: {fileID: 4264357844037074, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000613319 + objectReference: {fileID: 0} + - target: {fileID: 4264357844037074, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000013587974 + objectReference: {fileID: 0} + - target: {fileID: 4264357844037074, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 70.86697 + objectReference: {fileID: 0} + - target: {fileID: 4279359913592680, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 42.138092 + objectReference: {fileID: 0} + - target: {fileID: 4279359913592680, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -20.561392 + objectReference: {fileID: 0} + - target: {fileID: 4279359913592680, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -120.27826 + objectReference: {fileID: 0} + - target: {fileID: 4292246286975720, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000029070466 + objectReference: {fileID: 0} + - target: {fileID: 4292246286975720, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000000011844577 + objectReference: {fileID: 0} + - target: {fileID: 4292246286975720, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 57.716072 + objectReference: {fileID: 0} + - target: {fileID: 4295428814336086, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0056362944 + objectReference: {fileID: 0} + - target: {fileID: 4295428814336086, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.4780374 + objectReference: {fileID: 0} + - target: {fileID: 4295428814336086, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.27929485 + objectReference: {fileID: 0} + - target: {fileID: 4328299215684997, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 4328299215684997, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.34404 + objectReference: {fileID: 0} + - target: {fileID: 4328299215684997, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4354824845356902, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -16.523638 + objectReference: {fileID: 0} + - target: {fileID: 4354824845356902, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 101.5818 + objectReference: {fileID: 0} + - target: {fileID: 4354824845356902, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -175.17256 + objectReference: {fileID: 0} + - target: {fileID: 4356319167443197, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.822652 + objectReference: {fileID: 0} + - target: {fileID: 4356319167443197, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.681788 + objectReference: {fileID: 0} + - target: {fileID: 4356319167443197, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -32.6424 + objectReference: {fileID: 0} + - target: {fileID: 4370222726513266, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000030442203 + objectReference: {fileID: 0} + - target: {fileID: 4370222726513266, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000015268674 + objectReference: {fileID: 0} + - target: {fileID: 4370222726513266, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -9.0711645e-14 + objectReference: {fileID: 0} + - target: {fileID: 4384403120170545, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000015221084 + objectReference: {fileID: 0} + - target: {fileID: 4384403120170545, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000004435516 + objectReference: {fileID: 0} + - target: {fileID: 4384403120170545, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4386943702330414, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.00923 + objectReference: {fileID: 0} + - target: {fileID: 4386943702330414, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 165.15619 + objectReference: {fileID: 0} + - target: {fileID: 4386943702330414, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 82.46351 + objectReference: {fileID: 0} + - target: {fileID: 4393105877652414, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000045558776 + objectReference: {fileID: 0} + - target: {fileID: 4393105877652414, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00007553172 + objectReference: {fileID: 0} + - target: {fileID: 4393105877652414, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -15.219112 + objectReference: {fileID: 0} + - target: {fileID: 4408345039935966, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0040483847 + objectReference: {fileID: 0} + - target: {fileID: 4408345039935966, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -89 + objectReference: {fileID: 0} + - target: {fileID: 4408345039935966, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000405304 + objectReference: {fileID: 0} + - target: {fileID: 4431740505123533, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.822374 + objectReference: {fileID: 0} + - target: {fileID: 4431740505123533, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 169.3181 + objectReference: {fileID: 0} + - target: {fileID: 4431740505123533, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -147.3575 + objectReference: {fileID: 0} + - target: {fileID: 4450391854282655, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.00952 + objectReference: {fileID: 0} + - target: {fileID: 4450391854282655, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.844106 + objectReference: {fileID: 0} + - target: {fileID: 4450391854282655, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 97.53632 + objectReference: {fileID: 0} + - target: {fileID: 4492842699383957, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -46.382065 + objectReference: {fileID: 0} + - target: {fileID: 4492842699383957, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 88.11289 + objectReference: {fileID: 0} + - target: {fileID: 4492842699383957, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -80.59596 + objectReference: {fileID: 0} + - target: {fileID: 4499726237547504, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -78.97193 + objectReference: {fileID: 0} + - target: {fileID: 4499726237547504, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 150.747 + objectReference: {fileID: 0} + - target: {fileID: 4499726237547504, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -141.6016 + objectReference: {fileID: 0} + - target: {fileID: 4533803739292891, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.5291139 + objectReference: {fileID: 0} + - target: {fileID: 4533803739292891, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.4701064 + objectReference: {fileID: 0} + - target: {fileID: 4533803739292891, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -31.435017 + objectReference: {fileID: 0} + - target: {fileID: 4534704304255049, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -68.15851 + objectReference: {fileID: 0} + - target: {fileID: 4534704304255049, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -161.30954 + objectReference: {fileID: 0} + - target: {fileID: 4534704304255049, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 36.498177 + objectReference: {fileID: 0} + - target: {fileID: 4552309709192268, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 12.796604 + objectReference: {fileID: 0} + - target: {fileID: 4552309709192268, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 15.066799 + objectReference: {fileID: 0} + - target: {fileID: 4552309709192268, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 29.322865 + objectReference: {fileID: 0} + - target: {fileID: 4571878917323452, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.16588938 + objectReference: {fileID: 0} + - target: {fileID: 4571878917323452, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.289857 + objectReference: {fileID: 0} + - target: {fileID: 4571878917323452, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.98899245 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.0434642 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -28.304134 + objectReference: {fileID: 0} + - target: {fileID: 4572839542275309, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -43.552563 + objectReference: {fileID: 0} + - target: {fileID: 4574190619683098, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -72.12596 + objectReference: {fileID: 0} + - target: {fileID: 4574190619683098, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -94.08821 + objectReference: {fileID: 0} + - target: {fileID: 4574190619683098, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -78.649 + objectReference: {fileID: 0} + - target: {fileID: 4574304967836189, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 11.453932 + objectReference: {fileID: 0} + - target: {fileID: 4574304967836189, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.2885427 + objectReference: {fileID: 0} + - target: {fileID: 4574304967836189, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.6140447 + objectReference: {fileID: 0} + - target: {fileID: 4601984538237284, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00018837741 + objectReference: {fileID: 0} + - target: {fileID: 4601984538237284, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.5625443 + objectReference: {fileID: 0} + - target: {fileID: 4601984538237284, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -30.47504 + objectReference: {fileID: 0} + - target: {fileID: 4617365563186364, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000009857023 + objectReference: {fileID: 0} + - target: {fileID: 4617365563186364, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000028237857 + objectReference: {fileID: 0} + - target: {fileID: 4617365563186364, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000009857021 + objectReference: {fileID: 0} + - target: {fileID: 4630643969539439, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.1938107 + objectReference: {fileID: 0} + - target: {fileID: 4630643969539439, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.409792 + objectReference: {fileID: 0} + - target: {fileID: 4630643969539439, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -165.71347 + objectReference: {fileID: 0} + - target: {fileID: 4633296557590524, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.558809 + objectReference: {fileID: 0} + - target: {fileID: 4633296557590524, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -22.274063 + objectReference: {fileID: 0} + - target: {fileID: 4633296557590524, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.670475 + objectReference: {fileID: 0} + - target: {fileID: 4641631609468814, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.8053246 + objectReference: {fileID: 0} + - target: {fileID: 4641631609468814, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.4487967 + objectReference: {fileID: 0} + - target: {fileID: 4641631609468814, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -59.93632 + objectReference: {fileID: 0} + - target: {fileID: 4651560128206891, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.9232244 + objectReference: {fileID: 0} + - target: {fileID: 4651560128206891, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.2696366 + objectReference: {fileID: 0} + - target: {fileID: 4651560128206891, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 5.2472506 + objectReference: {fileID: 0} + - target: {fileID: 4658330495870062, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 25.547646 + objectReference: {fileID: 0} + - target: {fileID: 4658330495870062, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -128.47769 + objectReference: {fileID: 0} + - target: {fileID: 4658330495870062, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -102.6432 + objectReference: {fileID: 0} + - target: {fileID: 4689364072382846, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -78.39607 + objectReference: {fileID: 0} + - target: {fileID: 4689364072382846, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 120.70314 + objectReference: {fileID: 0} + - target: {fileID: 4689364072382846, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 148.68047 + objectReference: {fileID: 0} + - target: {fileID: 4690175861776792, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 55.819534 + objectReference: {fileID: 0} + - target: {fileID: 4690175861776792, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -125.94589 + objectReference: {fileID: 0} + - target: {fileID: 4690175861776792, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 154.24103 + objectReference: {fileID: 0} + - target: {fileID: 4693062532245359, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.9603596 + objectReference: {fileID: 0} + - target: {fileID: 4693062532245359, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.6576834 + objectReference: {fileID: 0} + - target: {fileID: 4693062532245359, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 34.412586 + objectReference: {fileID: 0} + - target: {fileID: 4699617135816954, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10.731396 + objectReference: {fileID: 0} + - target: {fileID: 4699617135816954, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -15.530455 + objectReference: {fileID: 0} + - target: {fileID: 4699617135816954, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.8205395 + objectReference: {fileID: 0} + - target: {fileID: 4703931505913403, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.22715558 + objectReference: {fileID: 0} + - target: {fileID: 4703931505913403, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.058784 + objectReference: {fileID: 0} + - target: {fileID: 4703931505913403, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -40.249832 + objectReference: {fileID: 0} + - target: {fileID: 4704330047573733, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.112297 + objectReference: {fileID: 0} + - target: {fileID: 4704330047573733, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.81268144 + objectReference: {fileID: 0} + - target: {fileID: 4704330047573733, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -71.32675 + objectReference: {fileID: 0} + - target: {fileID: 4722951815217645, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722951815217645, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722951815217645, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722951815217645, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4722951815217645, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4722951815217645, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4722951815217645, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4722951815217645, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722951815217645, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4722951815217645, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4743393880019028, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 6.458098 + objectReference: {fileID: 0} + - target: {fileID: 4743393880019028, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.16085064 + objectReference: {fileID: 0} + - target: {fileID: 4743393880019028, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.3520885 + objectReference: {fileID: 0} + - target: {fileID: 4770005084341472, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 19.142921 + objectReference: {fileID: 0} + - target: {fileID: 4770005084341472, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.16389 + objectReference: {fileID: 0} + - target: {fileID: 4770005084341472, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.99831176 + objectReference: {fileID: 0} + - target: {fileID: 4785330607447594, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000022831622 + objectReference: {fileID: 0} + - target: {fileID: 4785330607447594, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000046614463 + objectReference: {fileID: 0} + - target: {fileID: 4785330607447594, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4799762105739359, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -42.88621 + objectReference: {fileID: 0} + - target: {fileID: 4799762105739359, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -17.258371 + objectReference: {fileID: 0} + - target: {fileID: 4799762105739359, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 25.235607 + objectReference: {fileID: 0} + - target: {fileID: 4806657225351454, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.4514021e-12 + objectReference: {fileID: 0} + - target: {fileID: 4806657225351454, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000060884554 + objectReference: {fileID: 0} + - target: {fileID: 4806657225351454, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.4513826e-12 + objectReference: {fileID: 0} + - target: {fileID: 4829625606037309, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000000002378249 + objectReference: {fileID: 0} + - target: {fileID: 4829625606037309, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000000009513084 + objectReference: {fileID: 0} + - target: {fileID: 4829625606037309, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.0000012176863 + objectReference: {fileID: 0} + - target: {fileID: 4855482821919830, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 36.24436 + objectReference: {fileID: 0} + - target: {fileID: 4855482821919830, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -106.3268 + objectReference: {fileID: 0} + - target: {fileID: 4855482821919830, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -109.52918 + objectReference: {fileID: 0} + - target: {fileID: 4880619614767448, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.46713507 + objectReference: {fileID: 0} + - target: {fileID: 4880619614767448, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.2457582 + objectReference: {fileID: 0} + - target: {fileID: 4880619614767448, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -20.579252 + objectReference: {fileID: 0} + - target: {fileID: 4964469411310401, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.16328976 + objectReference: {fileID: 0} + - target: {fileID: 4964469411310401, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.1010337 + objectReference: {fileID: 0} + - target: {fileID: 4964469411310401, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.84023464 + objectReference: {fileID: 0} + - target: {fileID: 4969505138979683, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00034038123 + objectReference: {fileID: 0} + - target: {fileID: 4969505138979683, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000032619712 + objectReference: {fileID: 0} + - target: {fileID: 4969505138979683, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.3096804 + objectReference: {fileID: 0} + - target: {fileID: 4976365255789935, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 18.007046 + objectReference: {fileID: 0} + - target: {fileID: 4976365255789935, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -84.90529 + objectReference: {fileID: 0} + - target: {fileID: 4976365255789935, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 151.40039 + objectReference: {fileID: 0} + - target: {fileID: 4998874197659892, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.007824273 + objectReference: {fileID: 0} + - target: {fileID: 4998874197659892, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -179.99527 + objectReference: {fileID: 0} + - target: {fileID: 4998874197659892, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 60.07873 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: d3d366c4cae7e9043bfd375ab56109b7, type: 3} +--- !u!1001 &1698507950 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 763264655} + m_Modifications: + - target: {fileID: 1709254077376921, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_Name + value: Game177_changE_skill + objectReference: {fileID: 0} + - target: {fileID: 1709254077376921, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4000342987746139, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000003030307 + objectReference: {fileID: 0} + - target: {fileID: 4000342987746139, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000007973804 + objectReference: {fileID: 0} + - target: {fileID: 4000342987746139, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 62.179146 + objectReference: {fileID: 0} + - target: {fileID: 4007271993718322, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.7959193 + objectReference: {fileID: 0} + - target: {fileID: 4007271993718322, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -10.248431 + objectReference: {fileID: 0} + - target: {fileID: 4007271993718322, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 10.656455 + objectReference: {fileID: 0} + - target: {fileID: 4016782227057731, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000010621752 + objectReference: {fileID: 0} + - target: {fileID: 4016782227057731, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000061771057 + objectReference: {fileID: 0} + - target: {fileID: 4016782227057731, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 79.90817 + objectReference: {fileID: 0} + - target: {fileID: 4016852445014956, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000012896513 + objectReference: {fileID: 0} + - target: {fileID: 4016852445014956, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000073449073 + objectReference: {fileID: 0} + - target: {fileID: 4016852445014956, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -113.008286 + objectReference: {fileID: 0} + - target: {fileID: 4020314340478216, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.039693072 + objectReference: {fileID: 0} + - target: {fileID: 4020314340478216, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.854898 + objectReference: {fileID: 0} + - target: {fileID: 4020314340478216, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.7280865 + objectReference: {fileID: 0} + - target: {fileID: 4023566878023198, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 7.0731826 + objectReference: {fileID: 0} + - target: {fileID: 4023566878023198, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -19.822033 + objectReference: {fileID: 0} + - target: {fileID: 4023566878023198, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -161.75232 + objectReference: {fileID: 0} + - target: {fileID: 4033903555039309, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.71292144 + objectReference: {fileID: 0} + - target: {fileID: 4033903555039309, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.4815564 + objectReference: {fileID: 0} + - target: {fileID: 4033903555039309, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.477141 + objectReference: {fileID: 0} + - target: {fileID: 4036828218548272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000003425923 + objectReference: {fileID: 0} + - target: {fileID: 4036828218548272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.1758742e-12 + objectReference: {fileID: 0} + - target: {fileID: 4036828218548272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4041287186795109, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.6269729 + objectReference: {fileID: 0} + - target: {fileID: 4041287186795109, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -7.0169706 + objectReference: {fileID: 0} + - target: {fileID: 4041287186795109, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 34.9143 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00002641268 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000065777563 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00002929043 + objectReference: {fileID: 0} + - target: {fileID: 4041608817324026, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 48.066986 + objectReference: {fileID: 0} + - target: {fileID: 4041608817324026, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -102.37493 + objectReference: {fileID: 0} + - target: {fileID: 4041608817324026, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 94.88771 + objectReference: {fileID: 0} + - target: {fileID: 4044586276341600, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 19.11261 + objectReference: {fileID: 0} + - target: {fileID: 4044586276341600, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -10.664873 + objectReference: {fileID: 0} + - target: {fileID: 4044586276341600, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.56862175 + objectReference: {fileID: 0} + - target: {fileID: 4045646810609841, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.187882 + objectReference: {fileID: 0} + - target: {fileID: 4045646810609841, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 12.052271 + objectReference: {fileID: 0} + - target: {fileID: 4045646810609841, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 4.4157243 + objectReference: {fileID: 0} + - target: {fileID: 4055535033279528, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.5677728e-12 + objectReference: {fileID: 0} + - target: {fileID: 4055535033279528, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000035972114 + objectReference: {fileID: 0} + - target: {fileID: 4055535033279528, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.839198e-13 + objectReference: {fileID: 0} + - target: {fileID: 4066338149260220, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 13.689558 + objectReference: {fileID: 0} + - target: {fileID: 4066338149260220, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 172.05698 + objectReference: {fileID: 0} + - target: {fileID: 4066338149260220, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -56.829407 + objectReference: {fileID: 0} + - target: {fileID: 4067212629291419, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.6276468e-12 + objectReference: {fileID: 0} + - target: {fileID: 4067212629291419, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000049333235 + objectReference: {fileID: 0} + - target: {fileID: 4067212629291419, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000030517576 + objectReference: {fileID: 0} + - target: {fileID: 4071519224935516, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4071519224935516, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000005481468 + objectReference: {fileID: 0} + - target: {fileID: 4071519224935516, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4077469347768860, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.5752952 + objectReference: {fileID: 0} + - target: {fileID: 4077469347768860, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -10.547613 + objectReference: {fileID: 0} + - target: {fileID: 4077469347768860, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 13.439966 + objectReference: {fileID: 0} + - target: {fileID: 4081524457781149, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -37.195805 + objectReference: {fileID: 0} + - target: {fileID: 4081524457781149, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -86.15864 + objectReference: {fileID: 0} + - target: {fileID: 4081524457781149, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -99.049446 + objectReference: {fileID: 0} + - target: {fileID: 4081920422494107, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.958935 + objectReference: {fileID: 0} + - target: {fileID: 4081920422494107, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 17.006102 + objectReference: {fileID: 0} + - target: {fileID: 4081920422494107, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.467334 + objectReference: {fileID: 0} + - target: {fileID: 4083485975560739, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.49659768 + objectReference: {fileID: 0} + - target: {fileID: 4083485975560739, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.5189333 + objectReference: {fileID: 0} + - target: {fileID: 4083485975560739, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.38916016 + objectReference: {fileID: 0} + - target: {fileID: 4085134620244786, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 32.241875 + objectReference: {fileID: 0} + - target: {fileID: 4085134620244786, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 31.487139 + objectReference: {fileID: 0} + - target: {fileID: 4085134620244786, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -149.13412 + objectReference: {fileID: 0} + - target: {fileID: 4094283985748868, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -27.372393 + objectReference: {fileID: 0} + - target: {fileID: 4094283985748868, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.0346627 + objectReference: {fileID: 0} + - target: {fileID: 4094283985748868, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -24.59456 + objectReference: {fileID: 0} + - target: {fileID: 4096597530611644, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.0538182 + objectReference: {fileID: 0} + - target: {fileID: 4096597530611644, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.819189 + objectReference: {fileID: 0} + - target: {fileID: 4096597530611644, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.2845701 + objectReference: {fileID: 0} + - target: {fileID: 4102543447223915, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.94723755 + objectReference: {fileID: 0} + - target: {fileID: 4102543447223915, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -14.594473 + objectReference: {fileID: 0} + - target: {fileID: 4102543447223915, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.2757192 + objectReference: {fileID: 0} + - target: {fileID: 4105912343260855, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000052825348 + objectReference: {fileID: 0} + - target: {fileID: 4105912343260855, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 9.148203e-12 + objectReference: {fileID: 0} + - target: {fileID: 4105912343260855, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000009592586 + objectReference: {fileID: 0} + - target: {fileID: 4112815651697755, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00005379102 + objectReference: {fileID: 0} + - target: {fileID: 4112815651697755, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00003741539 + objectReference: {fileID: 0} + - target: {fileID: 4112815651697755, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -90.02939 + objectReference: {fileID: 0} + - target: {fileID: 4117307842306080, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 33.944847 + objectReference: {fileID: 0} + - target: {fileID: 4117307842306080, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.304978 + objectReference: {fileID: 0} + - target: {fileID: 4117307842306080, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -24.150152 + objectReference: {fileID: 0} + - target: {fileID: 4119337346424409, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.8264241 + objectReference: {fileID: 0} + - target: {fileID: 4119337346424409, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.7950604 + objectReference: {fileID: 0} + - target: {fileID: 4119337346424409, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -161.61128 + objectReference: {fileID: 0} + - target: {fileID: 4124577934639600, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -27.329248 + objectReference: {fileID: 0} + - target: {fileID: 4124577934639600, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -12.893735 + objectReference: {fileID: 0} + - target: {fileID: 4124577934639600, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 10.005955 + objectReference: {fileID: 0} + - target: {fileID: 4126508818681447, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 51.44054 + objectReference: {fileID: 0} + - target: {fileID: 4126508818681447, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 139.26358 + objectReference: {fileID: 0} + - target: {fileID: 4126508818681447, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 82.64106 + objectReference: {fileID: 0} + - target: {fileID: 4129116114662800, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000027407323 + objectReference: {fileID: 0} + - target: {fileID: 4129116114662800, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000007674061 + objectReference: {fileID: 0} + - target: {fileID: 4129116114662800, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00000991746 + objectReference: {fileID: 0} + - target: {fileID: 4132299442727904, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -86.52574 + objectReference: {fileID: 0} + - target: {fileID: 4132299442727904, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 59.172443 + objectReference: {fileID: 0} + - target: {fileID: 4132299442727904, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 35.279373 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000021925885 + objectReference: {fileID: 0} + - target: {fileID: 4134286944189183, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.637713 + objectReference: {fileID: 0} + - target: {fileID: 4134286944189183, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.88157815 + objectReference: {fileID: 0} + - target: {fileID: 4134286944189183, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.623246 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -9.04506 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 11.069922 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.498353 + objectReference: {fileID: 0} + - target: {fileID: 4171308771648913, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -11.676502 + objectReference: {fileID: 0} + - target: {fileID: 4171308771648913, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -21.620802 + objectReference: {fileID: 0} + - target: {fileID: 4171308771648913, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -10.643336 + objectReference: {fileID: 0} + - target: {fileID: 4173334745350128, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000068518398 + objectReference: {fileID: 0} + - target: {fileID: 4173334745350128, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000065777654 + objectReference: {fileID: 0} + - target: {fileID: 4173334745350128, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -1.8019708e-14 + objectReference: {fileID: 0} + - target: {fileID: 4173644300073267, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 31.895933 + objectReference: {fileID: 0} + - target: {fileID: 4173644300073267, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -37.75061 + objectReference: {fileID: 0} + - target: {fileID: 4173644300073267, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 16.542349 + objectReference: {fileID: 0} + - target: {fileID: 4195931274935818, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000035434272 + objectReference: {fileID: 0} + - target: {fileID: 4195931274935818, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000010999253 + objectReference: {fileID: 0} + - target: {fileID: 4195931274935818, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 44.632122 + objectReference: {fileID: 0} + - target: {fileID: 4197515695889172, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.24311 + objectReference: {fileID: 0} + - target: {fileID: 4197515695889172, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -13.016295 + objectReference: {fileID: 0} + - target: {fileID: 4197515695889172, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.6654582 + objectReference: {fileID: 0} + - target: {fileID: 4201141531394087, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000010962973 + objectReference: {fileID: 0} + - target: {fileID: 4201141531394087, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000005481471 + objectReference: {fileID: 0} + - target: {fileID: 4201141531394087, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.0000021925885 + objectReference: {fileID: 0} + - target: {fileID: 4202048797312955, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10.937202 + objectReference: {fileID: 0} + - target: {fileID: 4202048797312955, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.5013115 + objectReference: {fileID: 0} + - target: {fileID: 4202048797312955, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -98.08934 + objectReference: {fileID: 0} + - target: {fileID: 4208269818966246, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 37.178215 + objectReference: {fileID: 0} + - target: {fileID: 4208269818966246, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -71.720856 + objectReference: {fileID: 0} + - target: {fileID: 4208269818966246, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 146.97598 + objectReference: {fileID: 0} + - target: {fileID: 4222568209840903, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.947268 + objectReference: {fileID: 0} + - target: {fileID: 4222568209840903, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -16.627834 + objectReference: {fileID: 0} + - target: {fileID: 4222568209840903, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 22.283102 + objectReference: {fileID: 0} + - target: {fileID: 4228214996573471, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00011684942 + objectReference: {fileID: 0} + - target: {fileID: 4228214996573471, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.99992 + objectReference: {fileID: 0} + - target: {fileID: 4228214996573471, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -97.219345 + objectReference: {fileID: 0} + - target: {fileID: 4231676679060417, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -62.98727 + objectReference: {fileID: 0} + - target: {fileID: 4231676679060417, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 126.7929 + objectReference: {fileID: 0} + - target: {fileID: 4231676679060417, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -144.8946 + objectReference: {fileID: 0} + - target: {fileID: 4232415838589296, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -63.7469 + objectReference: {fileID: 0} + - target: {fileID: 4232415838589296, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -43.2861 + objectReference: {fileID: 0} + - target: {fileID: 4232415838589296, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 174.75974 + objectReference: {fileID: 0} + - target: {fileID: 4232720755092366, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.3038921 + objectReference: {fileID: 0} + - target: {fileID: 4232720755092366, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.7311764 + objectReference: {fileID: 0} + - target: {fileID: 4232720755092366, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.0132613 + objectReference: {fileID: 0} + - target: {fileID: 4239265225482239, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.7900147 + objectReference: {fileID: 0} + - target: {fileID: 4239265225482239, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.29579678 + objectReference: {fileID: 0} + - target: {fileID: 4239265225482239, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.3985193 + objectReference: {fileID: 0} + - target: {fileID: 4246887588868771, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000013206374 + objectReference: {fileID: 0} + - target: {fileID: 4246887588868771, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.6728157e-11 + objectReference: {fileID: 0} + - target: {fileID: 4246887588868771, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000052825348 + objectReference: {fileID: 0} + - target: {fileID: 4249237965167194, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.5182635 + objectReference: {fileID: 0} + - target: {fileID: 4249237965167194, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.715295 + objectReference: {fileID: 0} + - target: {fileID: 4249237965167194, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 9.934137 + objectReference: {fileID: 0} + - target: {fileID: 4250083484182041, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00002072606 + objectReference: {fileID: 0} + - target: {fileID: 4250083484182041, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000785339 + objectReference: {fileID: 0} + - target: {fileID: 4250083484182041, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.4575634 + objectReference: {fileID: 0} + - target: {fileID: 4290791091168379, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000023538798 + objectReference: {fileID: 0} + - target: {fileID: 4290791091168379, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000014478754 + objectReference: {fileID: 0} + - target: {fileID: 4290791091168379, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 10.43104 + objectReference: {fileID: 0} + - target: {fileID: 4291547872775986, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000027407273 + objectReference: {fileID: 0} + - target: {fileID: 4291547872775986, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.356423e-23 + objectReference: {fileID: 0} + - target: {fileID: 4291547872775986, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4322008579206753, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.33755195 + objectReference: {fileID: 0} + - target: {fileID: 4322008579206753, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.8143456 + objectReference: {fileID: 0} + - target: {fileID: 4322008579206753, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.4346676 + objectReference: {fileID: 0} + - target: {fileID: 4325787665662832, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.063508 + objectReference: {fileID: 0} + - target: {fileID: 4325787665662832, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.896325 + objectReference: {fileID: 0} + - target: {fileID: 4325787665662832, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -12.029329 + objectReference: {fileID: 0} + - target: {fileID: 4329075794784248, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.8535538 + objectReference: {fileID: 0} + - target: {fileID: 4329075794784248, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 163.29816 + objectReference: {fileID: 0} + - target: {fileID: 4329075794784248, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -17.748894 + objectReference: {fileID: 0} + - target: {fileID: 4329446674688094, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -15.873184 + objectReference: {fileID: 0} + - target: {fileID: 4329446674688094, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -7.942561 + objectReference: {fileID: 0} + - target: {fileID: 4329446674688094, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -23.31065 + objectReference: {fileID: 0} + - target: {fileID: 4337165658744233, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -11.545791 + objectReference: {fileID: 0} + - target: {fileID: 4337165658744233, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.6231656 + objectReference: {fileID: 0} + - target: {fileID: 4337165658744233, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.947604 + objectReference: {fileID: 0} + - target: {fileID: 4344618938641724, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000024991501 + objectReference: {fileID: 0} + - target: {fileID: 4344618938641724, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000032888836 + objectReference: {fileID: 0} + - target: {fileID: 4344618938641724, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4346445019804701, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.2857131 + objectReference: {fileID: 0} + - target: {fileID: 4346445019804701, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.8666205 + objectReference: {fileID: 0} + - target: {fileID: 4346445019804701, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 8.889178 + objectReference: {fileID: 0} + - target: {fileID: 4350143044813081, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 20.13395 + objectReference: {fileID: 0} + - target: {fileID: 4350143044813081, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 167.59721 + objectReference: {fileID: 0} + - target: {fileID: 4350143044813081, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 161.49312 + objectReference: {fileID: 0} + - target: {fileID: 4350408777337066, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.1772459 + objectReference: {fileID: 0} + - target: {fileID: 4350408777337066, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 61.213947 + objectReference: {fileID: 0} + - target: {fileID: 4350408777337066, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 25.741425 + objectReference: {fileID: 0} + - target: {fileID: 4353891062718048, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -69.45953 + objectReference: {fileID: 0} + - target: {fileID: 4353891062718048, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -98.00254 + objectReference: {fileID: 0} + - target: {fileID: 4353891062718048, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -99.87883 + objectReference: {fileID: 0} + - target: {fileID: 4360591974699550, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000060804277 + objectReference: {fileID: 0} + - target: {fileID: 4360591974699550, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.1038518e-12 + objectReference: {fileID: 0} + - target: {fileID: 4360591974699550, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00001759152 + objectReference: {fileID: 0} + - target: {fileID: 4364392939154294, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 77.27195 + objectReference: {fileID: 0} + - target: {fileID: 4364392939154294, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 161.83078 + objectReference: {fileID: 0} + - target: {fileID: 4364392939154294, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 168.45384 + objectReference: {fileID: 0} + - target: {fileID: 4365773988297632, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4365773988297632, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000082221953 + objectReference: {fileID: 0} + - target: {fileID: 4365773988297632, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4370081907136253, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -81.39106 + objectReference: {fileID: 0} + - target: {fileID: 4370081907136253, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 54.559643 + objectReference: {fileID: 0} + - target: {fileID: 4370081907136253, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 34.40685 + objectReference: {fileID: 0} + - target: {fileID: 4370485308309611, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.2455751 + objectReference: {fileID: 0} + - target: {fileID: 4370485308309611, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.6897198 + objectReference: {fileID: 0} + - target: {fileID: 4370485308309611, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.9560409 + objectReference: {fileID: 0} + - target: {fileID: 4372353275341440, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.8175048 + objectReference: {fileID: 0} + - target: {fileID: 4372353275341440, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 11.3647175 + objectReference: {fileID: 0} + - target: {fileID: 4372353275341440, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.2141724 + objectReference: {fileID: 0} + - target: {fileID: 4382656168358062, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000068518407 + objectReference: {fileID: 0} + - target: {fileID: 4382656168358062, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000065777654 + objectReference: {fileID: 0} + - target: {fileID: 4382656168358062, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000004385179 + objectReference: {fileID: 0} + - target: {fileID: 4384784573714692, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -74.87297 + objectReference: {fileID: 0} + - target: {fileID: 4384784573714692, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -46.552284 + objectReference: {fileID: 0} + - target: {fileID: 4384784573714692, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 164.21068 + objectReference: {fileID: 0} + - target: {fileID: 4386568470988373, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -80.80438 + objectReference: {fileID: 0} + - target: {fileID: 4386568470988373, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -139.77522 + objectReference: {fileID: 0} + - target: {fileID: 4386568470988373, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 3.7112994 + objectReference: {fileID: 0} + - target: {fileID: 4391225667286877, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00020109578 + objectReference: {fileID: 0} + - target: {fileID: 4391225667286877, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4391225667286877, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4401109917237556, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4401109917237556, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4401109917237556, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000004385177 + objectReference: {fileID: 0} + - target: {fileID: 4401429660297866, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 9.673574 + objectReference: {fileID: 0} + - target: {fileID: 4401429660297866, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -39.8752 + objectReference: {fileID: 0} + - target: {fileID: 4401429660297866, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.5269666 + objectReference: {fileID: 0} + - target: {fileID: 4403529848822963, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.02972992 + objectReference: {fileID: 0} + - target: {fileID: 4403529848822963, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.62325 + objectReference: {fileID: 0} + - target: {fileID: 4403529848822963, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.15776792 + objectReference: {fileID: 0} + - target: {fileID: 4405989028062321, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.194574e-13 + objectReference: {fileID: 0} + - target: {fileID: 4405989028062321, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000005344433 + objectReference: {fileID: 0} + - target: {fileID: 4405989028062321, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000016444412 + objectReference: {fileID: 0} + - target: {fileID: 4407886329842316, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000093783615 + objectReference: {fileID: 0} + - target: {fileID: 4407886329842316, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000010594893 + objectReference: {fileID: 0} + - target: {fileID: 4407886329842316, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 90.99376 + objectReference: {fileID: 0} + - target: {fileID: 4410049401584812, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -30.89972 + objectReference: {fileID: 0} + - target: {fileID: 4410049401584812, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -61.775257 + objectReference: {fileID: 0} + - target: {fileID: 4410049401584812, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -145.52216 + objectReference: {fileID: 0} + - target: {fileID: 4413603344295461, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 13.49907 + objectReference: {fileID: 0} + - target: {fileID: 4413603344295461, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -26.013336 + objectReference: {fileID: 0} + - target: {fileID: 4413603344295461, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.23513806 + objectReference: {fileID: 0} + - target: {fileID: 4415925016355036, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000028435095 + objectReference: {fileID: 0} + - target: {fileID: 4415925016355036, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000021925935 + objectReference: {fileID: 0} + - target: {fileID: 4415925016355036, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.0000017814774 + objectReference: {fileID: 0} + - target: {fileID: 4416529295595857, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 15.459978 + objectReference: {fileID: 0} + - target: {fileID: 4416529295595857, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.5775724 + objectReference: {fileID: 0} + - target: {fileID: 4416529295595857, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 10.347445 + objectReference: {fileID: 0} + - target: {fileID: 4422702022971346, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.1022012 + objectReference: {fileID: 0} + - target: {fileID: 4422702022971346, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.33542398 + objectReference: {fileID: 0} + - target: {fileID: 4422702022971346, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.3216933 + objectReference: {fileID: 0} + - target: {fileID: 4428560594236482, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.8519865 + objectReference: {fileID: 0} + - target: {fileID: 4428560594236482, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 38.848827 + objectReference: {fileID: 0} + - target: {fileID: 4428560594236482, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.9471993 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4433881075115309, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000054814547 + objectReference: {fileID: 0} + - target: {fileID: 4433881075115309, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000002740719 + objectReference: {fileID: 0} + - target: {fileID: 4433881075115309, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.2711277e-12 + objectReference: {fileID: 0} + - target: {fileID: 4446691751160785, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 19.740328 + objectReference: {fileID: 0} + - target: {fileID: 4446691751160785, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 4.709631 + objectReference: {fileID: 0} + - target: {fileID: 4446691751160785, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 22.279955 + objectReference: {fileID: 0} + - target: {fileID: 4450063812975771, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4450889307774998, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 83.81672 + objectReference: {fileID: 0} + - target: {fileID: 4450889307774998, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -51.940758 + objectReference: {fileID: 0} + - target: {fileID: 4450889307774998, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 126.99906 + objectReference: {fileID: 0} + - target: {fileID: 4458735412797113, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.5185022 + objectReference: {fileID: 0} + - target: {fileID: 4458735412797113, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.740693 + objectReference: {fileID: 0} + - target: {fileID: 4458735412797113, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.5325548 + objectReference: {fileID: 0} + - target: {fileID: 4463395028392447, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -5.380948 + objectReference: {fileID: 0} + - target: {fileID: 4463395028392447, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.1234493 + objectReference: {fileID: 0} + - target: {fileID: 4463395028392447, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.8487022 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4484755779879834, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -80.7593 + objectReference: {fileID: 0} + - target: {fileID: 4484755779879834, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -43.54853 + objectReference: {fileID: 0} + - target: {fileID: 4484755779879834, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -9.42815 + objectReference: {fileID: 0} + - target: {fileID: 4493949256727870, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000026412674 + objectReference: {fileID: 0} + - target: {fileID: 4493949256727870, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000049333207 + objectReference: {fileID: 0} + - target: {fileID: 4493949256727870, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000010962926 + objectReference: {fileID: 0} + - target: {fileID: 4494345407022765, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.6518319 + objectReference: {fileID: 0} + - target: {fileID: 4494345407022765, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.046631 + objectReference: {fileID: 0} + - target: {fileID: 4494345407022765, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.557755 + objectReference: {fileID: 0} + - target: {fileID: 4500050402096248, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 29.477129 + objectReference: {fileID: 0} + - target: {fileID: 4500050402096248, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.942892 + objectReference: {fileID: 0} + - target: {fileID: 4500050402096248, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 26.438406 + objectReference: {fileID: 0} + - target: {fileID: 4502609866597578, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.8961484 + objectReference: {fileID: 0} + - target: {fileID: 4502609866597578, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.901434 + objectReference: {fileID: 0} + - target: {fileID: 4502609866597578, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 31.627941 + objectReference: {fileID: 0} + - target: {fileID: 4504506843557392, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.081346 + objectReference: {fileID: 0} + - target: {fileID: 4504506843557392, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.467378 + objectReference: {fileID: 0} + - target: {fileID: 4504506843557392, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.110462 + objectReference: {fileID: 0} + - target: {fileID: 4505490946690937, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.9014001 + objectReference: {fileID: 0} + - target: {fileID: 4505490946690937, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.8383312 + objectReference: {fileID: 0} + - target: {fileID: 4505490946690937, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -17.259815 + objectReference: {fileID: 0} + - target: {fileID: 4505682267929073, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.002600372 + objectReference: {fileID: 0} + - target: {fileID: 4505682267929073, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.009213867 + objectReference: {fileID: 0} + - target: {fileID: 4505682267929073, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 14.623522 + objectReference: {fileID: 0} + - target: {fileID: 4507522976744791, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -78.406136 + objectReference: {fileID: 0} + - target: {fileID: 4507522976744791, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.843399 + objectReference: {fileID: 0} + - target: {fileID: 4507522976744791, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.8826427 + objectReference: {fileID: 0} + - target: {fileID: 4510073901028830, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.4454181 + objectReference: {fileID: 0} + - target: {fileID: 4510073901028830, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 12.499394 + objectReference: {fileID: 0} + - target: {fileID: 4510073901028830, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 15.974256 + objectReference: {fileID: 0} + - target: {fileID: 4510800835404288, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -36.673706 + objectReference: {fileID: 0} + - target: {fileID: 4510800835404288, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 174.35927 + objectReference: {fileID: 0} + - target: {fileID: 4510800835404288, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -155.97241 + objectReference: {fileID: 0} + - target: {fileID: 4517377532936435, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.79915076 + objectReference: {fileID: 0} + - target: {fileID: 4517377532936435, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -178.40976 + objectReference: {fileID: 0} + - target: {fileID: 4517377532936435, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 23.704386 + objectReference: {fileID: 0} + - target: {fileID: 4518639523470932, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.0759677 + objectReference: {fileID: 0} + - target: {fileID: 4518639523470932, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 24.813108 + objectReference: {fileID: 0} + - target: {fileID: 4518639523470932, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 10.209601 + objectReference: {fileID: 0} + - target: {fileID: 4519819979147140, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.06263443 + objectReference: {fileID: 0} + - target: {fileID: 4519819979147140, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.1500638 + objectReference: {fileID: 0} + - target: {fileID: 4519819979147140, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.3976638 + objectReference: {fileID: 0} + - target: {fileID: 4521597976012101, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00011684942 + objectReference: {fileID: 0} + - target: {fileID: 4521597976012101, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.99992 + objectReference: {fileID: 0} + - target: {fileID: 4521597976012101, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -97.219345 + objectReference: {fileID: 0} + - target: {fileID: 4527248355756736, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -80.34955 + objectReference: {fileID: 0} + - target: {fileID: 4527248355756736, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -131.69762 + objectReference: {fileID: 0} + - target: {fileID: 4527248355756736, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -167.32451 + objectReference: {fileID: 0} + - target: {fileID: 4536148047902537, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -10.111434 + objectReference: {fileID: 0} + - target: {fileID: 4536148047902537, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.365996 + objectReference: {fileID: 0} + - target: {fileID: 4536148047902537, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.030088 + objectReference: {fileID: 0} + - target: {fileID: 4543023241981873, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.0417795 + objectReference: {fileID: 0} + - target: {fileID: 4543023241981873, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 7.418312 + objectReference: {fileID: 0} + - target: {fileID: 4543023241981873, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 11.694494 + objectReference: {fileID: 0} + - target: {fileID: 4543584136297381, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.975942 + objectReference: {fileID: 0} + - target: {fileID: 4543584136297381, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -10.836237 + objectReference: {fileID: 0} + - target: {fileID: 4543584136297381, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -11.6322775 + objectReference: {fileID: 0} + - target: {fileID: 4544837802452058, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.6060877 + objectReference: {fileID: 0} + - target: {fileID: 4544837802452058, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 11.366648 + objectReference: {fileID: 0} + - target: {fileID: 4544837802452058, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -21.100315 + objectReference: {fileID: 0} + - target: {fileID: 4545683990359770, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -14.096508 + objectReference: {fileID: 0} + - target: {fileID: 4545683990359770, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -23.411623 + objectReference: {fileID: 0} + - target: {fileID: 4545683990359770, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 8.688714 + objectReference: {fileID: 0} + - target: {fileID: 4547349145286502, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000040116334 + objectReference: {fileID: 0} + - target: {fileID: 4547349145286502, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000012110044 + objectReference: {fileID: 0} + - target: {fileID: 4547349145286502, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000009917471 + objectReference: {fileID: 0} + - target: {fileID: 4548862692844868, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000051839364 + objectReference: {fileID: 0} + - target: {fileID: 4548862692844868, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 9.8887205 + objectReference: {fileID: 0} + - target: {fileID: 4548862692844868, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.00002185101 + objectReference: {fileID: 0} + - target: {fileID: 4556043395114336, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.8769019 + objectReference: {fileID: 0} + - target: {fileID: 4556043395114336, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.4355736 + objectReference: {fileID: 0} + - target: {fileID: 4556043395114336, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.9727354 + objectReference: {fileID: 0} + - target: {fileID: 4562080017223558, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.1130788 + objectReference: {fileID: 0} + - target: {fileID: 4562080017223558, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 20.023314 + objectReference: {fileID: 0} + - target: {fileID: 4562080017223558, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.7532349 + objectReference: {fileID: 0} + - target: {fileID: 4566389953100910, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -89.53572 + objectReference: {fileID: 0} + - target: {fileID: 4566389953100910, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -35.030968 + objectReference: {fileID: 0} + - target: {fileID: 4566389953100910, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -93.98587 + objectReference: {fileID: 0} + - target: {fileID: 4573076885614623, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 28.220749 + objectReference: {fileID: 0} + - target: {fileID: 4573076885614623, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 178.36385 + objectReference: {fileID: 0} + - target: {fileID: 4573076885614623, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -169.03929 + objectReference: {fileID: 0} + - target: {fileID: 4578716238308850, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -38.527775 + objectReference: {fileID: 0} + - target: {fileID: 4578716238308850, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.901866 + objectReference: {fileID: 0} + - target: {fileID: 4578716238308850, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.6122 + objectReference: {fileID: 0} + - target: {fileID: 4578880696632637, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.84892404 + objectReference: {fileID: 0} + - target: {fileID: 4578880696632637, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.718302 + objectReference: {fileID: 0} + - target: {fileID: 4578880696632637, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.646421 + objectReference: {fileID: 0} + - target: {fileID: 4580109562975512, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 83.28998 + objectReference: {fileID: 0} + - target: {fileID: 4580109562975512, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 141.69563 + objectReference: {fileID: 0} + - target: {fileID: 4580109562975512, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 150.93727 + objectReference: {fileID: 0} + - target: {fileID: 4583788928901705, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.8758497 + objectReference: {fileID: 0} + - target: {fileID: 4583788928901705, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -24.199465 + objectReference: {fileID: 0} + - target: {fileID: 4583788928901705, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 11.113255 + objectReference: {fileID: 0} + - target: {fileID: 4616352195932608, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.6039455 + objectReference: {fileID: 0} + - target: {fileID: 4616352195932608, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.986381 + objectReference: {fileID: 0} + - target: {fileID: 4616352195932608, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 24.485748 + objectReference: {fileID: 0} + - target: {fileID: 4616761771223058, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000032888827 + objectReference: {fileID: 0} + - target: {fileID: 4616761771223058, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -6.2710913e-12 + objectReference: {fileID: 0} + - target: {fileID: 4616761771223058, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -180 + objectReference: {fileID: 0} + - target: {fileID: 4632179142322292, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.008257278 + objectReference: {fileID: 0} + - target: {fileID: 4632179142322292, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0045568184 + objectReference: {fileID: 0} + - target: {fileID: 4632179142322292, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 15.328388 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00008825264 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00005152235 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -82.780655 + objectReference: {fileID: 0} + - target: {fileID: 4644357204029367, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -57.04905 + objectReference: {fileID: 0} + - target: {fileID: 4644357204029367, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -81.05417 + objectReference: {fileID: 0} + - target: {fileID: 4644357204029367, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -64.597786 + objectReference: {fileID: 0} + - target: {fileID: 4657558218238974, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00001320634 + objectReference: {fileID: 0} + - target: {fileID: 4657558218238974, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000001370378 + objectReference: {fileID: 0} + - target: {fileID: 4657558218238974, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4663898806329775, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.3019344 + objectReference: {fileID: 0} + - target: {fileID: 4663898806329775, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.1164536 + objectReference: {fileID: 0} + - target: {fileID: 4663898806329775, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.6344945 + objectReference: {fileID: 0} + - target: {fileID: 4681721672847880, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.8019708e-14 + objectReference: {fileID: 0} + - target: {fileID: 4681721672847880, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.0740583e-21 + objectReference: {fileID: 0} + - target: {fileID: 4681721672847880, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000004385177 + objectReference: {fileID: 0} + - target: {fileID: 4688331903957256, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -3.4625337 + objectReference: {fileID: 0} + - target: {fileID: 4688331903957256, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 9.396815 + objectReference: {fileID: 0} + - target: {fileID: 4688331903957256, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 19.399885 + objectReference: {fileID: 0} + - target: {fileID: 4689224686120706, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4689224686120706, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000032888825 + objectReference: {fileID: 0} + - target: {fileID: 4689224686120706, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4691570808825369, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.2180228 + objectReference: {fileID: 0} + - target: {fileID: 4691570808825369, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 8.527652 + objectReference: {fileID: 0} + - target: {fileID: 4691570808825369, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 9.29497 + objectReference: {fileID: 0} + - target: {fileID: 4696792502030561, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4696792502030561, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000010962942 + objectReference: {fileID: 0} + - target: {fileID: 4696792502030561, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4696919880513765, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -68.30245 + objectReference: {fileID: 0} + - target: {fileID: 4696919880513765, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -84.948654 + objectReference: {fileID: 0} + - target: {fileID: 4696919880513765, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -87.879166 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000005806351 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4704877758540679, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 19.081919 + objectReference: {fileID: 0} + - target: {fileID: 4704877758540679, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -12.567137 + objectReference: {fileID: 0} + - target: {fileID: 4704877758540679, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -18.00759 + objectReference: {fileID: 0} + - target: {fileID: 4719897623072781, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.51170176 + objectReference: {fileID: 0} + - target: {fileID: 4719897623072781, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.5193576 + objectReference: {fileID: 0} + - target: {fileID: 4719897623072781, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -21.769697 + objectReference: {fileID: 0} + - target: {fileID: 4722550256369544, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.9619302e-12 + objectReference: {fileID: 0} + - target: {fileID: 4722550256369544, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000006211618 + objectReference: {fileID: 0} + - target: {fileID: 4722550256369544, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.000026412674 + objectReference: {fileID: 0} + - target: {fileID: 4729442808604298, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.1417528 + objectReference: {fileID: 0} + - target: {fileID: 4729442808604298, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.444958 + objectReference: {fileID: 0} + - target: {fileID: 4729442808604298, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.120503 + objectReference: {fileID: 0} + - target: {fileID: 4729821067651183, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.138011 + objectReference: {fileID: 0} + - target: {fileID: 4729821067651183, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -14.189837 + objectReference: {fileID: 0} + - target: {fileID: 4729821067651183, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 8.855124 + objectReference: {fileID: 0} + - target: {fileID: 4731059169969419, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -17.100752 + objectReference: {fileID: 0} + - target: {fileID: 4731059169969419, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -170.39479 + objectReference: {fileID: 0} + - target: {fileID: 4731059169969419, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.0785658 + objectReference: {fileID: 0} + - target: {fileID: 4739268104783211, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.75525165 + objectReference: {fileID: 0} + - target: {fileID: 4739268104783211, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 12.101727 + objectReference: {fileID: 0} + - target: {fileID: 4739268104783211, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 10.266433 + objectReference: {fileID: 0} + - target: {fileID: 4743905223825669, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.1453638 + objectReference: {fileID: 0} + - target: {fileID: 4743905223825669, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -13.718489 + objectReference: {fileID: 0} + - target: {fileID: 4743905223825669, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.480027 + objectReference: {fileID: 0} + - target: {fileID: 4751888446361502, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -58.752476 + objectReference: {fileID: 0} + - target: {fileID: 4751888446361502, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 97.8347 + objectReference: {fileID: 0} + - target: {fileID: 4751888446361502, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.145478 + objectReference: {fileID: 0} + - target: {fileID: 4754026925822528, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -70.828964 + objectReference: {fileID: 0} + - target: {fileID: 4754026925822528, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -51.930344 + objectReference: {fileID: 0} + - target: {fileID: 4754026925822528, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -120.7144 + objectReference: {fileID: 0} + - target: {fileID: 4760480127920944, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.5483888 + objectReference: {fileID: 0} + - target: {fileID: 4760480127920944, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 35.53551 + objectReference: {fileID: 0} + - target: {fileID: 4760480127920944, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 9.660329 + objectReference: {fileID: 0} + - target: {fileID: 4782439640980787, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.6133037 + objectReference: {fileID: 0} + - target: {fileID: 4782439640980787, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.285966 + objectReference: {fileID: 0} + - target: {fileID: 4782439640980787, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.453216 + objectReference: {fileID: 0} + - target: {fileID: 4784622213810434, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -77.54143 + objectReference: {fileID: 0} + - target: {fileID: 4784622213810434, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 5.381059 + objectReference: {fileID: 0} + - target: {fileID: 4784622213810434, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 84.87568 + objectReference: {fileID: 0} + - target: {fileID: 4785416887765914, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.88332725 + objectReference: {fileID: 0} + - target: {fileID: 4785416887765914, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.5625367 + objectReference: {fileID: 0} + - target: {fileID: 4785416887765914, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 34.167316 + objectReference: {fileID: 0} + - target: {fileID: 4799881864385010, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000026412674 + objectReference: {fileID: 0} + - target: {fileID: 4799881864385010, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000005481445 + objectReference: {fileID: 0} + - target: {fileID: 4799881864385010, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4817105377731967, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -73.960045 + objectReference: {fileID: 0} + - target: {fileID: 4817105377731967, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -118.74951 + objectReference: {fileID: 0} + - target: {fileID: 4817105377731967, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -22.502676 + objectReference: {fileID: 0} + - target: {fileID: 4825818419884204, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.2463839 + objectReference: {fileID: 0} + - target: {fileID: 4825818419884204, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -33.559937 + objectReference: {fileID: 0} + - target: {fileID: 4825818419884204, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.4220953 + objectReference: {fileID: 0} + - target: {fileID: 4827586244175853, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.641991 + objectReference: {fileID: 0} + - target: {fileID: 4827586244175853, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.2759602 + objectReference: {fileID: 0} + - target: {fileID: 4827586244175853, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -22.221285 + objectReference: {fileID: 0} + - target: {fileID: 4832474124979885, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.3873594 + objectReference: {fileID: 0} + - target: {fileID: 4832474124979885, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 171.29625 + objectReference: {fileID: 0} + - target: {fileID: 4832474124979885, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -28.49146 + objectReference: {fileID: 0} + - target: {fileID: 4838352681112328, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 81.26476 + objectReference: {fileID: 0} + - target: {fileID: 4838352681112328, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 49.715256 + objectReference: {fileID: 0} + - target: {fileID: 4838352681112328, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 42.97819 + objectReference: {fileID: 0} + - target: {fileID: 4844361126439134, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.15959789 + objectReference: {fileID: 0} + - target: {fileID: 4844361126439134, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.8230829 + objectReference: {fileID: 0} + - target: {fileID: 4844361126439134, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.97437 + objectReference: {fileID: 0} + - target: {fileID: 4845025230388998, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.9543202e-17 + objectReference: {fileID: 0} + - target: {fileID: 4845025230388998, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -7.2173686e-17 + objectReference: {fileID: 0} + - target: {fileID: 4845025230388998, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000043851805 + objectReference: {fileID: 0} + - target: {fileID: 4851449666512103, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 4.272154 + objectReference: {fileID: 0} + - target: {fileID: 4851449666512103, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 8.874897 + objectReference: {fileID: 0} + - target: {fileID: 4851449666512103, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -25.456387 + objectReference: {fileID: 0} + - target: {fileID: 4869737159367836, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.7769046 + objectReference: {fileID: 0} + - target: {fileID: 4869737159367836, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.252089 + objectReference: {fileID: 0} + - target: {fileID: 4869737159367836, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -17.556086 + objectReference: {fileID: 0} + - target: {fileID: 4870947366518887, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.22842625 + objectReference: {fileID: 0} + - target: {fileID: 4870947366518887, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.98934084 + objectReference: {fileID: 0} + - target: {fileID: 4870947366518887, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 12.508598 + objectReference: {fileID: 0} + - target: {fileID: 4878983242975409, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.2841767 + objectReference: {fileID: 0} + - target: {fileID: 4878983242975409, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.1938577 + objectReference: {fileID: 0} + - target: {fileID: 4878983242975409, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -22.607723 + objectReference: {fileID: 0} + - target: {fileID: 4891995844532801, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4894225446638996, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000009592581 + objectReference: {fileID: 0} + - target: {fileID: 4894225446638996, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000026412674 + objectReference: {fileID: 0} + - target: {fileID: 4894225446638996, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4894352506636257, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 57.621918 + objectReference: {fileID: 0} + - target: {fileID: 4894352506636257, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -151.03352 + objectReference: {fileID: 0} + - target: {fileID: 4894352506636257, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 118.77683 + objectReference: {fileID: 0} + - target: {fileID: 4904079258986964, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.529711 + objectReference: {fileID: 0} + - target: {fileID: 4904079258986964, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -8.227585 + objectReference: {fileID: 0} + - target: {fileID: 4904079258986964, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -32.985275 + objectReference: {fileID: 0} + - target: {fileID: 4904400124545405, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 8.126645 + objectReference: {fileID: 0} + - target: {fileID: 4904400124545405, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -179.14375 + objectReference: {fileID: 0} + - target: {fileID: 4904400124545405, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -81.91343 + objectReference: {fileID: 0} + - target: {fileID: 4910201747455131, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.5244508 + objectReference: {fileID: 0} + - target: {fileID: 4910201747455131, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 20.117243 + objectReference: {fileID: 0} + - target: {fileID: 4910201747455131, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 4.127388 + objectReference: {fileID: 0} + - target: {fileID: 4911451331743778, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 81.93985 + objectReference: {fileID: 0} + - target: {fileID: 4911451331743778, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 36.26262 + objectReference: {fileID: 0} + - target: {fileID: 4911451331743778, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 57.119835 + objectReference: {fileID: 0} + - target: {fileID: 4932862749439555, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000027407325 + objectReference: {fileID: 0} + - target: {fileID: 4932862749439555, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000010962938 + objectReference: {fileID: 0} + - target: {fileID: 4932862749439555, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 4934287144746640, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0013760217 + objectReference: {fileID: 0} + - target: {fileID: 4934287144746640, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0026626363 + objectReference: {fileID: 0} + - target: {fileID: 4934287144746640, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -14.977087 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 85.781395 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -108.50921 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 90.6518 + objectReference: {fileID: 0} + - target: {fileID: 4949593803130734, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.35680705 + objectReference: {fileID: 0} + - target: {fileID: 4949593803130734, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.41540283 + objectReference: {fileID: 0} + - target: {fileID: 4949593803130734, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 12.872064 + objectReference: {fileID: 0} + - target: {fileID: 4951712121405908, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 32.02083 + objectReference: {fileID: 0} + - target: {fileID: 4951712121405908, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -9.382198 + objectReference: {fileID: 0} + - target: {fileID: 4951712121405908, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -32.822144 + objectReference: {fileID: 0} + - target: {fileID: 4952320105404285, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 34.284893 + objectReference: {fileID: 0} + - target: {fileID: 4952320105404285, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -11.417422 + objectReference: {fileID: 0} + - target: {fileID: 4952320105404285, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -12.181471 + objectReference: {fileID: 0} + - target: {fileID: 4952854571839949, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.8019708e-14 + objectReference: {fileID: 0} + - target: {fileID: 4952854571839949, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.416632e-21 + objectReference: {fileID: 0} + - target: {fileID: 4952854571839949, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000005532275 + objectReference: {fileID: 0} + - target: {fileID: 4958492976087124, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 6.808403 + objectReference: {fileID: 0} + - target: {fileID: 4958492976087124, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -26.853422 + objectReference: {fileID: 0} + - target: {fileID: 4958492976087124, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 5.5232167 + objectReference: {fileID: 0} + - target: {fileID: 4960577952585462, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.3215136 + objectReference: {fileID: 0} + - target: {fileID: 4960577952585462, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.4301858 + objectReference: {fileID: 0} + - target: {fileID: 4960577952585462, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.6961617 + objectReference: {fileID: 0} + - target: {fileID: 4962713294667487, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.1216135 + objectReference: {fileID: 0} + - target: {fileID: 4962713294667487, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 8.667563 + objectReference: {fileID: 0} + - target: {fileID: 4962713294667487, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 1.4243822 + objectReference: {fileID: 0} + - target: {fileID: 4964675957374274, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -30.836193 + objectReference: {fileID: 0} + - target: {fileID: 4964675957374274, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 95.15303 + objectReference: {fileID: 0} + - target: {fileID: 4964675957374274, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -160.33035 + objectReference: {fileID: 0} + - target: {fileID: 4964822413698908, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.1151951 + objectReference: {fileID: 0} + - target: {fileID: 4964822413698908, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -5.4100413 + objectReference: {fileID: 0} + - target: {fileID: 4964822413698908, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.120179 + objectReference: {fileID: 0} + - target: {fileID: 4965908813272002, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.1355553 + objectReference: {fileID: 0} + - target: {fileID: 4965908813272002, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 8.765443 + objectReference: {fileID: 0} + - target: {fileID: 4965908813272002, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 5.0028057 + objectReference: {fileID: 0} + - target: {fileID: 4975779338151784, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -38.60386 + objectReference: {fileID: 0} + - target: {fileID: 4975779338151784, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -52.747223 + objectReference: {fileID: 0} + - target: {fileID: 4975779338151784, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -136.62018 + objectReference: {fileID: 0} + - target: {fileID: 4985908891298522, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00006504249 + objectReference: {fileID: 0} + - target: {fileID: 4985908891298522, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.321012 + objectReference: {fileID: 0} + - target: {fileID: 4985908891298522, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000014603033 + objectReference: {fileID: 0} + - target: {fileID: 4989434536655964, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00008825264 + objectReference: {fileID: 0} + - target: {fileID: 4989434536655964, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00005152235 + objectReference: {fileID: 0} + - target: {fileID: 4989434536655964, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -82.780655 + objectReference: {fileID: 0} + - target: {fileID: 4993076962757715, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.1680285e-12 + objectReference: {fileID: 0} + - target: {fileID: 4993076962757715, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000060296197 + objectReference: {fileID: 0} + - target: {fileID: 4993076962757715, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.000009917457 + objectReference: {fileID: 0} + - target: {fileID: 4996317296757491, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 44.877167 + objectReference: {fileID: 0} + - target: {fileID: 4996317296757491, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -81.12605 + objectReference: {fileID: 0} + - target: {fileID: 4996317296757491, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 68.09012 + objectReference: {fileID: 0} + - target: {fileID: 4998495239010246, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 63.37669 + objectReference: {fileID: 0} + - target: {fileID: 4998495239010246, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -102.10808 + objectReference: {fileID: 0} + - target: {fileID: 4998495239010246, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -90.02106 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: dd660ab8139c6df4895797c43ee143c4, type: 3} +--- !u!4 &1698507951 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4477794280538272, guid: dd660ab8139c6df4895797c43ee143c4, + type: 3} + m_PrefabInstance: {fileID: 1698507950} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1840983956 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1106451914} + m_Modifications: + - target: {fileID: 1709254077376921, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_Name + value: Game177_zhubajie + objectReference: {fileID: 0} + - target: {fileID: 1709254077376921, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4007271993718322, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.36102396 + objectReference: {fileID: 0} + - target: {fileID: 4007271993718322, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 22.265007 + objectReference: {fileID: 0} + - target: {fileID: 4007271993718322, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -7.4338846 + objectReference: {fileID: 0} + - target: {fileID: 4011164340880974, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -46.945877 + objectReference: {fileID: 0} + - target: {fileID: 4011164340880974, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -34.982517 + objectReference: {fileID: 0} + - target: {fileID: 4011164340880974, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.4892493 + objectReference: {fileID: 0} + - target: {fileID: 4012617856089587, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 25.675785 + objectReference: {fileID: 0} + - target: {fileID: 4012617856089587, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 51.138542 + objectReference: {fileID: 0} + - target: {fileID: 4012617856089587, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.474755 + objectReference: {fileID: 0} + - target: {fileID: 4016852445014956, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -9.685302e-16 + objectReference: {fileID: 0} + - target: {fileID: 4016852445014956, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -2.5755496e-13 + objectReference: {fileID: 0} + - target: {fileID: 4016852445014956, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.21545978 + objectReference: {fileID: 0} + - target: {fileID: 4017892387517381, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000059613503 + objectReference: {fileID: 0} + - target: {fileID: 4017892387517381, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00008718221 + objectReference: {fileID: 0} + - target: {fileID: 4017892387517381, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -89.9999 + objectReference: {fileID: 0} + - target: {fileID: 4024252914577434, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 6.4404774e-14 + objectReference: {fileID: 0} + - target: {fileID: 4024252914577434, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000021610656 + objectReference: {fileID: 0} + - target: {fileID: 4024252914577434, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0.0000021610656 + objectReference: {fileID: 0} + - target: {fileID: 4038333544927157, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000010805328 + objectReference: {fileID: 0} + - target: {fileID: 4038333544927157, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00005402392 + objectReference: {fileID: 0} + - target: {fileID: 4038333544927157, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 4041320612064254, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4056248600188076, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -57.266254 + objectReference: {fileID: 0} + - target: {fileID: 4056248600188076, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -55.269325 + objectReference: {fileID: 0} + - target: {fileID: 4056248600188076, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 25.821741 + objectReference: {fileID: 0} + - target: {fileID: 4056905764334025, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 44.746174 + objectReference: {fileID: 0} + - target: {fileID: 4056905764334025, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -88.49416 + objectReference: {fileID: 0} + - target: {fileID: 4056905764334025, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -75.36425 + objectReference: {fileID: 0} + - target: {fileID: 4083739296819378, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000074592947 + objectReference: {fileID: 0} + - target: {fileID: 4083739296819378, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.00000078175435 + objectReference: {fileID: 0} + - target: {fileID: 4083739296819378, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -43.656628 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4091882994760266, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4092105871539913, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -8.3916645 + objectReference: {fileID: 0} + - target: {fileID: 4092105871539913, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.8385792 + objectReference: {fileID: 0} + - target: {fileID: 4092105871539913, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -5.191656 + objectReference: {fileID: 0} + - target: {fileID: 4095816830470745, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.830358e-14 + objectReference: {fileID: 0} + - target: {fileID: 4095816830470745, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000010805328 + objectReference: {fileID: 0} + - target: {fileID: 4095816830470745, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -0.0000032415983 + objectReference: {fileID: 0} + - target: {fileID: 4112815651697755, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000037546466 + objectReference: {fileID: 0} + - target: {fileID: 4112815651697755, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 90.00002 + objectReference: {fileID: 0} + - target: {fileID: 4112815651697755, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 30.3128 + objectReference: {fileID: 0} + - target: {fileID: 4132299442727904, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000060958905 + objectReference: {fileID: 0} + - target: {fileID: 4132299442727904, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.000001104582 + objectReference: {fileID: 0} + - target: {fileID: 4132299442727904, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -13.369011 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.6242776 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 17.745441 + objectReference: {fileID: 0} + - target: {fileID: 4133854062310043, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -6.6501064 + objectReference: {fileID: 0} + - target: {fileID: 4146109142143575, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000021610656 + objectReference: {fileID: 0} + - target: {fileID: 4146109142143575, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000021610656 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000025777538 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000067920523 + objectReference: {fileID: 0} + - target: {fileID: 4148353818683595, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.1734748 + objectReference: {fileID: 0} + - target: {fileID: 4156371104904051, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.6954658 + objectReference: {fileID: 0} + - target: {fileID: 4156371104904051, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.4748728 + objectReference: {fileID: 0} + - target: {fileID: 4156371104904051, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -17.037092 + objectReference: {fileID: 0} + - target: {fileID: 4168105826085154, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 36.583122 + objectReference: {fileID: 0} + - target: {fileID: 4168105826085154, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -37.739475 + objectReference: {fileID: 0} + - target: {fileID: 4168105826085154, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 7.0325394 + objectReference: {fileID: 0} + - target: {fileID: 4168775426067361, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 17.558077 + objectReference: {fileID: 0} + - target: {fileID: 4168775426067361, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -125.58642 + objectReference: {fileID: 0} + - target: {fileID: 4168775426067361, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 116.54783 + objectReference: {fileID: 0} + - target: {fileID: 4177930474251431, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.5434787 + objectReference: {fileID: 0} + - target: {fileID: 4177930474251431, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.395026 + objectReference: {fileID: 0} + - target: {fileID: 4177930474251431, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -8.215354 + objectReference: {fileID: 0} + - target: {fileID: 4181586030114204, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 16.822319 + objectReference: {fileID: 0} + - target: {fileID: 4181586030114204, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -96.41788 + objectReference: {fileID: 0} + - target: {fileID: 4181586030114204, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -177.82301 + objectReference: {fileID: 0} + - target: {fileID: 4195931274935818, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.00923 + objectReference: {fileID: 0} + - target: {fileID: 4195931274935818, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 165.15631 + objectReference: {fileID: 0} + - target: {fileID: 4195931274935818, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 82.46338 + objectReference: {fileID: 0} + - target: {fileID: 4201141531394087, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000009655735 + objectReference: {fileID: 0} + - target: {fileID: 4201141531394087, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 89.99998 + objectReference: {fileID: 0} + - target: {fileID: 4220697728379336, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -13.621465 + objectReference: {fileID: 0} + - target: {fileID: 4220697728379336, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 2.6829097 + objectReference: {fileID: 0} + - target: {fileID: 4220697728379336, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -44.223347 + objectReference: {fileID: 0} + - target: {fileID: 4258471659221418, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 26.806261 + objectReference: {fileID: 0} + - target: {fileID: 4258471659221418, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 152.08893 + objectReference: {fileID: 0} + - target: {fileID: 4258471659221418, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 152.12068 + objectReference: {fileID: 0} + - target: {fileID: 4271925019662038, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -71.06253 + objectReference: {fileID: 0} + - target: {fileID: 4271925019662038, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -156.19771 + objectReference: {fileID: 0} + - target: {fileID: 4271925019662038, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 24.575853 + objectReference: {fileID: 0} + - target: {fileID: 4274303670636188, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000020219316 + objectReference: {fileID: 0} + - target: {fileID: 4274303670636188, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000027545045 + objectReference: {fileID: 0} + - target: {fileID: 4274303670636188, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -17.845407 + objectReference: {fileID: 0} + - target: {fileID: 4291632710222552, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 13.916728 + objectReference: {fileID: 0} + - target: {fileID: 4291632710222552, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.22802976 + objectReference: {fileID: 0} + - target: {fileID: 4291632710222552, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 12.843002 + objectReference: {fileID: 0} + - target: {fileID: 4293198502218400, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000005402664 + objectReference: {fileID: 0} + - target: {fileID: 4293198502218400, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000021610647 + objectReference: {fileID: 0} + - target: {fileID: 4295926465608920, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.3044534 + objectReference: {fileID: 0} + - target: {fileID: 4295926465608920, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 6.884697 + objectReference: {fileID: 0} + - target: {fileID: 4295926465608920, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -75.013306 + objectReference: {fileID: 0} + - target: {fileID: 4320592835458227, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.000050908504 + objectReference: {fileID: 0} + - target: {fileID: 4320592835458227, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.99988 + objectReference: {fileID: 0} + - target: {fileID: 4320592835458227, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -101.65371 + objectReference: {fileID: 0} + - target: {fileID: 4321827775029018, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 5.6063175 + objectReference: {fileID: 0} + - target: {fileID: 4321827775029018, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 55.25275 + objectReference: {fileID: 0} + - target: {fileID: 4321827775029018, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -176.3349 + objectReference: {fileID: 0} + - target: {fileID: 4325787665662832, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.00000020259989 + objectReference: {fileID: 0} + - target: {fileID: 4325787665662832, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.00000040519978 + objectReference: {fileID: 0} + - target: {fileID: 4353891062718048, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.9790242 + objectReference: {fileID: 0} + - target: {fileID: 4353891062718048, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.478806 + objectReference: {fileID: 0} + - target: {fileID: 4353891062718048, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 20.695679 + objectReference: {fileID: 0} + - target: {fileID: 4358105479016104, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.33786 + objectReference: {fileID: 0} + - target: {fileID: 4358105479016104, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -89.83311 + objectReference: {fileID: 0} + - target: {fileID: 4358105479016104, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 178.23546 + objectReference: {fileID: 0} + - target: {fileID: 4407886329842316, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 4407886329842316, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 179.344 + objectReference: {fileID: 0} + - target: {fileID: 4407886329842316, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4416529295595857, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.5123514 + objectReference: {fileID: 0} + - target: {fileID: 4416529295595857, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.21169 + objectReference: {fileID: 0} + - target: {fileID: 4416529295595857, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 13.763096 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.4558097 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 8.276961 + objectReference: {fileID: 0} + - target: {fileID: 4429401810989285, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -15.029347 + objectReference: {fileID: 0} + - target: {fileID: 4433013960508438, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 22.2374 + objectReference: {fileID: 0} + - target: {fileID: 4433013960508438, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 136.85413 + objectReference: {fileID: 0} + - target: {fileID: 4433013960508438, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 18.690445 + objectReference: {fileID: 0} + - target: {fileID: 4446691751160785, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -15.137674 + objectReference: {fileID: 0} + - target: {fileID: 4446691751160785, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 111.0611 + objectReference: {fileID: 0} + - target: {fileID: 4446691751160785, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 12.382005 + objectReference: {fileID: 0} + - target: {fileID: 4450889307774998, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -4.2175856 + objectReference: {fileID: 0} + - target: {fileID: 4450889307774998, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 13.362051 + objectReference: {fileID: 0} + - target: {fileID: 4450889307774998, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 22.364653 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -46.382065 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 88.11288 + objectReference: {fileID: 0} + - target: {fileID: 4477794280538272, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -22.985548 + objectReference: {fileID: 0} + - target: {fileID: 4484755779879834, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.270695 + objectReference: {fileID: 0} + - target: {fileID: 4484755779879834, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 1.7895241 + objectReference: {fileID: 0} + - target: {fileID: 4484755779879834, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 14.589091 + objectReference: {fileID: 0} + - target: {fileID: 4499517081926786, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.5441172 + objectReference: {fileID: 0} + - target: {fileID: 4499517081926786, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.401909 + objectReference: {fileID: 0} + - target: {fileID: 4499517081926786, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 8.234344 + objectReference: {fileID: 0} + - target: {fileID: 4527248355756736, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 3.466699 + objectReference: {fileID: 0} + - target: {fileID: 4527248355756736, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.329473 + objectReference: {fileID: 0} + - target: {fileID: 4527248355756736, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.396019 + objectReference: {fileID: 0} + - target: {fileID: 4578716238308850, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000009655735 + objectReference: {fileID: 0} + - target: {fileID: 4578716238308850, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 89.99998 + objectReference: {fileID: 0} + - target: {fileID: 4589652054545887, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000004175431 + objectReference: {fileID: 0} + - target: {fileID: 4589652054545887, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000021373844 + objectReference: {fileID: 0} + - target: {fileID: 4589652054545887, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 2.5594995 + objectReference: {fileID: 0} + - target: {fileID: 4592664909728774, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -5.8492146 + objectReference: {fileID: 0} + - target: {fileID: 4592664909728774, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.60437757 + objectReference: {fileID: 0} + - target: {fileID: 4592664909728774, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 43.787395 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -12.436855 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.9459743 + objectReference: {fileID: 0} + - target: {fileID: 4603576887721950, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -33.39508 + objectReference: {fileID: 0} + - target: {fileID: 4641204913154593, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4649986673806370, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000001128526 + objectReference: {fileID: 0} + - target: {fileID: 4649986673806370, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000002887226 + objectReference: {fileID: 0} + - target: {fileID: 4649986673806370, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 90.43815 + objectReference: {fileID: 0} + - target: {fileID: 4657558218238974, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -9.193616 + objectReference: {fileID: 0} + - target: {fileID: 4657558218238974, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -87.05986 + objectReference: {fileID: 0} + - target: {fileID: 4657558218238974, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -96.183365 + objectReference: {fileID: 0} + - target: {fileID: 4689010887986514, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.822598 + objectReference: {fileID: 0} + - target: {fileID: 4689010887986514, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 10.681785 + objectReference: {fileID: 0} + - target: {fileID: 4689010887986514, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -78.43079 + objectReference: {fileID: 0} + - target: {fileID: 4689224686120706, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.003496319 + objectReference: {fileID: 0} + - target: {fileID: 4689224686120706, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.108645916 + objectReference: {fileID: 0} + - target: {fileID: 4689224686120706, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -3.680237 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 1.4017047 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 4.50519 + objectReference: {fileID: 0} + - target: {fileID: 4697715728111791, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -21.430243 + objectReference: {fileID: 0} + - target: {fileID: 4703247130969877, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000038400494 + objectReference: {fileID: 0} + - target: {fileID: 4703247130969877, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000009001339 + objectReference: {fileID: 0} + - target: {fileID: 4703247130969877, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 70.35006 + objectReference: {fileID: 0} + - target: {fileID: 4708180620337799, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.4967804 + objectReference: {fileID: 0} + - target: {fileID: 4708180620337799, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 3.5964994 + objectReference: {fileID: 0} + - target: {fileID: 4708180620337799, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -23.09394 + objectReference: {fileID: 0} + - target: {fileID: 4709890794832471, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000018909315 + objectReference: {fileID: 0} + - target: {fileID: 4709890794832471, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000005402667 + objectReference: {fileID: 0} + - target: {fileID: 4709890794832471, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 4.7985296e-22 + objectReference: {fileID: 0} + - target: {fileID: 4719897623072781, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -2.2050264 + objectReference: {fileID: 0} + - target: {fileID: 4719897623072781, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 9.509119 + objectReference: {fileID: 0} + - target: {fileID: 4719897623072781, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 12.132454 + objectReference: {fileID: 0} + - target: {fileID: 4738892719839630, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000022454478 + objectReference: {fileID: 0} + - target: {fileID: 4738892719839630, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000047841518 + objectReference: {fileID: 0} + - target: {fileID: 4738892719839630, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 60.133324 + objectReference: {fileID: 0} + - target: {fileID: 4784622213810434, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 2.695463 + objectReference: {fileID: 0} + - target: {fileID: 4784622213810434, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -1.4748739 + objectReference: {fileID: 0} + - target: {fileID: 4784622213810434, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -22.077477 + objectReference: {fileID: 0} + - target: {fileID: 4817325062191328, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000010805328 + objectReference: {fileID: 0} + - target: {fileID: 4817325062191328, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.0000010805328 + objectReference: {fileID: 0} + - target: {fileID: 4817325062191328, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4831874417830518, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -71.04428 + objectReference: {fileID: 0} + - target: {fileID: 4831874417830518, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -23.63151 + objectReference: {fileID: 0} + - target: {fileID: 4831874417830518, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 155.36697 + objectReference: {fileID: 0} + - target: {fileID: 4832474124979885, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -75.00952 + objectReference: {fileID: 0} + - target: {fileID: 4832474124979885, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 14.84405 + objectReference: {fileID: 0} + - target: {fileID: 4832474124979885, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 97.53638 + objectReference: {fileID: 0} + - target: {fileID: 4842968619709538, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.0000045214383 + objectReference: {fileID: 0} + - target: {fileID: 4842968619709538, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000040506093 + objectReference: {fileID: 0} + - target: {fileID: 4842968619709538, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -62.71057 + objectReference: {fileID: 0} + - target: {fileID: 4845025230388998, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.000009655735 + objectReference: {fileID: 0} + - target: {fileID: 4845025230388998, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 89.99998 + objectReference: {fileID: 0} + - target: {fileID: 4887312969816373, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.00000024984223 + objectReference: {fileID: 0} + - target: {fileID: 4887312969816373, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000010512516 + objectReference: {fileID: 0} + - target: {fileID: 4887312969816373, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -13.368996 + objectReference: {fileID: 0} + - target: {fileID: 4896002537488308, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000029075718 + objectReference: {fileID: 0} + - target: {fileID: 4896002537488308, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0.000008554396 + objectReference: {fileID: 0} + - target: {fileID: 4896002537488308, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 34.148155 + objectReference: {fileID: 0} + - target: {fileID: 4901155395665742, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -1.5555353 + objectReference: {fileID: 0} + - target: {fileID: 4901155395665742, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -87.541466 + objectReference: {fileID: 0} + - target: {fileID: 4901155395665742, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 158.57036 + objectReference: {fileID: 0} + - target: {fileID: 4904079258986964, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.13966918 + objectReference: {fileID: 0} + - target: {fileID: 4904079258986964, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.144312 + objectReference: {fileID: 0} + - target: {fileID: 4904079258986964, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -2.5389178 + objectReference: {fileID: 0} + - target: {fileID: 4911997548769506, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 14.822369 + objectReference: {fileID: 0} + - target: {fileID: 4911997548769506, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 169.31807 + objectReference: {fileID: 0} + - target: {fileID: 4911997548769506, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -104.968414 + objectReference: {fileID: 0} + - target: {fileID: 4941304181978548, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -67.66707 + objectReference: {fileID: 0} + - target: {fileID: 4941304181978548, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 111.96364 + objectReference: {fileID: 0} + - target: {fileID: 4941304181978548, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -93.95869 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0.25593477 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -3.5418234 + objectReference: {fileID: 0} + - target: {fileID: 4947810564538834, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 6.9905334 + objectReference: {fileID: 0} + - target: {fileID: 4955215445487071, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 41.62129 + objectReference: {fileID: 0} + - target: {fileID: 4955215445487071, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -34.001625 + objectReference: {fileID: 0} + - target: {fileID: 4955215445487071, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 53.937935 + objectReference: {fileID: 0} + - target: {fileID: 4965908813272002, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -8.40168 + objectReference: {fileID: 0} + - target: {fileID: 4965908813272002, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -85.780396 + objectReference: {fileID: 0} + - target: {fileID: 4965908813272002, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -129.5769 + objectReference: {fileID: 0} + - target: {fileID: 4992816746925483, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -82.149376 + objectReference: {fileID: 0} + - target: {fileID: 4992816746925483, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 23.08697 + objectReference: {fileID: 0} + - target: {fileID: 4992816746925483, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 55.30365 + objectReference: {fileID: 0} + - target: {fileID: 4995682140751655, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -0.0000004737438 + objectReference: {fileID: 0} + - target: {fileID: 4995682140751655, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -0.0000043299297 + objectReference: {fileID: 0} + - target: {fileID: 4995682140751655, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -13.368999 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 081b040fea8728c4c9b18a590ba3035e, type: 3} +--- !u!4 &1840983957 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4091882994760266, guid: 081b040fea8728c4c9b18a590ba3035e, + type: 3} + m_PrefabInstance: {fileID: 1840983956} + m_PrefabAsset: {fileID: 0} --- !u!1 &1931237641 GameObject: m_ObjectHideFlags: 0 @@ -2738,3 +16671,6 @@ SceneRoots: - {fileID: 6653992898640500668} - {fileID: 160957285} - {fileID: 6042787585684178739} + - {fileID: 1106451914} + - {fileID: 1566995047} + - {fileID: 763264655} diff --git a/Assets/MyGame/Scripts/Characters/Monster/MonsterContral.cs b/Assets/MyGame/Scripts/Characters/Monster/MonsterContral.cs index 98d5109a0..331533989 100644 --- a/Assets/MyGame/Scripts/Characters/Monster/MonsterContral.cs +++ b/Assets/MyGame/Scripts/Characters/Monster/MonsterContral.cs @@ -30,6 +30,8 @@ public class MonsterContral : MonoBehaviour public bool isMove = true; public bool is3D = false; public string forwordXYZ; + protected RectTransform uirootRect; + protected Camera mainCamera; public virtual void DieFish(object obj=null) { Destroy(gameObject); @@ -48,16 +50,18 @@ public class MonsterContral : MonoBehaviour } return null; } + const string YZMoveLineName="鱼阵"; + const string PuTongFishMoveLineName="曲线"; public virtual void Init(string pathId, float Time, bool isyuzhen = false, string yzID = "") { BezierCurveData bezierCurveData; if (isyuzhen) { - bezierCurveData = MonsterMoveLine.dic_BezierCurveDatas["鱼阵" + pathId]; + bezierCurveData = MonsterMoveLine.dic_BezierCurveDatas[YZMoveLineName + pathId]; } else { - bezierCurveData = MonsterMoveLine.dic_BezierCurveDatas["曲线" + pathId]; + bezierCurveData = MonsterMoveLine.dic_BezierCurveDatas[PuTongFishMoveLineName + pathId]; } monsterData.moveLine.Init(bezierCurveData, Time); isyz = isyuzhen; @@ -142,6 +146,8 @@ public class MonsterContral : MonoBehaviour { InitAnimList(); ChangeState(CharacterStateType.move); + uirootRect = UIManager.Instance.uiRoot.GetComponent(); + mainCamera = Camera.main; } public virtual void OnMoveEnter() { @@ -170,7 +176,7 @@ public class MonsterContral : MonoBehaviour //可优化 var movestart = monsterData.moveLine.bezierCurveData.start; - movestart = CoordinateTransformation.CanvasToWorld(movestart, UIManager.Instance.uiRoot.GetComponent(), Camera.main); + movestart = CoordinateTransformation.CanvasToWorld(movestart, uirootRect, mainCamera); //Debug.Log("movestart:"+movestart); if (monsterData.moveLine.bezierCurveData.start.y > 0) { @@ -191,7 +197,7 @@ public class MonsterContral : MonoBehaviour //可优化 movestart = monsterData.moveLine.bezierCurveData.start; - movestart = CoordinateTransformation.CanvasToWorld(movestart, UIManager.Instance.uiRoot.GetComponent(), Camera.main); + movestart = CoordinateTransformation.CanvasToWorld(movestart, uirootRect,mainCamera); //Debug.Log("movestart:" + movestart); { Vector2 v2 = movestart + (Vector2)(-1 * transform.up * moveTime * monsterData.moveLine.moveTime); diff --git a/Assets/MyGame/Scripts/Manager/CreateFishManager.cs b/Assets/MyGame/Scripts/Manager/CreateFishManager.cs index 333156e9d..1cad2f84d 100644 --- a/Assets/MyGame/Scripts/Manager/CreateFishManager.cs +++ b/Assets/MyGame/Scripts/Manager/CreateFishManager.cs @@ -43,6 +43,102 @@ public class CreateFishManager : MonoSingleton private Dictionary> createDic; private Dictionary fishDatas; public Dictionary fishDatas_hashCodekey = new Dictionary(); + // ================= 新增缓存字典 ================= + private Dictionary fishArrayConfigDic; + private Dictionary fishTypeConfigDic; + + private void BuildConfigCache() + { + // 构建 fishArrayConfigs 字典缓存 + fishArrayConfigDic = GameManager.Instance.gameConfig.fishArrayConfigs + .ToDictionary(a => a.fishArrayNumber, a => a); + + // 构建 fishTypeConfigs 字典缓存 + fishTypeConfigDic = GameManager.Instance.gameConfig.fishTypeConfigs + .ToDictionary(f => f.fishNumber, f => f); + } + ///// + ///// 懒加载初始化(只执行一次) + ///// + //private void EnsureInit() + //{ + // if (roomFishConfig != null) + // return; + // FishYZ.Init(); + // roomFishConfig = new Dictionary(); + // createDic = new Dictionary>(); + + + // var list = GameManager.Instance.gameConfig.roomFishConfigs; + // if (list == null || list.Count == 0) + // return; + + // foreach (var item in list) + // { + // GameTypeEnum gameType = (GameTypeEnum)item.gameType; + + // // 安全添加(避免重复 key 抛异常) + // roomFishConfig[gameType] = item; + + // // 初始化子字典 + // var fishDic = new Dictionary(); + // createDic[gameType] = fishDic; + + // // 普通鱼 + // if (item.normalFishList != null) + // { + // foreach (var fish in item.normalFishList) + // fishDic[fish.fishNumber] = fish; + // } + + // // 等级鱼(若与基础鱼相同素材替换基础的) + // if (item.roomFishLevelList != null) + // { + // foreach (var fish in item.roomFishLevelList) + // fishDic[fish.fishNumber] = fish; + // } + // } + //} + + private void EnsureInit() + { + if (roomFishConfig != null) + return; + + FishYZ.Init(); + roomFishConfig = new Dictionary(); + createDic = new Dictionary>(); + + var list = GameManager.Instance.gameConfig.roomFishConfigs; + if (list == null || list.Count == 0) + return; + + // 初始化缓存字典 + BuildConfigCache(); + + foreach (var item in list) + { + GameTypeEnum gameType = (GameTypeEnum)item.gameType; + roomFishConfig[gameType] = item; + + var fishDic = new Dictionary(); + createDic[gameType] = fishDic; + + if (item.normalFishList != null) + { + foreach (var fish in item.normalFishList) + fishDic[fish.fishNumber] = fish; + } + + if (item.roomFishLevelList != null) + { + foreach (var fish in item.roomFishLevelList) + fishDic[fish.fishNumber] = fish; + } + } + } + + public Dictionary FishDatas { get @@ -58,48 +154,6 @@ public class CreateFishManager : MonoSingleton } } #region 初始化鱼生成配置 - /// - /// 懒加载初始化(只执行一次) - /// - private void EnsureInit() - { - if (roomFishConfig != null) - return; - FishYZ.Init(); - roomFishConfig = new Dictionary(); - createDic = new Dictionary>(); - - - var list = GameManager.Instance.gameConfig.roomFishConfigs; - if (list == null || list.Count == 0) - return; - - foreach (var item in list) - { - GameTypeEnum gameType = (GameTypeEnum)item.gameType; - - // 安全添加(避免重复 key 抛异常) - roomFishConfig[gameType] = item; - - // 初始化子字典 - var fishDic = new Dictionary(); - createDic[gameType] = fishDic; - - // 普通鱼 - if (item.normalFishList != null) - { - foreach (var fish in item.normalFishList) - fishDic[fish.fishNumber] = fish; - } - - // 等级鱼(若与基础鱼相同素材替换基础的) - if (item.roomFishLevelList != null) - { - foreach (var fish in item.roomFishLevelList) - fishDic[fish.fishNumber] = fish; - } - } - } /// /// 房间鱼配置(按游戏类型) @@ -172,14 +226,24 @@ public class CreateFishManager : MonoSingleton } if (item.type == 2) { - var yz = GameManager.Instance.gameConfig.fishArrayConfigs.Find(a => a.fishArrayNumber == item.fishNumber); - if (!yz_FishConfig_Line.ContainsKey(yz.arrayNumber)) + //var yz = GameManager.Instance.gameConfig.fishArrayConfigs.Find(a => a.fishArrayNumber == item.fishNumber); + //if (!yz_FishConfig_Line.ContainsKey(yz.arrayNumber)) + //{ + + + // yz_FishConfig_Line[yz.arrayNumber] = new List(); + //} + //yz_FishConfig_Line[yz.arrayNumber].Add(item); + + // ====== 修改点:用字典替代 List.Find ====== + if (fishArrayConfigDic.TryGetValue(item.fishNumber, out var yz)) { - - - yz_FishConfig_Line[yz.arrayNumber] = new List(); + if (!yz_FishConfig_Line.ContainsKey(yz.arrayNumber)) + { + yz_FishConfig_Line[yz.arrayNumber] = new List(); + } + yz_FishConfig_Line[yz.arrayNumber].Add(item); } - yz_FishConfig_Line[yz.arrayNumber].Add(item); } } foreach (var item in config.roomFishLevelList) @@ -194,14 +258,24 @@ public class CreateFishManager : MonoSingleton - var yz = GameManager.Instance.gameConfig.fishArrayConfigs.Find(a => a.fishArrayNumber == item.fishNumber); - if (!yz_FishConfig_Line.ContainsKey(yz.arrayNumber)) + //var yz = GameManager.Instance.gameConfig.fishArrayConfigs.Find(a => a.fishArrayNumber == item.fishNumber); + //if (!yz_FishConfig_Line.ContainsKey(yz.arrayNumber)) + //{ + + + // yz_FishConfig_Line[yz.arrayNumber] = new List(); + //} + //yz_FishConfig_Line[yz.arrayNumber].Add(item); + + // ====== 修改点:用字典替代 List.Find ====== + if (fishArrayConfigDic.TryGetValue(item.fishNumber, out var yz)) { - - - yz_FishConfig_Line[yz.arrayNumber] = new List(); + if (!yz_FishConfig_Line.ContainsKey(yz.arrayNumber)) + { + yz_FishConfig_Line[yz.arrayNumber] = new List(); + } + yz_FishConfig_Line[yz.arrayNumber].Add(item); } - yz_FishConfig_Line[yz.arrayNumber].Add(item); } @@ -253,7 +327,7 @@ public class CreateFishManager : MonoSingleton spawnList = null; for (int i = 0; i < fishRoot.childCount; i++) { - Destroy( fishRoot.GetChild(i).gameObject); + Destroy(fishRoot.GetChild(i).gameObject); } } #endregion @@ -287,13 +361,13 @@ public class CreateFishManager : MonoSingleton float boss = 1; //float boss = 25; - float yz_Time; - int yzCount; + float yz_Time; + int yzCount; Dictionary isyzCreate = new Dictionary(); float pt = 3;//1-3个 int ptCount; - + public static List RandomUniqueNumbers(int count, int min, int max) { HashSet result = new HashSet(); @@ -327,10 +401,10 @@ public class CreateFishManager : MonoSingleton JobHandle handle = job.Schedule(); handle.Complete(); - - boss -= Time.deltaTime; - yz_Time -= Time.deltaTime; - pt -= Time.deltaTime; + float deltatime = Time.deltaTime; + boss -= deltatime; + yz_Time -= deltatime; + pt -= deltatime; if (boss <= 0) { if (fishTypeConfig.ContainsKey(FishTypeEnum.Boss鱼)) @@ -374,7 +448,7 @@ public class CreateFishManager : MonoSingleton yz_FishConfig_LineFalse[str].Add(va); } } - + } yz_Time = Random.Range(1, 6); @@ -488,21 +562,14 @@ public class CreateFishManager : MonoSingleton else if (cfg.type == 2) { //cfg.fishNumber;3 - var yz = GameManager.Instance.gameConfig.fishArrayConfigs.Find(a => a.fishArrayNumber == cfg.fishNumber); - foreach (var item in GameManager.Instance.gameConfig.fishArrayConfigs) + if (fishArrayConfigDic.TryGetValue(cfg.fishNumber, out var yz)) { - if (item.arrayNumber == cfg.fishNumber) - { - Debug.Log(item); - } + } FishTypeConfig fishType = null; - foreach (var item in M_GameConfig.fishTypeConfigs) + if (fishTypeConfigDic.TryGetValue(yz.fishNumber, out var ft)) { - if (item.fishNumber == yz.fishNumber) - { - fishType = item; - } + fishType = ft; } // 3. 出生点 Vector3 pos = new Vector3( @@ -512,7 +579,7 @@ public class CreateFishManager : MonoSingleton int pathId = 0; int count = 0; - count=yz.fishCount; + count = yz.fishCount; List list = new List(); switch (yz.arrayNumber.Substring(0, 3)) { @@ -520,7 +587,7 @@ public class CreateFishManager : MonoSingleton case "700": list = FishYZ.dicfishYZ[yz.arrayNumber]; - StartCoroutine(IeShanXing(createFishData, yz, pos, prefab, list, time,count)); + StartCoroutine(IeShanXing(createFishData, yz, pos, prefab, list, time, count)); break; case "701": @@ -534,7 +601,7 @@ public class CreateFishManager : MonoSingleton foreach (var item in list) { - StartCoroutine(YZ7007(createFishData, yz, pos, prefab, item, time,count)); + StartCoroutine(YZ7007(createFishData, yz, pos, prefab, item, time, count)); } break; @@ -542,12 +609,12 @@ public class CreateFishManager : MonoSingleton list = FishYZ.dicfishYZ[yz.arrayNumber]; foreach (var item in list) { - StartCoroutine(YZ7007(createFishData, yz, pos, prefab, item, time,count)); + StartCoroutine(YZ7007(createFishData, yz, pos, prefab, item, time, count)); } break; case "710": list = FishYZ.dicfishYZ[yz.arrayNumber]; - StartCoroutine(YZ7007(createFishData, yz, pos, prefab, list[Random.Range(0,list.Count)], time, count)); + StartCoroutine(YZ7007(createFishData, yz, pos, prefab, list[Random.Range(0, list.Count)], time, count)); break; default: break; @@ -560,7 +627,7 @@ public class CreateFishManager : MonoSingleton } - IEnumerator IeShanXing(FrameData_CreateFish createFishData, FishArrayConfig yz, Vector3 pos, GameObject prefab, List list, long time,int count) + IEnumerator IeShanXing(FrameData_CreateFish createFishData, FishArrayConfig yz, Vector3 pos, GameObject prefab, List list, long time, int count) { RoomFishDetailConfig cfg = spawnDic[createFishData.fishNumber]; foreach (var item in list) @@ -611,7 +678,7 @@ public class CreateFishManager : MonoSingleton } //顺序出 - IEnumerator YZ7007(FrameData_CreateFish createFishData, FishArrayConfig yz, Vector3 pos, GameObject prefab, int pathId, long time,int count) + IEnumerator YZ7007(FrameData_CreateFish createFishData, FishArrayConfig yz, Vector3 pos, GameObject prefab, int pathId, long time, int count) { RoomFishDetailConfig cfg = spawnDic[createFishData.fishNumber]; List list = FishDatas[yz.fishNumber].pathList; @@ -650,14 +717,19 @@ public class CreateFishManager : MonoSingleton { RoomFishDetailConfig cfg = spawnDic[createFishData.fishNumber]; // 1. 找到鱼的基础配置 - FishTypeConfig fishType = M_GameConfig.fishTypeConfigs - .Find(f => f.fishNumber == cfg.fishNumber); - - if (fishType == null) + //FishTypeConfig fishType = M_GameConfig.fishTypeConfigs + // .Find(f => f.fishNumber == cfg.fishNumber); + // ====== 修改点:用字典替代 List.Find ====== + if (!fishTypeConfigDic.TryGetValue(cfg.fishNumber, out var fishType)) { Debug.LogError($"找不到鱼配置:{cfg.fishNumber}"); return false; } + //if (fishType == null) + //{ + // Debug.LogError($"找不到鱼配置:{cfg.fishNumber}"); + // return false; + //} // 2. 加载 Prefab(imageUrl 你可以换成自己的字段) //var prefab = await Addressables.LoadAssetAsync(fishType.imageUrl).Task; @@ -793,7 +865,7 @@ public class CreateFishManager : MonoSingleton //Destroy(monster.gameObject); fishDatas_hashCodekey.Remove(fishId); } - } + } public void Ws_DieFish(string msg) { var killFish = JsonConvert.DeserializeObject>(msg).arguments[0]; diff --git a/Assets/MyGame/Scripts/Net/APIManager.cs b/Assets/MyGame/Scripts/Net/APIManager.cs index e426f53f1..994bc8a1e 100644 --- a/Assets/MyGame/Scripts/Net/APIManager.cs +++ b/Assets/MyGame/Scripts/Net/APIManager.cs @@ -253,7 +253,7 @@ namespace Assets.MyGame.Scripts.Net Debug.LogError("错误代码:" + code + "错误信息:" + message); //这里之后补弹窗 - + UIManager.Instance.ShowBoardError("错误代码:" + code + "错误信息:" + message); } } } diff --git a/Assets/MyGame/Scripts/Net/APIResponses/UserData_SubClass/UserBaseInfo.cs b/Assets/MyGame/Scripts/Net/APIResponses/UserData_SubClass/UserBaseInfo.cs index 05c290f82..54cfed0cc 100644 --- a/Assets/MyGame/Scripts/Net/APIResponses/UserData_SubClass/UserBaseInfo.cs +++ b/Assets/MyGame/Scripts/Net/APIResponses/UserData_SubClass/UserBaseInfo.cs @@ -1,4 +1,7 @@ -public class UserBaseInfo +using System; + +[Serializable] +public class UserBaseInfo { public string userName { get; set; } public string password { get; set; } diff --git a/Assets/MyGame/aa/UI/Home/MainPanel.prefab b/Assets/MyGame/aa/UI/Home/MainPanel.prefab index 9a50ab124..2e866efab 100644 --- a/Assets/MyGame/aa/UI/Home/MainPanel.prefab +++ b/Assets/MyGame/aa/UI/Home/MainPanel.prefab @@ -2888,7 +2888,6 @@ GameObject: - component: {fileID: 6542561060930485909} - component: {fileID: 1056885248303844320} - component: {fileID: 2669359584981438084} - - component: {fileID: 582122759025887289} m_Layer: 0 m_Name: -h-vip (1) m_TagString: Untagged @@ -2953,50 +2952,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!114 &582122759025887289 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2570285668878051517} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 2669359584981438084} - m_OnClick: - m_PersistentCalls: - m_Calls: [] --- !u!1 &2701901445882921336 GameObject: m_ObjectHideFlags: 0 @@ -5019,7 +4974,6 @@ GameObject: - component: {fileID: 3604835082534464121} - component: {fileID: 1020194819284908310} - component: {fileID: 7546787681005239013} - - component: {fileID: 348958790080805550} m_Layer: 0 m_Name: -h-vip (2) m_TagString: Untagged @@ -5084,50 +5038,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!114 &348958790080805550 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4348020444315061542} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 7546787681005239013} - m_OnClick: - m_PersistentCalls: - m_Calls: [] --- !u!1 &4587799190945175577 GameObject: m_ObjectHideFlags: 0 @@ -7145,7 +7055,6 @@ GameObject: - component: {fileID: 6817559745575328737} - component: {fileID: 8679119709980567266} - component: {fileID: 6119523778879306011} - - component: {fileID: 2403343744979405336} m_Layer: 0 m_Name: -h-vip m_TagString: Untagged @@ -7210,50 +7119,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!114 &2403343744979405336 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7454928103288557905} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 6119523778879306011} - m_OnClick: - m_PersistentCalls: - m_Calls: [] --- !u!1 &7657864743914521669 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/MyGame/aa/UI/Home/Sub/UIHome_BY_JJJPanel.cs b/Assets/MyGame/aa/UI/Home/Sub/UIHome_BY_JJJPanel.cs index f8cbf55c9..57711cff6 100644 --- a/Assets/MyGame/aa/UI/Home/Sub/UIHome_BY_JJJPanel.cs +++ b/Assets/MyGame/aa/UI/Home/Sub/UIHome_BY_JJJPanel.cs @@ -17,11 +17,13 @@ public class UIHome_BY_JJJPanel : SubUIBase public override void Awake() { base.Awake(); + //添加金币 btn_Receive.onClick.AddListener(() => { APIRequestList.GetRelief((callvack)=> { + UIManager.Instance.ShowBoardGongGao("救济金领取成功"); //这里弹窗领取成功 }); }); @@ -30,6 +32,7 @@ public class UIHome_BY_JJJPanel : SubUIBase protected override void OnShow(object args = null) { base.OnShow(args); + var jjjData = GameManager.Instance.gameConfig.reliefConfigs; txt_coinsNum.text = "金币" + jjjData.gold.ToString(); if (GameManager.Instance.user.assets.gold < jjjData.limit&& GameManager.Instance.user.@static.reliefGoldCount>0) diff --git a/Assets/Scripts/Assembly-CSharp/Eff_changE_StageEvent.cs b/Assets/Scripts/Assembly-CSharp/Eff_changE_StageEvent.cs index f70dd725a..47576aa6f 100644 --- a/Assets/Scripts/Assembly-CSharp/Eff_changE_StageEvent.cs +++ b/Assets/Scripts/Assembly-CSharp/Eff_changE_StageEvent.cs @@ -1,7 +1,14 @@ -using UnityEngine; +using UnityEngine; public class Eff_changE_StageEvent : MonoBehaviour { + public Transform MoveTargetPosition; + public void eventComeEnd() + { + GetComponent().CrossFade("fly",0.3f); + + } + /* Dummy class. This could have happened for several reasons: diff --git a/Assets/Spine/CHANGELOG.md b/Assets/Spine/CHANGELOG.md index 9e6e33b52..0bf15243e 100644 --- a/Assets/Spine/CHANGELOG.md +++ b/Assets/Spine/CHANGELOG.md @@ -1,409 +1,10 @@ -# 3.8 - -## AS3 -* **Breaking changes** - * Renamed `Slot#getAttachmentVertices()` to `Slot#getDeform()`. - * Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports. - * Renamed `Skin#addAttachment()` to `Skin#setAttachment()`. - * Removed `VertexAttachment#applyDeform()` and replaced it with `VertexAttachment#deformAttachment`. The attachment set on this field is used to decide if a `DeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied. - * Removed `inheritDeform` field, getter, and setter from `MeshAttachment`. - * Changed `.skel` binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably. - * Changed the `.json` and `.skel` file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes. - * Switched projects from FDT to Visual Studio Code. See updated `README.md` files for instructions. - -* **Additions** - * Added `SkeletonBinary` to load binary `.skel` files. See `MixAndMatchExample.as` in `spine-startling-example`. - * Added `x` and `y` coordinates for setup pose AABB in `SkeletonData`. - * Added support for rotated mesh region UVs. - * Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them. - * Improved Skin API to make it easier to handle mix-and-match use cases. - * Added `Skin#getAttachments()`. Returns all attachments in the skin. - * Added `Skin#getAttachments(int slotIndex)`. Returns all attachements in the skin for the given slot index. - * Added `Skin#addSkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. - * Added `Skin#copySkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `VertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied. - * Added `Attachment#copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices. - * Added `MeshAttachment#newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh. - * Added IK softness. - -### Starling -* Added `MixAndMatchExample.as` to demonstrate the new Skin API additions and how to load binary `.skel` files. -* Switched projects from FDT to Visual Studio Code. See updated `README.md` files for instructions. - -## C -* **Breaking changes** - * Renamed `spSlot#attachmentVertices` to `spSlot#deform`. - * Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports. - * Renamed `spSkin_addAttachment()` to `Skin#spSkin_addAttachment()`. - * Removed `spVertexAttachment_applyDeform()` and replaced it with `VertexAttachment#deformAttachment`. The attachment set on this field is used to decide if a `spDeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied. - * Removed `inheritDeform` field, getter, and setter from `spMeshAttachment`. - * Changed `.skel` binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably. - * Changed the `.json` and `.skel` file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes. - -* **Additions** - * Added `x` and `y` coordinates for setup pose AABB in `spSkeletonData`. - * Added support for rotated mesh region UVs. - * Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them. - * Improved Skin API to make it easier to handle mix-and-match use cases. - * Added `spSkin_getAttachments()`. Returns all attachments in the skin. - * Added `spSkin_getAttachments(int slotIndex)`. Returns all attachements in the skin for the given slot index. - * Added `spSkin_addSkin(spSkin* skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. - * Added `spSkin_copySkin(spSkin* skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `spVertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied. - * All attachments inserted into skins are reference counted. When the last skin referencing an attachment is disposed, the attachment will also be disposed. - * Added `spAttachment_copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices. - * Added `spMeshAttachment_newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh. - * Added IK softness. - -### Cocos2d-Objc -* Added mix-and-match example to demonstrate the new Skin API. -* Added `IKExample`. -* Added `SkeletonAnimation preUpdateWorldTransformsListener` and `SkeletonAnimation postUpdateWorldTransformsListener`. When set, these callbacks will be invokved before and after the skeleton's `updateWorldTransforms()` method is called. See the `IKExample` how it can be used. - -### SFML -* Added mix-and-match example to demonstrate the new Skin API. -* Added `IKExample`. - -## C++ -* **Breaking Changes** - * Renamed `Slot::getAttachmentVertices()` to `Slot::getDeform()`. - * Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports. - * Renamed `Skin::addAttachment()` to `Skin::setAttachment()`. - * Removed `VertexAttachment::applyDeform()` and replaced it with `VertexAttachment::getDeformAttachment()`. The attachment set on this field is used to decide if a `DeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied. - * Removed `_inheritDeform` field, getter, and setter from `MeshAttachment`. - * Changed `.skel` binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably. - * Changed the `.json` and `.skel` file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes. - -* **Additions** - * `AnimationState` and `TrackEntry` now also accept a subclass of `AnimationStateListenerObject` as a listener for animation events in the overloaded `setListener()` method. - * `SkeletonBinary` and `SkeletonJson` now parse and set all non-essential data like audio path. - * Added `x` and `y` coordinates for setup pose AABB in `SkeletonData`. - * Added support for rotated mesh region UVs. - * Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them. - * Improved Skin API to make it easier to handle mix-and-match use cases. - * Added `Skin#getAttachments()`. Returns all attachments in the skin. - * Added `Skin#getAttachments(int slotIndex)`. Returns all attachements in the skin for the given slot index. - * Added `Skin#addSkin(Skin &skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. - * Added `Skin#copySkin(Skin &skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `VertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied. - * All attachments inserted into skins are reference counted. When the last skin referencing an attachment is disposed, the attachment will also be disposed. - * Added `Attachment#copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices. - * Added `MeshAttachment#newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh. - * Added IK softness. - * Exposed `x` and `y` on `SkeletonData` through getters and setters. - -### Cocos2d-x -* Updated to cocos2d-x 3.17.1 -* Added mix-and-match example to demonstrate the new Skin API. -* Exmaple project requires Visual Studio 2019 on Windows -* Added `IKExample`. -* Added `SkeletonAnimation::setPreUpdateWorldTransformsListener()` and `SkeletonAnimation::setPreUpdateWorldTransformsListener()`. When set, these callbacks will be invokved before and after the skeleton's `updateWorldTransforms()` method is called. See the `IKExample` how it can be used. - -### SFML -* Added mix-and-match example to demonstrate the new Skin API. - -### UE4 -* Added `bAutoPlaying` flag to `USpineSkeletonAnimationComponent`. When `false`, the component will not update the internal animation state and skeleton. -* Updated example project to UE 4.22. -* (Re-)Importing Spine assets will perform a version compatibility check and alert users about mismatches in editor mode. -* `USpineSkeletonRendererComponent` allows passing a `USpineSkeletonComponent` to update it. This way, the renderer component can be used without a skeleton component on the same actor. -* Added blueprint-callable methods to `SpineSkeletonComponent` and `SpineSkeletonAnimationComponent` to query and set skins, and enumerate bones, slots, and animations. -* Extended skeleton data editor preview. The preview now shows bones, slots, animations, and skins found in the skeleton data. See this [blog post](http://esotericsoftware.com/blog/Unreal-Engine-4-quality-of-life-improvements). -* Added preview animation and skin fields, allowing you to preview animations and skins right in the editor. See this [blog post](http://esotericsoftware.com/blog/Unreal-Engine-4-quality-of-life-improvements). -* Removed dependency on `RHI`, `RenderCore`, and `ShaderCore`. -* Re-importing atlases and their textures now works consistently in all situations. -* Added mix-and-match example to demonstrate the new Skin API. -* Materials on `SkeletonRendererComponent` are now blueprint read and writeable. This allows setting dynamic material instances at runtime. -* Added `InitialSkin` property to `USpineWidget`. This allows previewing different skins in the UMG Designer. Initial skins can still be overridden via blueprint events such as `On Initialized`. - -## C# ## -* **Breaking changes** - * **Changed `IkConstraintData.Bones` type from `List` to `ExposedList`** for unification reasons. *Note: this modification will most likely not affect user code.* - * Renamed `Slot.AttachmentVertices` to `Slot.Deform`. - * Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports. - * Renamed `Skin.AddAttachment()` to `Skin.SetAttachment()`. - * Removed `FindAttachmentsForSlot(int slotIndex, List attachments)` and `FindNamesForSlot (int slotIndex, List names)` and replaced it with `Skin.GetAttachments(int slotIndex, List attachments)` which returns the combined `SkinEntry` object holding both name and attachment. - * Removed `VertexAttachment.ApplyDeform()` and replaced it with `VertexAttachment.DeformAttachment`. The attachment set on this field is used to decide if a `DeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied. - * Removed `inheritDeform` field, getter, and setter from `MeshAttachment`. - * Changed `.skel` binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably. - * Changed the `.json` and `.skel` file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes. - -* **Additions** - * Added `x` and `y` coordinates for setup pose AABB in `SkeletonData`. - * Added support for rotated mesh region UVs. - * Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them. - * Improved Skin API to make it easier to handle mix-and-match use cases. - * Added `Skin.GetAttachments()`. Returns all attachments in the skin. - * Added `Skin.GetAttachments(int slotIndex, List attachments)`. Returns all attachements in the skin for the given slot index. This method replaces `FindAttachmentsForSlot` and `FindNamesForSlot`. - * Added `Skin.AddSkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. - * Added `Skin.CopySkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `VertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied. - * Added `Attachment.Copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices. - * Added `MeshAttachment.NewLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh. - * Added IK softness. - -### Unity - -* **Breaking changes** - * **Officially supported Unity versions are 2017.1-2020.2**. - * **Spine `.asmdef` files are again active by default**. They have previously been deactivated to `.txt` extension which is now no longer necessary. - * **Removed PoseSkeleton() and PoseWithAnimation()** extension methods to prevent issues where animations are not mixed out. Problem was that these methods did not set AnimationState, leaving incorrect state at e.g. attachments enabled at slots when starting subsequent animations. As a replacement you can use `AnimationState.ClearTrack(0);` followed by `var entry = AnimationState.SetAnimation(0, animation, loop); entry.TrackTime = time` to achieve similar behaviour. - * **The `Shadow alpha cutoff` shader parameter is now respecting slot-color alpha** values at all Spine shaders. A fragment's texture color alpha is multiplied with slot-color alpha before the result is tested against the `Shadow alpha cutoff` threshold. - * **Removed redundant `Attachment.GetClone()` and `MeshAttachment.GetLinkedClone()` extension methods**. Use methods `Attachment.Copy` and `MeshAttachment.NewLinkedMesh()` instead. - * **Renamed extension method `Attachment.GetClone(bool cloneMeshesAsLinked)` to `Attachment.GetCopy(bool cloneMeshesAsLinked)`** to follow the naming scheme of the Spine API. - * `SkeletonDataAsset.atlasAssets` is now an array of the base class `AtlasAssetBase` instead of `SpineAtlasAsset`, which provides `IEnumerable<> Materials` instead of `List<> materials`. Replace any access via `atlasAsset.materials[0]` with `atlasAsset.Materials.First()` and add a `using System.Linq;` statement. - * **Changed `MeshAttachment.GetLinkedMesh()` method signatures:** removed optional parameters `bool inheritDeform = true, bool copyOriginalProperties = false`. - * Changed namespace `Spine.Unity.Modules` to `Spine.Unity` and `Spine.Unity.Examples` after restructuring (see section below) in respective classes: - * When receiving namespace related errors, replace using statements of `using Spine.Unity.Modules.AttachmentTools;` with `using Spine.Unity.AttachmentTools;`. You can remove `using Spine.Unity.Modules;` statements when a `using Spine.Unity` statement is already present in the file. - * `AttachmentTools`, `SkeletonPartsRenderer`, `SkeletonRenderSeparator`, `SkeletonRendererCustomMaterials` changed to namespace `Spine.Unity`. - * `SkeletonGhost`, `SkeletonGhostRenderer`, `AtlasRegionAttacher`, `SkeletonGraphicMirror`, `SkeletonRagdoll`, `SkeletonRagdoll2D`, `SkeletonUtilityEyeConstraint`, `SkeletonUtilityGroundConstraint`, `SkeletonUtilityKinematicShadow` changed to namespace `Spine.Unity.Examples`. - * Split `Editor/Utility/SpineEditorUtilities` class into multiple files with partial class qualifier. - * Nested classes `SpineEditorUtilities.AssetUtility` and `SpineEditorUtilities.EditorInstantiation` are now no longer nested. If you receive namespace related errors, replace any occurrance of - * `SpineEditorUtilities.AssetUtility` with `AssetUtility` and - * `SpineEditorUtilities.EditorInstantiation` with `EditorInstantiation`. - * **Timeline Support has been moved to a separate UPM Package** Previously the Spine Timeline integration was located in the `Modules/Timeline` directory and was deactivated by default, making it necessary to activate it via the Spine Preferences. Now the Timeline integration has been moved to an additional UPM package which can be found under `Modules/com.esotericsoftware.spine.timeline`. - * **Installation:** You can download the Unity Package Manager (UPM) package via the [download page](http://esotericsoftware.com/spine-unity-download) or find it in the [spine-runtimes/spine-unity/Modules](https://github.com/EsotericSoftware/spine-runtimes/tree/3.8-beta/spine-unity/Modules) subdirectory on the git repository. You can then either unzip (copy if using git) the package to - a) the `Packages` directory in your project where it will automatically be loaded, or - b) to an arbitrary directory outside the Assets directory and then open Package Manager in Unity, select the `+` icon, choose `Add package from disk..` and point it to the package.json file. - The Project panel should now show an entry `Spine Timeline Extensions` under `Packages`. If the directory is not yet listed, you will need to close and re-open Unity to have it display the directory and its contents. - * `SkeletonMecanim`'s `Layer Mix Mode` enum name `MixMode.SpineStyle` has been renamed to `MixMode.Hard`. This is most likely not set via code and thus unlikely to be a problem. Serialized scenes and prefabs are unaffected. - * `SkeletonRootMotion` and `SkeletonMecanimRootMotion` components now support arbitrary bones in the hierarchy as `Root Motion Bone`. Previously there were problems when selecting a non-root bone as `Root Motion Bone`. `Skeleton.ScaleX` and `.ScaleY` and parent bone scale is now respected as well. - -* **Additions** - * **Spine Preferences stored in Assets/Editor/SpineSettings.asset** Now Spine uses the new `SettingsProvider` API, storing settings in a SpineSettings.asset file which can be shared with team members. Your old preferences are automatically migrated to the new system. - * Added support for Unity's SpriteMask to `SkeletonAnimation` and `SkeletonMecanim`. All mask interaction modes are supported. See this [blog post](http://esotericsoftware.com/blog/Unity-SpriteMask-and-RectMask2D-support). - * Added support for Unity's RectMask2D to SkeletonGraphics. See this [blog post](http://esotericsoftware.com/blog/Unity-SpriteMask-and-RectMask2D-support). - * Added `Create 2D Hinge Chain` button at `SkeletonUtilityBone` inspector, previously only `Create 3D Hinge Chain` was available. - * **Now supporting Lightweight Render Pipeline (LWRP) through an additional UPM package.** - * **Installation:** You can download the Unity Package Manager (UPM) package via the [download page](http://esotericsoftware.com/spine-unity-download) or find it in the [spine-runtimes/spine-unity/Modules](https://github.com/EsotericSoftware/spine-runtimes/tree/3.8-beta/spine-unity/Modules) subdirectory on the git repository. You can then either unzip (copy if using git) the package to - * a) the `Packages` directory in your project where it will automatically be loaded, or - * b) to an arbitrary directory outside the Assets directory and then open Package Manager in Unity, select the `+` icon, choose `Add package from disk..` and point it to the package.json file. - - > If you are using git and Unity 2019.2 or newer versions and receive an error that dependencies could not be resolved by the package manager (only higher versions of Unity's `Lightweight RP` package are available, e.g. `6.9.0` and up), please copy the prepared package-UNITYVERSION.json file for your Unity version (e.g. `package-2019.2.json`) over the existing package.json file to change the dependency accordingly. Unfortunately Unity's Package Manager does not provide a way to specify a version range for a dependency like "5.7.2 - 6.9.0" yet, so this manual step is necessary for git users. - - The Project panel should now show an entry `Spine Lightweight RP Shaders` under `Packages`. If the directory is not yet listed, you will need to close and re-open Unity to have it display the directory and its contents. - * **Usage:** The package provides two shaders specifically built for the lightweight render pipeline: - * `Lightweight Render Pipeline/Spine/Skeleton`, as a lightweight variant of the `Spine/Skeleton` shader, - * `Lightweight Render Pipeline/Spine/Skeleton Lit`, as a lightweight variant of the `Spine/Skeleton Lit` shader and - * `Lightweight Render Pipeline/Spine/Sprite`, as a lightweight variant of the `Spine/Sprite/Vertex Lit` and `Pixel Lit` shaders, which were not functioning in the lightweight render pipeline. The shaders can be assigned to materials as usual and will respect your settings of the assigned `LightweightRenderPipelineAsset` under `Project Settings - Graphics`. - * **Restrictions** As all Spine shaders, the LWRP shaders **do not support `Premultiply alpha` (PMA) atlas textures in Linear color space**. Please export your atlas textures as `straight alpha` textures with disabled `Premultiply alpha` setting when using Linear color space. You can check the current color space via `Project Settings - Player - Other Settings - Color Space.`. - * **Example:** You can find an example scene in the package under `com.esotericsoftware.spine.lwrp-shaders-3.8/Examples/LWRP Shaders.unity` that demonstrates usage of the LWRP shaders. - * Added `Spine/Skeleton Lit ZWrite` shader. This variant of the `Spine/Skeleton Lit` shader writes to the depth buffer with configurable depth alpha threshold. Apart from that it is identical to `Spine/Skeleton Lit`. - * Additional yield instructions to wait for animation track events `End`, `Complete` and `Interrupt`. - * `WaitForSpineAnimationComplete` now proves an additional `bool includeEndEvent` parameter, defaults to `false` (previous behaviour). - * Added a new `WaitForSpineAnimationEnd` yield instruction. - * Added a new generic `WaitForSpineAnimation` yield instruction which can be configured to wait for any combination of animation track events. It is now used as base class for `WaitForSpineAnimationComplete` and `WaitForSpineAnimationEnd`. - * Additional **Fix Draw Order** parameter at SkeletonRenderer, defaults to `disabled` (previous behaviour). - Applies only when 3+ submeshes are used (2+ materials with alternating order, e.g. "A B A"). - If true, MaterialPropertyBlocks are assigned at each material to prevent aggressive batching of submeshes - by e.g. the LWRP renderer, leading to incorrect draw order (e.g. "A1 B A2" changed to "A1A2 B"). - You can leave this parameter disabled when everything is drawn correctly to save the additional performance cost. - * **Additional Timeline features.** SpineAnimationStateClip now provides a `Speed Multiplier`, a start time offset parameter `Clip In`, support for blending successive animations by overlapping tracks. An additional `Use Blend Duration` parameter *(defaults to true)* allows for automatic synchronisation of MixDuration with the current overlap blend duration. An additional Spine preferences parameter `Use Blend Duration` has been added which can be disabled to default to the previous behaviour before this update. - * Additional `SpriteMask and RectMask2D` example scene added for demonstration of mask setup and interaction. - * `Real physics hinge chains` for both 2D and 3D physics. The [SkeletonUtilityBone](http://esotericsoftware.com/spine-unity#SkeletonUtilityBone) Inspector provides an interface to create 2D and 3D hinge chains. Previously created chains have only been respecting gravity, but not momentum of the skeleton or parent bones. The new physics rig created when pressing `Create 3D Hinge Chain` and `Create 2D Hinge Chain` creates a more complex setup that also works when flipping the skeleton. Note that the chain root node is no longer parented to bones of the skeleton. This is a requirement in Unity to have momentum applied properly - do not reparent the chain root to bones of your skeleton, or you will loose any momentum applied by the skeleton's movement. - * `Outline rendering functionality for all shaders.` Every shader now provides an additional set of `Outline` parameters to enable custom outline rendering. When outline rendering is enabled via the `Material` inspector, it automatically switches the shader to the respective `Spine/Outline` shader variant. Outlines are generated by sampling neighbour pixels, so be sure to add enough transparent padding when exporting your atlas textures to fit the desired outline width. In order to enable outline rendering at a skeleton, it is recommended to first prepare an additional outline material copy and then switch the material of the target skeleton to this material. This prevents unnecessary additional runtime material copies and drawcalls. Material switching can be prepared via a [SkeletonRendererCustomMaterials](http://esotericsoftware.com/spine-unity#SkeletonRendererCustomMaterials) component and then enabled or disabled at runtime. Alternatively, you can also directly modify the `SkeletonRenderer.CustomMaterialOverride` property. - Outline rendering is fully supported on `SkeletonGraphic` shaders as well. - * Added `SkeletonRenderer.EditorSkipSkinSync` scripting API property to be able to set custom skins in editor scripts. Enable this property when overwriting the Skeleton's skin from an editor script. Without setting this parameter, changes will be overwritten by the next inspector update. Only affects Inspector synchronisation of skin with `initialSkinName`, not startup initialization. - * All `Spine/SkeletonGraphic` shaders now provide a parameter `CanvasGroup Compatible` which can be enabled to support `CanvasGroup` alpha blending. For correct results, you should then disable `Pma Vertex Colors` in the `SkeletonGraphic` Inspector, in section `Advanced` (otherwise Slot alpha will be applied twice). - * **Now supporting Universal Render Pipeline (URP), including the 2D Renderer pipeline, through an additional UPM package.** - * **Installation:** You can download the Unity Package Manager (UPM) package via the [download page](http://esotericsoftware.com/spine-unity-download) or find it in the [spine-runtimes/spine-unity/Modules](https://github.com/EsotericSoftware/spine-runtimes/tree/3.8-beta/spine-unity/Modules) subdirectory on the git repository. You can then either unzip (copy if using git) the package to - * a) the `Packages` directory in your project where it will automatically be loaded, or - * b) to an arbitrary directory outside the Assets directory and then open Package Manager in Unity, select the `+` icon, choose `Add package from disk..` and point it to the package.json file. - - The Project panel should now show an entry `Spine Universal RP Shaders` under `Packages`. If the directory is not yet listed, you will need to close and re-open Unity to have it display the directory and its contents. - * **Usage:** The package provides two shaders specifically built for the universal render pipeline: - * `Universal Render Pipeline/Spine/Skeleton`, as a universal variant of the `Spine/Skeleton` shader, - * `Universal Render Pipeline/Spine/Skeleton Lit`, as a universal variant of the `Spine/Skeleton Lit` shader, - * `Universal Render Pipeline/Spine/Sprite`, as a universal variant of the `Spine/Sprite/Vertex Lit` and `Pixel Lit` shaders, which were not functioning in the universal render pipeline, - * `Universal Render Pipeline/2D/Spine/Skeleton Lit`, as a universal 2D Renderer variant of the `Spine/Skeleton Lit` shader, and - * `Universal Render Pipeline/2D/Spine/Sprite`, as a universal 2D Renderer variant of the `Spine/Sprite/Vertex Lit` and `Pixel Lit` shaders. - The shaders can be assigned to materials as usual and will respect your settings of the assigned `UniversalRenderPipelineAsset` under `Project Settings - Graphics`. - * **Restrictions** As all Spine shaders, the URP shaders **do not support `Premultiply alpha` (PMA) atlas textures in Linear color space**. Please export your atlas textures as `straight alpha` textures with disabled `Premultiply alpha` setting when using Linear color space. You can check the current color space via `Project Settings - Player - Other Settings - Color Space.`. - * **Example:** You can find an example scene in the package under `com.esotericsoftware.spine.urp-shaders-3.8/Examples/URP Shaders.unity` that demonstrates usage of the URP shaders. - * Spine Preferences now provide an **`Atlas Texture Settings`** parameter for applying customizable texture import settings at all newly imported Spine atlas textures. - When exporting atlas textures from Spine with `Premultiply alpha` enabled (the default), you can leave it at `PMATexturePreset`. If you have disabled `Premultiply alpha`, set it to the included `StraightAlphaTexturePreset` asset. You can also create your own `TextureImporter` `Preset` asset and assign it here (include `PMA` or `Straight` in the name). In Unity versions before 2018.3 you can use `Texture2D` template assets instead of the newer `Preset` assets. Materials created for imported textures will also have the `Straight Alpha Texture` parameter configured accordingly. - * All `Sprite` shaders (including URP and LWRP extension packages) now provide an additional `Fixed Normal Space` option `World-Space`. PReviously options were limited to `View-Space` and `Model-Space`. - * `SkeletonGraphic` now fully supports [`SkeletonUtility`](http://esotericsoftware.com/spine-unity#SkeletonUtility) for generating a hierarchy of [`SkeletonUtilityBones`](http://esotericsoftware.com/spine-unity#SkeletonUtilityBone) in both modes `Follow` and `Override`. This also enables creating hinge chain physics rigs and using `SkeletonUtilityConstraints` such as `SkeletonUtilityGroundConstraint` and `SkeletonUtilityEyeConstraint` on `SkeletonGraphic`. - * Added `OnMeshAndMaterialsUpdated` callback event to `SkeletonRenderer` and `SkeletonGraphic`. It is issued at the end of `LateUpdate`, before rendering. - * Added `Skeleton-OutlineOnly` single pass shader to LWRP and URP extension modules. It can be assigned to materials as `Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly`. This allows for separate outline child *GameObjects* that reference the existing Mesh of their parent, and re-draw the mesh using this outline shader. - * Added example component `RenderExistingMesh` to render a mesh again with different materials, as required by the new `Skeleton-OutlineOnly` shaders. - In URP the outline has to be rendered via a separate GameObject as URP does not allow multiple render passes. To add an outline to your SkeletenRenderer: - 1) Add a child GameObject and move it a bit back (e.g. position Z = 0.01). - 2) Add a `RenderExistingMesh` component, provided in the `Spine Examples/Scripts/Sample Components` directory. - 3) Copy the original material, add *_Outline* to its name and set the shader to `Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly`. - 4) Assign this *_Outline* material at the `RenderExistingMesh` component under *Replacement Materials*. - * Added `Outline Shaders URP` example scene to URP extension module to demonstrate the above additions. - * Added support for Unity's [`SpriteAtlas`](https://docs.unity3d.com/Manual/class-SpriteAtlas.html) as atlas provider (as an alternative to `.atlas.txt` and `.png` files) alongside a skeleton data file. There is now an additional `Spine SpriteAtlas Import` tool window accessible via `Window - Spine - SpriteAtlas Import`. Additional information can be found in a new section on the [spine-unity documentation page](http://esotericsoftware.com/spine-unity#Advanced---Using-Unity-SpriteAtlas-as-Atlas-Provider). - * Added support for **multiple atlas textures at `SkeletonGraphic`**. You can enable this feature by enabling the parameter `Multiple CanvasRenders` in the `Advanced` section of the `SkeletonGraphic` Inspector. This automatically creates the required number of child `CanvasRenderer` GameObjects for each required draw call (submesh). - * Added support for **Render Separator Slots** at `SkeletonGraphic`. Render separation can be enabled directly in the `Advanced` section of the `SkeletonGraphic` Inspector, it does not require any additional components (like `SkeletonRenderSeparator` or `SkeletonPartsRenderer` for `SkeletonRenderer` components). When enabled, additional separator GameObjects will be created automatically for each separation part, and `CanvasRenderer` GameObjects re-parented to them accordingly. The separator GameObjects can be moved around and re-parented in the hierarchy according to your requirements to achieve the desired draw order within your `Canvas`. A usage example can be found in the updated `Spine Examples/Other Examples/SkeletonRenderSeparator` scene. - * Added `SkeletonGraphicCustomMaterials` component, providing functionality to override materials and textures of a `SkeletonGraphic`, similar to `SkeletonRendererCustomMaterials`. Note: overriding materials or textures per slot is not provided due to structural limitations. - * Added **Root Motion support** for `SkeletonAnimation`, `SkeletonMecanim` and `SkeletonGraphic` via new components `SkeletonRootMotion` and `SkeletonMecanimRootMotion`. The `SkeletonAnimation` and `SkeletonGraphic` component Inspector now provides a line `Root Motion` with `Add Component` and `Remove Component` buttons to add/remove the new `SkeletonRootMotion` component to your GameObject. The `SkeletonMecanim` Inspector detects whether root motion is enabled at the `Animator` component and adds a `SkeletonMecanimRootMotion` component automatically. - * `SkeletonMecanim` now provides an additional `Custom MixMode` parameter under `Mecanim Translator`. It is enabled by default in version 3.8 to maintain current behaviour, using the set `Mix Mode` for each Mecanim layer. When disabled, `SkeletonMecanim` will use the recommended `MixMode` according to the layer blend mode. Additional information can be found in the [Mecanim Translator section](http://esotericsoftware.com/spine-unity#Parameters-for-animation-blending-control) on the spine-unity documentation pages. - * Added **SkeletonGraphic Timeline support**. Added supprot for multi-track Timeline preview in the Editor outside of play mode (multi-track scrubbing). See the [Timeline-Extension-UPM-Package](http://esotericsoftware.com/spine-unity#Timeline-Extension-UPM-Package) section of the spine-unity documentation for more information. - * Added support for double-sided lighting at all `SkeletonLit` shaders (including URP and LWRP packages). - * Added frustum culling update mode parameters `Update When Invisible` (Inspector parameter) and `UpdateMode` (available via code) to all Skeleton components. This provides a simple way to disable certain updates when the `Renderer` is no longer visible (outside all cameras, culled in frustum culling). The new `UpdateMode` property allows disabling updates at a finer granularity level than disabling the whole component. Available modes are: `Nothing`, `OnlyAnimationStatus`, `EverythingExceptMesh` and `FullUpdate`. - * Added a new `Spine/Outline/OutlineOnly-ZWrite` shader to provide correct outline-only rendering. Note: the shader requires two render passes and is therefore not compatible with URP. The `Spine Examples/Other Examples/Outline Shaders` example scene has been updated to demonstrate the new shader. - * Added `OnMeshAndMaterialsUpdated` callback event to `SkeletonRenderSeparator` and `SkeletonPartsRenderer`. It is issued at the end of `LateUpdate`, before rendering. - * Added `Root Motion Scale X/Y` parameters to `SkeletonRootMotionBase` subclasses (`SkeletonRootMotion` and `SkeletonMecanimRootMotion`). Also providing `AdjustRootMotionToDistance()` and other methods to allow for easy delta compensation. Delta compensation can be used to e.g. stretch a jump to a given distance. Root motion can be adjusted at the start of an animation or every frame via `skeletonRootMotion.AdjustRootMotionToDistance(targetPosition - transform.position, trackIndex);`. - * Now providing a `Canvas Group Tint Black` parameter at the `SkeletonGraphic` Inspector in the `Advanced` section. When using the `Spine/SkeletonGraphic Tint Black` shader you can enable this parameter to receive proper blending results when using `Additive` blend mode under a `CanvasGroup`. Be sure to also have the parameter `CanvasGroup Compatible` enabled at the shader. Note that the normal `Spine/SkeletonGraphic` does not support `Additive` blend mode at a `CanvasGroup`, as it requires additional shader channels to work. - * Added `Mix and Match Skins` example scene to demonstrate how the 3.8 Skin API and combining skins can be used for a wardrobe and equipment use case. - * Spine Timeline Extensions: Added `Hold Previous` parameter at `SpineAnimationStateClip`. - * Added more warning messages at incompatible SkeletonRenderer/SkeletonGraphic Component vs Material settings. They appear both as an info box in the Inspector as well as upon initialization in the Console log window. The Inspector box warnings can be disabled via `Edit - Preferences - Spine`. - * Now providing `BeforeApply` update callbacks at all skeleton animation components (`SkeletonAnimation`, `SkeletonMecanim` and `SkeletonGraphic`). - * Added `BoundingBoxFollowerGraphic` component. This class is a counterpart of `BoundingBoxFollower` that can be used with `SkeletonGraphic`. - * Added Inspector context menu functions `SkeletonRenderer - Add all BoundingBoxFollower GameObjects` and `SkeletonGraphic - Add all BoundingBoxFollowerGraphic GameObjects` that automatically generate bounding box follower GameObjects for every `BoundingBoxAttachment` for all skins of a skeleton. - * `GetRemappedClone()` now provides an additional parameter `pivotShiftsMeshUVCoords` for `MeshAttachment` to prevent uv shifts at a non-central Sprite pivot. This parameter defaults to `true` to maintain previous behaviour. - * `SkeletonRenderer` components now provide an additional update mode `Only Event Timelines` at the `Update When Invisible` property. This mode saves additional timeline updates compared to update mode `Everything Except Mesh`. - * Now all URP (Universal Render Pipeline) and LWRP (Lightweight Render Pipeline) shaders support SRP (Scriptable Render Pipeline) batching. See [Unity SRPBatcher documentation pages](https://docs.unity3d.com/Manual/SRPBatcher.html) for additional information. - * Sprite shaders now provide four `Diffuse Ramp` modes as an Inspector Material parameter: `Hard`, `Soft`, `Old Hard` and `Old Soft`. In spine-unity 3.8 it defaults to `Old Hard` to keep the behaviour of existing projects unchanged. Note that `Old Hard` and `Old Soft` ramp versions were using only the right half of the ramp texture, and additionally multiplying the light intensity by 2, both leading to brighter lighting than without a ramp texture active. The new ramp modes `Hard` and `Soft` use the full ramp texture and do not modify light intensity, being consistent with lighting without a ramp texture active. - * Added **native support for slot blend modes** `Additive`, `Multiply` and `Screen` with automatic assignment at newly imported skeleton assets. `BlendModeMaterialAssets` are now obsolete and replaced by the native properties at `SkeletonDataAsset`. The `SkeletonDataAsset` Inspector provides a new `Blend Modes - Upgrade` button to upgrade an obsolete `BlendModeMaterialAsset` to the native blend modes properties. This upgrade will be performed automatically on imported and re-imported assets in Unity 2020.1 and newer to prevent reported `BlendModeMaterialAsset` issues in these Unity versions. spine-unity 4.0 and newer will automatically perform this upgrade regardless of the Unity version. - * `BoneFollower` and `BoneFollowerGraphic` components now provide better support for following bones when the skeleton's Transform is not the parent of the follower's Transform. Previously e.g. rotating a common parent Transform did not lead to the desired result, as well as negatively scaling a skeleton's Transform when it is not a parent of the follower's Transform. - * URP and LWRP `Sprite` and `SkeletonLit` shaders no longer require `Advanced - Add Normals` enabled to properly cast and receive shadows. It is recommended to disable `Add Normals` if normals are otherwise not needed. - * Added an example component `RootMotionDeltaCompensation` located in `Spine Examples/Scripts/Sample Components` which can be used for applying simple delta compensation. You can enable and disable the component to toggle delta compensation of the currently playing animation on and off. - * Root motion delta compensation now allows to only adjust X or Y components instead of both. Adds two parameters to `SkeletonRootMotionBase.AdjustRootMotionToDistance()` which default to adjusting both X and Y as before. The `RootMotionDeltaCompensation` example component exposes these parameters as public attributes. - * Root motion delta compensation now allows to also add translation root motion to e.g. adjust a horizontal jump upwards or downwards over time. This is necessary because a Y root motion of zero cannot be scaled to become non-zero. - * `Attachment.GetRemappedClone(Sprite)` method now provides an additional optional parameter `useOriginalRegionScale`. When set to `true`, the replaced attachment's scale is used instead of the Sprite's `Pixel per Unity` setting, allowing for more consistent scaling. *Note:* When remapping Sprites, be sure to set the Sprite's `Mesh Type` to `Full Rect` and not `Tight`, otherwise the scale will be wrong. - -* **Changes of default values** - * `SkeletonMecanim`'s `Layer Mix Mode` now defaults to `MixMode.MixNext` instead of `MixMode.MixAlways`. - * `BlendModeMaterialAsset` and it's instance `Default BlendModeMaterials.asset` now have `Apply Additive Material` set to `true` by default in order to apply all blend modes by default. - -* **Deprecated** - * Deprecated `Modules/SlotBlendModes/SlotBlendModes` component. Changed namespace from `Spine.Unity.Modules` to `Spine.Unity.Deprecated`. Moved to `Deprecated/SlotBlendModes`. - -* **Restructuring (Non-Breaking)** - - Note: The following changes will most likely not affect users of the Spine-Unity runtime as the API remains unchanged and no references are invalidated. - * Removed duplicates of `.cginc` files in `Modules/Shaders/Sprite` that were also present in the `Modules/Shaders/Sprite/CGIncludes` directory. - * Moved shaders from `Modules/Shaders` to `Shaders` directory. - * Moved shaders from `Modules/SkeletonGraphic/Shaders` to `Shaders/SkeletonGraphic`. - * Renamed shader `Shaders/Spine-SkeletonLit.shader` to `Shaders/Spine-Skeleton-Lit.shader`. - * Moved components from `SkeletonGraphic` to `Components` and `Components/Following` except for `SkeletonGraphicMirror` which was moved to `Spine Examples/Scripts/Sample Components`. - * Moved `BoneFollower`, `BoneFollowerGraphic` and `PointFollower` from `Components` directory to `Components/Following`. - * Moved `BoundingBoxFollower` component from `Modules/BoundingBoxFollower` to `Components/Following`. - * Moved `Modules/SkeletonRenderSeparator` directory to `Components/SkeletonRenderSeparator`. - * Moved `Modules/CustomMaterials` directory to `Components/SkeletonRendererCustomMaterials`. - * Moved `Asset Types/BlendModeMaterialsAsset.cs` class, `Shaders/BlendModes/Default BlendModeMaterials.asset` and materials from `Shaders/BlendModes` to `SkeletonDataModifierAssets/BlendModeMaterials` directory. - * Moved `Modules/Ghost` directory to `Spine Examples/Scripts/Sample Components/Ghost`. - * Moved `Modules/SkeletonUtility Modules` directory to `Spine Examples/Scripts/Sample Components/SkeletonUtility Modules`. - * Moved `Modules/AnimationMatchModifier` directory to `Spine Examples/Scripts/MecanimAnimationMatchModifier`. - * Moved `SkeletonRagdoll` and `SkeletonRagdoll2D` components from `Modules/Ragdoll` directory to `Spine Examples/Scripts/Sample Components/SkeletonUtility Modules`. - * Moved `AttachmentTools.cs` to `Utility` directory. - * Split the file `AttachmentTools` into 5 separate files for each contained class. No namespace or other API changes performed. - * Split the file `Mesh Generation/SpineMesh` into 4 separate files for each contained class. No namespace or other API changes performed. - * Moved `SkeletonExtensions.cs` to `Utility` directory. - * Moved `Modules/YieldInstructions` directory to `Utility/YieldInstructions`. - * Moved corresponding editor scripts of the above components to restructured directories as well. - * Renamed inspector editor class `PointFollowerEditor` to `PointFollowerInspector` for consistency reasons. - -### XNA/MonoGame -* Updated to latest MonoGame version 3.7.1 -* Rewrote example project to be cleaner and better demonstrate basic Spine features. -* Added mix-and-match example to demonstrate the new Skin API. -* Added normalmap support via `SpineEffectNormalmap` and support for loading multiple texture layers following a suffix-pattern. Please see the example code on how to use them. - -## Java -* **Breaking changes** - * Renamed `Slot#getAttachmentVertices()` to `Slot#getDeform()`. - * Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports. - * Renamed `Skin#addAttachment()` to `Skin#setAttachment()`. - * Removed `VertexAttachment#applyDeform()` and replaced it with `VertexAttachment#deformAttachment`. The attachment set on this field is used to decide if a `DeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied. - * Removed `inheritDeform` field, getter, and setter from `MeshAttachment`. - * Changed `.skel` binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably. - * `JsonRollback` tool now converts from 3.8 JSON to 3.7. - * Changed the `.json` and `.skel` file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes. - -* **Additions** - * Added `x` and `y` coordinates for setup pose AABB in `SkeletonData`. - * Added support for rotated mesh region UVs. - * Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them. - * Improved Skin API to make it easier to handle mix-and-match use cases. - * Added `Skin#getAttachments()`. Returns all attachments in the skin. - * Added `Skin#getAttachments(int slotIndex)`. Returns all attachements in the skin for the given slot index. - * Added `Skin#addSkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. - * Added `Skin#copySkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `VertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied. - * Added `Attachment#copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices. - * Added `MeshAttachment#newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh. - * Added IK softness. - -### libGDX -* `SkeletonViewer` can load a skeleton by specifying it as the first argument on the command line. -* Added mix-and-match example to demonstrate the new Skin API. - -## Lua -* **Breaking changes** - * Renamed `Slot:getAttachmentVertices()` to `Slot#deform`. - * Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports. - * Renamed `Skin:addAttachment()` to `Skin#setAttachment()`. - * Removed `VertexAttachment:applyDeform()` and replaced it with `VertexAttachment#deformAttachment`. The attachment set on this field is used to decide if a `DeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied. - * Removed `inheritDeform` field, getter, and setter from `MeshAttachment`. - * Changed the `.json` file format to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes. - -* **Additions** - * Added `x` and `y` coordinates for setup pose AABB in `SkeletonData`. - * Added support for rotated mesh region UVs. - * Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them. - * Improved Skin API to make it easier to handle mix-and-match use cases. - * Added `Skin:getAttachments()`. Returns all attachments in the skin. - * Added `Skin:getAttachments(slotIndex)`. Returns all attachements in the skin for the given slot index. - * Added `Skin:addSkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. - * Added `Skin:copySkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `VertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied. - * Added `Attachment:copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices. - * Added `MeshAttachment:newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh. - * Added IK softness. - -### Love2D -* Added support for 0-1 RGBA color component range change in Löve 0.11+. Older Löve versions using the 0-255 range are still supported! -* Added mix-and-match example to demonstrate the new Skin API. - -### Corona -* Added mix-and-match example to demonstrate the new Skin API. - -## Typescript/Javascript -* **Breaking changes** - * Renamed `MixDirection.in/out` to `MixDirection.mixIn/mixOut` as it was crashing a JS compressor. - * Renamed `Slot#getAttachmentVertices()` to `Slot#getDeform()`. - * Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports. - * Renamed `Skin#addAttachment()` to `Skin#setAttachment()`. - * Removed `VertexAttachment#applyDeform()` and replaced it with `VertexAttachment#deformAttachment`. The attachment set on this field is used to decide if a `DeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied. - * Removed `inheritDeform` field, getter, and setter from `MeshAttachment`. - * Changed `.skel` binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably. - * Changed the `.json` and `.skel` file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes. - * Updated runtime to be compatible with TypeScript 3.6.3. - -* **Additions** - * Added support for loading binary data via `AssetManager#loadBinary()`. `AssetManager#get()` will return a `Uint8Array` for such assets. - * Added support for loading binaries via new `SkeletonBinary`. Parses a `Uint8Array`. - * Added `x` and `y` coordinates for setup pose AABB in `SkeletonData`. - * Added support for rotated mesh region UVs. - * Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them. - * Improved Skin API to make it easier to handle mix-and-match use cases. - * Added `Skin#getAttachments()`. Returns all attachments in the skin. - * Added `Skin#getAttachments(slotIndex: number)`. Returns all attachements in the skin for the given slot index. - * Added `Skin#addSkin(skin: Skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. - * Added `Skin#copySkin(skin: Skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `VertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied. - * Added `Attachment#copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices. - * Added `MeshAttachment#newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh. - * Added IK softness. - * Added `AssetManager.setRawDataURI(path, data)`. Allows to embed data URIs for skeletons, atlases and atlas page images directly in the HTML/JS without needing to load it from a separate file. - -### WebGL backend -* `Input` can now take a partially defined implementation of `InputListener`. -* Added mix-and-match example to demonstrate the new Skin API. - -### Canvas backend - -### Three.js backend -* `SkeletonMesh` now takes an optional `SkeletonMeshMaterialParametersCustomizer` function that allows you to modify the `ShaderMaterialParameters` before the material is finalized. Use it to modify things like THREEJS' `Material.depthTest` etc. See #1590. - -### Player -* `SpinePlayer#setAnimation()` can now be called directly to set the animation being displayed. -* The player supports loading `.skel` binary skeleton files by setting the `SpinePlayerConfig#skelUrl` field instead of `SpinePlayerConfig#jsonUrl`. -* Added `SpinePlayerConfig#rawDataURIs`. Allows to embed data URIs for skeletons, atlases and atlas page images directly in the HTML/JS without needing to load it from a separate file. See the example for a demonstration. - # 3.7 ## AS3 * **Breaking changes** * The completion event will fire for looped 0 duration animations every frame. * `MixPose` is now called `MixBlend` - * Skeleton `flipX/flipY` has been replaced with `scaleX/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance + * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance * Mix time is no longer affected by `TrackEntry#timeScale`. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194 * **Additions** * Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry#setMixBlend(MixBlend.add)` on each track. To specify the blend percentage, set `TrackEntry#alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion. @@ -430,7 +31,7 @@ * Listeners on `spAnimationState` and `spTrackEntry` will now also be called if a track entry gets disposed as part of disposing an animation state. * The completion event will fire for looped 0 duration animations every frame. * The spine-cocos2dx and spine-ue4 runtimes are now based on spine-cpp. See below for changes. - * Skeleton `flipX/flipY` has been replaced with `scaleX/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance + * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance * Mix time is no longer affected by `TrackEntry#timeScale`. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194 * `spMeshAttachment` has two new fields `regionTextureWith` and `regionTextureHeight`. These must be set in custom attachment loader. See `AtlasAttachmentLoader`. * **Additions** @@ -504,7 +105,7 @@ ## C# ## * **Breaking changes** * The completion event will fire for looped 0 duration animations every frame. - * Skeleton `flipX/flipY` has been replaced with `scaleX/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance + * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance * Mix time is no longer affected by `TrackEntry#timeScale`. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194 * **Additions** * Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry#MixBlend = MixBlend.add` on each track. To specify the blend percentage, set `TrackEntry#Alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion. @@ -575,7 +176,7 @@ This will automatically: * Skeleton attachments: Moved update of attached skeleton out of libGDX `SkeletonRenderer`, added overloaded method `Skeleton#updateWorldTransform(Bone)`, used for `SkeletonAttachment`. You now MUST call this new method with the bone of the parent skeleton to which the child skeleton is attached. See `SkeletonAttachmentTest` for and example. * The completion event will fire for looped 0 duration animations every frame. * `MixPose` is now called `MixBlend`. - * Skeleton `flipX/flipY` has been replaced with `scaleX/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance + * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance * Mix time is no longer affected by `TrackEntry#timeScale`. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194 * **Additions** * Added `EventData#audioPath` field. This field contains the file name of the audio file used for the event. @@ -596,7 +197,7 @@ This will automatically: ## Lua * **Breaking changes** * The completion event will fire for looped 0 duration animations every frame. - * Skeleton `flipX/flipY` has been replaced with `scaleX/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance + * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance * Mix time is no longer affected by `TrackEntry#timeScale`. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194 * **Additions** * Added `JitterEffect` and `SwirlEffect` and support for vertex effects in Corona and Love @@ -614,7 +215,7 @@ This will automatically: ## Typescript/Javascript * **Breaking changes** * The completion event will fire for looped 0 duration animations every frame. - * Skeleton `flipX/flipY` has been replaced with `scaleX/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance + * Skeleton `flipX/flipY` has been replaced with `scaleY/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance * Mix time is no longer affected by `TrackEntry#timeScale`. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194 * **Additions** * Added `AssetManager.loadTextureAtlas`. Instead of loading the `.atlas` and corresponding image files manually, you can simply specify the location of the `.atlas` file and AssetManager will load the atlas and all its images automatically. `AssetManager.get("atlasname.atlas")` will then return an instance of `spine.TextureAtlas`. @@ -623,7 +224,6 @@ This will automatically: * Support for stretchy IK * Support for audio events, see `audioPath`, `volume` and `balance` fields on event (data). * `TrackEntry` has an additional field called `holdPrevious`. It can be used to counter act a limitation of `AnimationState` resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this [forum thread](http://esotericsoftware.com/forum/Probably-Easy-Animation-mixing-with-multiple-tracks-10682?p=48130&hilit=holdprevious#p48130). - * Added `AssetManager#setRawDataURI(path, data)`. Allows to set raw data URIs for a specific path, which in turn enables embedding assets into JavaScript/HTML. ### WebGL backend * Added `VertexEffect` interface, instances of which can be set on `SkeletonRenderer`. Allows to modify vertices before submitting them to GPU. See `SwirlEffect`, `JitterEffect`, and the example which allows to set effects. diff --git a/Assets/Spine/CHANGELOG.md.meta b/Assets/Spine/CHANGELOG.md.meta index 6a917533f..003fbfc72 100644 --- a/Assets/Spine/CHANGELOG.md.meta +++ b/Assets/Spine/CHANGELOG.md.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 3a206f1c4d5fd9e49a16634698666cfe -timeCreated: 1636570215 +guid: 83bddfd68c7abf74e8db4deaa82e3024 +timeCreated: 1565024968 licenseType: Free DefaultImporter: userData: diff --git a/Assets/Spine/Editor/spine-unity-editor.asmdef b/Assets/Spine/Editor/spine-unity-editor.txt similarity index 100% rename from Assets/Spine/Editor/spine-unity-editor.asmdef rename to Assets/Spine/Editor/spine-unity-editor.txt diff --git a/Assets/Spine/Editor/spine-unity-editor.asmdef.meta b/Assets/Spine/Editor/spine-unity-editor.txt.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity-editor.asmdef.meta rename to Assets/Spine/Editor/spine-unity-editor.txt.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/AnimationReferenceAssetEditor.cs b/Assets/Spine/Editor/spine-unity/Editor/AnimationReferenceAssetEditor.cs similarity index 81% rename from Assets/Spine/Editor/spine-unity/Editor/Asset Types/AnimationReferenceAssetEditor.cs rename to Assets/Spine/Editor/spine-unity/Editor/AnimationReferenceAssetEditor.cs index 3c4c149f0..0a346fcc4 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/AnimationReferenceAssetEditor.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/AnimationReferenceAssetEditor.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System.Collections; @@ -33,7 +33,6 @@ using UnityEngine; using UnityEditor; using System.Reflection; -using System; namespace Spine.Unity.Editor { using Editor = UnityEditor.Editor; @@ -59,11 +58,7 @@ namespace Spine.Unity.Editor { SkeletonData lastSkeletonData; void OnEnable () { HandleOnEnablePreview(); } - void OnDestroy () { - HandleOnDestroyPreview(); - AppDomain.CurrentDomain.DomainUnload -= OnDomainUnload; - EditorApplication.update -= preview.HandleEditorUpdate; - } + void OnDestroy () { HandleOnDestroyPreview(); } public override void OnInspectorGUI () { animationNameProperty = animationNameProperty ?? serializedObject.FindProperty("animationName"); @@ -75,12 +70,12 @@ namespace Spine.Unity.Editor { if (skeletonData != null) { animation = skeletonData.FindAnimation(animationName); } - } + } bool animationNotFound = (animation == null); if (changeNextFrame) { changeNextFrame = false; - + if (ThisSkeletonDataAsset != lastSkeletonDataAsset || ThisSkeletonDataAsset.GetSkeletonData(true) != lastSkeletonData) { preview.Clear(); preview.Initialize(Repaint, ThisSkeletonDataAsset, LastSkinName); @@ -118,7 +113,7 @@ namespace Spine.Unity.Editor { EditorGUILayout.HelpBox(string.Format("Animation named {0} was not found for this Skeleton.", animationNameProperty.stringValue), MessageType.Warning); } else { using (new SpineInspectorUtility.BoxScope()) { - if (!string.Equals(AssetUtility.GetPathSafeName(animationName), ThisAnimationReferenceAsset.name, System.StringComparison.OrdinalIgnoreCase)) + if (!string.Equals(SpineEditorUtilities.AssetUtility.GetPathSafeName(animationName), ThisAnimationReferenceAsset.name, System.StringComparison.OrdinalIgnoreCase)) EditorGUILayout.HelpBox("Animation name value does not match this asset's name. Inspectors using this asset may be misleading.", MessageType.None); EditorGUILayout.LabelField(SpineInspectorUtility.TempContent(animationName, SpineEditorUtilities.Icons.animation)); @@ -138,11 +133,6 @@ namespace Spine.Unity.Editor { void HandleOnEnablePreview () { if (ThisSkeletonDataAsset != null && ThisSkeletonDataAsset.skeletonJSON == null) return; - SpineEditorUtilities.ConfirmInitialization(); - - // This handles the case where the managed editor assembly is unloaded before recompilation when code changes. - AppDomain.CurrentDomain.DomainUnload -= OnDomainUnload; - AppDomain.CurrentDomain.DomainUnload += OnDomainUnload; preview.Initialize(this.Repaint, ThisSkeletonDataAsset, LastSkinName); preview.PlayPauseAnimation(ThisAnimationName, true); @@ -152,10 +142,6 @@ namespace Spine.Unity.Editor { EditorApplication.update += preview.HandleEditorUpdate; } - private void OnDomainUnload (object sender, EventArgs e) { - OnDestroy(); - } - private void HandleOnSkinChanged (string skinName) { EditorPrefs.SetString(LastSkinKey, skinName); preview.PlayPauseAnimation(ThisAnimationName, true); diff --git a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/AnimationReferenceAssetEditor.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/AnimationReferenceAssetEditor.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Asset Types/AnimationReferenceAssetEditor.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/AnimationReferenceAssetEditor.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineSpriteAtlasAssetInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineSpriteAtlasAssetInspector.cs deleted file mode 100644 index 6820b56e9..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineSpriteAtlasAssetInspector.cs +++ /dev/null @@ -1,153 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using System; -using System.Collections.Generic; -using System.Reflection; -using UnityEditor; -using UnityEngine; -using Spine; - -namespace Spine.Unity.Editor { - using Event = UnityEngine.Event; - - [CustomEditor(typeof(SpineSpriteAtlasAsset)), CanEditMultipleObjects] - public class SpineSpriteAtlasAssetInspector : UnityEditor.Editor { - SerializedProperty atlasFile, materials; - SpineSpriteAtlasAsset atlasAsset; - - static List GetRegions (Atlas atlas) { - FieldInfo regionsField = SpineInspectorUtility.GetNonPublicField(typeof(Atlas), "regions"); - return (List)regionsField.GetValue(atlas); - } - - void OnEnable () { - SpineEditorUtilities.ConfirmInitialization(); - atlasFile = serializedObject.FindProperty("spriteAtlasFile"); - materials = serializedObject.FindProperty("materials"); - materials.isExpanded = true; - atlasAsset = (SpineSpriteAtlasAsset)target; - - if (!SpineSpriteAtlasAsset.AnySpriteAtlasNeedsRegionsLoaded()) - return; - EditorApplication.update -= SpineSpriteAtlasAsset.UpdateWhenEditorPlayModeStarted; - EditorApplication.update += SpineSpriteAtlasAsset.UpdateWhenEditorPlayModeStarted; - } - - void OnDisable () { - EditorApplication.update -= SpineSpriteAtlasAsset.UpdateWhenEditorPlayModeStarted; - } - - override public void OnInspectorGUI () { - if (serializedObject.isEditingMultipleObjects) { - DrawDefaultInspector(); - return; - } - - serializedObject.Update(); - atlasAsset = (atlasAsset == null) ? (SpineSpriteAtlasAsset)target : atlasAsset; - - if (atlasAsset.RegionsNeedLoading) { - if (GUILayout.Button(SpineInspectorUtility.TempContent("Load regions by entering Play mode"), GUILayout.Height(20))) { - EditorApplication.isPlaying = true; - } - } - - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(atlasFile); - EditorGUILayout.PropertyField(materials, true); - if (EditorGUI.EndChangeCheck()) { - serializedObject.ApplyModifiedProperties(); - atlasAsset.Clear(); - atlasAsset.GetAtlas(); - atlasAsset.updateRegionsInPlayMode = true; - } - - if (materials.arraySize == 0) { - EditorGUILayout.HelpBox("No materials", MessageType.Error); - return; - } - - for (int i = 0; i < materials.arraySize; i++) { - SerializedProperty prop = materials.GetArrayElementAtIndex(i); - var material = (Material)prop.objectReferenceValue; - if (material == null) { - EditorGUILayout.HelpBox("Materials cannot be null.", MessageType.Error); - return; - } - } - - if (atlasFile.objectReferenceValue != null) { - int baseIndent = EditorGUI.indentLevel; - - var regions = SpineSpriteAtlasAssetInspector.GetRegions(atlasAsset.GetAtlas()); - int regionsCount = regions.Count; - using (new EditorGUILayout.HorizontalScope()) { - EditorGUILayout.LabelField("Atlas Regions", EditorStyles.boldLabel); - EditorGUILayout.LabelField(string.Format("{0} regions total", regionsCount)); - } - AtlasPage lastPage = null; - for (int i = 0; i < regionsCount; i++) { - if (lastPage != regions[i].page) { - if (lastPage != null) { - EditorGUILayout.Separator(); - EditorGUILayout.Separator(); - } - lastPage = regions[i].page; - Material mat = ((Material)lastPage.rendererObject); - if (mat != null) { - EditorGUI.indentLevel = baseIndent; - using (new GUILayout.HorizontalScope()) - using (new EditorGUI.DisabledGroupScope(true)) - EditorGUILayout.ObjectField(mat, typeof(Material), false, GUILayout.Width(250)); - EditorGUI.indentLevel = baseIndent + 1; - } else { - EditorGUILayout.HelpBox("Page missing material!", MessageType.Warning); - } - } - - string regionName = regions[i].name; - Texture2D icon = SpineEditorUtilities.Icons.image; - if (regionName.EndsWith(" ")) { - regionName = string.Format("'{0}'", regions[i].name); - icon = SpineEditorUtilities.Icons.warning; - EditorGUILayout.LabelField(SpineInspectorUtility.TempContent(regionName, icon, "Region name ends with whitespace. This may cause errors. Please check your source image filenames.")); - } else { - EditorGUILayout.LabelField(SpineInspectorUtility.TempContent(regionName, icon)); - } - } - EditorGUI.indentLevel = baseIndent; - } - - if (serializedObject.ApplyModifiedProperties() || SpineInspectorUtility.UndoRedoPerformed(Event.current)) - atlasAsset.Clear(); - } - } - -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetDatabaseAvailabilityDetector.cs b/Assets/Spine/Editor/spine-unity/Editor/AssetDatabaseAvailabilityDetector.cs similarity index 62% rename from Assets/Spine/Editor/spine-unity/Editor/Utility/AssetDatabaseAvailabilityDetector.cs rename to Assets/Spine/Editor/spine-unity/Editor/AssetDatabaseAvailabilityDetector.cs index 8c464a831..64851c09d 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetDatabaseAvailabilityDetector.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/AssetDatabaseAvailabilityDetector.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEngine; diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetDatabaseAvailabilityDetector.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/AssetDatabaseAvailabilityDetector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Utility/AssetDatabaseAvailabilityDetector.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/AssetDatabaseAvailabilityDetector.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/BoneFollowerInspector.cs similarity index 82% rename from Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerInspector.cs rename to Assets/Spine/Editor/spine-unity/Editor/BoneFollowerInspector.cs index 17cc73978..58fa5176d 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerInspector.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/BoneFollowerInspector.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEditor; @@ -37,8 +37,7 @@ namespace Spine.Unity.Editor { [CustomEditor(typeof(BoneFollower)), CanEditMultipleObjects] public class BoneFollowerInspector : Editor { - SerializedProperty boneName, skeletonRenderer, followXYPosition, followZPosition, followBoneRotation, - followLocalScale, followSkeletonFlip, maintainedAxisOrientation; + SerializedProperty boneName, skeletonRenderer, followZPosition, followBoneRotation, followLocalScale, followSkeletonFlip; BoneFollower targetBoneFollower; bool needsReset; @@ -46,7 +45,7 @@ namespace Spine.Unity.Editor { [MenuItem ("CONTEXT/SkeletonRenderer/Add BoneFollower GameObject")] static void AddBoneFollowerGameObject (MenuCommand cmd) { var skeletonRenderer = cmd.context as SkeletonRenderer; - var go = EditorInstantiation.NewGameObject("New BoneFollower", true); + var go = SpineEditorUtilities.EditorInstantiation.NewGameObject("New BoneFollower"); var t = go.transform; t.SetParent(skeletonRenderer.transform); t.localPosition = Vector3.zero; @@ -83,11 +82,9 @@ namespace Spine.Unity.Editor { skeletonRenderer = serializedObject.FindProperty("skeletonRenderer"); boneName = serializedObject.FindProperty("boneName"); followBoneRotation = serializedObject.FindProperty("followBoneRotation"); - followXYPosition = serializedObject.FindProperty("followXYPosition"); followZPosition = serializedObject.FindProperty("followZPosition"); followLocalScale = serializedObject.FindProperty("followLocalScale"); followSkeletonFlip = serializedObject.FindProperty("followSkeletonFlip"); - maintainedAxisOrientation = serializedObject.FindProperty("maintainedAxisOrientation"); targetBoneFollower = (BoneFollower)target; if (targetBoneFollower.SkeletonRenderer != null) @@ -175,21 +172,15 @@ namespace Spine.Unity.Editor { needsReset |= EditorGUI.EndChangeCheck(); EditorGUILayout.PropertyField(followBoneRotation); - EditorGUILayout.PropertyField(followXYPosition); EditorGUILayout.PropertyField(followZPosition); EditorGUILayout.PropertyField(followLocalScale); EditorGUILayout.PropertyField(followSkeletonFlip); - if ((followSkeletonFlip.hasMultipleDifferentValues || followSkeletonFlip.boolValue == false) && - (followBoneRotation.hasMultipleDifferentValues || followBoneRotation.boolValue == true)) { - using (new SpineInspectorUtility.IndentScope()) - EditorGUILayout.PropertyField(maintainedAxisOrientation); - } BoneFollowerInspector.RecommendRigidbodyButton(targetBoneFollower); } else { var boneFollowerSkeletonRenderer = targetBoneFollower.skeletonRenderer; if (boneFollowerSkeletonRenderer == null) { - EditorGUILayout.HelpBox("SkeletonRenderer is unassigned. Please assign a SkeletonRenderer (SkeletonAnimation or SkeletonMecanim).", MessageType.Warning); + EditorGUILayout.HelpBox("SkeletonRenderer is unassigned. Please assign a SkeletonRenderer (SkeletonAnimation or SkeletonAnimator).", MessageType.Warning); } else { boneFollowerSkeletonRenderer.Initialize(false); diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/BoneFollowerInspector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/BoneFollowerInspector.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerGraphicInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerGraphicInspector.cs deleted file mode 100644 index 2c2585d8e..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerGraphicInspector.cs +++ /dev/null @@ -1,261 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER -#define NEW_PREFAB_SYSTEM -#endif - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; - -namespace Spine.Unity.Editor { - using Event = UnityEngine.Event; - using Icons = SpineEditorUtilities.Icons; - - [CustomEditor(typeof(BoundingBoxFollowerGraphic))] - public class BoundingBoxFollowerGraphicInspector : UnityEditor.Editor { - SerializedProperty skeletonGraphic, slotName, isTrigger, clearStateOnDisable; - BoundingBoxFollowerGraphic follower; - bool rebuildRequired = false; - bool addBoneFollower = false; - bool sceneRepaintRequired = false; - bool debugIsExpanded; - - GUIContent addBoneFollowerLabel; - GUIContent AddBoneFollowerLabel { - get { - if (addBoneFollowerLabel == null) addBoneFollowerLabel = new GUIContent("Add Bone Follower", Icons.bone); - return addBoneFollowerLabel; - } - } - - void InitializeEditor () { - skeletonGraphic = serializedObject.FindProperty("skeletonGraphic"); - slotName = serializedObject.FindProperty("slotName"); - isTrigger = serializedObject.FindProperty("isTrigger"); - clearStateOnDisable = serializedObject.FindProperty("clearStateOnDisable"); - follower = (BoundingBoxFollowerGraphic)target; - } - - public override void OnInspectorGUI () { - - #if !NEW_PREFAB_SYSTEM - bool isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab); - #else - bool isInspectingPrefab = false; - #endif - - // Note: when calling InitializeEditor() in OnEnable, it throws exception - // "SerializedObjectNotCreatableException: Object at index 0 is null". - InitializeEditor(); - - // Try to auto-assign SkeletonGraphic field. - if (skeletonGraphic.objectReferenceValue == null) { - var foundSkeletonGraphic = follower.GetComponentInParent(); - if (foundSkeletonGraphic != null) - Debug.Log("BoundingBoxFollowerGraphic automatically assigned: " + foundSkeletonGraphic.gameObject.name); - else if (Event.current.type == EventType.Repaint) - Debug.Log("No Spine GameObject detected. Make sure to set this GameObject as a child of the Spine GameObject; or set BoundingBoxFollowerGraphic's 'Skeleton Graphic' field in the inspector."); - - skeletonGraphic.objectReferenceValue = foundSkeletonGraphic; - serializedObject.ApplyModifiedProperties(); - InitializeEditor(); - } - - var skeletonGraphicValue = skeletonGraphic.objectReferenceValue as SkeletonGraphic; - if (skeletonGraphicValue != null && skeletonGraphicValue.gameObject == follower.gameObject) { - using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox)) { - EditorGUILayout.HelpBox("It's ideal to add BoundingBoxFollowerGraphic to a separate child GameObject of the Spine GameObject.", MessageType.Warning); - - if (GUILayout.Button(new GUIContent("Move BoundingBoxFollowerGraphic to new GameObject", Icons.boundingBox), GUILayout.Height(30f))) { - AddBoundingBoxFollowerGraphicChild(skeletonGraphicValue, follower); - DestroyImmediate(follower); - return; - } - } - EditorGUILayout.Space(); - } - - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(skeletonGraphic); - EditorGUILayout.PropertyField(slotName, new GUIContent("Slot")); - if (EditorGUI.EndChangeCheck()) { - serializedObject.ApplyModifiedProperties(); - InitializeEditor(); - #if !NEW_PREFAB_SYSTEM - if (!isInspectingPrefab) - rebuildRequired = true; - #endif - } - - using (new SpineInspectorUtility.LabelWidthScope(150f)) { - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(isTrigger); - bool triggerChanged = EditorGUI.EndChangeCheck(); - - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(clearStateOnDisable, new GUIContent(clearStateOnDisable.displayName, "Enable this if you are pooling your Spine GameObject")); - bool clearStateChanged = EditorGUI.EndChangeCheck(); - - if (clearStateChanged || triggerChanged) { - serializedObject.ApplyModifiedProperties(); - InitializeEditor(); - if (triggerChanged) - foreach (var col in follower.colliderTable.Values) - col.isTrigger = isTrigger.boolValue; - } - } - - if (isInspectingPrefab) { - follower.colliderTable.Clear(); - follower.nameTable.Clear(); - EditorGUILayout.HelpBox("BoundingBoxAttachments cannot be previewed in prefabs.", MessageType.Info); - - // How do you prevent components from being saved into the prefab? No such HideFlag. DontSaveInEditor | DontSaveInBuild does not work. DestroyImmediate does not work. - var collider = follower.GetComponent(); - if (collider != null) Debug.LogWarning("Found BoundingBoxFollowerGraphic collider components in prefab. These are disposed and regenerated at runtime."); - - } else { - using (new SpineInspectorUtility.BoxScope()) { - if (debugIsExpanded = EditorGUILayout.Foldout(debugIsExpanded, "Debug Colliders")) { - EditorGUI.indentLevel++; - EditorGUILayout.LabelField(string.Format("Attachment Names ({0} PolygonCollider2D)", follower.colliderTable.Count)); - EditorGUI.BeginChangeCheck(); - foreach (var kp in follower.nameTable) { - string attachmentName = kp.Value; - var collider = follower.colliderTable[kp.Key]; - bool isPlaceholder = attachmentName != kp.Key.Name; - collider.enabled = EditorGUILayout.ToggleLeft(new GUIContent(!isPlaceholder ? attachmentName : string.Format("{0} [{1}]", attachmentName, kp.Key.Name), isPlaceholder ? Icons.skinPlaceholder : Icons.boundingBox), collider.enabled); - } - sceneRepaintRequired |= EditorGUI.EndChangeCheck(); - EditorGUI.indentLevel--; - } - } - - } - - if (follower.Slot == null) - follower.Initialize(false); - bool hasBoneFollower = follower.GetComponent() != null; - if (!hasBoneFollower) { - bool buttonDisabled = follower.Slot == null; - using (new EditorGUI.DisabledGroupScope(buttonDisabled)) { - addBoneFollower |= SpineInspectorUtility.LargeCenteredButton(AddBoneFollowerLabel, true); - EditorGUILayout.Space(); - } - } - - - if (Event.current.type == EventType.Repaint) { - if (addBoneFollower) { - var boneFollower = follower.gameObject.AddComponent(); - boneFollower.skeletonGraphic = skeletonGraphicValue; - boneFollower.SetBone(follower.Slot.Data.BoneData.Name); - addBoneFollower = false; - } - - if (sceneRepaintRequired) { - SceneView.RepaintAll(); - sceneRepaintRequired = false; - } - - if (rebuildRequired) { - follower.Initialize(); - rebuildRequired = false; - } - } - } - - #region Menus - [MenuItem("CONTEXT/SkeletonGraphic/Add BoundingBoxFollowerGraphic GameObject")] - static void AddBoundingBoxFollowerGraphicChild (MenuCommand command) { - var go = AddBoundingBoxFollowerGraphicChild((SkeletonGraphic)command.context); - Undo.RegisterCreatedObjectUndo(go, "Add BoundingBoxFollowerGraphic"); - } - - [MenuItem("CONTEXT/SkeletonGraphic/Add all BoundingBoxFollowerGraphic GameObjects")] - static void AddAllBoundingBoxFollowerGraphicChildren (MenuCommand command) { - var objects = AddAllBoundingBoxFollowerGraphicChildren((SkeletonGraphic)command.context); - foreach (var go in objects) - Undo.RegisterCreatedObjectUndo(go, "Add BoundingBoxFollowerGraphic"); - } - #endregion - - public static GameObject AddBoundingBoxFollowerGraphicChild (SkeletonGraphic skeletonGraphic, - BoundingBoxFollowerGraphic original = null, string name = "BoundingBoxFollowerGraphic", - string slotName = null) { - - var go = EditorInstantiation.NewGameObject(name, true); - go.transform.SetParent(skeletonGraphic.transform, false); - go.AddComponent(); - var newFollower = go.AddComponent(); - - if (original != null) { - newFollower.slotName = original.slotName; - newFollower.isTrigger = original.isTrigger; - newFollower.clearStateOnDisable = original.clearStateOnDisable; - } - if (slotName != null) - newFollower.slotName = slotName; - - newFollower.skeletonGraphic = skeletonGraphic; - newFollower.Initialize(); - - Selection.activeGameObject = go; - EditorGUIUtility.PingObject(go); - return go; - } - - public static List AddAllBoundingBoxFollowerGraphicChildren ( - SkeletonGraphic skeletonGraphic, BoundingBoxFollowerGraphic original = null) { - - List createdGameObjects = new List(); - foreach (var skin in skeletonGraphic.Skeleton.Data.Skins) { - var attachments = skin.Attachments; - foreach (var entry in attachments) { - var boundingBoxAttachment = entry.Value as BoundingBoxAttachment; - if (boundingBoxAttachment == null) - continue; - int slotIndex = entry.Key.SlotIndex; - var slot = skeletonGraphic.Skeleton.Slots.Items[slotIndex]; - string slotName = slot.Data.Name; - GameObject go = AddBoundingBoxFollowerGraphicChild(skeletonGraphic, - original, boundingBoxAttachment.Name, slotName); - var boneFollower = go.AddComponent(); - boneFollower.skeletonGraphic = skeletonGraphic; - boneFollower.SetBone(slot.Data.BoneData.Name); - createdGameObjects.Add(go); - } - } - return createdGameObjects; - } - } - -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicCustomMaterialsInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicCustomMaterialsInspector.cs deleted file mode 100644 index f9a1c2d78..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicCustomMaterialsInspector.cs +++ /dev/null @@ -1,159 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using UnityEditor; -using UnityEngine; -using Spine.Unity.Examples; - -namespace Spine.Unity.Editor { - - // This script is not intended for use with code. See spine-unity documentation page for additional information. - [CustomEditor(typeof(SkeletonGraphicCustomMaterials))] - public class SkeletonGraphicCustomMaterialsInspector : UnityEditor.Editor { - List componentCustomMaterialOverrides, _customMaterialOverridesPrev; - List componentCustomTextureOverrides, _customTextureOverridesPrev; - SkeletonGraphicCustomMaterials component; - - const BindingFlags PrivateInstance = BindingFlags.Instance | BindingFlags.NonPublic; - MethodInfo RemoveCustomMaterialOverrides, RemoveCustomTextureOverrides, SetCustomMaterialOverrides, SetCustomTextureOverrides; - - #region SkeletonGraphic context menu - [MenuItem("CONTEXT/SkeletonGraphic/Add Basic Serialized Custom Materials")] - static void AddSkeletonGraphicCustomMaterials (MenuCommand menuCommand) { - var skeletonGraphic = (SkeletonGraphic)menuCommand.context; - var newComponent = skeletonGraphic.gameObject.AddComponent(); - Undo.RegisterCreatedObjectUndo(newComponent, "Add Basic Serialized Custom Materials"); - } - - [MenuItem("CONTEXT/SkeletonGraphic/Add Basic Serialized Custom Materials", true)] - static bool AddSkeletonGraphicCustomMaterials_Validate (MenuCommand menuCommand) { - var skeletonGraphic = (SkeletonGraphic)menuCommand.context; - return (skeletonGraphic.GetComponent() == null); - } - #endregion - - void OnEnable () { - Type cm = typeof(SkeletonGraphicCustomMaterials); - RemoveCustomMaterialOverrides = cm.GetMethod("RemoveCustomMaterialOverrides", PrivateInstance); - RemoveCustomTextureOverrides = cm.GetMethod("RemoveCustomTextureOverrides", PrivateInstance); - SetCustomMaterialOverrides = cm.GetMethod("SetCustomMaterialOverrides", PrivateInstance); - SetCustomTextureOverrides = cm.GetMethod("SetCustomTextureOverrides", PrivateInstance); - } - - public override void OnInspectorGUI () { - component = (SkeletonGraphicCustomMaterials)target; - var skeletonGraphic = component.skeletonGraphic; - - // Draw the default inspector - DrawDefaultInspector(); - - if (serializedObject.isEditingMultipleObjects) - return; - - if (componentCustomMaterialOverrides == null) { - Type cm = typeof(SkeletonGraphicCustomMaterials); - componentCustomMaterialOverrides = cm.GetField("customMaterialOverrides", PrivateInstance).GetValue(component) as List; - componentCustomTextureOverrides = cm.GetField("customTextureOverrides", PrivateInstance).GetValue(component) as List; - if (componentCustomMaterialOverrides == null) { - Debug.Log("Reflection failed."); - return; - } - } - - // Fill with current values at start - if (_customMaterialOverridesPrev == null || _customTextureOverridesPrev == null) { - _customMaterialOverridesPrev = CopyList(componentCustomMaterialOverrides); - _customTextureOverridesPrev = CopyList(componentCustomTextureOverrides); - } - - // Compare new values with saved. If change is detected: - // store new values, restore old values, remove overrides, restore new values, restore overrides. - - // 1. Store new values - var customMaterialOverridesNew = CopyList(componentCustomMaterialOverrides); - var customTextureOverridesNew = CopyList(componentCustomTextureOverrides); - - // Detect changes - if (!_customMaterialOverridesPrev.SequenceEqual(customMaterialOverridesNew) || - !_customTextureOverridesPrev.SequenceEqual(customTextureOverridesNew)) { - // 2. Restore old values - componentCustomMaterialOverrides.Clear(); - componentCustomTextureOverrides.Clear(); - componentCustomMaterialOverrides.AddRange(_customMaterialOverridesPrev); - componentCustomTextureOverrides.AddRange(_customTextureOverridesPrev); - - // 3. Remove overrides - RemoveCustomMaterials(); - - // 4. Restore new values - componentCustomMaterialOverrides.Clear(); - componentCustomTextureOverrides.Clear(); - componentCustomMaterialOverrides.AddRange(customMaterialOverridesNew); - componentCustomTextureOverrides.AddRange(customTextureOverridesNew); - - // 5. Restore overrides - SetCustomMaterials(); - - if (skeletonGraphic != null) - skeletonGraphic.LateUpdate(); - } - - _customMaterialOverridesPrev = CopyList(componentCustomMaterialOverrides); - _customTextureOverridesPrev = CopyList(componentCustomTextureOverrides); - - if (SpineInspectorUtility.LargeCenteredButton(SpineInspectorUtility.TempContent("Clear and Reapply Changes", tooltip: "Removes all non-serialized overrides in the SkeletonGraphic and reapplies the overrides on this component."))) { - if (skeletonGraphic != null) { - skeletonGraphic.CustomMaterialOverride.Clear(); - skeletonGraphic.CustomTextureOverride.Clear(); - RemoveCustomMaterials(); - SetCustomMaterials(); - skeletonGraphic.LateUpdate(); - } - } - } - - void RemoveCustomMaterials () { - RemoveCustomMaterialOverrides.Invoke(component, null); - RemoveCustomTextureOverrides.Invoke(component, null); - } - - void SetCustomMaterials () { - SetCustomMaterialOverrides.Invoke(component, null); - SetCustomTextureOverrides.Invoke(component, null); - } - - static List CopyList (List list) { - return list.GetRange(0, list.Count); - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicInspector.cs deleted file mode 100644 index e1406ca27..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicInspector.cs +++ /dev/null @@ -1,436 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER -#define NEW_PREFAB_SYSTEM -#endif - -using UnityEngine; -using UnityEditor; - -namespace Spine.Unity.Editor { - using Icons = SpineEditorUtilities.Icons; - - [CustomEditor(typeof(SkeletonGraphic))] - [CanEditMultipleObjects] - public class SkeletonGraphicInspector : UnityEditor.Editor { - - const string SeparatorSlotNamesFieldName = "separatorSlotNames"; - const string ReloadButtonString = "Reload"; - protected GUIContent SkeletonDataAssetLabel; - static GUILayoutOption reloadButtonWidth; - static GUILayoutOption ReloadButtonWidth { get { return reloadButtonWidth = reloadButtonWidth ?? GUILayout.Width(GUI.skin.label.CalcSize(new GUIContent(ReloadButtonString)).x + 20); } } - static GUIStyle ReloadButtonStyle { get { return EditorStyles.miniButton; } } - - SerializedProperty material, color; - SerializedProperty skeletonDataAsset, initialSkinName; - SerializedProperty startingAnimation, startingLoop, timeScale, freeze, updateWhenInvisible, unscaledTime, tintBlack; - SerializedProperty initialFlipX, initialFlipY; - SerializedProperty meshGeneratorSettings; - SerializedProperty allowMultipleCanvasRenderers, separatorSlotNames, enableSeparatorSlots, updateSeparatorPartLocation; - SerializedProperty raycastTarget; - - SkeletonGraphic thisSkeletonGraphic; - protected bool isInspectingPrefab; - protected bool slotsReapplyRequired = false; - protected bool forceReloadQueued = false; - - protected bool TargetIsValid { - get { - if (serializedObject.isEditingMultipleObjects) { - foreach (var o in targets) { - var component = (SkeletonGraphic)o; - if (!component.IsValid) - return false; - } - return true; - } - else { - var component = (SkeletonGraphic)target; - return component.IsValid; - } - } - } - - void OnEnable () { -#if NEW_PREFAB_SYSTEM - isInspectingPrefab = false; -#else - isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab); -#endif - SpineEditorUtilities.ConfirmInitialization(); - - // Labels - SkeletonDataAssetLabel = new GUIContent("SkeletonData Asset", Icons.spine); - - var so = this.serializedObject; - thisSkeletonGraphic = target as SkeletonGraphic; - - // MaskableGraphic - material = so.FindProperty("m_Material"); - color = so.FindProperty("m_Color"); - raycastTarget = so.FindProperty("m_RaycastTarget"); - - // SkeletonRenderer - skeletonDataAsset = so.FindProperty("skeletonDataAsset"); - initialSkinName = so.FindProperty("initialSkinName"); - - initialFlipX = so.FindProperty("initialFlipX"); - initialFlipY = so.FindProperty("initialFlipY"); - - // SkeletonAnimation - startingAnimation = so.FindProperty("startingAnimation"); - startingLoop = so.FindProperty("startingLoop"); - timeScale = so.FindProperty("timeScale"); - unscaledTime = so.FindProperty("unscaledTime"); - freeze = so.FindProperty("freeze"); - updateWhenInvisible = so.FindProperty("updateWhenInvisible"); - - meshGeneratorSettings = so.FindProperty("meshGenerator").FindPropertyRelative("settings"); - meshGeneratorSettings.isExpanded = SkeletonRendererInspector.advancedFoldout; - - allowMultipleCanvasRenderers = so.FindProperty("allowMultipleCanvasRenderers"); - updateSeparatorPartLocation = so.FindProperty("updateSeparatorPartLocation"); - enableSeparatorSlots = so.FindProperty("enableSeparatorSlots"); - - separatorSlotNames = so.FindProperty("separatorSlotNames"); - separatorSlotNames.isExpanded = true; - } - - public override void OnInspectorGUI () { - - if (UnityEngine.Event.current.type == EventType.Layout) { - if (forceReloadQueued) { - forceReloadQueued = false; - foreach (var c in targets) { - SpineEditorUtilities.ReloadSkeletonDataAssetAndComponent(c as SkeletonGraphic); - } - } - else { - foreach (var c in targets) { - var component = c as SkeletonGraphic; - if (!component.IsValid) { - SpineEditorUtilities.ReinitializeComponent(component); - if (!component.IsValid) continue; - } - } - } - } - - bool wasChanged = false; - EditorGUI.BeginChangeCheck(); - - using (new EditorGUILayout.HorizontalScope(EditorStyles.helpBox)) { - SpineInspectorUtility.PropertyFieldFitLabel(skeletonDataAsset, SkeletonDataAssetLabel); - if (GUILayout.Button(ReloadButtonString, ReloadButtonStyle, ReloadButtonWidth)) - forceReloadQueued = true; - } - - EditorGUILayout.PropertyField(material); - EditorGUILayout.PropertyField(color); - - if (thisSkeletonGraphic.skeletonDataAsset == null) { - EditorGUILayout.HelpBox("You need to assign a SkeletonDataAsset first.", MessageType.Info); - serializedObject.ApplyModifiedProperties(); - serializedObject.Update(); - return; - } - - string errorMessage = null; - if (SpineEditorUtilities.Preferences.componentMaterialWarning && - MaterialChecks.IsMaterialSetupProblematic(thisSkeletonGraphic, ref errorMessage)) { - EditorGUILayout.HelpBox(errorMessage, MessageType.Error, true); - } - - bool isSingleRendererOnly = (!allowMultipleCanvasRenderers.hasMultipleDifferentValues && allowMultipleCanvasRenderers.boolValue == false); - bool isSeparationEnabledButNotMultipleRenderers = - isSingleRendererOnly && (!enableSeparatorSlots.hasMultipleDifferentValues && enableSeparatorSlots.boolValue == true); - bool meshRendersIncorrectlyWithSingleRenderer = - isSingleRendererOnly && SkeletonHasMultipleSubmeshes(); - - if (isSeparationEnabledButNotMultipleRenderers || meshRendersIncorrectlyWithSingleRenderer) - meshGeneratorSettings.isExpanded = true; - - using (new SpineInspectorUtility.BoxScope()) { - - EditorGUILayout.PropertyField(meshGeneratorSettings, SpineInspectorUtility.TempContent("Advanced..."), includeChildren: true); - SkeletonRendererInspector.advancedFoldout = meshGeneratorSettings.isExpanded; - - if (meshGeneratorSettings.isExpanded) { - EditorGUILayout.Space(); - using (new SpineInspectorUtility.IndentScope()) { - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.PropertyField(allowMultipleCanvasRenderers, SpineInspectorUtility.TempContent("Multiple CanvasRenderers")); - - if (GUILayout.Button(new GUIContent("Trim Renderers", "Remove currently unused CanvasRenderer GameObjects. These will be regenerated whenever needed."), - EditorStyles.miniButton, GUILayout.Width(100f))) { - - foreach (var skeletonGraphic in targets) { - ((SkeletonGraphic)skeletonGraphic).TrimRenderers(); - } - } - EditorGUILayout.EndHorizontal(); - - EditorGUILayout.PropertyField(updateWhenInvisible); - - // warning box - if (isSeparationEnabledButNotMultipleRenderers) { - using (new SpineInspectorUtility.BoxScope()) { - meshGeneratorSettings.isExpanded = true; - EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("'Multiple Canvas Renderers' must be enabled\nwhen 'Enable Separation' is enabled.", Icons.warning), GUILayout.Height(42), GUILayout.Width(340)); - } - } - else if (meshRendersIncorrectlyWithSingleRenderer) { - using (new SpineInspectorUtility.BoxScope()) { - meshGeneratorSettings.isExpanded = true; - EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("This mesh uses multiple atlas pages. You\n" + - "need to enable 'Multiple Canvas Renderers'\n" + - "for correct rendering. Consider packing\n" + - "attachments to a single atlas page if possible.", Icons.warning), GUILayout.Height(60), GUILayout.Width(340)); - } - } - } - - EditorGUILayout.Space(); - SeparatorsField(separatorSlotNames, enableSeparatorSlots, updateSeparatorPartLocation); - } - } - - EditorGUILayout.Space(); - EditorGUILayout.PropertyField(initialSkinName); - { - var rect = GUILayoutUtility.GetRect(EditorGUIUtility.currentViewWidth, EditorGUIUtility.singleLineHeight); - EditorGUI.PrefixLabel(rect, SpineInspectorUtility.TempContent("Initial Flip")); - rect.x += EditorGUIUtility.labelWidth; - rect.width = 30f; - SpineInspectorUtility.ToggleLeft(rect, initialFlipX, SpineInspectorUtility.TempContent("X", tooltip: "initialFlipX")); - rect.x += 35f; - SpineInspectorUtility.ToggleLeft(rect, initialFlipY, SpineInspectorUtility.TempContent("Y", tooltip: "initialFlipY")); - } - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Animation", EditorStyles.boldLabel); - EditorGUILayout.PropertyField(startingAnimation); - EditorGUILayout.PropertyField(startingLoop); - EditorGUILayout.PropertyField(timeScale); - EditorGUILayout.PropertyField(unscaledTime, SpineInspectorUtility.TempContent(unscaledTime.displayName, tooltip: "If checked, this will use Time.unscaledDeltaTime to make this update independent of game Time.timeScale. Instance SkeletonGraphic.timeScale will still be applied.")); - EditorGUILayout.Space(); - EditorGUILayout.PropertyField(freeze); - EditorGUILayout.Space(); - SkeletonRendererInspector.SkeletonRootMotionParameter(targets); - EditorGUILayout.Space(); - EditorGUILayout.LabelField("UI", EditorStyles.boldLabel); - EditorGUILayout.PropertyField(raycastTarget); - - EditorGUILayout.BeginHorizontal(GUILayout.Height(EditorGUIUtility.singleLineHeight + 5)); - EditorGUILayout.PrefixLabel("Match RectTransform with Mesh"); - if (GUILayout.Button("Match", EditorStyles.miniButton, GUILayout.Width(65f))) { - foreach (var skeletonGraphic in targets) { - MatchRectTransformWithBounds((SkeletonGraphic)skeletonGraphic); - } - } - EditorGUILayout.EndHorizontal(); - - if (TargetIsValid && !isInspectingPrefab) { - EditorGUILayout.Space(); - if (SpineInspectorUtility.CenteredButton(new GUIContent("Add Skeleton Utility", Icons.skeletonUtility), 21, true, 200f)) - foreach (var t in targets) { - var component = t as Component; - if (component.GetComponent() == null) { - component.gameObject.AddComponent(); - } - } - } - - wasChanged |= EditorGUI.EndChangeCheck(); - - if (wasChanged) { - serializedObject.ApplyModifiedProperties(); - slotsReapplyRequired = true; - } - - if (slotsReapplyRequired && UnityEngine.Event.current.type == EventType.Repaint) { - foreach (var target in targets) { - var skeletonGraphic = (SkeletonGraphic)target; - skeletonGraphic.ReapplySeparatorSlotNames(); - skeletonGraphic.LateUpdate(); - SceneView.RepaintAll(); - } - slotsReapplyRequired = false; - } - } - - protected bool SkeletonHasMultipleSubmeshes () { - foreach (var target in targets) { - var skeletonGraphic = (SkeletonGraphic)target; - if (skeletonGraphic.HasMultipleSubmeshInstructions()) - return true; - } - return false; - } - - public static void SetSeparatorSlotNames (SkeletonRenderer skeletonRenderer, string[] newSlotNames) { - var field = SpineInspectorUtility.GetNonPublicField(typeof(SkeletonRenderer), SeparatorSlotNamesFieldName); - field.SetValue(skeletonRenderer, newSlotNames); - } - - public static string[] GetSeparatorSlotNames (SkeletonRenderer skeletonRenderer) { - var field = SpineInspectorUtility.GetNonPublicField(typeof(SkeletonRenderer), SeparatorSlotNamesFieldName); - return field.GetValue(skeletonRenderer) as string[]; - } - - public static void SeparatorsField (SerializedProperty separatorSlotNames, SerializedProperty enableSeparatorSlots, - SerializedProperty updateSeparatorPartLocation) { - - bool multi = separatorSlotNames.serializedObject.isEditingMultipleObjects; - bool hasTerminalSlot = false; - if (!multi) { - var sr = separatorSlotNames.serializedObject.targetObject as ISkeletonComponent; - var skeleton = sr.Skeleton; - int lastSlot = skeleton.Slots.Count - 1; - if (skeleton != null) { - for (int i = 0, n = separatorSlotNames.arraySize; i < n; i++) { - int index = skeleton.FindSlotIndex(separatorSlotNames.GetArrayElementAtIndex(i).stringValue); - if (index == 0 || index == lastSlot) { - hasTerminalSlot = true; - break; - } - } - } - } - - string terminalSlotWarning = hasTerminalSlot ? " (!)" : ""; - - using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox)) { - const string SeparatorsDescription = "Stored names of slots where the Skeleton's render will be split into different batches. This is used by separate components that split the render into different MeshRenderers or GameObjects."; - if (separatorSlotNames.isExpanded) { - EditorGUILayout.PropertyField(separatorSlotNames, SpineInspectorUtility.TempContent(separatorSlotNames.displayName + terminalSlotWarning, Icons.slotRoot, SeparatorsDescription), true); - GUILayout.BeginHorizontal(); - GUILayout.FlexibleSpace(); - if (GUILayout.Button("+", GUILayout.MaxWidth(28f), GUILayout.MaxHeight(15f))) { - separatorSlotNames.arraySize++; - } - GUILayout.EndHorizontal(); - } - else - EditorGUILayout.PropertyField(separatorSlotNames, new GUIContent(separatorSlotNames.displayName + string.Format("{0} [{1}]", terminalSlotWarning, separatorSlotNames.arraySize), SeparatorsDescription), true); - - EditorGUILayout.PropertyField(enableSeparatorSlots, SpineInspectorUtility.TempContent("Enable Separation", tooltip: "Whether to enable separation at the above separator slots.")); - EditorGUILayout.PropertyField(updateSeparatorPartLocation, SpineInspectorUtility.TempContent("Update Part Location", tooltip:"Update separator part GameObject location to match the position of the SkeletonGraphic. This can be helpful when re-parenting parts to a different GameObject.")); - } - } - - #region Menus - [MenuItem("CONTEXT/SkeletonGraphic/Match RectTransform with Mesh Bounds")] - static void MatchRectTransformWithBounds (MenuCommand command) { - var skeletonGraphic = (SkeletonGraphic)command.context; - MatchRectTransformWithBounds(skeletonGraphic); - } - - static void MatchRectTransformWithBounds (SkeletonGraphic skeletonGraphic) { - if (!skeletonGraphic.MatchRectTransformWithBounds()) - Debug.Log("Mesh was not previously generated."); - } - - [MenuItem("GameObject/Spine/SkeletonGraphic (UnityUI)", false, 15)] - static public void SkeletonGraphicCreateMenuItem () { - var parentGameObject = Selection.activeObject as GameObject; - var parentTransform = parentGameObject == null ? null : parentGameObject.GetComponent(); - - if (parentTransform == null) - Debug.LogWarning("Your new SkeletonGraphic will not be visible until it is placed under a Canvas"); - - var gameObject = NewSkeletonGraphicGameObject("New SkeletonGraphic"); - gameObject.transform.SetParent(parentTransform, false); - EditorUtility.FocusProjectWindow(); - Selection.activeObject = gameObject; - EditorGUIUtility.PingObject(Selection.activeObject); - } - - // SpineEditorUtilities.InstantiateDelegate. Used by drag and drop. - public static Component SpawnSkeletonGraphicFromDrop (SkeletonDataAsset data) { - return InstantiateSkeletonGraphic(data); - } - - public static SkeletonGraphic InstantiateSkeletonGraphic (SkeletonDataAsset skeletonDataAsset, string skinName) { - return InstantiateSkeletonGraphic(skeletonDataAsset, skeletonDataAsset.GetSkeletonData(true).FindSkin(skinName)); - } - - public static SkeletonGraphic InstantiateSkeletonGraphic (SkeletonDataAsset skeletonDataAsset, Skin skin = null) { - string spineGameObjectName = string.Format("SkeletonGraphic ({0})", skeletonDataAsset.name.Replace("_SkeletonData", "")); - var go = NewSkeletonGraphicGameObject(spineGameObjectName); - var graphic = go.GetComponent(); - graphic.skeletonDataAsset = skeletonDataAsset; - - SkeletonData data = skeletonDataAsset.GetSkeletonData(true); - - if (data == null) { - for (int i = 0; i < skeletonDataAsset.atlasAssets.Length; i++) { - string reloadAtlasPath = AssetDatabase.GetAssetPath(skeletonDataAsset.atlasAssets[i]); - skeletonDataAsset.atlasAssets[i] = (AtlasAssetBase)AssetDatabase.LoadAssetAtPath(reloadAtlasPath, typeof(AtlasAssetBase)); - } - - data = skeletonDataAsset.GetSkeletonData(true); - } - - skin = skin ?? data.DefaultSkin ?? data.Skins.Items[0]; - graphic.MeshGenerator.settings.zSpacing = SpineEditorUtilities.Preferences.defaultZSpacing; - - graphic.startingLoop = SpineEditorUtilities.Preferences.defaultInstantiateLoop; - graphic.Initialize(false); - if (skin != null) graphic.Skeleton.SetSkin(skin); - graphic.initialSkinName = skin.Name; - graphic.Skeleton.UpdateWorldTransform(); - graphic.UpdateMesh(); - return graphic; - } - - static GameObject NewSkeletonGraphicGameObject (string gameObjectName) { - var go = EditorInstantiation.NewGameObject(gameObjectName, true, typeof(RectTransform), typeof(CanvasRenderer), typeof(SkeletonGraphic)); - var graphic = go.GetComponent(); - graphic.material = SkeletonGraphicInspector.DefaultSkeletonGraphicMaterial; - return go; - } - - public static Material DefaultSkeletonGraphicMaterial { - get { - var guids = AssetDatabase.FindAssets("SkeletonGraphicDefault t:material"); - if (guids.Length <= 0) return null; - - var firstAssetPath = AssetDatabase.GUIDToAssetPath(guids[0]); - if (string.IsNullOrEmpty(firstAssetPath)) return null; - - var firstMaterial = AssetDatabase.LoadAssetAtPath(firstAssetPath); - return firstMaterial; - } - } - - #endregion - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonMecanimInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonMecanimInspector.cs deleted file mode 100644 index c322a8ece..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonMecanimInspector.cs +++ /dev/null @@ -1,153 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -// Contributed by: Mitch Thompson - -using UnityEditor; -using UnityEngine; - -namespace Spine.Unity.Editor { - [CustomEditor(typeof(SkeletonMecanim))] - [CanEditMultipleObjects] - public class SkeletonMecanimInspector : SkeletonRendererInspector { - public static bool mecanimSettingsFoldout; - - protected SerializedProperty autoReset; - protected SerializedProperty useCustomMixMode; - protected SerializedProperty layerMixModes; - protected SerializedProperty layerBlendModes; - - protected override void OnEnable () { - base.OnEnable(); - SerializedProperty mecanimTranslator = serializedObject.FindProperty("translator"); - autoReset = mecanimTranslator.FindPropertyRelative("autoReset"); - useCustomMixMode = mecanimTranslator.FindPropertyRelative("useCustomMixMode"); - layerMixModes = mecanimTranslator.FindPropertyRelative("layerMixModes"); - layerBlendModes = mecanimTranslator.FindPropertyRelative("layerBlendModes"); - } - - protected override void DrawInspectorGUI (bool multi) { - - AddRootMotionComponentIfEnabled(); - - base.DrawInspectorGUI(multi); - - using (new SpineInspectorUtility.BoxScope()) { - mecanimSettingsFoldout = EditorGUILayout.Foldout(mecanimSettingsFoldout, "Mecanim Translator"); - if (mecanimSettingsFoldout) { - EditorGUILayout.PropertyField(autoReset, new GUIContent("Auto Reset", - "When set to true, the skeleton state is mixed out to setup-" + - "pose when an animation finishes, according to the " + - "animation's keyed items.")); - - EditorGUILayout.PropertyField(useCustomMixMode, new GUIContent("Custom MixMode", - "When disabled, the recommended MixMode is used according to the layer blend mode. Enable to specify a custom MixMode for each Mecanim layer.")); - - if (useCustomMixMode.hasMultipleDifferentValues || useCustomMixMode.boolValue == true) { - DrawLayerSettings(); - EditorGUILayout.Space(); - } - } - } - } - - protected void AddRootMotionComponentIfEnabled () { - foreach (var t in targets) { - var component = t as Component; - var animator = component.GetComponent(); - if (animator != null && animator.applyRootMotion) { - if (component.GetComponent() == null) { - component.gameObject.AddComponent(); - } - } - } - } - - protected void DrawLayerSettings () { - string[] layerNames = GetLayerNames(); - float widthLayerColumn = 140; - float widthMixColumn = 84; - - using (new GUILayout.HorizontalScope()) { - var rect = GUILayoutUtility.GetRect(EditorGUIUtility.currentViewWidth, EditorGUIUtility.singleLineHeight); - rect.width = widthLayerColumn; - EditorGUI.LabelField(rect, SpineInspectorUtility.TempContent("Mecanim Layer"), EditorStyles.boldLabel); - - var savedIndent = EditorGUI.indentLevel; - EditorGUI.indentLevel = 0; - - rect.position += new Vector2(rect.width, 0); - rect.width = widthMixColumn; - EditorGUI.LabelField(rect, SpineInspectorUtility.TempContent("Mix Mode"), EditorStyles.boldLabel); - - EditorGUI.indentLevel = savedIndent; - } - - using (new SpineInspectorUtility.IndentScope()) { - int layerCount = layerMixModes.arraySize; - for (int i = 0; i < layerCount; ++i) { - using (new GUILayout.HorizontalScope()) { - string layerName = i < layerNames.Length ? layerNames[i] : ("Layer " + i); - - var rect = GUILayoutUtility.GetRect(EditorGUIUtility.currentViewWidth, EditorGUIUtility.singleLineHeight); - rect.width = widthLayerColumn; - EditorGUI.PrefixLabel(rect, SpineInspectorUtility.TempContent(layerName)); - - var savedIndent = EditorGUI.indentLevel; - EditorGUI.indentLevel = 0; - - var mixMode = layerMixModes.GetArrayElementAtIndex(i); - rect.position += new Vector2(rect.width, 0); - rect.width = widthMixColumn; - EditorGUI.PropertyField(rect, mixMode, GUIContent.none); - - EditorGUI.indentLevel = savedIndent; - } - } - } - } - - protected string[] GetLayerNames () { - int maxLayerCount = 0; - int maxIndex = 0; - for (int i = 0; i < targets.Length; ++i) { - var skeletonMecanim = ((SkeletonMecanim)targets[i]); - int count = skeletonMecanim.Translator.MecanimLayerCount; - if (count > maxLayerCount) { - maxLayerCount = count; - maxIndex = i; - } - } - if (maxLayerCount == 0) - return new string[0]; - var skeletonMecanimMaxLayers = ((SkeletonMecanim)targets[maxIndex]); - return skeletonMecanimMaxLayers.Translator.MecanimLayerNames; - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonMecanimRootMotionInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonMecanimRootMotionInspector.cs deleted file mode 100644 index bcdbbaab3..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonMecanimRootMotionInspector.cs +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEditor; -using UnityEngine; - -namespace Spine.Unity.Editor { - [CustomEditor(typeof(SkeletonMecanimRootMotion))] - [CanEditMultipleObjects] - public class SkeletonMecanimRootMotionInspector : SkeletonRootMotionBaseInspector { - protected SerializedProperty mecanimLayerFlags; - - protected GUIContent mecanimLayersLabel; - - protected override void OnEnable () { - base.OnEnable(); - mecanimLayerFlags = serializedObject.FindProperty("mecanimLayerFlags"); - - mecanimLayersLabel = new UnityEngine.GUIContent("Mecanim Layers", "Mecanim layers to apply root motion at. Defaults to the first Mecanim layer."); - } - - override public void OnInspectorGUI () { - - base.MainPropertyFields(); - MecanimLayerMaskPropertyField(); - - base.OptionalPropertyFields(); - serializedObject.ApplyModifiedProperties(); - } - - protected string[] GetLayerNames () { - int maxLayerCount = 0; - int maxIndex = 0; - for (int i = 0; i < targets.Length; ++i) { - var skeletonMecanim = ((SkeletonMecanimRootMotion)targets[i]).SkeletonMecanim; - int count = skeletonMecanim.Translator.MecanimLayerCount; - if (count > maxLayerCount) { - maxLayerCount = count; - maxIndex = i; - } - } - if (maxLayerCount == 0) - return new string[0]; - var skeletonMecanimMaxLayers = ((SkeletonMecanimRootMotion)targets[maxIndex]).SkeletonMecanim; - return skeletonMecanimMaxLayers.Translator.MecanimLayerNames; - } - - protected void MecanimLayerMaskPropertyField () { - string[] layerNames = GetLayerNames(); - if (layerNames.Length > 0) - mecanimLayerFlags.intValue = EditorGUILayout.MaskField( - mecanimLayersLabel, mecanimLayerFlags.intValue, layerNames); - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonMecanimRootMotionInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonMecanimRootMotionInspector.cs.meta deleted file mode 100644 index 04c6dcfc9..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonMecanimRootMotionInspector.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4613924c50d66cf458f0db803776dd2f -timeCreated: 1593175106 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRootMotionBaseInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRootMotionBaseInspector.cs deleted file mode 100644 index 8314eb092..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRootMotionBaseInspector.cs +++ /dev/null @@ -1,113 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEditor; -using UnityEngine; - -namespace Spine.Unity.Editor { - [CustomEditor(typeof(SkeletonRootMotionBase))] - [CanEditMultipleObjects] - public class SkeletonRootMotionBaseInspector : UnityEditor.Editor { - protected SerializedProperty rootMotionBoneName; - protected SerializedProperty transformPositionX; - protected SerializedProperty transformPositionY; - protected SerializedProperty rootMotionScaleX; - protected SerializedProperty rootMotionScaleY; - protected SerializedProperty rootMotionTranslateXPerY; - protected SerializedProperty rootMotionTranslateYPerX; - protected SerializedProperty rigidBody2D; - protected SerializedProperty rigidBody; - - protected GUIContent rootMotionBoneNameLabel; - protected GUIContent transformPositionXLabel; - protected GUIContent transformPositionYLabel; - protected GUIContent rootMotionScaleXLabel; - protected GUIContent rootMotionScaleYLabel; - protected GUIContent rootMotionTranslateXPerYLabel; - protected GUIContent rootMotionTranslateYPerXLabel; - protected GUIContent rigidBody2DLabel; - protected GUIContent rigidBodyLabel; - - protected virtual void OnEnable () { - - rootMotionBoneName = serializedObject.FindProperty("rootMotionBoneName"); - transformPositionX = serializedObject.FindProperty("transformPositionX"); - transformPositionY = serializedObject.FindProperty("transformPositionY"); - rootMotionScaleX = serializedObject.FindProperty("rootMotionScaleX"); - rootMotionScaleY = serializedObject.FindProperty("rootMotionScaleY"); - rootMotionTranslateXPerY = serializedObject.FindProperty("rootMotionTranslateXPerY"); - rootMotionTranslateYPerX = serializedObject.FindProperty("rootMotionTranslateYPerX"); - rigidBody2D = serializedObject.FindProperty("rigidBody2D"); - rigidBody = serializedObject.FindProperty("rigidBody"); - - rootMotionBoneNameLabel = new UnityEngine.GUIContent("Root Motion Bone", "The bone to take the motion from."); - transformPositionXLabel = new UnityEngine.GUIContent("X", "Root transform position (X)"); - transformPositionYLabel = new UnityEngine.GUIContent("Y", "Use the Y-movement of the bone."); - rootMotionScaleXLabel = new UnityEngine.GUIContent("Root Motion Scale (X)", "Scale applied to the horizontal root motion delta. Can be used for delta compensation to e.g. stretch a jump to the desired distance."); - rootMotionScaleYLabel = new UnityEngine.GUIContent("Root Motion Scale (Y)", "Scale applied to the vertical root motion delta. Can be used for delta compensation to e.g. stretch a jump to the desired distance."); - rootMotionTranslateXPerYLabel = new UnityEngine.GUIContent("Root Motion Translate (X)", "Added X translation per root motion Y delta. Can be used for delta compensation when scaling is not enough, to e.g. offset a horizontal jump to a vertically different goal."); - rootMotionTranslateYPerXLabel = new UnityEngine.GUIContent("Root Motion Translate (Y)", "Added Y translation per root motion X delta. Can be used for delta compensation when scaling is not enough, to e.g. offset a horizontal jump to a vertically different goal."); - rigidBody2DLabel = new UnityEngine.GUIContent("Rigidbody2D", - "Optional Rigidbody2D: Assign a Rigidbody2D here if you want " + - " to apply the root motion to the rigidbody instead of the Transform." + - "\n\n" + - "Note that animation and physics updates are not always in sync." + - "Some jitter may result at certain framerates."); - rigidBodyLabel = new UnityEngine.GUIContent("Rigidbody", - "Optional Rigidbody: Assign a Rigidbody here if you want " + - " to apply the root motion to the rigidbody instead of the Transform." + - "\n\n" + - "Note that animation and physics updates are not always in sync." + - "Some jitter may result at certain framerates."); - } - - public override void OnInspectorGUI () { - MainPropertyFields(); - OptionalPropertyFields(); - serializedObject.ApplyModifiedProperties(); - } - - protected virtual void MainPropertyFields () { - EditorGUILayout.PropertyField(rootMotionBoneName, rootMotionBoneNameLabel); - EditorGUILayout.PropertyField(transformPositionX, transformPositionXLabel); - EditorGUILayout.PropertyField(transformPositionY, transformPositionYLabel); - - EditorGUILayout.PropertyField(rootMotionScaleX, rootMotionScaleXLabel); - EditorGUILayout.PropertyField(rootMotionScaleY, rootMotionScaleYLabel); - - EditorGUILayout.PropertyField(rootMotionTranslateXPerY, rootMotionTranslateXPerYLabel); - EditorGUILayout.PropertyField(rootMotionTranslateYPerX, rootMotionTranslateYPerXLabel); - } - - protected virtual void OptionalPropertyFields () { - EditorGUILayout.PropertyField(rigidBody2D, rigidBody2DLabel); - EditorGUILayout.PropertyField(rigidBody, rigidBodyLabel); - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRootMotionBaseInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRootMotionBaseInspector.cs.meta deleted file mode 100644 index 030444885..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRootMotionBaseInspector.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f2cba83baf6afdf44a996e40017c6325 -timeCreated: 1593175106 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRootMotionInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRootMotionInspector.cs deleted file mode 100644 index 2c9650656..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRootMotionInspector.cs +++ /dev/null @@ -1,79 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEditor; -using UnityEngine; - -namespace Spine.Unity.Editor { - [CustomEditor(typeof(SkeletonRootMotion))] - [CanEditMultipleObjects] - public class SkeletonRootMotionInspector : SkeletonRootMotionBaseInspector { - protected SerializedProperty animationTrackFlags; - protected GUIContent animationTrackFlagsLabel; - - string[] TrackNames; - - protected override void OnEnable () { - base.OnEnable(); - - animationTrackFlags = serializedObject.FindProperty("animationTrackFlags"); - animationTrackFlagsLabel = new UnityEngine.GUIContent("Animation Tracks", - "Animation tracks to apply root motion at. Defaults to the first" + - " animation track (index 0)."); - } - - override public void OnInspectorGUI () { - - base.MainPropertyFields(); - AnimationTracksPropertyField(); - - base.OptionalPropertyFields(); - serializedObject.ApplyModifiedProperties(); - } - - protected void AnimationTracksPropertyField () { - - if (TrackNames == null) { - InitTrackNames(); - - } - - animationTrackFlags.intValue = EditorGUILayout.MaskField( - animationTrackFlagsLabel, animationTrackFlags.intValue, TrackNames); - } - - protected void InitTrackNames () { - int numEntries = 32; - TrackNames = new string[numEntries]; - for (int i = 0; i < numEntries; ++i) { - TrackNames[i] = string.Format("Track {0}", i); - } - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRootMotionInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRootMotionInspector.cs.meta deleted file mode 100644 index 7c357a899..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRootMotionInspector.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e4836100aed984c4a9af11d39c63cb6b -timeCreated: 1593183609 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityBoneInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityBoneInspector.cs deleted file mode 100644 index b4e12b683..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityBoneInspector.cs +++ /dev/null @@ -1,541 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -// Contributed by: Mitch Thompson - -#if UNITY_2019_2_OR_NEWER -#define HINGE_JOINT_NEW_BEHAVIOUR -#endif - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using Spine; - -namespace Spine.Unity.Editor { - using Icons = SpineEditorUtilities.Icons; - - [CustomEditor(typeof(SkeletonUtilityBone)), CanEditMultipleObjects] - public class SkeletonUtilityBoneInspector : UnityEditor.Editor { - SerializedProperty mode, boneName, zPosition, position, rotation, scale, overrideAlpha, hierarchy, parentReference; - GUIContent hierarchyLabel; - - //multi selected flags - bool containsFollows, containsOverrides, multiObject; - - //single selected helpers - SkeletonUtilityBone utilityBone; - SkeletonUtility skeletonUtility; - bool canCreateHingeChain = false; - - Dictionary> boundingBoxTable = new Dictionary>(); - - void OnEnable () { - mode = this.serializedObject.FindProperty("mode"); - boneName = this.serializedObject.FindProperty("boneName"); - zPosition = this.serializedObject.FindProperty("zPosition"); - position = this.serializedObject.FindProperty("position"); - rotation = this.serializedObject.FindProperty("rotation"); - scale = this.serializedObject.FindProperty("scale"); - overrideAlpha = this.serializedObject.FindProperty("overrideAlpha"); - hierarchy = this.serializedObject.FindProperty("hierarchy"); - hierarchyLabel = new GUIContent("Skeleton Utility Parent"); - parentReference = this.serializedObject.FindProperty("parentReference"); - - utilityBone = (SkeletonUtilityBone)target; - skeletonUtility = utilityBone.hierarchy; - EvaluateFlags(); - - if (!utilityBone.valid && skeletonUtility != null) { - if (skeletonUtility.skeletonRenderer != null) - skeletonUtility.skeletonRenderer.Initialize(false); - if (skeletonUtility.skeletonGraphic != null) - skeletonUtility.skeletonGraphic.Initialize(false); - } - - canCreateHingeChain = CanCreateHingeChain(); - boundingBoxTable.Clear(); - - if (multiObject) return; - if (utilityBone.bone == null) return; - - var skeleton = utilityBone.bone.Skeleton; - int slotCount = skeleton.Slots.Count; - Skin skin = skeleton.Skin; - if (skeleton.Skin == null) - skin = skeleton.Data.DefaultSkin; - - for(int i = 0; i < slotCount; i++){ - Slot slot = skeletonUtility.Skeleton.Slots.Items[i]; - if (slot.Bone == utilityBone.bone) { - var slotAttachments = new List(); - int slotIndex = skeleton.FindSlotIndex(slot.Data.Name); - skin.GetAttachments(slotIndex, slotAttachments); - - var boundingBoxes = new List(); - foreach (var att in slotAttachments) { - var boundingBoxAttachment = att.Attachment as BoundingBoxAttachment; - if (boundingBoxAttachment != null) - boundingBoxes.Add(boundingBoxAttachment); - } - - if (boundingBoxes.Count > 0) - boundingBoxTable.Add(slot, boundingBoxes); - } - } - } - - void EvaluateFlags () { - if (Selection.objects.Length == 1) { - containsFollows = utilityBone.mode == SkeletonUtilityBone.Mode.Follow; - containsOverrides = utilityBone.mode == SkeletonUtilityBone.Mode.Override; - } else { - int boneCount = 0; - foreach (Object o in Selection.objects) { - var go = o as GameObject; - if (go != null) { - SkeletonUtilityBone sub = go.GetComponent(); - if (sub != null) { - boneCount++; - containsFollows |= (sub.mode == SkeletonUtilityBone.Mode.Follow); - containsOverrides |= (sub.mode == SkeletonUtilityBone.Mode.Override); - } - } - } - - multiObject |= (boneCount > 1); - } - } - - public override void OnInspectorGUI () { - serializedObject.Update(); - - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(mode); - if (EditorGUI.EndChangeCheck()) { - containsOverrides = mode.enumValueIndex == 1; - containsFollows = mode.enumValueIndex == 0; - } - - using (new EditorGUI.DisabledGroupScope(multiObject)) { - string str = boneName.stringValue; - if (str == "") - str = ""; - if (multiObject) - str = ""; - - using (new GUILayout.HorizontalScope()) { - EditorGUILayout.PrefixLabel("Bone"); - if (GUILayout.Button(str, EditorStyles.popup)) { - BoneSelectorContextMenu(str, ((SkeletonUtilityBone)target).hierarchy.Skeleton.Bones, "", TargetBoneSelected); - } - } - } - - EditorGUILayout.PropertyField(zPosition); - EditorGUILayout.PropertyField(position); - EditorGUILayout.PropertyField(rotation); - EditorGUILayout.PropertyField(scale); - - using (new EditorGUI.DisabledGroupScope(containsFollows)) { - EditorGUILayout.PropertyField(overrideAlpha); - EditorGUILayout.PropertyField(parentReference); - EditorGUILayout.PropertyField(hierarchy, hierarchyLabel); - } - - EditorGUILayout.Space(); - - using (new GUILayout.HorizontalScope()) { - EditorGUILayout.Space(); - using (new EditorGUI.DisabledGroupScope(multiObject || !utilityBone.valid || utilityBone.bone == null || utilityBone.bone.Children.Count == 0)) { - if (GUILayout.Button(SpineInspectorUtility.TempContent("Add Child Bone", Icons.bone), GUILayout.MinWidth(120), GUILayout.Height(24))) - BoneSelectorContextMenu("", utilityBone.bone.Children, "", SpawnChildBoneSelected); - } - using (new EditorGUI.DisabledGroupScope(multiObject || !utilityBone.valid || utilityBone.bone == null || containsOverrides)) { - if (GUILayout.Button(SpineInspectorUtility.TempContent("Add Override", Icons.poseBones), GUILayout.MinWidth(120), GUILayout.Height(24))) - SpawnOverride(); - } - EditorGUILayout.Space(); - } - EditorGUILayout.Space(); - using (new GUILayout.HorizontalScope()) { - EditorGUILayout.Space(); - using (new EditorGUI.DisabledGroupScope(multiObject || !utilityBone.valid || !canCreateHingeChain)) { - if (GUILayout.Button(SpineInspectorUtility.TempContent("Create 3D Hinge Chain", Icons.hingeChain), GUILayout.MinWidth(120), GUILayout.Height(24))) - CreateHingeChain(); - if (GUILayout.Button(SpineInspectorUtility.TempContent("Create 2D Hinge Chain", Icons.hingeChain), GUILayout.MinWidth(120), GUILayout.Height(24))) - CreateHingeChain2D(); - } - EditorGUILayout.Space(); - } - - using (new EditorGUI.DisabledGroupScope(multiObject || boundingBoxTable.Count == 0)) { - EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("Bounding Boxes", Icons.boundingBox), EditorStyles.boldLabel); - - foreach (var entry in boundingBoxTable){ - Slot slot = entry.Key; - var boundingBoxes = entry.Value; - - EditorGUI.indentLevel++; - EditorGUILayout.LabelField(slot.Data.Name); - EditorGUI.indentLevel++; - { - foreach (var box in boundingBoxes) { - using (new GUILayout.HorizontalScope()) { - GUILayout.Space(30); - string buttonLabel = box.IsWeighted() ? box.Name + " (!)" : box.Name; - if (GUILayout.Button(buttonLabel, GUILayout.Width(200))) { - utilityBone.bone.Skeleton.UpdateWorldTransform(); - var bbTransform = utilityBone.transform.Find("[BoundingBox]" + box.Name); // Use FindChild in older versions of Unity. - if (bbTransform != null) { - var originalCollider = bbTransform.GetComponent(); - if (originalCollider != null) - SkeletonUtility.SetColliderPointsLocal(originalCollider, slot, box); - else - SkeletonUtility.AddBoundingBoxAsComponent(box, slot, bbTransform.gameObject); - } else { - var newPolygonCollider = SkeletonUtility.AddBoundingBoxGameObject(null, box, slot, utilityBone.transform); - bbTransform = newPolygonCollider.transform; - } - EditorGUIUtility.PingObject(bbTransform); - } - } - - } - } - EditorGUI.indentLevel--; - EditorGUI.indentLevel--; - } - } - - BoneFollowerInspector.RecommendRigidbodyButton(utilityBone); - - serializedObject.ApplyModifiedProperties(); - } - - static void BoneSelectorContextMenu (string current, ExposedList bones, string topValue, GenericMenu.MenuFunction2 callback) { - var menu = new GenericMenu(); - - if (topValue != "") - menu.AddItem(new GUIContent(topValue), current == topValue, callback, null); - - for (int i = 0; i < bones.Count; i++) - menu.AddItem(new GUIContent(bones.Items[i].Data.Name), bones.Items[i].Data.Name == current, callback, bones.Items[i]); - - menu.ShowAsContext(); - } - - void TargetBoneSelected (object obj) { - if (obj == null) { - boneName.stringValue = ""; - serializedObject.ApplyModifiedProperties(); - } else { - var bone = (Bone)obj; - boneName.stringValue = bone.Data.Name; - serializedObject.ApplyModifiedProperties(); - utilityBone.Reset(); - } - } - - void SpawnChildBoneSelected (object obj) { - if (obj == null) { - // Add recursively - foreach (var bone in utilityBone.bone.Children) { - GameObject go = skeletonUtility.SpawnBoneRecursively(bone, utilityBone.transform, utilityBone.mode, utilityBone.position, utilityBone.rotation, utilityBone.scale); - SkeletonUtilityBone[] newUtilityBones = go.GetComponentsInChildren(); - foreach (SkeletonUtilityBone utilBone in newUtilityBones) - SkeletonUtilityInspector.AttachIcon(utilBone); - } - } else { - var bone = (Bone)obj; - GameObject go = skeletonUtility.SpawnBone(bone, utilityBone.transform, utilityBone.mode, utilityBone.position, utilityBone.rotation, utilityBone.scale); - SkeletonUtilityInspector.AttachIcon(go.GetComponent()); - Selection.activeGameObject = go; - EditorGUIUtility.PingObject(go); - } - } - - void SpawnOverride () { - GameObject go = skeletonUtility.SpawnBone(utilityBone.bone, utilityBone.transform.parent, SkeletonUtilityBone.Mode.Override, utilityBone.position, utilityBone.rotation, utilityBone.scale); - go.name = go.name + " [Override]"; - SkeletonUtilityInspector.AttachIcon(go.GetComponent()); - Selection.activeGameObject = go; - EditorGUIUtility.PingObject(go); - } - - bool CanCreateHingeChain () { - if (utilityBone == null) - return false; - if (utilityBone.GetComponent() != null || utilityBone.GetComponent() != null) - return false; - if (utilityBone.bone != null && utilityBone.bone.Children.Count == 0) - return false; - - var rigidbodies = utilityBone.GetComponentsInChildren(); - var rigidbodies2D = utilityBone.GetComponentsInChildren(); - return rigidbodies.Length <= 0 && rigidbodies2D.Length <= 0; - } - - void CreateHingeChain2D () { - var kinematicParentUtilityBone = utilityBone.transform.parent.GetComponent(); - if (kinematicParentUtilityBone == null) { - UnityEditor.EditorUtility.DisplayDialog("No parent SkeletonUtilityBone found!", "Please select the first physically moving chain node, having a parent GameObject with a SkeletonUtilityBone component attached.", "OK"); - return; - } - - float mass = 10; - const float rotationLimit = 20.0f; - - SetSkeletonUtilityToFlipByRotation(); - - kinematicParentUtilityBone.mode = SkeletonUtilityBone.Mode.Follow; - kinematicParentUtilityBone.position = kinematicParentUtilityBone.rotation = kinematicParentUtilityBone.scale = kinematicParentUtilityBone.zPosition = true; - - GameObject commonParentObject = new GameObject(skeletonUtility.name + " HingeChain Parent " + utilityBone.name); - var commonParentActivateOnFlip = commonParentObject.AddComponent(); - commonParentActivateOnFlip.skeletonRenderer = skeletonUtility.skeletonRenderer; - commonParentActivateOnFlip.skeletonGraphic = skeletonUtility.skeletonGraphic; - - // HingeChain Parent - // Needs to be on top hierarchy level (not attached to the moving skeleton at least) for physics to apply proper momentum. - GameObject normalChainParentObject = new GameObject("HingeChain"); - normalChainParentObject.transform.SetParent(commonParentObject.transform); - commonParentActivateOnFlip.activeOnNormalX = normalChainParentObject; - - //var followRotationComponent = normalChainParentObject.AddComponent(); - //followRotationComponent.reference = skeletonUtility.boneRoot; - - // Follower Kinematic Rigidbody - GameObject followerKinematicObject = new GameObject(kinematicParentUtilityBone.name + " Follower"); - followerKinematicObject.transform.parent = normalChainParentObject.transform; - var followerRigidbody = followerKinematicObject.AddComponent(); - followerRigidbody.mass = mass; - followerRigidbody.isKinematic = true; - followerKinematicObject.AddComponent().reference = kinematicParentUtilityBone.transform; - followerKinematicObject.transform.position = kinematicParentUtilityBone.transform.position; - followerKinematicObject.transform.rotation = kinematicParentUtilityBone.transform.rotation; - - // Child Bones - var utilityBones = utilityBone.GetComponentsInChildren(); - var childBoneParentReference = followerKinematicObject.transform; - for (int i = 0; i < utilityBones.Length; ++i) { - var childBone = utilityBones[i]; - mass *= 0.75f; - childBone.parentReference = (i == 0) ? kinematicParentUtilityBone.transform : childBoneParentReference; - childBone.transform.SetParent(normalChainParentObject.transform, true); // we need a flat hierarchy of all Joint objects in Unity. - AttachRigidbodyAndCollider2D(childBone); - childBone.mode = SkeletonUtilityBone.Mode.Override; - childBone.scale = childBone.position = childBone.zPosition = false; - - HingeJoint2D joint = childBone.gameObject.AddComponent(); - joint.connectedBody = childBoneParentReference.GetComponent(); - joint.useLimits = true; - ApplyJoint2DAngleLimits(joint, rotationLimit, childBoneParentReference, childBone.transform); - - childBone.GetComponent().mass = mass; - childBoneParentReference = childBone.transform; - } - - Duplicate2DHierarchyForFlippedChains(normalChainParentObject, commonParentActivateOnFlip, skeletonUtility.transform, rotationLimit); - UnityEditor.Selection.activeGameObject = commonParentObject; - } - - void ApplyJoint2DAngleLimits (HingeJoint2D joint, float rotationLimit, Transform parentBone, Transform bone) { - #if HINGE_JOINT_NEW_BEHAVIOUR - float referenceAngle = (parentBone.eulerAngles.z - bone.eulerAngles.z + 360f) % 360f; - float minAngle = referenceAngle - rotationLimit; - float maxAngle = referenceAngle + rotationLimit; - if (maxAngle > 270f) { - minAngle -= 360f; - maxAngle -= 360f; - } - if (minAngle < -90f) { - minAngle += 360f; - maxAngle += 360f; - } -#else - float minAngle = - rotationLimit; - float maxAngle = rotationLimit; -#endif - joint.limits = new JointAngleLimits2D { - min = minAngle, - max = maxAngle - }; - } - - void Duplicate2DHierarchyForFlippedChains (GameObject normalChainParentObject, ActivateBasedOnFlipDirection commonParentActivateOnFlip, - Transform skeletonUtilityRoot, float rotationLimit) { - - GameObject mirroredChain = GameObject.Instantiate(normalChainParentObject, normalChainParentObject.transform.position, - normalChainParentObject.transform.rotation, commonParentActivateOnFlip.transform); - mirroredChain.name = normalChainParentObject.name + " FlippedX"; - - commonParentActivateOnFlip.activeOnFlippedX = mirroredChain; - - var followerKinematicObject = mirroredChain.GetComponentInChildren(); - followerKinematicObject.followFlippedX = true; - FlipBone2DHorizontal(followerKinematicObject.transform, skeletonUtilityRoot); - - var childBoneJoints = mirroredChain.GetComponentsInChildren(); - Transform prevRotatedChild = null; - Transform parentTransformForAngles = followerKinematicObject.transform; - for (int i = 0; i < childBoneJoints.Length; ++i) { - var joint = childBoneJoints[i]; - FlipBone2DHorizontal(joint.transform, skeletonUtilityRoot); - ApplyJoint2DAngleLimits(joint, rotationLimit, parentTransformForAngles, joint.transform); - - GameObject rotatedChild = GameObject.Instantiate(joint.gameObject, joint.transform, true); - rotatedChild.name = joint.name + " rotated"; - var rotationEulerAngles = rotatedChild.transform.localEulerAngles; - rotationEulerAngles.x = 180; - rotatedChild.transform.localEulerAngles = rotationEulerAngles; - DestroyImmediate(rotatedChild.GetComponent()); - DestroyImmediate(rotatedChild.GetComponent()); - DestroyImmediate(rotatedChild.GetComponent()); - - DestroyImmediate(joint.gameObject.GetComponent()); - - if (i > 0) { - var utilityBone = rotatedChild.GetComponent(); - utilityBone.parentReference = prevRotatedChild; - } - prevRotatedChild = rotatedChild.transform; - parentTransformForAngles = joint.transform; - } - - mirroredChain.SetActive(false); - } - - void FlipBone2DHorizontal(Transform bone, Transform mirrorPosition) { - Vector3 position = bone.position; - position.x = 2 * mirrorPosition.position.x - position.x; // = mirrorPosition + (mirrorPosition - bone.position) - bone.position = position; - - Vector3 boneZ = bone.forward; - Vector3 boneX = bone.right; - boneX.x *= -1; - - bone.rotation = Quaternion.LookRotation(boneZ, Vector3.Cross(boneZ, boneX)); - } - - void CreateHingeChain () { - var kinematicParentUtilityBone = utilityBone.transform.parent.GetComponent(); - if (kinematicParentUtilityBone == null) { - UnityEditor.EditorUtility.DisplayDialog("No parent SkeletonUtilityBone found!", "Please select the first physically moving chain node, having a parent GameObject with a SkeletonUtilityBone component attached.", "OK"); - return; - } - - SetSkeletonUtilityToFlipByRotation(); - - kinematicParentUtilityBone.mode = SkeletonUtilityBone.Mode.Follow; - kinematicParentUtilityBone.position = kinematicParentUtilityBone.rotation = kinematicParentUtilityBone.scale = kinematicParentUtilityBone.zPosition = true; - - // HingeChain Parent - // Needs to be on top hierarchy level (not attached to the moving skeleton at least) for physics to apply proper momentum. - GameObject chainParentObject = new GameObject(skeletonUtility.name + " HingeChain Parent " + utilityBone.name); - var followRotationComponent = chainParentObject.AddComponent(); - followRotationComponent.reference = skeletonUtility.boneRoot; - - // Follower Kinematic Rigidbody - GameObject followerKinematicObject = new GameObject(kinematicParentUtilityBone.name + " Follower"); - followerKinematicObject.transform.parent = chainParentObject.transform; - var followerRigidbody = followerKinematicObject.AddComponent(); - followerRigidbody.mass = 10; - followerRigidbody.isKinematic = true; - followerKinematicObject.AddComponent().reference = kinematicParentUtilityBone.transform; - followerKinematicObject.transform.position = kinematicParentUtilityBone.transform.position; - followerKinematicObject.transform.rotation = kinematicParentUtilityBone.transform.rotation; - - // Child Bones - var utilityBones = utilityBone.GetComponentsInChildren(); - var childBoneParentReference = followerKinematicObject.transform; - foreach (var childBone in utilityBones) { - childBone.parentReference = childBoneParentReference; - childBone.transform.SetParent(chainParentObject.transform, true); // we need a flat hierarchy of all Joint objects in Unity. - AttachRigidbodyAndCollider(childBone); - childBone.mode = SkeletonUtilityBone.Mode.Override; - - HingeJoint joint = childBone.gameObject.AddComponent(); - joint.axis = Vector3.forward; - joint.connectedBody = childBoneParentReference.GetComponent(); - joint.useLimits = true; - joint.limits = new JointLimits { - min = -20, - max = 20 - }; - childBone.GetComponent().mass = childBoneParentReference.transform.GetComponent().mass * 0.75f; - - childBoneParentReference = childBone.transform; - } - UnityEditor.Selection.activeGameObject = chainParentObject; - } - - void SetSkeletonUtilityToFlipByRotation () { - if (!skeletonUtility.flipBy180DegreeRotation) { - skeletonUtility.flipBy180DegreeRotation = true; - Debug.Log("Set SkeletonUtility " + skeletonUtility.name + " to flip by rotation instead of negative scale (required).", skeletonUtility); - } - } - - static void AttachRigidbodyAndCollider (SkeletonUtilityBone utilBone, bool enableCollider = false) { - if (utilBone.GetComponent() == null) { - if (utilBone.bone.Data.Length == 0) { - SphereCollider sphere = utilBone.gameObject.AddComponent(); - sphere.radius = 0.1f; - sphere.enabled = enableCollider; - } else { - float length = utilBone.bone.Data.Length; - BoxCollider box = utilBone.gameObject.AddComponent(); - box.size = new Vector3(length, length / 3f, 0.2f); - box.center = new Vector3(length / 2f, 0, 0); - box.enabled = enableCollider; - } - } - utilBone.gameObject.AddComponent(); - } - - static void AttachRigidbodyAndCollider2D(SkeletonUtilityBone utilBone, bool enableCollider = false) { - if (utilBone.GetComponent() == null) { - if (utilBone.bone.Data.Length == 0) { - var sphere = utilBone.gameObject.AddComponent(); - sphere.radius = 0.1f; - sphere.enabled = enableCollider; - } - else { - float length = utilBone.bone.Data.Length; - var box = utilBone.gameObject.AddComponent(); - box.size = new Vector3(length, length / 3f, 0.2f); - box.offset = new Vector3(length / 2f, 0, 0); - box.enabled = enableCollider; - } - } - utilBone.gameObject.AddComponent(); - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets.meta b/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets.meta deleted file mode 100644 index 39eef80bd..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a018d561e5df35848bcabbe2809c7549 -folderAsset: yes -timeCreated: 1580402759 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMAPresetTemplate.png b/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMAPresetTemplate.png deleted file mode 100644 index b40be5a3e..000000000 Binary files a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMAPresetTemplate.png and /dev/null differ diff --git a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMATexturePreset.preset b/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMATexturePreset.preset deleted file mode 100644 index f5d5a7333..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMATexturePreset.preset +++ /dev/null @@ -1,390 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!181963792 &2655988077585873504 -Preset: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: PMATexturePreset - m_TargetType: - m_NativeTypeID: 1006 - m_ManagedTypePPtr: {fileID: 0} - m_ManagedTypeFallback: - m_Properties: - - target: {fileID: 0} - propertyPath: m_ExternalObjects.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_EnableMipMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_sRGBTexture - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_LinearTexture - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_FadeOut - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_BorderMipMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapsPreserveCoverage - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaTestReferenceValue - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapFadeDistanceStart - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapFadeDistanceEnd - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ConvertToNormalMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ExternalNormalMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_HeightScale - value: 0.25 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_NormalMapFilter - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_IsReadable - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_StreamingMipmaps - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_StreamingMipmapsPriority - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_GrayScaleToAlpha - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_GenerateCubemap - value: 6 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CubemapConvolution - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SeamlessCubemap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureFormat - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MaxTextureSize - value: 2048 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_FilterMode - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_Aniso - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_MipBias - value: -100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapU - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapV - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapW - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_NPOTScale - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Lightmap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteExtrude - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteMeshType - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Alignment - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePixelsToUnits - value: 100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.w - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteGenerateFallbackPhysicsShape - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaUsage - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaIsTransparency - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteTessellationDetail - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureType - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureShape - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SingleChannelComponent - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MaxTextureSizeSet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CompressionQualitySet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureFormatSet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.size - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_BuildTarget - value: DefaultTexturePlatform - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_MaxTextureSize - value: 2048 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_TextureCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_ForceMaximumCompressionQuality_BC6H_BC7 - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_BuildTarget - value: Standalone - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_MaxTextureSize - value: 2048 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_TextureCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_ForceMaximumCompressionQuality_BC6H_BC7 - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Sprites.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Outline.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_PhysicsShape.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Bones.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_SpriteID - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_InternalID - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Vertices.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Indices.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Edges.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Weights.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_SecondaryTextures.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePackingTag - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PSDRemoveMatte - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PSDShowRemoveMatteOption - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_UserData - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleName - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleVariant - value: - objectReference: {fileID: 0} diff --git a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMATexturePreset.preset.meta b/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMATexturePreset.preset.meta deleted file mode 100644 index 8c4a8e8e6..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMATexturePreset.preset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 665f49f3e2dc7b645b6577f14455f445 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/StraightAlphaPreset.preset b/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/StraightAlphaPreset.preset deleted file mode 100644 index 60212d410..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/StraightAlphaPreset.preset +++ /dev/null @@ -1,390 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!181963792 &2655988077585873504 -Preset: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: StraightAlphaPreset - m_TargetType: - m_NativeTypeID: 1006 - m_ManagedTypePPtr: {fileID: 0} - m_ManagedTypeFallback: - m_Properties: - - target: {fileID: 0} - propertyPath: m_ExternalObjects.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_EnableMipMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_sRGBTexture - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_LinearTexture - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_FadeOut - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_BorderMipMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapsPreserveCoverage - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaTestReferenceValue - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapFadeDistanceStart - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MipMapFadeDistanceEnd - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ConvertToNormalMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_ExternalNormalMap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_HeightScale - value: 0.25 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_NormalMapFilter - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_IsReadable - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_StreamingMipmaps - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_StreamingMipmapsPriority - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_GrayScaleToAlpha - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_GenerateCubemap - value: 6 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CubemapConvolution - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SeamlessCubemap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureFormat - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MaxTextureSize - value: 2048 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_FilterMode - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_Aniso - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_MipBias - value: -100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapU - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapV - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureSettings.m_WrapW - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_NPOTScale - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Lightmap - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteExtrude - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteMeshType - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_Alignment - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePixelsToUnits - value: 100 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteBorder.w - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteGenerateFallbackPhysicsShape - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaUsage - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AlphaIsTransparency - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteTessellationDetail - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureType - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureShape - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SingleChannelComponent - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_MaxTextureSizeSet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_CompressionQualitySet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_TextureFormatSet - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.size - value: 2 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_BuildTarget - value: DefaultTexturePlatform - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_MaxTextureSize - value: 2048 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_TextureCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[0].m_ForceMaximumCompressionQuality_BC6H_BC7 - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_BuildTarget - value: Standalone - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_MaxTextureSize - value: 2048 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_ResizeAlgorithm - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_TextureFormat - value: -1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_TextureCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_CompressionQuality - value: 50 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_CrunchedCompression - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_AllowsAlphaSplitting - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_Overridden - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_AndroidETC2FallbackOverride - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PlatformSettings.Array.data[1].m_ForceMaximumCompressionQuality_BC6H_BC7 - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Sprites.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Outline.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_PhysicsShape.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Bones.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_SpriteID - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_InternalID - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Vertices.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Indices.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Edges.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_Weights.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpriteSheet.m_SecondaryTextures.Array.size - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_SpritePackingTag - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PSDRemoveMatte - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_PSDShowRemoveMatteOption - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_UserData - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleName - value: - objectReference: {fileID: 0} - - target: {fileID: 0} - propertyPath: m_AssetBundleVariant - value: - objectReference: {fileID: 0} diff --git a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/StraightAlphaPreset.preset.meta b/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/StraightAlphaPreset.preset.meta deleted file mode 100644 index b64d04efd..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/StraightAlphaPreset.preset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b3fe5ce49a7c8c041a9d60e4f7f403de -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/StraightAlphaPresetTemplate.png b/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/StraightAlphaPresetTemplate.png deleted file mode 100644 index 4db601f8f..000000000 Binary files a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/StraightAlphaPresetTemplate.png and /dev/null differ diff --git a/Assets/Spine/Editor/spine-unity/Editor/Menus.cs b/Assets/Spine/Editor/spine-unity/Editor/Menus.cs index 605a2e39a..7e8e5cdb4 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Menus.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/Menus.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -36,12 +36,12 @@ namespace Spine.Unity.Editor { public static class Menus { [MenuItem("GameObject/Spine/SkeletonRenderer", false, 10)] static public void CreateSkeletonRendererGameObject () { - EditorInstantiation.InstantiateEmptySpineGameObject("New SkeletonRenderer", true); + SpineEditorUtilities.EditorInstantiation.InstantiateEmptySpineGameObject("New SkeletonRenderer"); } [MenuItem("GameObject/Spine/SkeletonAnimation", false, 10)] static public void CreateSkeletonAnimationGameObject () { - EditorInstantiation.InstantiateEmptySpineGameObject("New SkeletonAnimation", true); + SpineEditorUtilities.EditorInstantiation.InstantiateEmptySpineGameObject("New SkeletonAnimation"); } } } diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/PointFollowerInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/PointFollowerEditor.cs similarity index 84% rename from Assets/Spine/Editor/spine-unity/Editor/Components/PointFollowerInspector.cs rename to Assets/Spine/Editor/spine-unity/Editor/PointFollowerEditor.cs index 858a8ecfe..3e605951d 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/PointFollowerInspector.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/PointFollowerEditor.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,19 +15,18 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -using System.Collections; using UnityEditor; using UnityEngine; @@ -37,7 +36,7 @@ namespace Spine.Unity.Editor { using Event = UnityEngine.Event; [CustomEditor(typeof(PointFollower)), CanEditMultipleObjects] - public class PointFollowerInspector : Editor { + public class PointFollowerEditor : Editor { SerializedProperty slotName, pointAttachmentName, skeletonRenderer, followZPosition, followBoneRotation, followSkeletonFlip; PointFollower targetPointFollower; bool needsReset; @@ -46,7 +45,7 @@ namespace Spine.Unity.Editor { [MenuItem("CONTEXT/SkeletonRenderer/Add PointFollower GameObject")] static void AddBoneFollowerGameObject (MenuCommand cmd) { var skeletonRenderer = cmd.context as SkeletonRenderer; - var go = EditorInstantiation.NewGameObject("PointFollower", true); + var go = SpineEditorUtilities.EditorInstantiation.NewGameObject("PointFollower"); var t = go.transform; t.SetParent(skeletonRenderer.transform); t.localPosition = Vector3.zero; @@ -114,8 +113,8 @@ namespace Spine.Unity.Editor { foreach (var skinEntry in skin.Attachments) { var attachment = skinEntry.Value as PointAttachment; if (attachment != null) { - var skinKey = (Skin.SkinEntry)skinEntry.Key; - var slot = skeleton.Slots.Items[skinKey.SlotIndex]; + var skinKey = skinEntry.Key; + var slot = skeleton.Slots.Items[skinKey.slotIndex]; DrawPointAttachmentWithLabel(attachment, slot.Bone, transform); } } diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/PointFollowerInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/PointFollowerEditor.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Components/PointFollowerInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/PointFollowerEditor.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineShaderWithOutlineGUI.cs b/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineShaderWithOutlineGUI.cs deleted file mode 100644 index 4b0d5824d..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineShaderWithOutlineGUI.cs +++ /dev/null @@ -1,226 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; -using UnityEditor; -using Spine.Unity; - -using SpineInspectorUtility = Spine.Unity.Editor.SpineInspectorUtility; - -public class SpineShaderWithOutlineGUI : ShaderGUI { - - protected MaterialEditor _materialEditor; - bool _showAdvancedOutlineSettings = false; - bool _showStencilSettings = false; - - MaterialProperty _OutlineWidth = null; - MaterialProperty _OutlineColor = null; - MaterialProperty _OutlineReferenceTexWidth = null; - MaterialProperty _ThresholdEnd = null; - MaterialProperty _OutlineSmoothness = null; - MaterialProperty _Use8Neighbourhood = null; - MaterialProperty _OutlineMipLevel = null; - MaterialProperty _StencilComp = null; - MaterialProperty _StencilRef = null; - - static GUIContent _EnableOutlineText = new GUIContent("Outline", "Enable outline rendering. Draws an outline by sampling 4 or 8 neighbourhood pixels at a given distance specified via 'Outline Width'."); - static GUIContent _OutlineWidthText = new GUIContent("Outline Width", ""); - static GUIContent _OutlineColorText = new GUIContent("Outline Color", ""); - static GUIContent _OutlineReferenceTexWidthText = new GUIContent("Reference Texture Width", ""); - static GUIContent _ThresholdEndText = new GUIContent("Outline Threshold", ""); - static GUIContent _OutlineSmoothnessText = new GUIContent("Outline Smoothness", ""); - static GUIContent _Use8NeighbourhoodText = new GUIContent("Sample 8 Neighbours", ""); - static GUIContent _OutlineMipLevelText = new GUIContent("Outline Mip Level", ""); - static GUIContent _StencilCompText = new GUIContent("Stencil Comparison", ""); - static GUIContent _StencilRefText = new GUIContent("Stencil Reference", ""); - - static GUIContent _OutlineAdvancedText = new GUIContent("Advanced", ""); - static GUIContent _ShowStencilText = new GUIContent("Stencil", "Stencil parameters for mask interaction."); - - protected const string ShaderOutlineNamePrefix = "Spine/Outline/"; - protected const string ShaderNormalNamePrefix = "Spine/"; - protected const string ShaderWithoutStandardVariantSuffix = "OutlineOnly"; - - #region ShaderGUI - - public override void OnGUI (MaterialEditor materialEditor, MaterialProperty[] properties) { - FindProperties(properties); // MaterialProperties can be animated so we do not cache them but fetch them every event to ensure animated values are updated correctly - _materialEditor = materialEditor; - - base.OnGUI(materialEditor, properties); - EditorGUILayout.Space(); - RenderStencilProperties(); - EditorGUILayout.Space(); - RenderOutlineProperties(); - } - - #endregion - - #region Virtual Interface - - protected virtual void FindProperties (MaterialProperty[] props) { - - _OutlineWidth = FindProperty("_OutlineWidth", props, false); - _OutlineReferenceTexWidth = FindProperty("_OutlineReferenceTexWidth", props, false); - _OutlineColor = FindProperty("_OutlineColor", props, false); - _ThresholdEnd = FindProperty("_ThresholdEnd", props, false); - _OutlineSmoothness = FindProperty("_OutlineSmoothness", props, false); - _Use8Neighbourhood = FindProperty("_Use8Neighbourhood", props, false); - _OutlineMipLevel = FindProperty("_OutlineMipLevel", props, false); - - _StencilComp = FindProperty("_StencilComp", props, false); - _StencilRef = FindProperty("_StencilRef", props, false); - if (_StencilRef == null) - _StencilRef = FindProperty("_Stencil", props, false); - } - - protected virtual void RenderStencilProperties () { - if (_StencilComp == null) - return; // not a shader supporting custom stencil operations - - // Use default labelWidth - EditorGUIUtility.labelWidth = 0f; - _showStencilSettings = EditorGUILayout.Foldout(_showStencilSettings, _ShowStencilText); - if (_showStencilSettings) { - using (new SpineInspectorUtility.IndentScope()) { - _materialEditor.ShaderProperty(_StencilComp, _StencilCompText); - _materialEditor.ShaderProperty(_StencilRef, _StencilRefText); - } - } - } - - protected virtual void RenderOutlineProperties () { - - if (_OutlineWidth == null) - return; // not an outline shader - - // Use default labelWidth - EditorGUIUtility.labelWidth = 0f; - - bool mixedValue; - bool hasOutlineVariant = !IsShaderWithoutStandardVariantShader(_materialEditor, out mixedValue); - bool isOutlineEnabled = true; - if (hasOutlineVariant) { - isOutlineEnabled = IsOutlineEnabled(_materialEditor, out mixedValue); - EditorGUI.showMixedValue = mixedValue; - EditorGUI.BeginChangeCheck(); - - var origFontStyle = EditorStyles.label.fontStyle; - EditorStyles.label.fontStyle = FontStyle.Bold; - isOutlineEnabled = EditorGUILayout.Toggle(_EnableOutlineText, isOutlineEnabled); - EditorStyles.label.fontStyle = origFontStyle; - EditorGUI.showMixedValue = false; - if (EditorGUI.EndChangeCheck()) { - foreach (Material material in _materialEditor.targets) { - SwitchShaderToOutlineSettings(material, isOutlineEnabled); - } - } - } - else { - var origFontStyle = EditorStyles.label.fontStyle; - EditorStyles.label.fontStyle = FontStyle.Bold; - EditorGUILayout.LabelField(_EnableOutlineText); - EditorStyles.label.fontStyle = origFontStyle; - } - - if (isOutlineEnabled) { - _materialEditor.ShaderProperty(_OutlineWidth, _OutlineWidthText); - _materialEditor.ShaderProperty(_OutlineColor, _OutlineColorText); - - _showAdvancedOutlineSettings = EditorGUILayout.Foldout(_showAdvancedOutlineSettings, _OutlineAdvancedText); - if (_showAdvancedOutlineSettings) { - using (new SpineInspectorUtility.IndentScope()) { - _materialEditor.ShaderProperty(_OutlineReferenceTexWidth, _OutlineReferenceTexWidthText); - _materialEditor.ShaderProperty(_ThresholdEnd, _ThresholdEndText); - _materialEditor.ShaderProperty(_OutlineSmoothness, _OutlineSmoothnessText); - _materialEditor.ShaderProperty(_Use8Neighbourhood, _Use8NeighbourhoodText); - _materialEditor.ShaderProperty(_OutlineMipLevel, _OutlineMipLevelText); - } - } - } - } - - #endregion - - #region Private Functions - - void SwitchShaderToOutlineSettings (Material material, bool enableOutline) { - - var shaderName = material.shader.name; - bool isSetToOutlineShader = shaderName.Contains(ShaderOutlineNamePrefix); - if (isSetToOutlineShader && !enableOutline) { - shaderName = shaderName.Replace(ShaderOutlineNamePrefix, ShaderNormalNamePrefix); - _materialEditor.SetShader(Shader.Find(shaderName), false); - return; - } - else if (!isSetToOutlineShader && enableOutline) { - shaderName = shaderName.Replace(ShaderNormalNamePrefix, ShaderOutlineNamePrefix); - _materialEditor.SetShader(Shader.Find(shaderName), false); - return; - } - } - - static bool IsOutlineEnabled (MaterialEditor editor, out bool mixedValue) { - mixedValue = false; - bool isAnyEnabled = false; - foreach (Material material in editor.targets) { - if (material.shader.name.Contains(ShaderOutlineNamePrefix)) { - isAnyEnabled = true; - } - else if (isAnyEnabled) { - mixedValue = true; - } - } - return isAnyEnabled; - } - - static bool IsShaderWithoutStandardVariantShader (MaterialEditor editor, out bool mixedValue) { - mixedValue = false; - bool isAnyShaderWithoutVariant = false; - foreach (Material material in editor.targets) { - if (material.shader.name.Contains(ShaderWithoutStandardVariantSuffix)) { - isAnyShaderWithoutVariant = true; - } - else if (isAnyShaderWithoutVariant) { - mixedValue = true; - } - } - return isAnyShaderWithoutVariant; - } - - static bool BoldToggleField (GUIContent label, bool value) { - FontStyle origFontStyle = EditorStyles.label.fontStyle; - EditorStyles.label.fontStyle = FontStyle.Bold; - value = EditorGUILayout.Toggle(label, value, EditorStyles.toggle); - EditorStyles.label.fontStyle = origFontStyle; - return value; - } - - #endregion -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonAnimationInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/SkeletonAnimationInspector.cs similarity index 56% rename from Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonAnimationInspector.cs rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonAnimationInspector.cs index c33232442..57d50427e 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonAnimationInspector.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/SkeletonAnimationInspector.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEditor; @@ -32,12 +32,12 @@ using UnityEngine; using Spine; namespace Spine.Unity.Editor { - + [CustomEditor(typeof(SkeletonAnimation))] [CanEditMultipleObjects] public class SkeletonAnimationInspector : SkeletonRendererInspector { protected SerializedProperty animationName, loop, timeScale, autoReset; - protected bool wasAnimationParameterChanged = false; + protected bool wasAnimationNameChanged; protected bool requireRepaint; readonly GUIContent LoopLabel = new GUIContent("Loop", "Whether or not .AnimationName should loop. This only applies to the initial animation specified in the inspector, or any subsequent Animations played through .AnimationName. Animations set through state.SetAnimation are unaffected."); readonly GUIContent TimeScaleLabel = new GUIContent("Time Scale", "The rate at which animations progress over time. 1 means normal speed. 0.5 means 50% speed."); @@ -54,53 +54,53 @@ namespace Spine.Unity.Editor { if (!TargetIsValid) return; bool sameData = SpineInspectorUtility.TargetsUseSameData(serializedObject); - foreach (var o in targets) - TrySetAnimation(o as SkeletonAnimation); - - EditorGUILayout.Space(); - if (!sameData) { - EditorGUILayout.DelayedTextField(animationName); + if (multi) { + foreach (var o in targets) + TrySetAnimation(o as SkeletonAnimation, multi); + + EditorGUILayout.Space(); + if (!sameData) { + EditorGUILayout.DelayedTextField(animationName); + } else { + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(animationName); + wasAnimationNameChanged |= EditorGUI.EndChangeCheck(); // Value used in the next update. + } + EditorGUILayout.PropertyField(loop); + EditorGUILayout.PropertyField(timeScale); + foreach (var o in targets) { + var component = o as SkeletonAnimation; + component.timeScale = Mathf.Max(component.timeScale, 0); + } } else { + TrySetAnimation(target as SkeletonAnimation, multi); + + EditorGUILayout.Space(); EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(animationName); - wasAnimationParameterChanged |= EditorGUI.EndChangeCheck(); // Value used in the next update. - } - - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(loop, LoopLabel); - wasAnimationParameterChanged |= EditorGUI.EndChangeCheck(); // Value used in the next update. - EditorGUILayout.PropertyField(timeScale, TimeScaleLabel); - foreach (var o in targets) { - var component = o as SkeletonAnimation; + wasAnimationNameChanged |= EditorGUI.EndChangeCheck(); // Value used in the next update. + EditorGUILayout.PropertyField(loop, LoopLabel); + EditorGUILayout.PropertyField(timeScale, TimeScaleLabel); + var component = (SkeletonAnimation)target; component.timeScale = Mathf.Max(component.timeScale, 0); + EditorGUILayout.Space(); } - EditorGUILayout.Space(); - SkeletonRootMotionParameter(); - - serializedObject.ApplyModifiedProperties(); - if (!isInspectingPrefab) { if (requireRepaint) { - UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); + SceneView.RepaintAll(); requireRepaint = false; } } } - protected void TrySetAnimation (SkeletonAnimation skeletonAnimation) { + protected void TrySetAnimation (SkeletonAnimation skeletonAnimation, bool multi) { if (skeletonAnimation == null) return; - if (!skeletonAnimation.valid || skeletonAnimation.AnimationState == null) + if (!skeletonAnimation.valid) return; - TrackEntry current = skeletonAnimation.AnimationState.GetCurrent(0); if (!isInspectingPrefab) { - string activeAnimation = (current != null) ? current.Animation.Name : ""; - bool activeLoop = (current != null) ? current.Loop : false; - bool animationParameterChanged = this.wasAnimationParameterChanged && - ((activeAnimation != animationName.stringValue) || (activeLoop != loop.boolValue)); - if (animationParameterChanged) { - this.wasAnimationParameterChanged = false; + if (wasAnimationNameChanged) { var skeleton = skeletonAnimation.Skeleton; var state = skeletonAnimation.AnimationState; @@ -112,10 +112,8 @@ namespace Spine.Unity.Editor { Spine.Animation animationToUse = skeleton.Data.FindAnimation(animationName.stringValue); if (!Application.isPlaying) { - if (animationToUse != null) { - skeletonAnimation.AnimationState.SetAnimation(0, animationToUse, loop.boolValue); - } - skeletonAnimation.Update(0); + if (animationToUse != null) animationToUse.PoseSkeleton(skeleton, 0f); + skeleton.UpdateWorldTransform(); skeletonAnimation.LateUpdate(); requireRepaint = true; } else { @@ -124,11 +122,14 @@ namespace Spine.Unity.Editor { else state.ClearTrack(0); } + + wasAnimationNameChanged = false; } // Reflect animationName serialized property in the inspector even if SetAnimation API was used. - if (Application.isPlaying) { - if (current != null && current.Animation != null) { + if (!multi && Application.isPlaying) { + TrackEntry current = skeletonAnimation.AnimationState.GetCurrent(0); + if (current != null) { if (skeletonAnimation.AnimationName != animationName.stringValue) animationName.stringValue = current.Animation.Name; } diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonAnimationInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/SkeletonAnimationInspector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonAnimationInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonAnimationInspector.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBaker.cs b/Assets/Spine/Editor/spine-unity/Editor/SkeletonBaker.cs similarity index 91% rename from Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBaker.cs rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonBaker.cs index a4bf07057..2d80e9712 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBaker.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/SkeletonBaker.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -47,7 +47,7 @@ namespace Spine.Unity.Editor { /// /// [SUPPORTS] - /// Linear, Constant, and Bezier Curves* + /// Linear, Constant, and Bezier Curves* /// Inverse Kinematics* /// Inherit Rotation /// Translate Timeline @@ -55,15 +55,15 @@ namespace Spine.Unity.Editor { /// Scale Timeline** /// Event Timeline*** /// Attachment Timeline - /// + /// /// RegionAttachment /// MeshAttachment (optionally Skinned) - /// + /// /// [LIMITATIONS] /// *Bezier Curves are baked into the animation at 60fps and are not realtime. Use bakeIncrement constant to adjust key density if desired. /// *Inverse Kinematics is baked into the animation at 60fps and are not realtime. Use bakeIncrement constant to adjust key density if desired. /// ***Events may only fire 1 type of data per event in Unity safely so priority to String data if present in Spine key, otherwise a Float is sent whether the Spine key was Int or Float with priority given to Int. - /// + /// /// [DOES NOT SUPPORT] /// FFD (Unity does not provide access to BlendShapes with code) /// Color Keys (Maybe one day when Unity supports full FBX standard and provides access with code) @@ -71,7 +71,7 @@ namespace Spine.Unity.Editor { /// public static class SkeletonBaker { - #region SkeletonMecanim's Mecanim Clips + #region SkeletonAnimator's Mecanim Clips #if SPINE_SKELETONMECANIM public static void UpdateMecanimClips (SkeletonDataAsset skeletonDataAsset) { if (skeletonDataAsset.controller == null) @@ -88,7 +88,7 @@ namespace Spine.Unity.Editor { } string dataPath = AssetDatabase.GetAssetPath(skeletonDataAsset); - string controllerPath = dataPath.Replace(AssetUtility.SkeletonDataSuffix, "_Controller").Replace(".asset", ".controller"); + string controllerPath = dataPath.Replace(SpineEditorUtilities.AssetUtility.SkeletonDataSuffix, "_Controller").Replace(".asset", ".controller"); UnityEditor.Animations.AnimatorController controller; if (skeletonDataAsset.controller != null) { controller = (UnityEditor.Animations.AnimatorController)skeletonDataAsset.controller; @@ -126,7 +126,7 @@ namespace Spine.Unity.Editor { Debug.LogWarningFormat("Duplicate AnimationClips were found named {0}", clip.name); } unityAnimationClipTable.Add(clip.name, clip); - } + } } } @@ -185,8 +185,10 @@ namespace Spine.Unity.Editor { return; } + #if !NEW_PREFAB_SYSTEM + if (outputPath == "") { - outputPath = System.IO.Path.GetDirectoryName(AssetDatabase.GetAssetPath(skeletonDataAsset)).Replace('\\', '/') + "/Baked"; + outputPath = System.IO.Path.GetDirectoryName(AssetDatabase.GetAssetPath(skeletonDataAsset)) + "/Baked"; System.IO.Directory.CreateDirectory(outputPath); } @@ -226,11 +228,11 @@ namespace Spine.Unity.Editor { List attachmentNames = new List(); for (int i = 0; i < skinCount; i++) { var skin = skins.Items[i]; - var skinEntries = new List(); - skin.GetAttachments(s, skinEntries); - foreach (var entry in skinEntries) { - if (!attachmentNames.Contains(entry.Name)) - attachmentNames.Add(entry.Name); + List temp = new List(); + skin.FindNamesForSlot(s, temp); + foreach (string str in temp) { + if (!attachmentNames.Contains(str)) + attachmentNames.Add(str); } } slotLookup.Add(s, attachmentNames); @@ -277,15 +279,9 @@ namespace Spine.Unity.Editor { string prefabPath = outputPath + "/" + skeletonDataAsset.skeletonJSON.name + " (" + skin.Name + ").prefab"; Object prefab = AssetDatabase.LoadAssetAtPath(prefabPath, typeof(GameObject)); - + if (prefab == null) { - #if NEW_PREFAB_SYSTEM - GameObject emptyGameObject = new GameObject(); - prefab = PrefabUtility.SaveAsPrefabAssetAndConnect(emptyGameObject, prefabPath, InteractionMode.AutomatedAction); - GameObject.DestroyImmediate(emptyGameObject); - #else prefab = PrefabUtility.CreateEmptyPrefab(prefabPath); - #endif newPrefab = true; } @@ -299,7 +295,7 @@ namespace Spine.Unity.Editor { } } - GameObject prefabRoot = EditorInstantiation.NewGameObject("root", true); + GameObject prefabRoot = SpineEditorUtilities.EditorInstantiation.NewGameObject("root"); Dictionary slotTable = new Dictionary(); Dictionary boneTable = new Dictionary(); @@ -308,7 +304,7 @@ namespace Spine.Unity.Editor { //create bones for (int i = 0; i < skeletonData.Bones.Count; i++) { var boneData = skeletonData.Bones.Items[i]; - Transform boneTransform = EditorInstantiation.NewGameObject(boneData.Name, true).transform; + Transform boneTransform = SpineEditorUtilities.EditorInstantiation.NewGameObject(boneData.Name).transform; boneTransform.parent = prefabRoot.transform; boneTable.Add(boneTransform.name, boneTransform); boneList.Add(boneTransform); @@ -337,20 +333,26 @@ namespace Spine.Unity.Editor { } //create slots and attachments - for (int slotIndex = 0; slotIndex < skeletonData.Slots.Count; slotIndex++) { - var slotData = skeletonData.Slots.Items[slotIndex]; - Transform slotTransform = EditorInstantiation.NewGameObject(slotData.Name, true).transform; + for (int i = 0; i < skeletonData.Slots.Count; i++) { + var slotData = skeletonData.Slots.Items[i]; + Transform slotTransform = SpineEditorUtilities.EditorInstantiation.NewGameObject(slotData.Name).transform; slotTransform.parent = prefabRoot.transform; slotTable.Add(slotData.Name, slotTransform); - var skinEntries = new List(); - skin.GetAttachments(slotIndex, skinEntries); - if (skin != skeletonData.DefaultSkin) - skeletonData.DefaultSkin.GetAttachments(slotIndex, skinEntries); + List attachments = new List(); + List attachmentNames = new List(); - for (int a = 0; a < skinEntries.Count; a++) { - var attachment = skinEntries[a].Attachment; - string attachmentName = skinEntries[a].Name; + skin.FindAttachmentsForSlot(i, attachments); + skin.FindNamesForSlot(i, attachmentNames); + + if (skin != skeletonData.DefaultSkin) { + skeletonData.DefaultSkin.FindAttachmentsForSlot(i, attachments); + skeletonData.DefaultSkin.FindNamesForSlot(i, attachmentNames); + } + + for (int a = 0; a < attachments.Count; a++) { + var attachment = attachments[a]; + string attachmentName = attachmentNames[a]; string attachmentMeshName = "[" + slotData.Name + "] " + attachmentName; Vector3 offset = Vector3.zero; float rotation = 0; @@ -378,10 +380,10 @@ namespace Spine.Unity.Editor { rotation = 0; if (isWeightedMesh) - mesh = ExtractWeightedMeshAttachment(attachmentMeshName, meshAttachment, slotIndex, skeletonData, boneList, mesh); + mesh = ExtractWeightedMeshAttachment(attachmentMeshName, meshAttachment, i, skeletonData, boneList, mesh); else mesh = ExtractMeshAttachment(attachmentMeshName, meshAttachment, mesh); - + material = attachment.GetMaterial(); unusedMeshNames.Remove(attachmentMeshName); if (newPrefab || meshTable.ContainsKey(attachmentMeshName) == false) @@ -389,7 +391,7 @@ namespace Spine.Unity.Editor { } else continue; - Transform attachmentTransform = EditorInstantiation.NewGameObject(attachmentName, true).transform; + Transform attachmentTransform = SpineEditorUtilities.EditorInstantiation.NewGameObject(attachmentName).transform; attachmentTransform.parent = slotTransform; attachmentTransform.localPosition = offset; @@ -408,7 +410,7 @@ namespace Spine.Unity.Editor { } attachmentTransform.GetComponent().sharedMaterial = material; - attachmentTransform.GetComponent().sortingOrder = slotIndex; + attachmentTransform.GetComponent().sortingOrder = i; if (attachmentName != slotData.AttachmentName) attachmentTransform.gameObject.SetActive(false); @@ -432,24 +434,16 @@ namespace Spine.Unity.Editor { } if (newPrefab) { - #if NEW_PREFAB_SYSTEM - PrefabUtility.SaveAsPrefabAssetAndConnect(prefabRoot, prefabPath, InteractionMode.AutomatedAction); - #else PrefabUtility.ReplacePrefab(prefabRoot, prefab, ReplacePrefabOptions.ConnectToPrefab); - #endif } else { foreach (string str in unusedMeshNames) { Mesh.DestroyImmediate(meshTable[str], true); } - #if NEW_PREFAB_SYSTEM - PrefabUtility.SaveAsPrefabAssetAndConnect(prefabRoot, prefabPath, InteractionMode.AutomatedAction); - #else PrefabUtility.ReplacePrefab(prefabRoot, prefab, ReplacePrefabOptions.ReplaceNameBased); - #endif } - + EditorGUIUtility.PingObject(prefab); @@ -457,8 +451,10 @@ namespace Spine.Unity.Editor { AssetDatabase.SaveAssets(); GameObject.DestroyImmediate(prefabRoot); - + } + #endif + } #region Attachment Baking @@ -506,7 +502,7 @@ namespace Spine.Unity.Editor { if (centered) { bone.X = -attachment.X; bone.Y = -attachment.Y; - } + } bone.UpdateWorldTransform(); @@ -621,7 +617,7 @@ namespace Spine.Unity.Editor { int[] triangles = attachment.Triangles; Color color = new Color(attachment.R, attachment.G, attachment.B, attachment.A); - mesh = (mesh == null) ? new Mesh() : mesh; + mesh = mesh ?? new Mesh(); mesh.triangles = new int[0]; @@ -673,7 +669,7 @@ namespace Spine.Unity.Editor { for (int b = 0; b < pairs.Count; b++) { if (b > 3) { if (warningBuilder.Length == 0) - warningBuilder.Insert(0, "[Weighted Mesh: " + name + "]\r\nUnity only supports 4 weight influences per vertex! The 4 strongest influences will be used.\r\n"); + warningBuilder.Insert(0, "[Weighted Mesh: " + name + "]\r\nUnity only supports 4 weight influences per vertex! The 4 strongest influences will be used.\r\n"); warningBuilder.AppendFormat("{0} ignored on vertex {1}!\r\n", pairs[b].bone.name, i); continue; @@ -834,7 +830,7 @@ namespace Spine.Unity.Editor { Skeleton skeleton = bone.Skeleton; bool inheritRotation = bone.Data.TransformMode.InheritsRotation(); - animation.Apply(skeleton, 0, 0, false, null, 1f, MixBlend.Setup, MixDirection.In); + animation.PoseSkeleton(skeleton, 0); skeleton.UpdateWorldTransform(); float duration = animation.Duration; @@ -862,7 +858,7 @@ namespace Spine.Unity.Editor { if (i == steps) currentTime = duration; - animation.Apply(skeleton, 0, currentTime, true, null, 1f, MixBlend.Setup, MixDirection.In); + animation.PoseSkeleton(skeleton, currentTime, true); skeleton.UpdateWorldTransform(); int pIndex = listIndex - 1; @@ -1311,14 +1307,9 @@ namespace Spine.Unity.Editor { var animEvents = new List(); for (int i = 0, n = frames.Length; i < n; i++) { var spineEvent = events[i]; - string eventName = spineEvent.Data.Name; - if (SpineEditorUtilities.Preferences.mecanimEventIncludeFolderName) - eventName = eventName.Replace("/", ""); // calls method FolderNameEventName() - else - eventName = eventName.Substring(eventName.LastIndexOf('/') + 1); // calls method EventName() var unityAnimationEvent = new AnimationEvent { time = frames[i], - functionName = eventName, + functionName = spineEvent.Data.Name, messageOptions = eventOptions }; @@ -1424,9 +1415,9 @@ namespace Spine.Unity.Editor { atlasAsset.GetAtlas(); // Initializes atlasAsset. string atlasAssetPath = AssetDatabase.GetAssetPath(atlasAsset); - string atlasAssetDirPath = Path.GetDirectoryName(atlasAssetPath).Replace('\\', '/'); + string atlasAssetDirPath = Path.GetDirectoryName(atlasAssetPath); string bakedDirPath = Path.Combine(atlasAssetDirPath, atlasAsset.name); - string bakedPrefabPath = Path.Combine(bakedDirPath, AssetUtility.GetPathSafeName(region.name) + ".prefab").Replace("\\", "/"); + string bakedPrefabPath = Path.Combine(bakedDirPath, SpineEditorUtilities.AssetUtility.GetPathSafeName(region.name) + ".prefab").Replace("\\", "/"); GameObject prefab = (GameObject)AssetDatabase.LoadAssetAtPath(bakedPrefabPath, typeof(GameObject)); GameObject root; @@ -1437,7 +1428,7 @@ namespace Spine.Unity.Editor { Directory.CreateDirectory(bakedDirPath); if (prefab == null) { - root = EditorInstantiation.NewGameObject("temp", true, typeof(MeshFilter), typeof(MeshRenderer)); + root = SpineEditorUtilities.EditorInstantiation.NewGameObject("temp", typeof(MeshFilter), typeof(MeshRenderer)); #if NEW_PREFAB_SYSTEM prefab = PrefabUtility.SaveAsPrefabAsset(root, bakedPrefabPath); #else diff --git a/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBaker.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/SkeletonBaker.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBaker.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonBaker.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBakingWindow.cs b/Assets/Spine/Editor/spine-unity/Editor/SkeletonBakingWindow.cs similarity index 87% rename from Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBakingWindow.cs rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonBakingWindow.cs index 62870d00d..ac35c57b4 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBakingWindow.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/SkeletonBakingWindow.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,18 +15,22 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER +#define NEW_PREFAB_SYSTEM +#endif + using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -40,6 +44,7 @@ namespace Spine.Unity.Editor { public class SkeletonBakingWindow : EditorWindow { const bool IsUtilityWindow = true; + #if !NEW_PREFAB_SYSTEM [MenuItem("CONTEXT/SkeletonDataAsset/Skeleton Baking", false, 5000)] public static void Init (MenuCommand command) { var window = EditorWindow.GetWindow(IsUtilityWindow); @@ -49,6 +54,7 @@ namespace Spine.Unity.Editor { window.skeletonDataAsset = command.context as SkeletonDataAsset; window.Show(); } + #endif public SkeletonDataAsset skeletonDataAsset; [SpineSkin(dataField:"skeletonDataAsset")] @@ -69,7 +75,7 @@ namespace Spine.Unity.Editor { void OnGUI () { so = so ?? new SerializedObject(this); - + EditorGUIUtility.wideMode = true; EditorGUILayout.LabelField("Spine Skeleton Prefab Baking", EditorStyles.boldLabel); @@ -81,7 +87,7 @@ namespace Spine.Unity.Editor { "\n\tLocal Shear" + "\n\tAll Constraint types" + "\n\tWeighted mesh verts with more than 4 bound bones" + - + "\n\nBaked Animations do not support the following:" + "\n\tMesh Deform Keys" + "\n\tColor Keys" + @@ -141,10 +147,10 @@ namespace Spine.Unity.Editor { } } EditorGUILayout.Space(); - + if (!string.IsNullOrEmpty(skinToBake) && UnityEngine.Event.current.type == EventType.Repaint) bakeSkin = skeletonData.FindSkin(skinToBake) ?? skeletonData.DefaultSkin; - + var prefabIcon = EditorGUIUtility.FindTexture("PrefabModel Icon"); if (hasExtraSkins) { @@ -166,8 +172,8 @@ namespace Spine.Unity.Editor { if (SpineInspectorUtility.LargeCenteredButton(SpineInspectorUtility.TempContent("Bake Skeleton", prefabIcon))) { SkeletonBaker.BakeToPrefab(skeletonDataAsset, new ExposedList(new[] { bakeSkin }), "", bakeAnimations, bakeIK, bakeEventOptions); } - - } + + } } } diff --git a/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBakingWindow.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/SkeletonBakingWindow.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBakingWindow.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonBakingWindow.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/SkeletonDataAssetInspector.cs similarity index 85% rename from Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonDataAssetInspector.cs index 5cb6eca00..4641eb68d 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/SkeletonDataAssetInspector.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #define SPINE_SKELETON_MECANIM @@ -40,7 +40,7 @@ using System.Collections.Generic; using UnityEditor; using UnityEngine; -using CompatibilityProblemInfo = Spine.Unity.SkeletonDataCompatibility.CompatibilityProblemInfo; +using Spine; namespace Spine.Unity.Editor { using Event = UnityEngine.Event; @@ -56,7 +56,6 @@ namespace Spine.Unity.Editor { SerializedProperty atlasAssets, skeletonJSON, scale, fromAnimation, toAnimation, duration, defaultMix; SerializedProperty skeletonDataModifiers; - SerializedProperty blendModeMaterials; #if SPINE_TK2D SerializedProperty spriteCollection; #endif @@ -70,7 +69,6 @@ namespace Spine.Unity.Editor { SkeletonData targetSkeletonData; readonly List warnings = new List(); - CompatibilityProblemInfo compatibilityProblemInfo = null; readonly SkeletonInspectorPreview preview = new SkeletonInspectorPreview(); GUIStyle activePlayButtonStyle, idlePlayButtonStyle; @@ -79,7 +77,7 @@ namespace Spine.Unity.Editor { string TargetAssetGUID { get { return AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(targetSkeletonDataAsset)); } } string LastSkinKey { get { return TargetAssetGUID + "_lastSkin"; } } string LastSkinName { get { return EditorPrefs.GetString(LastSkinKey, ""); } } - + void OnEnable () { InitializeEditor(); } @@ -97,8 +95,7 @@ namespace Spine.Unity.Editor { public void UpdateSkeletonData () { preview.Clear(); InitializeEditor(); - if (targetSkeletonDataAsset) - EditorUtility.SetDirty(targetSkeletonDataAsset); + EditorUtility.SetDirty(targetSkeletonDataAsset); } void InitializeEditor () { @@ -115,7 +112,6 @@ namespace Spine.Unity.Editor { defaultMix = serializedObject.FindProperty("defaultMix"); skeletonDataModifiers = serializedObject.FindProperty("skeletonDataModifiers"); - blendModeMaterials = serializedObject.FindProperty("blendModeMaterials"); #if SPINE_SKELETON_MECANIM controller = serializedObject.FindProperty("controller"); @@ -127,7 +123,7 @@ namespace Spine.Unity.Editor { #else // Analysis disable once ConvertIfToOrExpression if (newAtlasAssets) atlasAssets.isExpanded = true; - #endif +#endif // This handles the case where the managed editor assembly is unloaded before recompilation when code changes. AppDomain.CurrentDomain.DomainUnload -= OnDomainUnload; @@ -141,15 +137,15 @@ namespace Spine.Unity.Editor { PopulateWarnings(); if (targetSkeletonDataAsset.skeletonJSON == null) { targetSkeletonData = null; - return; + return; } - targetSkeletonData = NoProblems() ? targetSkeletonDataAsset.GetSkeletonData(false) : null; + targetSkeletonData = warnings.Count == 0 ? targetSkeletonDataAsset.GetSkeletonData(false) : null; - if (targetSkeletonData != null && NoProblems()) { + if (targetSkeletonData != null && warnings.Count <= 0) { preview.Initialize(this.Repaint, targetSkeletonDataAsset, this.LastSkinName); } - + } void Clear () { @@ -184,9 +180,6 @@ namespace Spine.Unity.Editor { using (new SpineInspectorUtility.BoxScope()) DrawSkeletonDataFields(); - if (compatibilityProblemInfo != null) - return; - using (new SpineInspectorUtility.BoxScope()) { DrawAtlasAssetsFields(); HandleAtlasAssetsNulls(); @@ -206,7 +199,7 @@ namespace Spine.Unity.Editor { } // Unity Quirk: Some code depends on valid preview. If preview is initialized elsewhere, this can cause contents to change between Layout and Repaint events, causing GUILayout control count errors. - if (NoProblems()) + if (warnings.Count <= 0) preview.Initialize(this.Repaint, targetSkeletonDataAsset, this.LastSkinName); if (targetSkeletonData != null) { @@ -222,7 +215,7 @@ namespace Spine.Unity.Editor { DrawAnimationList(); if (targetSkeletonData.Animations.Count > 0) { const string AnimationReferenceButtonText = "Create Animation Reference Assets"; - const string AnimationReferenceTooltipText = "AnimationReferenceAsset acts as Unity asset for a reference to a Spine.Animation. This can be used in inspectors.\n\nIt serializes a reference to a SkeletonDataAsset and an animationName.\n\nAt runtime, a reference to its Spine.Animation is loaded and cached into the object to be used as needed. This skips the need to find and cache animation references in individual MonoBehaviours."; + const string AnimationReferenceTooltipText = "AnimationReferenceAsset acts as Unity asset for a reference to a Spine.Animation. This can be used in inspectors.\n\nIt serializes a reference to a SkeletonDataAsset and an animationName.\n\nAt runtime, a reference to its Spine.Animation is loaded and cached into the object to be used as needed. This skips the need to find and cache animation references in individual MonoBehaviours."; if (GUILayout.Button(SpineInspectorUtility.TempContent(AnimationReferenceButtonText, Icons.animationRoot, AnimationReferenceTooltipText), GUILayout.Width(250), GUILayout.Height(26))) { CreateAnimationReferenceAssets(); } @@ -262,7 +255,7 @@ namespace Spine.Unity.Editor { FieldInfo nameField = typeof(AnimationReferenceAsset).GetField("animationName", BindingFlags.NonPublic | BindingFlags.Instance); FieldInfo skeletonDataAssetField = typeof(AnimationReferenceAsset).GetField("skeletonDataAsset", BindingFlags.NonPublic | BindingFlags.Instance); foreach (var animation in targetSkeletonData.Animations) { - string assetPath = string.Format("{0}/{1}.asset", dataPath, AssetUtility.GetPathSafeName(animation.Name)); + string assetPath = string.Format("{0}/{1}.asset", dataPath, SpineEditorUtilities.AssetUtility.GetPathSafeName(animation.Name)); AnimationReferenceAsset existingAsset = AssetDatabase.LoadAssetAtPath(assetPath); if (existingAsset == null) { AnimationReferenceAsset newAsset = ScriptableObject.CreateInstance(); @@ -280,7 +273,7 @@ namespace Spine.Unity.Editor { } void OnInspectorGUIMulti () { - + // Skeleton data file field. using (new SpineInspectorUtility.BoxScope()) { EditorGUILayout.LabelField("SkeletonData", EditorStyles.boldLabel); @@ -288,8 +281,6 @@ namespace Spine.Unity.Editor { EditorGUILayout.DelayedFloatField(scale); //EditorGUILayout.PropertyField(scale); EditorGUILayout.Space(); EditorGUILayout.PropertyField(skeletonDataModifiers, true); - - DrawBlendModeMaterialProperties(); } // Texture source field. @@ -315,27 +306,6 @@ namespace Spine.Unity.Editor { } - void DrawBlendModeMaterialProperties () { - if (skeletonDataModifiers.arraySize > 0) { - EditorGUILayout.BeginHorizontal(GUILayout.Height(EditorGUIUtility.singleLineHeight + 5)); - EditorGUILayout.PrefixLabel("Blend Modes"); - if (GUILayout.Button(new GUIContent("Upgrade", "Upgrade BlendModeMaterialAsset to built-in BlendModeMaterials."), EditorStyles.miniButton, GUILayout.Width(65f))) { - foreach (SkeletonDataAsset skeletonData in targets) { - BlendModeMaterialsUtility.UpgradeBlendModeMaterials(skeletonData); - } - } - EditorGUILayout.EndHorizontal(); - } - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(blendModeMaterials, true); - if (EditorGUI.EndChangeCheck()) { - serializedObject.ApplyModifiedProperties(); - foreach (SkeletonDataAsset skeletonData in targets) { - BlendModeMaterialsUtility.UpdateBlendModeMaterials(skeletonData); - } - } - } - void DrawSkeletonDataFields () { using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.LabelField("SkeletonData", EditorStyles.boldLabel); @@ -347,17 +317,9 @@ namespace Spine.Unity.Editor { } } EditorGUILayout.PropertyField(skeletonJSON, SpineInspectorUtility.TempContent(skeletonJSON.displayName, Icons.spine)); - - if (compatibilityProblemInfo != null) { - EditorGUILayout.LabelField(SpineInspectorUtility.TempContent(compatibilityProblemInfo.DescriptionString(), Icons.warning), GUILayout.Height(52)); - return; - } - EditorGUILayout.DelayedFloatField(scale); //EditorGUILayout.PropertyField(scale); EditorGUILayout.Space(); EditorGUILayout.PropertyField(skeletonDataModifiers, true); - - DrawBlendModeMaterialProperties(); } void DrawAtlasAssetsFields () { @@ -414,7 +376,7 @@ namespace Spine.Unity.Editor { using (new SpineInspectorUtility.IndentScope()) SpineInspectorUtility.PropertyFieldWideLabel(defaultMix, DefaultMixLabel, 160); - + if (fromAnimation.arraySize > 0) { using (new SpineInspectorUtility.IndentScope()) { EditorGUILayout.LabelField("Custom Mix Durations", EditorStyles.boldLabel); @@ -438,7 +400,7 @@ namespace Spine.Unity.Editor { } } } - } + } using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.Space(); @@ -464,7 +426,7 @@ namespace Spine.Unity.Editor { return; bool isPreviewWindowOpen = preview.IsValid; - + if (isPreviewWindowOpen) { if (GUILayout.Button(SpineInspectorUtility.TempContent("Setup Pose", Icons.skeleton), GUILayout.Width(105), GUILayout.Height(18))) { preview.ClearAnimationSetupPose(); @@ -518,46 +480,47 @@ namespace Spine.Unity.Editor { int attachmentCount = skin.Attachments.Count; EditorGUILayout.LabelField(SpineInspectorUtility.TempContent(string.Format("{0} ({1} attachment{2})", skin.Name, attachmentCount, SpineInspectorUtility.PluralThenS(attachmentCount)), Icons.skin)); } - + } } - var slotAttachments = new List(); - var defaultSkinAttachments = new List(); + var slotAttachments = new List(); + var slotAttachmentNames = new List(); + var defaultSkinAttachmentNames = new List(); var slotsItems = preview.Skeleton.Slots.Items; for (int i = preview.Skeleton.Slots.Count - 1; i >= 0; i--) { Slot slot = slotsItems[i]; EditorGUILayout.LabelField(SpineInspectorUtility.TempContent(slot.Data.Name, Icons.slot)); if (showAttachments) { slotAttachments.Clear(); - defaultSkinAttachments.Clear(); + slotAttachmentNames.Clear(); + defaultSkinAttachmentNames.Clear(); using (new SpineInspectorUtility.IndentScope()) { { - skin.GetAttachments(i, slotAttachments); - if (defaultSkin != null) { - if (skin != defaultSkin) { - defaultSkin.GetAttachments(i, slotAttachments); - defaultSkin.GetAttachments(i, defaultSkinAttachments); - } - else { - defaultSkin.GetAttachments(i, defaultSkinAttachments); - } + skin.FindNamesForSlot(i, slotAttachmentNames); + skin.FindAttachmentsForSlot(i, slotAttachments); + + if (skin != defaultSkin) { + defaultSkin.FindNamesForSlot(i, defaultSkinAttachmentNames); + defaultSkin.FindNamesForSlot(i, slotAttachmentNames); + defaultSkin.FindAttachmentsForSlot(i, slotAttachments); + } else { + defaultSkin.FindNamesForSlot(i, defaultSkinAttachmentNames); } } for (int a = 0; a < slotAttachments.Count; a++) { - var skinEntry = slotAttachments[a]; - Attachment attachment = skinEntry.Attachment; - string attachmentName = skinEntry.Name; - bool attachmentIsFromSkin = !defaultSkinAttachments.Contains(skinEntry); + Attachment attachment = slotAttachments[a]; + string attachmentName = slotAttachmentNames[a]; + bool attachmentIsFromSkin = !defaultSkinAttachmentNames.Contains(attachmentName); Texture2D attachmentTypeIcon = Icons.GetAttachmentIcon(attachment); bool initialState = slot.Attachment == attachment; Texture2D iconToUse = attachmentIsFromSkin ? Icons.skinPlaceholder : attachmentTypeIcon; bool toggled = EditorGUILayout.ToggleLeft(SpineInspectorUtility.TempContent(attachmentName, iconToUse), slot.Attachment == attachment, GUILayout.MinWidth(150f)); - + if (attachmentIsFromSkin) { Rect extraIconRect = GUILayoutUtility.GetLastRect(); extraIconRect.x += extraIconRect.width - (attachmentTypeIcon.width * 2f); @@ -576,13 +539,13 @@ namespace Spine.Unity.Editor { } } } - + } void DrawUnityTools () { #if SPINE_SKELETON_MECANIM using (new SpineInspectorUtility.BoxScope()) { - isMecanimExpanded = EditorGUILayout.Foldout(isMecanimExpanded, SpineInspectorUtility.TempContent("SkeletonMecanim", SpineInspectorUtility.UnityIcon())); + isMecanimExpanded = EditorGUILayout.Foldout(isMecanimExpanded, SpineInspectorUtility.TempContent("SkeletonAnimator", SpineInspectorUtility.UnityIcon())); if (isMecanimExpanded) { using (new SpineInspectorUtility.IndentScope()) { EditorGUILayout.PropertyField(controller, SpineInspectorUtility.TempContent("Controller", SpineInspectorUtility.UnityIcon())); @@ -594,7 +557,7 @@ namespace Spine.Unity.Editor { if (GUILayout.Button(SpineInspectorUtility.TempContent("Generate Mecanim Controller"), GUILayout.Height(20))) SkeletonBaker.GenerateMecanimAnimationClips(targetSkeletonDataAsset); } - EditorGUILayout.HelpBox("SkeletonMecanim is the Mecanim alternative to SkeletonAnimation.\nIt is not required.", MessageType.Info); + EditorGUILayout.HelpBox("SkeletonAnimator is the Mecanim alternative to SkeletonAnimation.\nIt is not required.", MessageType.Info); } else { @@ -619,18 +582,13 @@ namespace Spine.Unity.Editor { void PopulateWarnings () { warnings.Clear(); - compatibilityProblemInfo = null; if (skeletonJSON.objectReferenceValue == null) { warnings.Add("Missing Skeleton JSON"); } else { var fieldValue = (TextAsset)skeletonJSON.objectReferenceValue; - string problemDescription = null; - if (!AssetUtility.IsSpineData(fieldValue, out compatibilityProblemInfo, ref problemDescription)) { - if (problemDescription != null) - warnings.Add(problemDescription); - else - warnings.Add("Skeleton data file is not a valid Spine JSON or binary file."); + if (!SpineEditorUtilities.AssetUtility.IsSpineData(fieldValue)) { + warnings.Add("Skeleton data file is not a valid Spine JSON or binary file."); } else { #if SPINE_TK2D bool searchForSpineAtlasAssets = true; @@ -647,12 +605,11 @@ namespace Spine.Unity.Editor { var actualAtlasAssets = targetSkeletonDataAsset.atlasAssets; for (int i = 0; i < actualAtlasAssets.Length; i++) { - if (actualAtlasAssets[i] == null) { + if (targetSkeletonDataAsset.atlasAssets[i] == null) { detectedNullAtlasEntry = true; break; } else { - if (actualAtlasAssets[i].MaterialCount > 0) - atlasList.Add(actualAtlasAssets[i].GetAtlas()); + atlasList.Add(actualAtlasAssets[i].GetAtlas()); } } @@ -661,10 +618,9 @@ namespace Spine.Unity.Editor { } else { List missingPaths = null; if (atlasAssets.arraySize > 0) { - missingPaths = AssetUtility.GetRequiredAtlasRegions(AssetDatabase.GetAssetPath(skeletonJSON.objectReferenceValue)); + missingPaths = SpineEditorUtilities.AssetUtility.GetRequiredAtlasRegions(AssetDatabase.GetAssetPath(skeletonJSON.objectReferenceValue)); + foreach (var atlas in atlasList) { - if (atlas == null) - continue; for (int i = 0; i < missingPaths.Count; i++) { if (atlas.FindRegion(missingPaths[i]) != null) { missingPaths.RemoveAt(i); @@ -683,7 +639,7 @@ namespace Spine.Unity.Editor { foreach (string missingRegion in missingPaths) warnings.Add(string.Format("Missing Region: '{0}'", missingRegion)); } - + } } @@ -692,7 +648,7 @@ namespace Spine.Unity.Editor { } void DoReimport () { - AssetUtility.ImportSpineContent(new [] { AssetDatabase.GetAssetPath(skeletonJSON.objectReferenceValue) }, null, true); + SpineEditorUtilities.AssetUtility.ImportSpineContent(new [] { AssetDatabase.GetAssetPath(skeletonJSON.objectReferenceValue) }, true); preview.Clear(); InitializeEditor(); EditorUtility.SetDirty(targetSkeletonDataAsset); @@ -702,17 +658,13 @@ namespace Spine.Unity.Editor { EditorPrefs.SetString(LastSkinKey, skinName); } - bool NoProblems() { - return warnings.Count == 0 && compatibilityProblemInfo == null; - } - #region Preview Handlers void HandleOnDestroyPreview () { EditorApplication.update -= preview.HandleEditorUpdate; preview.OnDestroy(); } - override public bool HasPreviewGUI () { + override public bool HasPreviewGUI () { if (serializedObject.isEditingMultipleObjects) return false; @@ -726,7 +678,7 @@ namespace Spine.Unity.Editor { } override public void OnInteractivePreviewGUI (Rect r, GUIStyle background) { - if (NoProblems()) { + if (warnings.Count <= 0) { preview.Initialize(this.Repaint, targetSkeletonDataAsset, this.LastSkinName); preview.HandleInteractivePreviewGUI(r, background); } @@ -748,7 +700,10 @@ namespace Spine.Unity.Editor { SkeletonAnimation skeletonAnimation; GameObject previewGameObject; internal bool requiresRefresh; + + #if !SPINE_UNITY_2018_PREVIEW_API float animationLastTime; + #endif static float CurrentTime { get { return (float)EditorApplication.timeSinceStartup; } } @@ -840,12 +795,14 @@ namespace Spine.Unity.Editor { return; } - const int PreviewLayer = 30; - const int PreviewCameraCullingMask = 1 << PreviewLayer; - if (previewRenderUtility == null) { previewRenderUtility = new PreviewRenderUtility(true); + #if !SPINE_UNITY_2018_PREVIEW_API animationLastTime = CurrentTime; + #endif + + const int PreviewLayer = 30; + const int PreviewCameraCullingMask = 1 << PreviewLayer; { var c = this.PreviewUtilityCamera; @@ -858,32 +815,32 @@ namespace Spine.Unity.Editor { } DestroyPreviewGameObject(); - } - if (previewGameObject == null) { - try { - previewGameObject = EditorInstantiation.InstantiateSkeletonAnimation(skeletonDataAsset, skinName, useObjectFactory:false).gameObject; + if (previewGameObject == null) { + try { + previewGameObject = SpineEditorUtilities.EditorInstantiation.InstantiateSkeletonAnimation(skeletonDataAsset, skinName).gameObject; - if (previewGameObject != null) { - previewGameObject.hideFlags = HideFlags.HideAndDontSave; - previewGameObject.layer = PreviewLayer; - skeletonAnimation = previewGameObject.GetComponent(); - skeletonAnimation.initialSkinName = skinName; - skeletonAnimation.LateUpdate(); - previewGameObject.GetComponent().enabled = false; + if (previewGameObject != null) { + previewGameObject.hideFlags = HideFlags.HideAndDontSave; + previewGameObject.layer = PreviewLayer; + skeletonAnimation = previewGameObject.GetComponent(); + skeletonAnimation.initialSkinName = skinName; + skeletonAnimation.LateUpdate(); + previewGameObject.GetComponent().enabled = false; - #if SPINE_UNITY_2018_PREVIEW_API - previewRenderUtility.AddSingleGO(previewGameObject); - #endif + #if SPINE_UNITY_2018_PREVIEW_API + previewRenderUtility.AddSingleGO(previewGameObject); + #endif + } + + if (this.ActiveTrack != null) cameraAdjustEndFrame = EditorApplication.timeSinceStartup + skeletonAnimation.AnimationState.GetCurrent(0).Alpha; + AdjustCameraGoals(); + } catch { + DestroyPreviewGameObject(); } - if (this.ActiveTrack != null) cameraAdjustEndFrame = EditorApplication.timeSinceStartup + skeletonAnimation.AnimationState.GetCurrent(0).Alpha; - AdjustCameraGoals(); - } catch { - DestroyPreviewGameObject(); + RefreshOnNextUpdate(); } - - RefreshOnNextUpdate(); } } @@ -930,12 +887,14 @@ namespace Spine.Unity.Editor { var renderer = go.GetComponent(); renderer.enabled = true; - + if (!EditorApplication.isPlaying) { + #if !SPINE_UNITY_2018_PREVIEW_API float current = CurrentTime; float deltaTime = (current - animationLastTime); skeletonAnimation.Update(deltaTime); animationLastTime = current; + #endif skeletonAnimation.LateUpdate(); } @@ -1054,7 +1013,7 @@ namespace Spine.Unity.Editor { if (isEmpty) { skeleton.SetToSetupPose(); animationState.SetAnimation(0, targetAnimation, loop); - } else { + } else { bool sameAnimation = (currentTrack.Animation == targetAnimation); if (sameAnimation) { currentTrack.TimeScale = (currentTrack.TimeScale == 0) ? 1f : 0f; // pause/play @@ -1158,7 +1117,7 @@ namespace Spine.Unity.Editor { float lineRectWidth = lineRect.width; TrackEntry t = skeletonAnimation.AnimationState.GetCurrent(0); - if (t != null && Icons.userEvent != null) { // when changing to play mode, Icons.userEvent will not be reset + if (t != null) { int loopCount = (int)(t.TrackTime / t.TrackEnd); float currentTime = t.TrackTime - (t.TrackEnd * loopCount); float normalizedTime = currentTime / t.Animation.Duration; @@ -1176,15 +1135,14 @@ namespace Spine.Unity.Editor { for (int i = 0; i < currentAnimationEvents.Count; i++) { float eventTime = currentAnimationEventTimes[i]; var userEventIcon = Icons.userEvent; - float iconX = Mathf.Max(((eventTime / t.Animation.Duration) * lineRectWidth) - (userEventIcon.width / 2), barRect.x); - float iconY = barRect.y + userEventIcon.height; var evRect = new Rect(barRect) { - x = iconX, - y = iconY, + x = Mathf.Max(((eventTime / t.Animation.Duration) * lineRectWidth) - (userEventIcon.width / 2), barRect.x), + y = barRect.y + userEventIcon.height, width = userEventIcon.width, height = userEventIcon.height }; GUI.DrawTexture(evRect, userEventIcon); + Event ev = Event.current; if (ev.type == EventType.Repaint) { if (evRect.Contains(ev.mousePosition)) { diff --git a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/SkeletonDataAssetInspector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonDataAssetInspector.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonDebugWindow.cs b/Assets/Spine/Editor/spine-unity/Editor/SkeletonDebugWindow.cs similarity index 92% rename from Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonDebugWindow.cs rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonDebugWindow.cs index 4170a5542..4cf6c69ef 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonDebugWindow.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/SkeletonDebugWindow.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ // With contributions from: Mitch Thompson @@ -84,7 +84,7 @@ namespace Spine.Unity.Editor { [SpineBone(dataField:"skeletonRenderer")] public string boneName; - readonly Dictionary> attachmentTable = new Dictionary>(); + readonly Dictionary> attachmentTable = new Dictionary>(); static bool staticLostValues = true; @@ -101,7 +101,7 @@ namespace Spine.Unity.Editor { if (bone != null) { SpineHandles.DrawBone(skeletonRenderer.transform, bone, 1.5f, Color.cyan); Handles.Label(bone.GetWorldPosition(skeletonRenderer.transform) + (Vector3.down * 0.15f), bone.Data.Name, SpineHandles.BoneNameStyle); - } + } } void OnSelectionChange () { @@ -123,7 +123,7 @@ namespace Spine.Unity.Editor { if (selectedSkeletonRenderer == null) { noSkeletonRenderer = true; } else if (skeletonRenderer != selectedSkeletonRenderer) { - + bone = null; if (skeletonRenderer != null && skeletonRenderer.SkeletonDataAsset != selectedSkeletonRenderer.SkeletonDataAsset) boneName = null; @@ -139,7 +139,7 @@ namespace Spine.Unity.Editor { #endif UpdateAttachments(); } - } + } if (noSkeletonRenderer) Clear(); Repaint(); @@ -194,7 +194,7 @@ namespace Spine.Unity.Editor { EditorGUILayout.Space(); EditorGUI.BeginDisabledGroup(true); - EditorGUILayout.ObjectField(SpineInspectorUtility.TempContent("Debug Selection", Icons.spine), skeletonRenderer, typeof(SkeletonRenderer), true); + EditorGUILayout.ObjectField(SpineInspectorUtility.TempContent("Debug Selection", Icons.spine), skeletonRenderer, typeof(SkeletonRenderer), true); EditorGUI.EndDisabledGroup(); if (skeleton == null || skeletonRenderer == null) { @@ -209,7 +209,7 @@ namespace Spine.Unity.Editor { if (!skeletonRenderer.valid) { EditorGUILayout.HelpBox("Spine Component is invalid. Check SkeletonData Asset.", MessageType.Error); - return; + return; } if (activeSkin != skeleton.Skin) @@ -338,7 +338,7 @@ namespace Spine.Unity.Editor { } int baseIndent = EditorGUI.indentLevel; - foreach (KeyValuePair> pair in attachmentTable) { + foreach (KeyValuePair> pair in attachmentTable) { Slot slot = pair.Key; using (new EditorGUILayout.HorizontalScope()) { @@ -352,8 +352,7 @@ namespace Spine.Unity.Editor { } } - foreach (var skinEntry in pair.Value) { - var attachment = skinEntry.Attachment; + foreach (var attachment in pair.Value) { GUI.contentColor = slot.Attachment == attachment ? Color.white : Color.grey; EditorGUI.indentLevel = baseIndent + 2; var icon = Icons.GetAttachmentIcon(attachment); @@ -471,7 +470,7 @@ namespace Spine.Unity.Editor { showDrawOrderTree.target = EditorGUILayout.Foldout(showDrawOrderTree.target, SpineInspectorUtility.TempContent("Draw Order and Separators", Icons.slotRoot), BoldFoldoutStyle); - //var separatorSlotNamesField = + //var separatorSlotNamesField = //SpineInspectorUtility.ge if (showDrawOrderTree.faded > 0) { using (new SpineInspectorUtility.IndentScope()) { @@ -482,10 +481,7 @@ namespace Spine.Unity.Editor { if (Application.isPlaying) { foreach (var slot in skeleton.DrawOrder) { if (skeletonRenderer.separatorSlots.Contains(slot)) EditorGUILayout.LabelField(SeparatorString); - - using (new EditorGUI.DisabledScope(!slot.Bone.Active)) { - EditorGUILayout.LabelField(SpineInspectorUtility.TempContent(slot.Data.Name, Icons.slot), GUILayout.ExpandWidth(false)); - } + EditorGUILayout.LabelField(SpineInspectorUtility.TempContent(slot.Data.Name, Icons.slot), GUILayout.ExpandWidth(false)); } } else { foreach (var slot in skeleton.DrawOrder) { @@ -496,12 +492,10 @@ namespace Spine.Unity.Editor { break; } } - using (new EditorGUI.DisabledScope(!slot.Bone.Active)) { - EditorGUILayout.LabelField(SpineInspectorUtility.TempContent(slot.Data.Name, Icons.slot), GUILayout.ExpandWidth(false)); - } + EditorGUILayout.LabelField(SpineInspectorUtility.TempContent(slot.Data.Name, Icons.slot), GUILayout.ExpandWidth(false)); } } - + } } } @@ -578,12 +572,10 @@ namespace Spine.Unity.Editor { attachmentTable.Clear(); for (int i = skeleton.Slots.Count - 1; i >= 0; i--) { - var attachments = new List(); + var attachments = new List(); attachmentTable.Add(skeleton.Slots.Items[i], attachments); - // Add skin attachments. - skin.GetAttachments(i, attachments); - if (notDefaultSkin && defaultSkin != null) // Add default skin attachments. - defaultSkin.GetAttachments(i, attachments); + skin.FindAttachmentsForSlot(i, attachments); // Add skin attachments. + if (notDefaultSkin) defaultSkin.FindAttachmentsForSlot(i, attachments); // Add default skin attachments. } activeSkin = skeleton.Skin; diff --git a/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonDebugWindow.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/SkeletonDebugWindow.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonDebugWindow.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonDebugWindow.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/SkeletonMecanimInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/SkeletonMecanimInspector.cs new file mode 100644 index 000000000..329891142 --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Editor/SkeletonMecanimInspector.cs @@ -0,0 +1,50 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +// Contributed by: Mitch Thompson + +using UnityEditor; + +namespace Spine.Unity.Editor { + [CustomEditor(typeof(SkeletonMecanim))] + [CanEditMultipleObjects] + public class SkeletonMecanimInspector : SkeletonRendererInspector { + protected SerializedProperty mecanimTranslator; + + protected override void OnEnable () { + base.OnEnable(); + mecanimTranslator = serializedObject.FindProperty("translator"); + } + + protected override void DrawInspectorGUI (bool multi) { + base.DrawInspectorGUI(multi); + EditorGUILayout.PropertyField(mecanimTranslator, true); + } + } +} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonMecanimInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/SkeletonMecanimInspector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonMecanimInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonMecanimInspector.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/SkeletonRendererInspector.cs similarity index 78% rename from Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererInspector.cs rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonRendererInspector.cs index d66869120..e505a6aa5 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererInspector.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/SkeletonRendererInspector.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -33,10 +33,6 @@ #define NO_PREFAB_MESH #endif -#if UNITY_2018_1_OR_NEWER -#define PER_MATERIAL_PROPERTY_BLOCKS -#endif - #if UNITY_2017_1_OR_NEWER #define BUILT_IN_SPRITE_MASK_COMPONENT #endif @@ -59,7 +55,7 @@ namespace Spine.Unity.Editor { protected SerializedProperty skeletonDataAsset, initialSkinName; protected SerializedProperty initialFlipX, initialFlipY; - protected SerializedProperty updateWhenInvisible, singleSubmesh, separatorSlotNames, clearStateOnDisable, immutableTriangles, fixDrawOrder; + protected SerializedProperty singleSubmesh, separatorSlotNames, clearStateOnDisable, immutableTriangles; protected SerializedProperty normals, tangents, zSpacing, pmaVertexColors, tintBlack; // MeshGenerator settings protected SerializedProperty maskInteraction; protected SerializedProperty maskMaterialsNone, maskMaterialsInside, maskMaterialsOutside; @@ -74,15 +70,15 @@ namespace Spine.Unity.Editor { protected bool deleteOutsideMaskMaterialsQueued = false; protected GUIContent SkeletonDataAssetLabel, SkeletonUtilityButtonContent; - protected GUIContent PMAVertexColorsLabel, ClearStateOnDisableLabel, ZSpacingLabel, ImmubleTrianglesLabel, TintBlackLabel, UpdateWhenInvisibleLabel, SingleSubmeshLabel, FixDrawOrderLabel; + protected GUIContent PMAVertexColorsLabel, ClearStateOnDisableLabel, ZSpacingLabel, ImmubleTrianglesLabel, TintBlackLabel, SingleSubmeshLabel; protected GUIContent NormalsLabel, TangentsLabel, MaskInteractionLabel; protected GUIContent MaskMaterialsHeadingLabel, MaskMaterialsNoneLabel, MaskMaterialsInsideLabel, MaskMaterialsOutsideLabel; protected GUIContent SetMaterialButtonLabel, ClearMaterialButtonLabel, DeleteMaterialButtonLabel; - + const string ReloadButtonString = "Reload"; static GUILayoutOption reloadButtonWidth; static GUILayoutOption ReloadButtonWidth { get { return reloadButtonWidth = reloadButtonWidth ?? GUILayout.Width(GUI.skin.label.CalcSize(new GUIContent(ReloadButtonString)).x + 20); } } - static GUIStyle ReloadButtonStyle { get { return EditorStyles.miniButton; } } + static GUIStyle ReloadButtonStyle { get { return EditorStyles.miniButtonRight; } } protected bool TargetIsValid { get { @@ -106,6 +102,7 @@ namespace Spine.Unity.Editor { #else isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab); #endif + SpineEditorUtilities.ConfirmInitialization(); // Labels @@ -119,8 +116,6 @@ namespace Spine.Unity.Editor { TangentsLabel = new GUIContent("Solve Tangents", "Calculates the tangents per frame. Use this if you are using lit shaders (usually with normal maps) that require vertex tangents."); TintBlackLabel = new GUIContent("Tint Black (!)", "Adds black tint vertex data to the mesh as UV2 and UV3. Black tinting requires that the shader interpret UV2 and UV3 as black tint colors for this effect to work. You may also use the default [Spine/Skeleton Tint Black] shader.\n\nIf you only need to tint the whole skeleton and not individual parts, the [Spine/Skeleton Tint] shader is recommended for better efficiency and changing/animating the _Black material property via MaterialPropertyBlock."); SingleSubmeshLabel = new GUIContent("Use Single Submesh", "Simplifies submesh generation by assuming you are only using one Material and need only one submesh. This is will disable multiple materials, render separation, and custom slot materials."); - UpdateWhenInvisibleLabel = new GUIContent("Update When Invisible", "Update mode used when the MeshRenderer becomes invisible. Update mode is automatically reset to UpdateMode.FullUpdate when the mesh becomes visible again."); - FixDrawOrderLabel = new GUIContent("Fix Draw Order", "Applies only when 3+ submeshes are used (2+ materials with alternating order, e.g. \"A B A\"). If true, GPU instancing will be disabled at all materials and MaterialPropertyBlocks are assigned at each material to prevent aggressive batching of submeshes by e.g. the LWRP renderer, leading to incorrect draw order (e.g. \"A1 B A2\" changed to \"A1A2 B\"). You can disable this parameter when everything is drawn correctly to save the additional performance cost. Note: the GPU instancing setting will remain disabled at affected material assets after exiting play mode, you have to enable it manually if you accidentally enabled this parameter."); MaskInteractionLabel = new GUIContent("Mask Interaction", "SkeletonRenderer's interaction with a Sprite Mask."); MaskMaterialsHeadingLabel = new GUIContent("Mask Interaction Materials", "Materials used for different interaction with sprite masks."); MaskMaterialsNoneLabel = new GUIContent("Normal Materials", "Normal materials used when Mask Interaction is set to None."); @@ -128,7 +123,7 @@ namespace Spine.Unity.Editor { MaskMaterialsOutsideLabel = new GUIContent("Outside Mask", "Materials used when Mask Interaction is set to Outside Mask."); SetMaterialButtonLabel = new GUIContent("Set", "Prepares material references for switching to the corresponding Mask Interaction mode at runtime. Creates the required materials if they do not exist."); ClearMaterialButtonLabel = new GUIContent("Clear", "Clears unused material references. Note: when switching to the corresponding Mask Interaction mode at runtime, a new material is generated on the fly."); - DeleteMaterialButtonLabel = new GUIContent("Delete", "Clears unused material references and deletes the corresponding assets. Note: when switching to the corresponding Mask Interaction mode at runtime, a new material is generated on the fly."); + DeleteMaterialButtonLabel = new GUIContent("Delete", "Clears unused material references and deletes the corresponding assets. Note: when switching to the corresponding Mask Interaction mode at runtime, a new material is generated on the fly."); var so = this.serializedObject; skeletonDataAsset = so.FindProperty("skeletonDataAsset"); @@ -141,9 +136,7 @@ namespace Spine.Unity.Editor { pmaVertexColors = so.FindProperty("pmaVertexColors"); clearStateOnDisable = so.FindProperty("clearStateOnDisable"); tintBlack = so.FindProperty("tintBlack"); - updateWhenInvisible = so.FindProperty("updateWhenInvisible"); singleSubmesh = so.FindProperty("singleSubmesh"); - fixDrawOrder = so.FindProperty("fixDrawOrder"); maskInteraction = so.FindProperty("maskInteraction"); maskMaterialsNone = so.FindProperty("maskMaterials.materialsMaskDisabled"); maskMaterialsInside = so.FindProperty("maskMaterials.materialsInsideMask"); @@ -170,12 +163,29 @@ namespace Spine.Unity.Editor { override public void OnInspectorGUI () { bool multi = serializedObject.isEditingMultipleObjects; DrawInspectorGUI(multi); - HandleSkinChange(); if (serializedObject.ApplyModifiedProperties() || SpineInspectorUtility.UndoRedoPerformed(Event.current) || AreAnyMaskMaterialsMissing()) { if (!Application.isPlaying) { + if (multi) { + foreach (var o in targets) EditorForceInitializeComponent((SkeletonRenderer)o); + } else { + EditorForceInitializeComponent((SkeletonRenderer)target); + } + SceneView.RepaintAll(); + } + } + + if (!Application.isPlaying && Event.current.type == EventType.Layout) { + bool mismatchDetected = false; + if (multi) { foreach (var o in targets) - SpineEditorUtilities.ReinitializeComponent((SkeletonRenderer)o); + mismatchDetected |= UpdateIfSkinMismatch((SkeletonRenderer)o); + } else { + mismatchDetected |= UpdateIfSkinMismatch(target as SkeletonRenderer); + } + + if (mismatchDetected) { + mismatchDetected = false; SceneView.RepaintAll(); } } @@ -186,16 +196,25 @@ namespace Spine.Unity.Editor { if (Event.current.type == EventType.Layout) { if (forceReloadQueued) { forceReloadQueued = false; - foreach (var c in targets) { - SpineEditorUtilities.ReloadSkeletonDataAssetAndComponent(c as SkeletonRenderer); + if (multi) { + foreach (var c in targets) + EditorForceReloadSkeletonDataAssetAndComponent(c as SkeletonRenderer); + } else { + EditorForceReloadSkeletonDataAssetAndComponent(target as SkeletonRenderer); } } else { - foreach (var c in targets) { - var component = c as SkeletonRenderer; - if (!component.valid) { - SpineEditorUtilities.ReinitializeComponent(component); - if (!component.valid) continue; + if (multi) { + foreach (var c in targets) { + var component = c as SkeletonRenderer; + if (!component.valid) { + EditorForceInitializeComponent(component); + if (!component.valid) continue; + } } + } else { + var component = (SkeletonRenderer)target; + if (!component.valid) + EditorForceInitializeComponent(component); } } @@ -230,8 +249,15 @@ namespace Spine.Unity.Editor { #if NO_PREFAB_MESH if (isInspectingPrefab) { - foreach (var c in targets) { - var component = (SkeletonRenderer)c; + if (multi) { + foreach (var c in targets) { + var component = (SkeletonRenderer)c; + MeshFilter meshFilter = component.GetComponent(); + if (meshFilter != null && meshFilter.sharedMesh != null) + meshFilter.sharedMesh = null; + } + } else { + var component = (SkeletonRenderer)target; MeshFilter meshFilter = component.GetComponent(); if (meshFilter != null && meshFilter.sharedMesh != null) meshFilter.sharedMesh = null; @@ -268,14 +294,14 @@ namespace Spine.Unity.Editor { return; } - if (!SpineEditorUtilities.SkeletonDataAssetIsValid(component.skeletonDataAsset)) { + if (!SkeletonDataAssetIsValid(component.skeletonDataAsset)) { EditorGUILayout.HelpBox("Skeleton Data Asset error. Please check Skeleton Data Asset.", MessageType.Error); return; } if (valid) EditorGUILayout.PropertyField(initialSkinName, SpineInspectorUtility.TempContent("Initial Skin")); - + } EditorGUILayout.Space(); @@ -288,12 +314,6 @@ namespace Spine.Unity.Editor { if (!valid) return; - string errorMessage = null; - if (SpineEditorUtilities.Preferences.componentMaterialWarning && - MaterialChecks.IsMaterialSetupProblematic((SkeletonRenderer)this.target, ref errorMessage)) { - EditorGUILayout.HelpBox(errorMessage, MessageType.Error, true); - } - // More Render Options... using (new SpineInspectorUtility.BoxScope()) { EditorGUI.BeginChangeCheck(); @@ -322,12 +342,7 @@ namespace Spine.Unity.Editor { EditorGUILayout.LabelField("Renderer Settings", EditorStyles.boldLabel); using (new SpineInspectorUtility.LabelWidthScope()) { // Optimization options - if (updateWhenInvisible != null) EditorGUILayout.PropertyField(updateWhenInvisible, UpdateWhenInvisibleLabel); - if (singleSubmesh != null) EditorGUILayout.PropertyField(singleSubmesh, SingleSubmeshLabel); - #if PER_MATERIAL_PROPERTY_BLOCKS - if (fixDrawOrder != null) EditorGUILayout.PropertyField(fixDrawOrder, FixDrawOrderLabel); - #endif if (immutableTriangles != null) EditorGUILayout.PropertyField(immutableTriangles, ImmubleTrianglesLabel); EditorGUILayout.PropertyField(clearStateOnDisable, ClearStateOnDisableLabel); EditorGUILayout.Space(); @@ -368,7 +383,7 @@ namespace Spine.Unity.Editor { differentMaskModesSelected, allowDelete : true, isActiveMaterial: activeMaskInteractionValue == (int)SpriteMaskInteraction.VisibleOutsideMask); } #endif - + EditorGUILayout.Space(); if (valid && !isInspectingPrefab) { @@ -399,48 +414,6 @@ namespace Spine.Unity.Editor { } } - protected void SkeletonRootMotionParameter() { - SkeletonRootMotionParameter(targets); - } - - public static void SkeletonRootMotionParameter(Object[] targets) { - int rootMotionComponentCount = 0; - foreach (var t in targets) { - var component = t as Component; - if (component.GetComponent() != null) { - ++rootMotionComponentCount; - } - } - bool allHaveRootMotion = rootMotionComponentCount == targets.Length; - bool anyHaveRootMotion = rootMotionComponentCount > 0; - - using (new GUILayout.HorizontalScope()) { - EditorGUILayout.PrefixLabel("Root Motion"); - - if (!allHaveRootMotion) { - if (GUILayout.Button(SpineInspectorUtility.TempContent("Add Component", Icons.constraintTransform), GUILayout.MaxWidth(130), GUILayout.Height(18))) { - foreach (var t in targets) { - var component = t as Component; - if (component.GetComponent() == null) { - component.gameObject.AddComponent(); - } - } - } - } - if (anyHaveRootMotion) { - if (GUILayout.Button(SpineInspectorUtility.TempContent("Remove Component", Icons.constraintTransform), GUILayout.MaxWidth(140), GUILayout.Height(18))) { - foreach (var t in targets) { - var component = t as Component; - var rootMotionComponent = component.GetComponent(); - if (rootMotionComponent != null) { - DestroyImmediate(rootMotionComponent); - } - } - } - } - } - } - public static void SetSeparatorSlotNames (SkeletonRenderer skeletonRenderer, string[] newSlotNames) { var field = SpineInspectorUtility.GetNonPublicField(typeof(SkeletonRenderer), SeparatorSlotNamesFieldName); field.SetValue(skeletonRenderer, newSlotNames); @@ -520,48 +493,57 @@ namespace Spine.Unity.Editor { } } - void HandleSkinChange() { - if (!Application.isPlaying && Event.current.type == EventType.Layout && !initialSkinName.hasMultipleDifferentValues) { - bool mismatchDetected = false; - string newSkinName = initialSkinName.stringValue; - foreach (var o in targets) { - mismatchDetected |= UpdateIfSkinMismatch((SkeletonRenderer)o, newSkinName); - } - - if (mismatchDetected) { - mismatchDetected = false; - UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); - } - } - } - - static bool UpdateIfSkinMismatch (SkeletonRenderer skeletonRenderer, string componentSkinName) { - if (!skeletonRenderer.valid || skeletonRenderer.EditorSkipSkinSync) return false; + static bool UpdateIfSkinMismatch (SkeletonRenderer skeletonRenderer) { + if (!skeletonRenderer.valid) return false; var skin = skeletonRenderer.Skeleton.Skin; string skeletonSkinName = skin != null ? skin.Name : null; + string componentSkinName = skeletonRenderer.initialSkinName; bool defaultCase = skin == null && string.IsNullOrEmpty(componentSkinName); bool fieldMatchesSkin = defaultCase || string.Equals(componentSkinName, skeletonSkinName, System.StringComparison.Ordinal); if (!fieldMatchesSkin) { Skin skinToSet = string.IsNullOrEmpty(componentSkinName) ? null : skeletonRenderer.Skeleton.Data.FindSkin(componentSkinName); - skeletonRenderer.Skeleton.SetSkin(skinToSet); + skeletonRenderer.Skeleton.Skin = skinToSet; skeletonRenderer.Skeleton.SetSlotsToSetupPose(); - - // Note: the UpdateIfSkinMismatch concept shall be replaced with e.g. an OnValidate based - // solution or in a separate commit. The current solution does not repaint the Game view because - // it is first applying values and in the next editor pass is calling this skin-changing method. - if (skeletonRenderer is SkeletonAnimation) - ((SkeletonAnimation) skeletonRenderer).Update(0f); - else if (skeletonRenderer is SkeletonMecanim) - ((SkeletonMecanim) skeletonRenderer).Update(); - skeletonRenderer.LateUpdate(); return true; } return false; } + static void EditorForceReloadSkeletonDataAssetAndComponent (SkeletonRenderer component) { + if (component == null) return; + + // Clear all and reload. + if (component.skeletonDataAsset != null) { + foreach (AtlasAssetBase aa in component.skeletonDataAsset.atlasAssets) { + if (aa != null) aa.Clear(); + } + component.skeletonDataAsset.Clear(); + } + component.skeletonDataAsset.GetSkeletonData(true); + + // Reinitialize. + EditorForceInitializeComponent(component); + } + + static void EditorForceInitializeComponent (SkeletonRenderer component) { + if (component == null) return; + if (!SkeletonDataAssetIsValid(component.SkeletonDataAsset)) return; + component.Initialize(true); + + #if BUILT_IN_SPRITE_MASK_COMPONENT + SpineMaskUtilities.EditorAssignSpriteMaskMaterials(component); + #endif + + component.LateUpdate(); + } + + static bool SkeletonDataAssetIsValid (SkeletonDataAsset asset) { + return asset != null && asset.GetSkeletonData(quiet: true) != null; + } + bool AreAnyMaskMaterialsMissing() { #if BUILT_IN_SPRITE_MASK_COMPONENT foreach (var o in targets) { @@ -579,13 +561,13 @@ namespace Spine.Unity.Editor { static void EditorSetMaskMaterials(SkeletonRenderer component, SpriteMaskInteraction maskType) { if (component == null) return; - if (!SpineEditorUtilities.SkeletonDataAssetIsValid(component.SkeletonDataAsset)) return; + if (!SkeletonDataAssetIsValid(component.SkeletonDataAsset)) return; SpineMaskUtilities.EditorInitMaskMaterials(component, component.maskMaterials, maskType); } static void EditorDeleteMaskMaterials(SkeletonRenderer component, SpriteMaskInteraction maskType) { if (component == null) return; - if (!SpineEditorUtilities.SkeletonDataAssetIsValid(component.SkeletonDataAsset)) return; + if (!SkeletonDataAssetIsValid(component.SkeletonDataAsset)) return; SpineMaskUtilities.EditorDeleteMaskMaterials(component.maskMaterials, maskType); } #endif diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/SkeletonRendererInspector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/SkeletonRendererInspector.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineAtlasAssetInspector.cs b/Assets/Spine/Editor/spine-unity/Editor/SpineAtlasAssetInspector.cs similarity index 88% rename from Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineAtlasAssetInspector.cs rename to Assets/Spine/Editor/spine-unity/Editor/SpineAtlasAssetInspector.cs index ef9b437e4..c4985bb8a 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineAtlasAssetInspector.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/SpineAtlasAssetInspector.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ //#define BAKE_ALL_BUTTON @@ -57,7 +57,7 @@ namespace Spine.Unity.Editor { "If your atlas was exported with Premultiply Alpha, " + "your SpriteRenderer should use the generated Spine _Material asset (or any Material with a PMA shader) instead of Sprites-Default."); } - return spriteSlicesLabel; + return spriteSlicesLabel; } } @@ -92,7 +92,7 @@ namespace Spine.Unity.Editor { string bakedDirPath = Path.Combine(atlasAssetDirPath, atlasAsset.name); for (int i = 0; i < regions.Count; i++) { AtlasRegion region = regions[i]; - string bakedPrefabPath = Path.Combine(bakedDirPath, AssetUtility.GetPathSafeRegionName(region) + ".prefab").Replace("\\", "/"); + string bakedPrefabPath = Path.Combine(bakedDirPath, SpineEditorUtilities.AssetUtility.GetPathSafeRegionName(region) + ".prefab").Replace("\\", "/"); GameObject prefab = (GameObject)AssetDatabase.LoadAssetAtPath(bakedPrefabPath, typeof(GameObject)); baked.Add(prefab != null); bakedObjects.Add(prefab); @@ -108,7 +108,7 @@ namespace Spine.Unity.Editor { } serializedObject.Update(); - atlasAsset = (atlasAsset == null) ? (SpineAtlasAsset)target : atlasAsset; + atlasAsset = atlasAsset ?? (SpineAtlasAsset)target; EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(atlasFile); EditorGUILayout.PropertyField(materials, true); @@ -133,15 +133,12 @@ namespace Spine.Unity.Editor { } EditorGUILayout.Space(); - if (SpineInspectorUtility.LargeCenteredButton(SpineInspectorUtility.TempContent("Set Mipmap Bias to " + SpinePreferences.DEFAULT_MIPMAPBIAS, tooltip: "This may help textures with mipmaps be less blurry when used for 2D sprites."))) { + if (SpineInspectorUtility.LargeCenteredButton(SpineInspectorUtility.TempContent("Set Mipmap Bias to " + SpineEditorUtilities.Preferences.DEFAULT_MIPMAPBIAS, tooltip: "This may help textures with mipmaps be less blurry when used for 2D sprites."))) { foreach (var m in atlasAsset.materials) { var texture = m.mainTexture; - string texturePath = AssetDatabase.GetAssetPath(texture.GetInstanceID()); - var importer = (TextureImporter)TextureImporter.GetAtPath(texturePath); - importer.mipMapBias = SpinePreferences.DEFAULT_MIPMAPBIAS; - EditorUtility.SetDirty(texture); + texture.mipMapBias = SpineEditorUtilities.Preferences.DEFAULT_MIPMAPBIAS; } - Debug.Log("Texture mipmap bias set to " + SpinePreferences.DEFAULT_MIPMAPBIAS); + Debug.Log("Texture mipmap bias set to " + SpineEditorUtilities.Preferences.DEFAULT_MIPMAPBIAS); } EditorGUILayout.Space(); @@ -259,12 +256,12 @@ namespace Spine.Unity.Editor { } #endif - + } #else if (atlasFile.objectReferenceValue != null) { - - + + int baseIndent = EditorGUI.indentLevel; var regions = SpineAtlasAssetInspector.GetRegions(atlasAsset.GetAtlas()); @@ -302,7 +299,7 @@ namespace Spine.Unity.Editor { } else { EditorGUILayout.LabelField(SpineInspectorUtility.TempContent(regionName, icon)); } - + } EditorGUI.indentLevel = baseIndent; } diff --git a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineAtlasAssetInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/SpineAtlasAssetInspector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineAtlasAssetInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/SpineAtlasAssetInspector.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/SpineAttributeDrawers.cs b/Assets/Spine/Editor/spine-unity/Editor/SpineAttributeDrawers.cs index 33a928352..78ee7a3de 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/SpineAttributeDrawers.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/SpineAttributeDrawers.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ // Contributed by: Mitch Thompson @@ -35,7 +35,6 @@ using System; using System.Collections.Generic; using System.Reflection; using Spine; -using System.Linq; namespace Spine.Unity.Editor { public struct SpineDrawerValuePair { @@ -75,7 +74,7 @@ namespace Spine.Unity.Editor { } // Handle multi-editing when instances don't use the same SkeletonDataAsset. - if (!SpineInspectorUtility.TargetsUseSameData(property.serializedObject)) { + if (!SpineInspectorUtility.TargetsUseSameData(property.serializedObject)) { EditorGUI.DelayedTextField(position, property, label); return; } @@ -119,7 +118,7 @@ namespace Spine.Unity.Editor { skeletonDataAsset = property.serializedObject.targetObject as SkeletonDataAsset; if (skeletonDataAsset == null) return; } - + position = EditorGUI.PrefixLabel(position, label); Texture2D image = Icon; @@ -137,7 +136,7 @@ namespace Spine.Unity.Editor { return skeletonComponent; } else { var component = property.serializedObject.targetObject as Component; - if (component != null) + if (component != null) return component.GetComponentInChildren(typeof(ISkeletonComponent)) as ISkeletonComponent; } @@ -178,21 +177,19 @@ namespace Spine.Unity.Editor { if (TargetAttribute.includeNone) menu.AddItem(new GUIContent(NoneString), !property.hasMultipleDifferentValues && string.IsNullOrEmpty(property.stringValue), HandleSelect, new SpineDrawerValuePair(string.Empty, property)); - IEnumerable orderedSlots = data.Slots.Items.OrderBy(slotData => slotData.Name); - foreach (SlotData slotData in orderedSlots) { - int slotIndex = slotData.Index; - string name = slotData.Name; + for (int i = 0; i < data.Slots.Count; i++) { + string name = data.Slots.Items[i].Name; if (name.StartsWith(targetAttribute.startsWith, StringComparison.Ordinal)) { if (targetAttribute.containsBoundingBoxes) { - var skinEntries = new List(); - foreach (var skin in data.Skins) { - skin.GetAttachments(slotIndex, skinEntries); - } + int slotIndex = i; + var attachments = new List(); + foreach (var skin in data.Skins) + skin.FindAttachmentsForSlot(slotIndex, attachments); bool hasBoundingBox = false; - foreach (var entry in skinEntries) { - var bbAttachment = entry.Attachment as BoundingBoxAttachment; + foreach (var attachment in attachments) { + var bbAttachment = attachment as BoundingBoxAttachment; if (bbAttachment != null) { string menuLabel = bbAttachment.IsWeighted() ? name + " (!)" : name; menu.AddItem(new GUIContent(menuLabel), !property.hasMultipleDifferentValues && name == property.stringValue, HandleSelect, new SpineDrawerValuePair(name, property)); @@ -258,8 +255,8 @@ namespace Spine.Unity.Editor { string choiceValue = TargetAttribute.defaultAsEmptyString && isDefault ? string.Empty : name; menu.AddItem(new GUIContent(name), !property.hasMultipleDifferentValues && choiceValue == property.stringValue, HandleSelect, new SpineDrawerValuePair(choiceValue, property)); } - - } + + } } } @@ -345,7 +342,7 @@ namespace Spine.Unity.Editor { menu.AddItem(new GUIContent(name), !property.hasMultipleDifferentValues && name == property.stringValue, HandleSelect, new SpineDrawerValuePair(name, property)); } } - + } } @@ -473,21 +470,10 @@ namespace Spine.Unity.Editor { attachmentNames.Clear(); placeholderNames.Clear(); - var skinEntries = new List(); - skin.GetAttachments(i, skinEntries); - foreach (var entry in skinEntries) { - attachmentNames.Add(entry.Name); - } - + skin.FindNamesForSlot(i, attachmentNames); if (skin != defaultSkin) { - foreach (var entry in skinEntries) { - placeholderNames.Add(entry.Name); - } - skinEntries.Clear(); - defaultSkin.GetAttachments(i, skinEntries); - foreach (var entry in skinEntries) { - attachmentNames.Add(entry.Name); - } + defaultSkin.FindNamesForSlot(i, attachmentNames); + skin.FindNamesForSlot(i, placeholderNames); } for (int a = 0; a < attachmentNames.Count; a++) { @@ -524,17 +510,9 @@ namespace Spine.Unity.Editor { menu.AddItem(new GUIContent(NoneString), !property.hasMultipleDifferentValues && string.IsNullOrEmpty(property.stringValue), HandleSelect, new SpineDrawerValuePair(string.Empty, property)); for (int i = 0; i < data.Bones.Count; i++) { - var bone = data.Bones.Items[i]; - string name = bone.Name; - if (name.StartsWith(targetAttribute.startsWith, StringComparison.Ordinal)) { - // jointName = "root/hip/bone" to show a hierarchial tree. - string jointName = name; - var iterator = bone; - while ((iterator = iterator.Parent) != null) - jointName = string.Format("{0}/{1}", iterator.Name, jointName); - - menu.AddItem(new GUIContent(jointName), !property.hasMultipleDifferentValues && name == property.stringValue, HandleSelect, new SpineDrawerValuePair(name, property)); - } + string name = data.Bones.Items[i].Name; + if (name.StartsWith(targetAttribute.startsWith, StringComparison.Ordinal)) + menu.AddItem(new GUIContent(name), !property.hasMultipleDifferentValues && name == property.stringValue, HandleSelect, new SpineDrawerValuePair(name, property)); } } diff --git a/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs b/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs new file mode 100644 index 000000000..f5848e43c --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs @@ -0,0 +1,2580 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#pragma warning disable 0219 +#pragma warning disable 0618 // for 3.7 branch only. Avoids "PreferenceItem' is obsolete: '[PreferenceItem] is deprecated. Use [SettingsProvider] instead." + +// Original contribution by: Mitch Thompson + +#define SPINE_SKELETONMECANIM + +#if UNITY_2017_2_OR_NEWER +#define NEWPLAYMODECALLBACKS +#endif + +#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER +#define NEW_PREFAB_SYSTEM +#endif + +#if UNITY_2018 || UNITY_2019 || UNITY_2018_3_OR_NEWER +#define NEWHIERARCHYWINDOWCALLBACKS +#endif + +#if UNITY_2018_3_OR_NEWER +#define NEW_PREFERENCES_SETTINGS_PROVIDER +#endif + +#if UNITY_2019_1_OR_NEWER +#define NEW_TIMELINE_AS_PACKAGE +#endif + +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Linq; +using System.Reflection; +using System.Globalization; + +namespace Spine.Unity.Editor { + using EventType = UnityEngine.EventType; + + // Analysis disable once ConvertToStaticType + [InitializeOnLoad] + public class SpineEditorUtilities : AssetPostprocessor { + + public static class Icons { + public static Texture2D skeleton; + public static Texture2D nullBone; + public static Texture2D bone; + public static Texture2D poseBones; + public static Texture2D boneNib; + public static Texture2D slot; + public static Texture2D slotRoot; + public static Texture2D skinPlaceholder; + public static Texture2D image; + public static Texture2D genericAttachment; + public static Texture2D boundingBox; + public static Texture2D point; + public static Texture2D mesh; + public static Texture2D weights; + public static Texture2D path; + public static Texture2D clipping; + public static Texture2D skin; + public static Texture2D skinsRoot; + public static Texture2D animation; + public static Texture2D animationRoot; + public static Texture2D spine; + public static Texture2D userEvent; + public static Texture2D constraintNib; + public static Texture2D constraintRoot; + public static Texture2D constraintTransform; + public static Texture2D constraintPath; + public static Texture2D constraintIK; + public static Texture2D warning; + public static Texture2D skeletonUtility; + public static Texture2D hingeChain; + public static Texture2D subMeshRenderer; + public static Texture2D skeletonDataAssetIcon; + public static Texture2D info; + public static Texture2D unity; + + static Texture2D LoadIcon (string filename) { + return (Texture2D)AssetDatabase.LoadMainAssetAtPath(SpineEditorUtilities.editorGUIPath + "/" + filename); + } + + public static void Initialize () { + skeleton = LoadIcon("icon-skeleton.png"); + nullBone = LoadIcon("icon-null.png"); + bone = LoadIcon("icon-bone.png"); + poseBones = LoadIcon("icon-poseBones.png"); + boneNib = LoadIcon("icon-boneNib.png"); + slot = LoadIcon("icon-slot.png"); + slotRoot = LoadIcon("icon-slotRoot.png"); + skinPlaceholder = LoadIcon("icon-skinPlaceholder.png"); + + genericAttachment = LoadIcon("icon-attachment.png"); + image = LoadIcon("icon-image.png"); + boundingBox = LoadIcon("icon-boundingBox.png"); + point = LoadIcon("icon-point.png"); + mesh = LoadIcon("icon-mesh.png"); + weights = LoadIcon("icon-weights.png"); + path = LoadIcon("icon-path.png"); + clipping = LoadIcon("icon-clipping.png"); + + skin = LoadIcon("icon-skin.png"); + skinsRoot = LoadIcon("icon-skinsRoot.png"); + animation = LoadIcon("icon-animation.png"); + animationRoot = LoadIcon("icon-animationRoot.png"); + spine = LoadIcon("icon-spine.png"); + userEvent = LoadIcon("icon-event.png"); + constraintNib = LoadIcon("icon-constraintNib.png"); + + constraintRoot = LoadIcon("icon-constraints.png"); + constraintTransform = LoadIcon("icon-constraintTransform.png"); + constraintPath = LoadIcon("icon-constraintPath.png"); + constraintIK = LoadIcon("icon-constraintIK.png"); + + warning = LoadIcon("icon-warning.png"); + skeletonUtility = LoadIcon("icon-skeletonUtility.png"); + hingeChain = LoadIcon("icon-hingeChain.png"); + subMeshRenderer = LoadIcon("icon-subMeshRenderer.png"); + + skeletonDataAssetIcon = LoadIcon("SkeletonDataAsset Icon.png"); + + info = EditorGUIUtility.FindTexture("console.infoicon.sml"); + unity = EditorGUIUtility.FindTexture("SceneAsset Icon"); + } + + public static Texture2D GetAttachmentIcon (Attachment attachment) { + // Analysis disable once CanBeReplacedWithTryCastAndCheckForNull + if (attachment is RegionAttachment) + return Icons.image; + else if (attachment is MeshAttachment) + return ((MeshAttachment)attachment).IsWeighted() ? Icons.weights : Icons.mesh; + else if (attachment is BoundingBoxAttachment) + return Icons.boundingBox; + else if (attachment is PointAttachment) + return Icons.point; + else if (attachment is PathAttachment) + return Icons.path; + else if (attachment is ClippingAttachment) + return Icons.clipping; + else + return Icons.warning; + } + } + + public static string editorPath = ""; + public static string editorGUIPath = ""; + public static bool initialized; + + static int STRAIGHT_ALPHA_PARAM_ID = Shader.PropertyToID("_StraightAlphaInput"); + + #if NEW_PREFERENCES_SETTINGS_PROVIDER + static class SpineSettingsProviderRegistration + { + [SettingsProvider] + public static SettingsProvider CreateSpineSettingsProvider() + { + var provider = new SettingsProvider("Spine", SettingsScope.User) + { + label = "Spine", + guiHandler = (searchContext) => + { + Preferences.HandlePreferencesGUI(); // This line shall NOT be merged to 3.8 branch. Version to provide a non-behavior-changing implementation for 3.7 branch. + }, + + // Populate the search keywords to enable smart search filtering and label highlighting: + keywords = new HashSet(new[] { "Spine", "Preferences", "Skeleton", "Default", "Mix", "Duration" }) + }; + return provider; + } + } + #else + // Preferences entry point + [PreferenceItem("Spine")] + static void PreferencesGUI () { + Preferences.HandlePreferencesGUI(); + } + #endif + + // Auto-import entry point + static void OnPostprocessAllAssets (string[] imported, string[] deleted, string[] moved, string[] movedFromAssetPaths) { + if (imported.Length == 0) + return; + + AssetUtility.HandleOnPostprocessAllAssets(imported); + } + +#region Initialization + static SpineEditorUtilities () { + Initialize(); + } + + static void Initialize () { + if (EditorApplication.isPlayingOrWillChangePlaymode) return; + + Preferences.Load(); + + string[] assets = AssetDatabase.FindAssets("t:script SpineEditorUtilities"); + string assetPath = AssetDatabase.GUIDToAssetPath(assets[0]); + editorPath = Path.GetDirectoryName(assetPath).Replace("\\", "/"); + editorGUIPath = editorPath + "/GUI"; + + Icons.Initialize(); + + // Drag and Drop +#if UNITY_2019_1_OR_NEWER + SceneView.duringSceneGui -= DragAndDropInstantiation.SceneViewDragAndDrop; + SceneView.duringSceneGui += DragAndDropInstantiation.SceneViewDragAndDrop; +#else + SceneView.onSceneGUIDelegate -= DragAndDropInstantiation.SceneViewDragAndDrop; + SceneView.onSceneGUIDelegate += DragAndDropInstantiation.SceneViewDragAndDrop; +#endif + + EditorApplication.hierarchyWindowItemOnGUI -= HierarchyHandler.HandleDragAndDrop; + EditorApplication.hierarchyWindowItemOnGUI += HierarchyHandler.HandleDragAndDrop; + + // Hierarchy Icons +#if NEWPLAYMODECALLBACKS + EditorApplication.playModeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged; + EditorApplication.playModeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged; + HierarchyHandler.IconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode); +#else + EditorApplication.playmodeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged; + EditorApplication.playmodeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged; + HierarchyHandler.IconsOnPlaymodeStateChanged(); +#endif + + // Data Refresh Edit Mode. + // This prevents deserialized SkeletonData from persisting from play mode to edit mode. +#if NEWPLAYMODECALLBACKS + EditorApplication.playModeStateChanged -= DataReloadHandler.OnPlaymodeStateChanged; + EditorApplication.playModeStateChanged += DataReloadHandler.OnPlaymodeStateChanged; + DataReloadHandler.OnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode); +#else + EditorApplication.playmodeStateChanged -= DataReloadHandler.OnPlaymodeStateChanged; + EditorApplication.playmodeStateChanged += DataReloadHandler.OnPlaymodeStateChanged; + DataReloadHandler.OnPlaymodeStateChanged(); +#endif + + if (SpineEditorUtilities.Preferences.textureImporterWarning) { + IssueWarningsForUnrecommendedTextureSettings(); + } + + initialized = true; + } + + public static void ConfirmInitialization () { + if (!initialized || Icons.skeleton == null) + Initialize(); + } + + public static void IssueWarningsForUnrecommendedTextureSettings() { + + string[] atlasDescriptionGUIDs = AssetDatabase.FindAssets("t:textasset .atlas"); // Note: finds .atlas.txt files + for (int i = 0; i < atlasDescriptionGUIDs.Length; ++i) { + string atlasDescriptionPath = AssetDatabase.GUIDToAssetPath(atlasDescriptionGUIDs[i]); + string texturePath = atlasDescriptionPath.Replace(".atlas.txt", ".png"); + + bool textureExists = IssueWarningsForUnrecommendedTextureSettings(texturePath); + if (!textureExists) { + texturePath = texturePath.Replace(".png", ".jpg"); + textureExists = IssueWarningsForUnrecommendedTextureSettings(texturePath); + } + if (!textureExists) { + continue; + } + } + } + + public static bool IssueWarningsForUnrecommendedTextureSettings(string texturePath) + { + TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath); + if (texImporter == null) { + return false; + } + + int extensionPos = texturePath.LastIndexOf('.'); + string materialPath = texturePath.Substring(0, extensionPos) + "_Material.mat"; + Material material = AssetDatabase.LoadAssetAtPath(materialPath); + if (material == null || !material.HasProperty(STRAIGHT_ALPHA_PARAM_ID)) { + return true; // non-Spine shader used on material + } + + // 'sRGBTexture = true' generates incorrectly weighted mipmaps at PMA textures, + // causing white borders due to undesired custom weighting. + if (texImporter.sRGBTexture && texImporter.mipmapEnabled && PlayerSettings.colorSpace == ColorSpace.Gamma) { + Debug.LogWarningFormat("`{0}` : Problematic Texture Settings found: When enabling `Generate Mip Maps` in Gamma color space, it is recommended to disable `sRGB (Color Texture)`. Otherwise you will receive white border artifacts on an atlas exported with default `Premultiply alpha` settings.\n(You can disable this warning in `Edit - Preferences - Spine`)", texturePath); + } + if (texImporter.alphaIsTransparency) { + int straightAlphaValue = material.GetInt(STRAIGHT_ALPHA_PARAM_ID); + if (straightAlphaValue == 0) { + string materialName = System.IO.Path.GetFileName(materialPath); + Debug.LogWarningFormat("`{0}` and material `{1}` : Incorrect Texture / Material Settings found: It is strongly recommended to disable `Alpha Is Transparency` on `Premultiply alpha` textures.\nAssuming `Premultiply alpha` texture because `Straight Alpha Texture` is disabled at material). (You can disable this warning in `Edit - Preferences - Spine`)", texturePath, materialName); + } + } + return true; + } +#endregion + + public static class Preferences { +#if SPINE_TK2D + const float DEFAULT_DEFAULT_SCALE = 1f; +#else + const float DEFAULT_DEFAULT_SCALE = 0.01f; +#endif + const string DEFAULT_SCALE_KEY = "SPINE_DEFAULT_SCALE"; + public static float defaultScale = DEFAULT_DEFAULT_SCALE; + + const float DEFAULT_DEFAULT_MIX = 0.2f; + const string DEFAULT_MIX_KEY = "SPINE_DEFAULT_MIX"; + public static float defaultMix = DEFAULT_DEFAULT_MIX; + + const string DEFAULT_DEFAULT_SHADER = "Spine/Skeleton"; + const string DEFAULT_SHADER_KEY = "SPINE_DEFAULT_SHADER"; + public static string defaultShader = DEFAULT_DEFAULT_SHADER; + + const float DEFAULT_DEFAULT_ZSPACING = 0f; + const string DEFAULT_ZSPACING_KEY = "SPINE_DEFAULT_ZSPACING"; + public static float defaultZSpacing = DEFAULT_DEFAULT_ZSPACING; + + const bool DEFAULT_DEFAULT_INSTANTIATE_LOOP = true; + const string DEFAULT_INSTANTIATE_LOOP_KEY = "SPINE_DEFAULT_INSTANTIATE_LOOP"; + public static bool defaultInstantiateLoop = DEFAULT_DEFAULT_INSTANTIATE_LOOP; + + const bool DEFAULT_SHOW_HIERARCHY_ICONS = true; + const string SHOW_HIERARCHY_ICONS_KEY = "SPINE_SHOW_HIERARCHY_ICONS"; + public static bool showHierarchyIcons = DEFAULT_SHOW_HIERARCHY_ICONS; + + const bool DEFAULT_SET_TEXTUREIMPORTER_SETTINGS = true; + const string SET_TEXTUREIMPORTER_SETTINGS_KEY = "SPINE_SET_TEXTUREIMPORTER_SETTINGS"; + public static bool setTextureImporterSettings = DEFAULT_SET_TEXTUREIMPORTER_SETTINGS; + + const bool DEFAULT_ATLASTXT_WARNING = true; + const string ATLASTXT_WARNING_KEY = "SPINE_ATLASTXT_WARNING"; + public static bool atlasTxtImportWarning = DEFAULT_ATLASTXT_WARNING; + + const bool DEFAULT_TEXTUREIMPORTER_WARNING = true; + const string TEXTUREIMPORTER_WARNING_KEY = "SPINE_TEXTUREIMPORTER_WARNING"; + public static bool textureImporterWarning = DEFAULT_TEXTUREIMPORTER_WARNING; + + internal const float DEFAULT_MIPMAPBIAS = -0.5f; + + public const float DEFAULT_SCENE_ICONS_SCALE = 1f; + public const string SCENE_ICONS_SCALE_KEY = "SPINE_SCENE_ICONS_SCALE"; + + const bool DEFAULT_AUTO_RELOAD_SCENESKELETONS = true; + const string AUTO_RELOAD_SCENESKELETONS_KEY = "SPINE_AUTO_RELOAD_SCENESKELETONS"; + public static bool autoReloadSceneSkeletons = DEFAULT_AUTO_RELOAD_SCENESKELETONS; + + static bool preferencesLoaded = false; + + public static void Load () { + if (preferencesLoaded) + return; + + defaultMix = EditorPrefs.GetFloat(DEFAULT_MIX_KEY, DEFAULT_DEFAULT_MIX); + defaultScale = EditorPrefs.GetFloat(DEFAULT_SCALE_KEY, DEFAULT_DEFAULT_SCALE); + defaultZSpacing = EditorPrefs.GetFloat(DEFAULT_ZSPACING_KEY, DEFAULT_DEFAULT_ZSPACING); + defaultShader = EditorPrefs.GetString(DEFAULT_SHADER_KEY, DEFAULT_DEFAULT_SHADER); + showHierarchyIcons = EditorPrefs.GetBool(SHOW_HIERARCHY_ICONS_KEY, DEFAULT_SHOW_HIERARCHY_ICONS); + setTextureImporterSettings = EditorPrefs.GetBool(SET_TEXTUREIMPORTER_SETTINGS_KEY, DEFAULT_SET_TEXTUREIMPORTER_SETTINGS); + autoReloadSceneSkeletons = EditorPrefs.GetBool(AUTO_RELOAD_SCENESKELETONS_KEY, DEFAULT_AUTO_RELOAD_SCENESKELETONS); + atlasTxtImportWarning = EditorPrefs.GetBool(ATLASTXT_WARNING_KEY, DEFAULT_ATLASTXT_WARNING); + textureImporterWarning = EditorPrefs.GetBool(TEXTUREIMPORTER_WARNING_KEY, DEFAULT_TEXTUREIMPORTER_WARNING); + + SpineHandles.handleScale = EditorPrefs.GetFloat(SCENE_ICONS_SCALE_KEY, DEFAULT_SCENE_ICONS_SCALE); + preferencesLoaded = true; + } + + public static void HandlePreferencesGUI () { + if (!preferencesLoaded) + Load(); + + EditorGUI.BeginChangeCheck(); + showHierarchyIcons = EditorGUILayout.Toggle(new GUIContent("Show Hierarchy Icons", "Show relevant icons on GameObjects with Spine Components on them. Disable this if you have large, complex scenes."), showHierarchyIcons); + if (EditorGUI.EndChangeCheck()) { + EditorPrefs.SetBool(SHOW_HIERARCHY_ICONS_KEY, showHierarchyIcons); +#if NEWPLAYMODECALLBACKS + HierarchyHandler.IconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode); +#else + HierarchyHandler.IconsOnPlaymodeStateChanged(); +#endif + } + + BoolPrefsField(ref autoReloadSceneSkeletons, AUTO_RELOAD_SCENESKELETONS_KEY, new GUIContent("Auto-reload scene components", "Reloads Skeleton components in the scene whenever their SkeletonDataAsset is modified. This makes it so changes in the SkeletonDataAsset inspector are immediately reflected. This may be slow when your scenes have large numbers of SkeletonRenderers or SkeletonGraphic.")); + + EditorGUILayout.Separator(); + EditorGUILayout.LabelField("Auto-Import Settings", EditorStyles.boldLabel); + { + SpineEditorUtilities.FloatPrefsField(ref defaultMix, DEFAULT_MIX_KEY, new GUIContent("Default Mix", "The Default Mix Duration for newly imported SkeletonDataAssets."), min: 0); + SpineEditorUtilities.FloatPrefsField(ref defaultScale, DEFAULT_SCALE_KEY, new GUIContent("Default SkeletonData Scale", "The Default skeleton import scale for newly imported SkeletonDataAssets."), min: 0.0000001f); + + EditorGUI.BeginChangeCheck(); + var shader = (EditorGUILayout.ObjectField("Default Shader", Shader.Find(defaultShader), typeof(Shader), false) as Shader); + defaultShader = shader != null ? shader.name : DEFAULT_DEFAULT_SHADER; + if (EditorGUI.EndChangeCheck()) + EditorPrefs.SetString(DEFAULT_SHADER_KEY, defaultShader); + + SpineEditorUtilities.BoolPrefsField(ref setTextureImporterSettings, SET_TEXTUREIMPORTER_SETTINGS_KEY, new GUIContent("Apply Atlas Texture Settings", "Apply the recommended settings for Texture Importers.")); + } + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Warnings", EditorStyles.boldLabel); + { + SpineEditorUtilities.BoolPrefsField(ref atlasTxtImportWarning, ATLASTXT_WARNING_KEY, new GUIContent("Atlas Extension Warning", "Log a warning and recommendation whenever a `.atlas` file is found.")); + SpineEditorUtilities.BoolPrefsField(ref textureImporterWarning, TEXTUREIMPORTER_WARNING_KEY, new GUIContent("Texture Settings Warning", "Log a warning and recommendation whenever Texture Import Settings are detected that could lead to undesired effects, e.g. white border artifacts.")); + } + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Editor Instantiation", EditorStyles.boldLabel); + { + EditorGUI.BeginChangeCheck(); + defaultZSpacing = EditorGUILayout.Slider("Default Slot Z-Spacing", defaultZSpacing, -0.1f, 0f); + if (EditorGUI.EndChangeCheck()) + EditorPrefs.SetFloat(DEFAULT_ZSPACING_KEY, defaultZSpacing); + + SpineEditorUtilities.BoolPrefsField(ref defaultInstantiateLoop, DEFAULT_INSTANTIATE_LOOP_KEY, new GUIContent("Default Loop", "Spawn Spine GameObjects with loop enabled.")); + } + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Handles and Gizmos", EditorStyles.boldLabel); + { + EditorGUI.BeginChangeCheck(); + SpineHandles.handleScale = EditorGUILayout.Slider("Editor Bone Scale", SpineHandles.handleScale, 0.01f, 2f); + SpineHandles.handleScale = Mathf.Max(0.01f, SpineHandles.handleScale); + if (EditorGUI.EndChangeCheck()) { + EditorPrefs.SetFloat(SCENE_ICONS_SCALE_KEY, SpineHandles.handleScale); + SceneView.RepaintAll(); + } + } + +#if NEW_TIMELINE_AS_PACKAGE + GUILayout.Space(20); + EditorGUILayout.LabelField("Timeline Support", EditorStyles.boldLabel); + using (new GUILayout.HorizontalScope()) { + EditorGUILayout.PrefixLabel("Timeline Package Support"); + + var requestState = SpineEditorUtilities.SpinePackageDependencyUtility.HandlePendingAsyncTimelineRequest(); + using (new EditorGUI.DisabledGroupScope(requestState != SpineEditorUtilities.SpinePackageDependencyUtility.RequestState.NoRequestIssued)) { + if (GUILayout.Button("Enable", GUILayout.Width(64))) + SpineEditorUtilities.SpinePackageDependencyUtility.EnableTimelineSupport(); + if (GUILayout.Button("Disable", GUILayout.Width(64))) + SpineEditorUtilities.SpinePackageDependencyUtility.DisableTimelineSupport(); + } + } +#endif + + GUILayout.Space(20); + EditorGUILayout.LabelField("3rd Party Settings", EditorStyles.boldLabel); + using (new GUILayout.HorizontalScope()) { + EditorGUILayout.PrefixLabel("Define TK2D"); + if (GUILayout.Button("Enable", GUILayout.Width(64))) + SpineTK2DEditorUtility.EnableTK2D(); + if (GUILayout.Button("Disable", GUILayout.Width(64))) + SpineTK2DEditorUtility.DisableTK2D(); + } + } + } + + static void BoolPrefsField (ref bool currentValue, string editorPrefsKey, GUIContent label) { + EditorGUI.BeginChangeCheck(); + currentValue = EditorGUILayout.Toggle(label, currentValue); + if (EditorGUI.EndChangeCheck()) + EditorPrefs.SetBool(editorPrefsKey, currentValue); + } + + static void FloatPrefsField (ref float currentValue, string editorPrefsKey, GUIContent label, float min = float.NegativeInfinity, float max = float.PositiveInfinity) { + EditorGUI.BeginChangeCheck(); + currentValue = EditorGUILayout.DelayedFloatField(label, currentValue); + if (EditorGUI.EndChangeCheck()) { + currentValue = Mathf.Clamp(currentValue, min, max); + EditorPrefs.SetFloat(editorPrefsKey, currentValue); + } + } + + + + public static class DataReloadHandler { + + internal static Dictionary savedSkeletonDataAssetAtSKeletonGraphicID = new Dictionary(); + +#if NEWPLAYMODECALLBACKS + internal static void OnPlaymodeStateChanged (PlayModeStateChange stateChange) { +#else + internal static void OnPlaymodeStateChanged () { +#endif + ReloadAllActiveSkeletonsEditMode(); + } + + public static void ReloadAllActiveSkeletonsEditMode () { + + if (EditorApplication.isPaused) return; + if (EditorApplication.isPlaying) return; + if (EditorApplication.isCompiling) return; + if (EditorApplication.isPlayingOrWillChangePlaymode) return; + + var skeletonDataAssetsToReload = new HashSet(); + + var activeSkeletonRenderers = GameObject.FindObjectsOfType(); + foreach (var sr in activeSkeletonRenderers) { + var skeletonDataAsset = sr.skeletonDataAsset; + if (skeletonDataAsset != null) skeletonDataAssetsToReload.Add(skeletonDataAsset); + } + + // Under some circumstances (e.g. on first import) SkeletonGraphic objects + // have their skeletonGraphic.skeletonDataAsset reference corrupted + // by the instance of the ScriptableObject being destroyed but still assigned. + // Here we save the skeletonGraphic.skeletonDataAsset asset path in order + // to restore it later. + var activeSkeletonGraphics = GameObject.FindObjectsOfType(); + foreach (var sg in activeSkeletonGraphics) { + var skeletonDataAsset = sg.skeletonDataAsset; + if (skeletonDataAsset != null) { + var assetPath = AssetDatabase.GetAssetPath(skeletonDataAsset); + var sgID = sg.GetInstanceID(); + savedSkeletonDataAssetAtSKeletonGraphicID[sgID] = assetPath; + skeletonDataAssetsToReload.Add(skeletonDataAsset); + } + } + + foreach (var sda in skeletonDataAssetsToReload) { + sda.Clear(); + sda.GetSkeletonData(true); + } + + foreach (var sr in activeSkeletonRenderers) { + var meshRenderer = sr.GetComponent(); + var sharedMaterials = meshRenderer.sharedMaterials; + foreach (var m in sharedMaterials) { + if (m == null) { + sr.Initialize(true); + break; + } + } + } + + foreach (var sg in activeSkeletonGraphics) { + if (sg.mainTexture == null) + sg.Initialize(true); + } + } + + public static void ReloadSceneSkeletonComponents (SkeletonDataAsset skeletonDataAsset) { + if (EditorApplication.isPaused) return; + if (EditorApplication.isPlaying) return; + if (EditorApplication.isCompiling) return; + if (EditorApplication.isPlayingOrWillChangePlaymode) return; + + var activeSkeletonRenderers = GameObject.FindObjectsOfType(); + foreach (var sr in activeSkeletonRenderers) { + if (sr.isActiveAndEnabled && sr.skeletonDataAsset == skeletonDataAsset) sr.Initialize(true); + } + + var activeSkeletonGraphics = GameObject.FindObjectsOfType(); + foreach (var sg in activeSkeletonGraphics) { + if (sg.isActiveAndEnabled && sg.skeletonDataAsset == skeletonDataAsset) sg.Initialize(true); + } + } + } + + public static class AssetUtility { + public const string SkeletonDataSuffix = "_SkeletonData"; + public const string AtlasSuffix = "_Atlas"; + + static readonly int[][] compatibleBinaryVersions = { new[] { 3, 7, 0 } }; + static readonly int[][] compatibleJsonVersions = { new[] { 3, 7, 0 }, new[] { 3, 6, 0 }, new[] { 3, 5, 0 } }; + //static bool isFixVersionRequired = false; + + /// HACK: This list keeps the asset reference temporarily during importing. + /// + /// In cases of very large projects/sufficient RAM pressure, when AssetDatabase.SaveAssets is called, + /// Unity can mistakenly unload assets whose references are only on the stack. + /// This leads to MissingReferenceException and other errors. + public static readonly List protectFromStackGarbageCollection = new List(); + public static HashSet assetsImportedInWrongState = new HashSet(); + + public static void HandleOnPostprocessAllAssets (string[] imported) { + // In case user used "Assets -> Reimport All", during the import process, + // asset database is not initialized until some point. During that period, + // all attempts to load any assets using API (i.e. AssetDatabase.LoadAssetAtPath) + // will return null, and as result, assets won't be loaded even if they actually exists, + // which may lead to numerous importing errors. + // This situation also happens if Library folder is deleted from the project, which is a pretty + // common case, since when using version control systems, the Library folder must be excluded. + // + // So to avoid this, in case asset database is not available, we delay loading the assets + // until next time. + // + // Unity *always* reimports some internal assets after the process is done, so this method + // is always called once again in a state when asset database is available. + // + // Checking whether AssetDatabase is initialized is done by attempting to load + // a known "marker" asset that should always be available. Failing to load this asset + // means that AssetDatabase is not initialized. + AssetUtility.assetsImportedInWrongState.UnionWith(imported); + if (AssetDatabaseAvailabilityDetector.IsAssetDatabaseAvailable()) { + string[] combinedAssets = AssetUtility.assetsImportedInWrongState.ToArray(); + AssetUtility.assetsImportedInWrongState.Clear(); + AssetUtility.ImportSpineContent(combinedAssets); + } + } + +#region Match SkeletonData with Atlases + static readonly AttachmentType[] AtlasTypes = { AttachmentType.Region, AttachmentType.Linkedmesh, AttachmentType.Mesh }; + + public static List GetRequiredAtlasRegions (string skeletonDataPath) { + List requiredPaths = new List(); + + if (skeletonDataPath.Contains(".skel")) { + AddRequiredAtlasRegionsFromBinary(skeletonDataPath, requiredPaths); + return requiredPaths; + } + + TextReader reader = null; + TextAsset spineJson = AssetDatabase.LoadAssetAtPath(skeletonDataPath); + Dictionary root = null; + try { + if (spineJson != null) { + reader = new StringReader(spineJson.text); + } + else { + // On a "Reimport All" the order of imports can be wrong, thus LoadAssetAtPath() above could return null. + // as a workaround, we provide a fallback reader. + reader = new StreamReader(skeletonDataPath); + } + root = Json.Deserialize(reader) as Dictionary; + } + finally { + if (reader != null) + reader.Dispose(); + } + + if (root == null || !root.ContainsKey("skins")) + return requiredPaths; + + foreach (var skin in (Dictionary)root["skins"]) { + foreach (var slot in (Dictionary)skin.Value) { + + foreach (var attachment in ((Dictionary)slot.Value)) { + var data = ((Dictionary)attachment.Value); + + // Ignore non-atlas-requiring types. + if (data.ContainsKey("type")) { + AttachmentType attachmentType; + string typeString = (string)data["type"]; + try { + attachmentType = (AttachmentType)System.Enum.Parse(typeof(AttachmentType), typeString, true); + } catch (System.ArgumentException e) { + // For more info, visit: http://esotericsoftware.com/forum/Spine-editor-and-runtime-version-management-6534 + Debug.LogWarning(string.Format("Unidentified Attachment type: \"{0}\". Skeleton may have been exported from an incompatible Spine version.", typeString)); + throw e; + } + + if (!AtlasTypes.Contains(attachmentType)) + continue; + } + + if (data.ContainsKey("path")) + requiredPaths.Add((string)data["path"]); + else if (data.ContainsKey("name")) + requiredPaths.Add((string)data["name"]); + else + requiredPaths.Add(attachment.Key); + } + } + } + + return requiredPaths; + } + + internal static void AddRequiredAtlasRegionsFromBinary (string skeletonDataPath, List requiredPaths) { + SkeletonBinary binary = new SkeletonBinary(new AtlasRequirementLoader(requiredPaths)); + Stream input = null; + TextAsset data = AssetDatabase.LoadAssetAtPath(skeletonDataPath); + try { + if (data != null) { + input = new MemoryStream(data.bytes); + } + else { + // On a "Reimport All" the order of imports can be wrong, thus LoadAssetAtPath() above could return null. + // as a workaround, we provide a fallback reader. + input = File.Open(skeletonDataPath, FileMode.Open, FileAccess.Read); + } + binary.ReadSkeletonData(input); + } + finally { + if (input != null) + input.Dispose(); + } + binary = null; + } + + internal static AtlasAssetBase GetMatchingAtlas (List requiredPaths, List atlasAssets) { + AtlasAssetBase atlasAssetMatch = null; + + foreach (AtlasAssetBase a in atlasAssets) { + Atlas atlas = a.GetAtlas(); + bool failed = false; + foreach (string regionPath in requiredPaths) { + if (atlas.FindRegion(regionPath) == null) { + failed = true; + break; + } + } + + if (!failed) { + atlasAssetMatch = a; + break; + } + } + + return atlasAssetMatch; + } + + public class AtlasRequirementLoader : AttachmentLoader { + List requirementList; + + public AtlasRequirementLoader (List requirementList) { + this.requirementList = requirementList; + } + + public RegionAttachment NewRegionAttachment (Skin skin, string name, string path) { + requirementList.Add(path); + return new RegionAttachment(name); + } + + public MeshAttachment NewMeshAttachment (Skin skin, string name, string path) { + requirementList.Add(path); + return new MeshAttachment(name); + } + + public BoundingBoxAttachment NewBoundingBoxAttachment (Skin skin, string name) { + return new BoundingBoxAttachment(name); + } + + public PathAttachment NewPathAttachment (Skin skin, string name) { + return new PathAttachment(name); + } + + public PointAttachment NewPointAttachment (Skin skin, string name) { + return new PointAttachment(name); + } + + public ClippingAttachment NewClippingAttachment (Skin skin, string name) { + return new ClippingAttachment(name); + } + } +#endregion + + public static void ImportSpineContent (string[] imported, bool reimport = false) { + var atlasPaths = new List(); + var imagePaths = new List(); + var skeletonPaths = new List(); + + foreach (string str in imported) { + string extension = Path.GetExtension(str).ToLower(); + switch (extension) { + case ".atlas": + if (SpineEditorUtilities.Preferences.atlasTxtImportWarning) { + Debug.LogWarningFormat("`{0}` : If this file is a Spine atlas, please change its extension to `.atlas.txt`. This is to allow Unity to recognize it and avoid filename collisions. You can also set this file extension when exporting from the Spine editor.", str); + } + break; + case ".txt": + if (str.EndsWith(".atlas.txt", System.StringComparison.Ordinal)) + atlasPaths.Add(str); + break; + case ".png": + case ".jpg": + imagePaths.Add(str); + break; + case ".json": + var jsonAsset = AssetDatabase.LoadAssetAtPath(str); + if (jsonAsset != null && IsSpineData(jsonAsset)) + skeletonPaths.Add(str); + break; + case ".bytes": + if (str.ToLower().EndsWith(".skel.bytes", System.StringComparison.Ordinal)) { + if (IsSpineData(AssetDatabase.LoadAssetAtPath(str))) + skeletonPaths.Add(str); + } + break; + } + } + + // Import atlases first. + var atlases = new List(); + foreach (string ap in atlasPaths) { + TextAsset atlasText = AssetDatabase.LoadAssetAtPath(ap); + AtlasAssetBase atlas = IngestSpineAtlas(atlasText); + atlases.Add(atlas); + } + + // Import skeletons and match them with atlases. + bool abortSkeletonImport = false; + foreach (string skeletonPath in skeletonPaths) { + if (!reimport && CheckForValidSkeletonData(skeletonPath)) { + ReloadSkeletonData(skeletonPath); + continue; + } + + string dir = Path.GetDirectoryName(skeletonPath); + +#if SPINE_TK2D + IngestSpineProject(AssetDatabase.LoadAssetAtPath(skeletonPath), null); +#else + var localAtlases = FindAtlasesAtPath(dir); + var requiredPaths = GetRequiredAtlasRegions(skeletonPath); + var atlasMatch = GetMatchingAtlas(requiredPaths, localAtlases); + if (atlasMatch != null || requiredPaths.Count == 0) { + IngestSpineProject(AssetDatabase.LoadAssetAtPath(skeletonPath), atlasMatch); + } else { + SkeletonImportDialog(skeletonPath, localAtlases, requiredPaths, ref abortSkeletonImport); + } + + if (abortSkeletonImport) + break; +#endif + } + + SkeletonDataAssetInspector[] skeletonDataInspectors = Resources.FindObjectsOfTypeAll(); + foreach (var inspector in skeletonDataInspectors) { + inspector.UpdateSkeletonData(); + } + + // Any post processing of images + + // Under some circumstances (e.g. on first import) SkeletonGraphic objects + // have their skeletonGraphic.skeletonDataAsset reference corrupted + // by the instance of the ScriptableObject being destroyed but still assigned. + // Here we restore broken skeletonGraphic.skeletonDataAsset references. + var skeletonGraphicObjects = Resources.FindObjectsOfTypeAll(typeof(SkeletonGraphic)) as SkeletonGraphic[]; + foreach (var skeletonGraphic in skeletonGraphicObjects) { + + if (skeletonGraphic.skeletonDataAsset == null) { + var skeletonGraphicID = skeletonGraphic.GetInstanceID(); + if (DataReloadHandler.savedSkeletonDataAssetAtSKeletonGraphicID.ContainsKey(skeletonGraphicID)) { + string assetPath = DataReloadHandler.savedSkeletonDataAssetAtSKeletonGraphicID[skeletonGraphicID]; + skeletonGraphic.skeletonDataAsset = (SkeletonDataAsset)AssetDatabase.LoadAssetAtPath(assetPath); + } + } + } + } + + static void ReloadSkeletonData (string skeletonJSONPath) { + string dir = Path.GetDirectoryName(skeletonJSONPath); + TextAsset textAsset = AssetDatabase.LoadAssetAtPath(skeletonJSONPath); + DirectoryInfo dirInfo = new DirectoryInfo(dir); + FileInfo[] files = dirInfo.GetFiles("*.asset"); + + foreach (var f in files) { + string localPath = dir + "/" + f.Name; + var obj = AssetDatabase.LoadAssetAtPath(localPath, typeof(Object)); + var skeletonDataAsset = obj as SkeletonDataAsset; + if (skeletonDataAsset != null) { + if (skeletonDataAsset.skeletonJSON == textAsset) { + if (Selection.activeObject == skeletonDataAsset) + Selection.activeObject = null; + + Debug.LogFormat("Changes to '{0}' detected. Clearing SkeletonDataAsset: {1}", skeletonJSONPath, localPath); + skeletonDataAsset.Clear(); + + string guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(skeletonDataAsset)); + string lastHash = EditorPrefs.GetString(guid + "_hash"); + + // For some weird reason sometimes Unity loses the internal Object pointer, + // and as a result, all comparisons with null returns true. + // But the C# wrapper is still alive, so we can "restore" the object + // by reloading it from its Instance ID. + AtlasAssetBase[] skeletonDataAtlasAssets = skeletonDataAsset.atlasAssets; + if (skeletonDataAtlasAssets != null) { + for (int i = 0; i < skeletonDataAtlasAssets.Length; i++) { + if (!ReferenceEquals(null, skeletonDataAtlasAssets[i]) && + skeletonDataAtlasAssets[i].Equals(null) && + skeletonDataAtlasAssets[i].GetInstanceID() != 0 + ) { + skeletonDataAtlasAssets[i] = EditorUtility.InstanceIDToObject(skeletonDataAtlasAssets[i].GetInstanceID()) as AtlasAssetBase; + } + } + } + + SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(true); + string currentHash = skeletonData != null ? skeletonData.Hash : null; + +#if SPINE_SKELETONMECANIM + if (currentHash == null || lastHash != currentHash) + SkeletonBaker.UpdateMecanimClips(skeletonDataAsset); +#endif + + // if (currentHash == null || lastHash != currentHash) + // Do any upkeep on synchronized assets + + if (currentHash != null) + EditorPrefs.SetString(guid + "_hash", currentHash); + } + DataReloadHandler.ReloadSceneSkeletonComponents(skeletonDataAsset); + } + } + } + +#region Import Atlases + static List FindAtlasesAtPath (string path) { + List arr = new List(); + DirectoryInfo dir = new DirectoryInfo(path); + FileInfo[] assetInfoArr = dir.GetFiles("*.asset"); + + int subLen = Application.dataPath.Length - 6; + foreach (var f in assetInfoArr) { + string assetRelativePath = f.FullName.Substring(subLen, f.FullName.Length - subLen).Replace("\\", "/"); + Object obj = AssetDatabase.LoadAssetAtPath(assetRelativePath, typeof(AtlasAssetBase)); + if (obj != null) + arr.Add(obj as AtlasAssetBase); + } + + return arr; + } + + static AtlasAssetBase IngestSpineAtlas (TextAsset atlasText) { + if (atlasText == null) { + Debug.LogWarning("Atlas source cannot be null!"); + return null; + } + + string primaryName = Path.GetFileNameWithoutExtension(atlasText.name).Replace(".atlas", ""); + string assetPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(atlasText)); + + string atlasPath = assetPath + "/" + primaryName + AtlasSuffix + ".asset"; + + SpineAtlasAsset atlasAsset = (SpineAtlasAsset)AssetDatabase.LoadAssetAtPath(atlasPath, typeof(SpineAtlasAsset)); + + List vestigialMaterials = new List(); + + if (atlasAsset == null) + atlasAsset = SpineAtlasAsset.CreateInstance(); + else { + foreach (Material m in atlasAsset.materials) + vestigialMaterials.Add(m); + } + + protectFromStackGarbageCollection.Add(atlasAsset); + atlasAsset.atlasFile = atlasText; + + //strip CR + string atlasStr = atlasText.text; + atlasStr = atlasStr.Replace("\r", ""); + + string[] atlasLines = atlasStr.Split('\n'); + List pageFiles = new List(); + for (int i = 0; i < atlasLines.Length - 1; i++) { + if (atlasLines[i].Trim().Length == 0) + pageFiles.Add(atlasLines[i + 1].Trim()); + } + + var populatingMaterials = new List(pageFiles.Count);//atlasAsset.materials = new Material[pageFiles.Count]; + + for (int i = 0; i < pageFiles.Count; i++) { + string texturePath = assetPath + "/" + pageFiles[i]; + Texture2D texture = (Texture2D)AssetDatabase.LoadAssetAtPath(texturePath, typeof(Texture2D)); + + if (SpineEditorUtilities.Preferences.setTextureImporterSettings) { + TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath); + if (texImporter == null) { + Debug.LogWarning(string.Format("{0} ::: Texture asset \"{1}\" not found. Skipping. Please check your atlas file for renamed files.", atlasAsset.name, texturePath)); + continue; + } + + texImporter.textureCompression = TextureImporterCompression.Uncompressed; + texImporter.alphaSource = TextureImporterAlphaSource.FromInput; + texImporter.mipmapEnabled = false; + texImporter.alphaIsTransparency = false; // Prevent the texture importer from applying bleed to the transparent parts for PMA. + texImporter.spriteImportMode = SpriteImportMode.None; + texImporter.maxTextureSize = 2048; + + EditorUtility.SetDirty(texImporter); + AssetDatabase.ImportAsset(texturePath); + AssetDatabase.SaveAssets(); + } + + string pageName = Path.GetFileNameWithoutExtension(pageFiles[i]); + + //because this looks silly + if (pageName == primaryName && pageFiles.Count == 1) + pageName = "Material"; + + string materialPath = assetPath + "/" + primaryName + "_" + pageName + ".mat"; + Material mat = (Material)AssetDatabase.LoadAssetAtPath(materialPath, typeof(Material)); + + if (mat == null) { + mat = new Material(Shader.Find(SpineEditorUtilities.Preferences.defaultShader)); + AssetDatabase.CreateAsset(mat, materialPath); + } else { + vestigialMaterials.Remove(mat); + } + + mat.mainTexture = texture; + EditorUtility.SetDirty(mat); + AssetDatabase.SaveAssets(); + + populatingMaterials.Add(mat); //atlasAsset.materials[i] = mat; + } + + atlasAsset.materials = populatingMaterials.ToArray(); + + for (int i = 0; i < vestigialMaterials.Count; i++) + AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(vestigialMaterials[i])); + + if (AssetDatabase.GetAssetPath(atlasAsset) == "") + AssetDatabase.CreateAsset(atlasAsset, atlasPath); + else + atlasAsset.Clear(); + + EditorUtility.SetDirty(atlasAsset); + AssetDatabase.SaveAssets(); + + if (pageFiles.Count != atlasAsset.materials.Length) + Debug.LogWarning(string.Format("{0} :: Not all atlas pages were imported. If you rename your image files, please make sure you also edit the filenames specified in the atlas file.", atlasAsset.name)); + else + Debug.Log(string.Format("{0} :: Imported with {1} material", atlasAsset.name, atlasAsset.materials.Length)); + + // Iterate regions and bake marked. + Atlas atlas = atlasAsset.GetAtlas(); + if (atlas != null) { + FieldInfo field = typeof(Atlas).GetField("regions", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.NonPublic); + var regions = (List)field.GetValue(atlas); + string atlasAssetPath = AssetDatabase.GetAssetPath(atlasAsset); + string atlasAssetDirPath = Path.GetDirectoryName(atlasAssetPath); + string bakedDirPath = Path.Combine(atlasAssetDirPath, atlasAsset.name); + + bool hasBakedRegions = false; + for (int i = 0; i < regions.Count; i++) { + AtlasRegion region = regions[i]; + string bakedPrefabPath = Path.Combine(bakedDirPath, SpineEditorUtilities.AssetUtility.GetPathSafeName(region.name) + ".prefab").Replace("\\", "/"); + GameObject prefab = (GameObject)AssetDatabase.LoadAssetAtPath(bakedPrefabPath, typeof(GameObject)); + if (prefab != null) { + SkeletonBaker.BakeRegion(atlasAsset, region, false); + hasBakedRegions = true; + } + } + + if (hasBakedRegions) { + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + } + } + + protectFromStackGarbageCollection.Remove(atlasAsset); + return (AtlasAssetBase)AssetDatabase.LoadAssetAtPath(atlasPath, typeof(AtlasAssetBase)); + } +#endregion + +#region Import SkeletonData (json or binary) + internal static SkeletonDataAsset IngestSpineProject (TextAsset spineJson, params AtlasAssetBase[] atlasAssets) { + string primaryName = Path.GetFileNameWithoutExtension(spineJson.name); + string assetPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(spineJson)); + string filePath = assetPath + "/" + primaryName + SkeletonDataSuffix + ".asset"; + +#if SPINE_TK2D + if (spineJson != null) { + SkeletonDataAsset skeletonDataAsset = (SkeletonDataAsset)AssetDatabase.LoadAssetAtPath(filePath, typeof(SkeletonDataAsset)); + if (skeletonDataAsset == null) { + skeletonDataAsset = SkeletonDataAsset.CreateInstance(); + skeletonDataAsset.skeletonJSON = spineJson; + skeletonDataAsset.fromAnimation = new string[0]; + skeletonDataAsset.toAnimation = new string[0]; + skeletonDataAsset.duration = new float[0]; + skeletonDataAsset.defaultMix = SpineEditorUtilities.Preferences.defaultMix; + skeletonDataAsset.scale = SpineEditorUtilities.Preferences.defaultScale; + + AssetDatabase.CreateAsset(skeletonDataAsset, filePath); + AssetDatabase.SaveAssets(); + } else { + skeletonDataAsset.Clear(); + skeletonDataAsset.GetSkeletonData(true); + } + + return skeletonDataAsset; + } else { + EditorUtility.DisplayDialog("Error!", "Tried to ingest null Spine data.", "OK"); + return null; + } + +#else + if (spineJson != null && atlasAssets != null) { + SkeletonDataAsset skeletonDataAsset = (SkeletonDataAsset)AssetDatabase.LoadAssetAtPath(filePath, typeof(SkeletonDataAsset)); + if (skeletonDataAsset == null) { + skeletonDataAsset = ScriptableObject.CreateInstance(); + { + skeletonDataAsset.atlasAssets = atlasAssets; + skeletonDataAsset.skeletonJSON = spineJson; + skeletonDataAsset.defaultMix = SpineEditorUtilities.Preferences.defaultMix; + skeletonDataAsset.scale = SpineEditorUtilities.Preferences.defaultScale; + } + + AssetDatabase.CreateAsset(skeletonDataAsset, filePath); + AssetDatabase.SaveAssets(); + } else { + skeletonDataAsset.atlasAssets = atlasAssets; + skeletonDataAsset.Clear(); + skeletonDataAsset.GetSkeletonData(true); + } + + return skeletonDataAsset; + } else { + EditorUtility.DisplayDialog("Error!", "Must specify both Spine JSON and AtlasAsset array", "OK"); + return null; + } +#endif + } +#endregion + +#region Spine Skeleton Data File Validation + public static bool CheckForValidSkeletonData (string skeletonJSONPath) { + string dir = Path.GetDirectoryName(skeletonJSONPath); + TextAsset textAsset = AssetDatabase.LoadAssetAtPath(skeletonJSONPath); + DirectoryInfo dirInfo = new DirectoryInfo(dir); + FileInfo[] files = dirInfo.GetFiles("*.asset"); + + foreach (var path in files) { + string localPath = dir + "/" + path.Name; + var obj = AssetDatabase.LoadAssetAtPath(localPath, typeof(Object)); + var skeletonDataAsset = obj as SkeletonDataAsset; + if (skeletonDataAsset != null && skeletonDataAsset.skeletonJSON == textAsset) + return true; + } + + return false; + } + + public static bool IsSpineData (TextAsset asset) { + if (asset == null) + return false; + + bool isSpineData = false; + string rawVersion = null; + + int[][] compatibleVersions; + if (asset.name.Contains(".skel")) { + try { + using (var memStream = new MemoryStream(asset.bytes)) { + rawVersion = SkeletonBinary.GetVersionString(memStream); + } + isSpineData = !(string.IsNullOrEmpty(rawVersion)); + compatibleVersions = compatibleBinaryVersions; + } catch (System.Exception e) { + Debug.LogErrorFormat("Failed to read '{0}'. It is likely not a binary Spine SkeletonData file.\n{1}", asset.name, e); + return false; + } + } else { + object obj = Json.Deserialize(new StringReader(asset.text)); + if (obj == null) { + Debug.LogErrorFormat("'{0}' is not valid JSON.", asset.name); + return false; + } + + var root = obj as Dictionary; + if (root == null) { + Debug.LogError("Parser returned an incorrect type."); + return false; + } + + isSpineData = root.ContainsKey("skeleton"); + if (isSpineData) { + var skeletonInfo = (Dictionary)root["skeleton"]; + object jv; + skeletonInfo.TryGetValue("spine", out jv); + rawVersion = jv as string; + } + + compatibleVersions = compatibleJsonVersions; + } + + // Version warning + if (isSpineData) { + string primaryRuntimeVersionDebugString = compatibleVersions[0][0] + "." + compatibleVersions[0][1]; + + if (string.IsNullOrEmpty(rawVersion)) { + Debug.LogWarningFormat("Skeleton '{0}' has no version information. It may be incompatible with your runtime version: spine-unity v{1}", asset.name, primaryRuntimeVersionDebugString); + } else { + string[] versionSplit = rawVersion.Split('.'); + bool match = false; + foreach (var version in compatibleVersions) { + bool primaryMatch = version[0] == int.Parse(versionSplit[0], CultureInfo.InvariantCulture); + bool secondaryMatch = version[1] == int.Parse(versionSplit[1], CultureInfo.InvariantCulture); + + // if (isFixVersionRequired) secondaryMatch &= version[2] <= int.Parse(jsonVersionSplit[2], CultureInfo.InvariantCulture); + + if (primaryMatch && secondaryMatch) { + match = true; + break; + } + } + + if (!match) + Debug.LogWarningFormat("Skeleton '{0}' (exported with Spine {1}) may be incompatible with your runtime version: spine-csharp v{2}", asset.name, rawVersion, primaryRuntimeVersionDebugString); + } + } + + return isSpineData; + } +#endregion + +#region Dialogs + public static void SkeletonImportDialog (string skeletonPath, List localAtlases, List requiredPaths, ref bool abortSkeletonImport) { + bool resolved = false; + while (!resolved) { + + string filename = Path.GetFileNameWithoutExtension(skeletonPath); + int result = EditorUtility.DisplayDialogComplex( + string.Format("AtlasAsset for \"{0}\"", filename), + string.Format("Could not automatically set the AtlasAsset for \"{0}\".\n\n (You may resolve this manually later.)", filename), + "Resolve atlases...", "Import without atlases", "Stop importing" + ); + + switch (result) { + case -1: + //Debug.Log("Select Atlas"); + AtlasAssetBase selectedAtlas = BrowseAtlasDialog(Path.GetDirectoryName(skeletonPath)); + if (selectedAtlas != null) { + localAtlases.Clear(); + localAtlases.Add(selectedAtlas); + var atlasMatch = AssetUtility.GetMatchingAtlas(requiredPaths, localAtlases); + if (atlasMatch != null) { + resolved = true; + AssetUtility.IngestSpineProject(AssetDatabase.LoadAssetAtPath(skeletonPath), atlasMatch); + } + } + break; + case 0: // Resolve AtlasAssets... + var atlasList = MultiAtlasDialog(requiredPaths, Path.GetDirectoryName(skeletonPath), Path.GetFileNameWithoutExtension(skeletonPath)); + if (atlasList != null) + AssetUtility.IngestSpineProject(AssetDatabase.LoadAssetAtPath(skeletonPath), atlasList.ToArray()); + + resolved = true; + break; + case 1: // Import without atlas + Debug.LogWarning("Imported with missing atlases. Skeleton will not render: " + Path.GetFileName(skeletonPath)); + AssetUtility.IngestSpineProject(AssetDatabase.LoadAssetAtPath(skeletonPath), new AtlasAssetBase[] { }); + resolved = true; + break; + case 2: // Stop importing all + abortSkeletonImport = true; + resolved = true; + break; + } + } + } + + public static List MultiAtlasDialog (List requiredPaths, string initialDirectory, string filename = "") { + List atlasAssets = new List(); + bool resolved = false; + string lastAtlasPath = initialDirectory; + while (!resolved) { + + // Build dialog box message. + var missingRegions = new List(requiredPaths); + var dialogText = new StringBuilder(); + { + dialogText.AppendLine(string.Format("SkeletonDataAsset for \"{0}\"", filename)); + dialogText.AppendLine("has missing regions."); + dialogText.AppendLine(); + dialogText.AppendLine("Current Atlases:"); + + if (atlasAssets.Count == 0) + dialogText.AppendLine("\t--none--"); + + for (int i = 0; i < atlasAssets.Count; i++) + dialogText.AppendLine("\t" + atlasAssets[i].name); + + dialogText.AppendLine(); + dialogText.AppendLine("Missing Regions:"); + + foreach (var atlasAsset in atlasAssets) { + var atlas = atlasAsset.GetAtlas(); + for (int i = 0; i < missingRegions.Count; i++) { + if (atlas.FindRegion(missingRegions[i]) != null) { + missingRegions.RemoveAt(i); + i--; + } + } + } + + int n = missingRegions.Count; + if (n == 0) + break; + + const int MaxListLength = 15; + for (int i = 0; (i < n && i < MaxListLength); i++) + dialogText.AppendLine(string.Format("\t {0}", missingRegions[i])); + + if (n > MaxListLength) + dialogText.AppendLine(string.Format("\t... {0} more...", n - MaxListLength)); + } + + // Show dialog box. + int result = EditorUtility.DisplayDialogComplex( + "SkeletonDataAsset has missing Atlas.", + dialogText.ToString(), + "Browse Atlas...", "Import anyway", "Cancel import" + ); + + switch (result) { + case 0: // Browse... + AtlasAssetBase selectedAtlasAsset = BrowseAtlasDialog(lastAtlasPath); + if (selectedAtlasAsset != null) { + if (!atlasAssets.Contains(selectedAtlasAsset)) { + var atlas = selectedAtlasAsset.GetAtlas(); + bool hasValidRegion = false; + foreach (string str in missingRegions) { + if (atlas.FindRegion(str) != null) { + hasValidRegion = true; + break; + } + } + atlasAssets.Add(selectedAtlasAsset); + } + } + break; + case 1: // Import anyway + resolved = true; + break; + case 2: // Cancel + atlasAssets = null; + resolved = true; + break; + } + } + + return atlasAssets; + } + + public static AtlasAssetBase BrowseAtlasDialog (string dirPath) { + string path = EditorUtility.OpenFilePanel("Select AtlasAsset...", dirPath, "asset"); + if (path == "") + return null; // Canceled or closed by user. + + int subLen = Application.dataPath.Length - 6; + string assetRelativePath = path.Substring(subLen, path.Length - subLen).Replace("\\", "/"); + + var obj = AssetDatabase.LoadAssetAtPath(assetRelativePath, typeof(AtlasAssetBase)); + if (obj == null || !(obj is AtlasAssetBase)) { + Debug.Log("Chosen asset was not of type AtlasAssetBase"); + return null; + } + + return (AtlasAssetBase)obj; + } +#endregion + + public static string GetPathSafeName (string name) { + foreach (char c in System.IO.Path.GetInvalidFileNameChars()) { // Doesn't handle more obscure file name limitations. + name = name.Replace(c, '_'); + } + return name; + } + } + + public static class EditorInstantiation { + public delegate Component InstantiateDelegate (SkeletonDataAsset skeletonDataAsset); + + public class SkeletonComponentSpawnType { + public string menuLabel; + public InstantiateDelegate instantiateDelegate; + public bool isUI; + } + + internal static readonly List additionalSpawnTypes = new List(); + + public static void TryInitializeSkeletonRendererSettings (SkeletonRenderer skeletonRenderer, Skin skin = null) { + const string PMAShaderQuery = "Spine/Skeleton"; + const string TintBlackShaderQuery = "Tint Black"; + + if (skeletonRenderer == null) return; + var skeletonDataAsset = skeletonRenderer.skeletonDataAsset; + if (skeletonDataAsset == null) return; + + bool pmaVertexColors = false; + bool tintBlack = false; + foreach (AtlasAssetBase atlasAsset in skeletonDataAsset.atlasAssets) { + if (!pmaVertexColors) { + foreach (Material m in atlasAsset.Materials) { + if (m.shader.name.Contains(PMAShaderQuery)) { + pmaVertexColors = true; + break; + } + } + } + + if (!tintBlack) { + foreach (Material m in atlasAsset.Materials) { + if (m.shader.name.Contains(TintBlackShaderQuery)) { + tintBlack = true; + break; + } + } + } + } + + skeletonRenderer.pmaVertexColors = pmaVertexColors; + skeletonRenderer.tintBlack = tintBlack; + skeletonRenderer.zSpacing = SpineEditorUtilities.Preferences.defaultZSpacing; + + var data = skeletonDataAsset.GetSkeletonData(false); + bool noSkins = data.DefaultSkin == null && (data.Skins == null || data.Skins.Count == 0); // Support attachmentless/skinless SkeletonData. + skin = skin ?? data.DefaultSkin ?? (noSkins ? null : data.Skins.Items[0]); + if (skin != null && skin != data.DefaultSkin) { + skeletonRenderer.initialSkinName = skin.Name; + } + } + + public static SkeletonAnimation InstantiateSkeletonAnimation (SkeletonDataAsset skeletonDataAsset, string skinName, bool destroyInvalid = true) { + var skeletonData = skeletonDataAsset.GetSkeletonData(true); + var skin = skeletonData != null ? skeletonData.FindSkin(skinName) : null; + return InstantiateSkeletonAnimation(skeletonDataAsset, skin, destroyInvalid); + } + + public static SkeletonAnimation InstantiateSkeletonAnimation (SkeletonDataAsset skeletonDataAsset, Skin skin = null, bool destroyInvalid = true) { + SkeletonData data = skeletonDataAsset.GetSkeletonData(true); + + if (data == null) { + for (int i = 0; i < skeletonDataAsset.atlasAssets.Length; i++) { + string reloadAtlasPath = AssetDatabase.GetAssetPath(skeletonDataAsset.atlasAssets[i]); + skeletonDataAsset.atlasAssets[i] = (AtlasAssetBase)AssetDatabase.LoadAssetAtPath(reloadAtlasPath, typeof(AtlasAssetBase)); + } + data = skeletonDataAsset.GetSkeletonData(false); + } + + if (data == null) { + Debug.LogWarning("InstantiateSkeletonAnimation tried to instantiate a skeleton from an invalid SkeletonDataAsset."); + return null; + } + + string spineGameObjectName = string.Format("Spine GameObject ({0})", skeletonDataAsset.name.Replace("_SkeletonData", "")); + GameObject go = EditorInstantiation.NewGameObject(spineGameObjectName, typeof(MeshFilter), typeof(MeshRenderer), typeof(SkeletonAnimation)); + SkeletonAnimation newSkeletonAnimation = go.GetComponent(); + newSkeletonAnimation.skeletonDataAsset = skeletonDataAsset; + TryInitializeSkeletonRendererSettings(newSkeletonAnimation, skin); + + // Initialize + try { + newSkeletonAnimation.Initialize(false); + } catch (System.Exception e) { + if (destroyInvalid) { + Debug.LogWarning("Editor-instantiated SkeletonAnimation threw an Exception. Destroying GameObject to prevent orphaned GameObject."); + GameObject.DestroyImmediate(go); + } + throw e; + } + + newSkeletonAnimation.loop = SpineEditorUtilities.Preferences.defaultInstantiateLoop; + newSkeletonAnimation.skeleton.Update(0); + newSkeletonAnimation.state.Update(0); + newSkeletonAnimation.state.Apply(newSkeletonAnimation.skeleton); + newSkeletonAnimation.skeleton.UpdateWorldTransform(); + + return newSkeletonAnimation; + } + + /// Handles creating a new GameObject in the Unity Editor. This uses the new ObjectFactory API where applicable. + public static GameObject NewGameObject (string name) { +#if NEW_PREFAB_SYSTEM + return ObjectFactory.CreateGameObject(name); +#else + return new GameObject(name); +#endif + } + + /// Handles creating a new GameObject in the Unity Editor. This uses the new ObjectFactory API where applicable. + public static GameObject NewGameObject (string name, params System.Type[] components) { +#if NEW_PREFAB_SYSTEM + return ObjectFactory.CreateGameObject(name, components); +#else + return new GameObject(name, components); +#endif + } + + public static void InstantiateEmptySpineGameObject (string name) where T : MonoBehaviour { + var parentGameObject = Selection.activeObject as GameObject; + var parentTransform = parentGameObject == null ? null : parentGameObject.transform; + + var gameObject = EditorInstantiation.NewGameObject(name, typeof(T)); + gameObject.transform.SetParent(parentTransform, false); + EditorUtility.FocusProjectWindow(); + Selection.activeObject = gameObject; + EditorGUIUtility.PingObject(Selection.activeObject); + } + +#region SkeletonMecanim +#if SPINE_SKELETONMECANIM + public static SkeletonMecanim InstantiateSkeletonMecanim (SkeletonDataAsset skeletonDataAsset, string skinName) { + return InstantiateSkeletonMecanim(skeletonDataAsset, skeletonDataAsset.GetSkeletonData(true).FindSkin(skinName)); + } + + public static SkeletonMecanim InstantiateSkeletonMecanim (SkeletonDataAsset skeletonDataAsset, Skin skin = null, bool destroyInvalid = true) { + SkeletonData data = skeletonDataAsset.GetSkeletonData(true); + + if (data == null) { + for (int i = 0; i < skeletonDataAsset.atlasAssets.Length; i++) { + string reloadAtlasPath = AssetDatabase.GetAssetPath(skeletonDataAsset.atlasAssets[i]); + skeletonDataAsset.atlasAssets[i] = (AtlasAssetBase)AssetDatabase.LoadAssetAtPath(reloadAtlasPath, typeof(AtlasAssetBase)); + } + data = skeletonDataAsset.GetSkeletonData(false); + } + + if (data == null) { + Debug.LogWarning("InstantiateSkeletonMecanim tried to instantiate a skeleton from an invalid SkeletonDataAsset."); + return null; + } + + string spineGameObjectName = string.Format("Spine Mecanim GameObject ({0})", skeletonDataAsset.name.Replace("_SkeletonData", "")); + GameObject go = EditorInstantiation.NewGameObject(spineGameObjectName, typeof(MeshFilter), typeof(MeshRenderer), typeof(Animator), typeof(SkeletonMecanim)); + + if (skeletonDataAsset.controller == null) { + SkeletonBaker.GenerateMecanimAnimationClips(skeletonDataAsset); + Debug.Log(string.Format("Mecanim controller was automatically generated and assigned for {0}", skeletonDataAsset.name)); + } + + go.GetComponent().runtimeAnimatorController = skeletonDataAsset.controller; + + SkeletonMecanim newSkeletonMecanim = go.GetComponent(); + newSkeletonMecanim.skeletonDataAsset = skeletonDataAsset; + TryInitializeSkeletonRendererSettings(newSkeletonMecanim, skin); + + // Initialize + try { + newSkeletonMecanim.Initialize(false); + } catch (System.Exception e) { + if (destroyInvalid) { + Debug.LogWarning("Editor-instantiated SkeletonAnimation threw an Exception. Destroying GameObject to prevent orphaned GameObject."); + GameObject.DestroyImmediate(go); + } + throw e; + } + + newSkeletonMecanim.skeleton.Update(0); + newSkeletonMecanim.skeleton.UpdateWorldTransform(); + newSkeletonMecanim.LateUpdate(); + + return newSkeletonMecanim; + } +#endif +#endregion + } + + public static class DragAndDropInstantiation { + public struct SpawnMenuData { + public Vector3 spawnPoint; + public SkeletonDataAsset skeletonDataAsset; + public EditorInstantiation.InstantiateDelegate instantiateDelegate; + public bool isUI; + } + + public static void SceneViewDragAndDrop (SceneView sceneview) { + var current = UnityEngine.Event.current; + var references = DragAndDrop.objectReferences; + if (current.type == EventType.Layout) + return; + + // Allow drag and drop of one SkeletonDataAsset. + if (references.Length == 1) { + var skeletonDataAsset = references[0] as SkeletonDataAsset; + if (skeletonDataAsset != null) { + var mousePos = current.mousePosition; + + bool invalidSkeletonData = skeletonDataAsset.GetSkeletonData(true) == null; + if (invalidSkeletonData) { + DragAndDrop.visualMode = DragAndDropVisualMode.Rejected; + Handles.BeginGUI(); + GUI.Label(new Rect(mousePos + new Vector2(20f, 20f), new Vector2(400f, 40f)), new GUIContent(string.Format("{0} is invalid.\nCannot create new Spine GameObject.", skeletonDataAsset.name), SpineEditorUtilities.Icons.warning)); + Handles.EndGUI(); + return; + } else { + DragAndDrop.visualMode = DragAndDropVisualMode.Copy; + Handles.BeginGUI(); + GUI.Label(new Rect(mousePos + new Vector2(20f, 20f), new Vector2(400f, 20f)), new GUIContent(string.Format("Create Spine GameObject ({0})", skeletonDataAsset.skeletonJSON.name), SpineEditorUtilities.Icons.skeletonDataAssetIcon)); + Handles.EndGUI(); + + if (current.type == EventType.DragPerform) { + RectTransform rectTransform = (Selection.activeGameObject == null) ? null : Selection.activeGameObject.GetComponent(); + Plane plane = (rectTransform == null) ? new Plane(Vector3.back, Vector3.zero) : new Plane(-rectTransform.forward, rectTransform.position); + Vector3 spawnPoint = MousePointToWorldPoint2D(mousePos, sceneview.camera, plane); + ShowInstantiateContextMenu(skeletonDataAsset, spawnPoint); + DragAndDrop.AcceptDrag(); + current.Use(); + } + } + } + } + } + + public static void ShowInstantiateContextMenu (SkeletonDataAsset skeletonDataAsset, Vector3 spawnPoint) { + var menu = new GenericMenu(); + + // SkeletonAnimation + menu.AddItem(new GUIContent("SkeletonAnimation"), false, HandleSkeletonComponentDrop, new SpawnMenuData { + skeletonDataAsset = skeletonDataAsset, + spawnPoint = spawnPoint, + instantiateDelegate = (data) => EditorInstantiation.InstantiateSkeletonAnimation(data), + isUI = false + }); + + // SkeletonGraphic + var skeletonGraphicInspectorType = System.Type.GetType("Spine.Unity.Editor.SkeletonGraphicInspector"); + if (skeletonGraphicInspectorType != null) { + var graphicInstantiateDelegate = skeletonGraphicInspectorType.GetMethod("SpawnSkeletonGraphicFromDrop", BindingFlags.Static | BindingFlags.Public); + if (graphicInstantiateDelegate != null) + menu.AddItem(new GUIContent("SkeletonGraphic (UI)"), false, HandleSkeletonComponentDrop, new SpawnMenuData { + skeletonDataAsset = skeletonDataAsset, + spawnPoint = spawnPoint, + instantiateDelegate = System.Delegate.CreateDelegate(typeof(EditorInstantiation.InstantiateDelegate), graphicInstantiateDelegate) as EditorInstantiation.InstantiateDelegate, + isUI = true + }); + } + +#if SPINE_SKELETONMECANIM + menu.AddSeparator(""); + // SkeletonMecanim + menu.AddItem(new GUIContent("SkeletonMecanim"), false, HandleSkeletonComponentDrop, new SpawnMenuData { + skeletonDataAsset = skeletonDataAsset, + spawnPoint = spawnPoint, + instantiateDelegate = (data) => EditorInstantiation.InstantiateSkeletonMecanim(data) + }); +#endif + + menu.ShowAsContext(); + } + + public static void HandleSkeletonComponentDrop (object spawnMenuData) { + var data = (SpawnMenuData)spawnMenuData; + + if (data.skeletonDataAsset.GetSkeletonData(true) == null) { + EditorUtility.DisplayDialog("Invalid SkeletonDataAsset", "Unable to create Spine GameObject.\n\nPlease check your SkeletonDataAsset.", "Ok"); + return; + } + + bool isUI = data.isUI; + + Component newSkeletonComponent = data.instantiateDelegate.Invoke(data.skeletonDataAsset); + GameObject newGameObject = newSkeletonComponent.gameObject; + Transform newTransform = newGameObject.transform; + + var activeGameObject = Selection.activeGameObject; + if (isUI && activeGameObject != null) + newTransform.SetParent(activeGameObject.transform, false); + + newTransform.position = isUI ? data.spawnPoint : RoundVector(data.spawnPoint, 2); + + if (isUI && (activeGameObject == null || activeGameObject.GetComponent() == null)) + Debug.Log("Created a UI Skeleton GameObject not under a RectTransform. It may not be visible until you parent it to a canvas."); + + if (!isUI && activeGameObject != null && activeGameObject.transform.localScale != Vector3.one) + Debug.Log("New Spine GameObject was parented to a scaled Transform. It may not be the intended size."); + + Selection.activeGameObject = newGameObject; + //EditorGUIUtility.PingObject(newGameObject); // Doesn't work when setting activeGameObject. + Undo.RegisterCreatedObjectUndo(newGameObject, "Create Spine GameObject"); + } + + /// + /// Rounds off vector components to a number of decimal digits. + /// + public static Vector3 RoundVector (Vector3 vector, int digits) { + vector.x = (float)System.Math.Round(vector.x, digits); + vector.y = (float)System.Math.Round(vector.y, digits); + vector.z = (float)System.Math.Round(vector.z, digits); + return vector; + } + + /// + /// Converts a mouse point to a world point on a plane. + /// + static Vector3 MousePointToWorldPoint2D (Vector2 mousePosition, Camera camera, Plane plane) { + var screenPos = new Vector3(mousePosition.x, camera.pixelHeight - mousePosition.y, 0f); + var ray = camera.ScreenPointToRay(screenPos); + float distance; + bool hit = plane.Raycast(ray, out distance); + return ray.GetPoint(distance); + } + } + + static class HierarchyHandler { + static Dictionary skeletonRendererTable = new Dictionary(); + static Dictionary skeletonUtilityBoneTable = new Dictionary(); + static Dictionary boundingBoxFollowerTable = new Dictionary(); + +#if NEWPLAYMODECALLBACKS + internal static void IconsOnPlaymodeStateChanged (PlayModeStateChange stateChange) { +#else + internal static void IconsOnPlaymodeStateChanged () { +#endif + skeletonRendererTable.Clear(); + skeletonUtilityBoneTable.Clear(); + boundingBoxFollowerTable.Clear(); + +#if NEWHIERARCHYWINDOWCALLBACKS + EditorApplication.hierarchyChanged -= IconsOnChanged; +#else + EditorApplication.hierarchyWindowChanged -= IconsOnChanged; +#endif + EditorApplication.hierarchyWindowItemOnGUI -= IconsOnGUI; + + if (!Application.isPlaying && Preferences.showHierarchyIcons) { +#if NEWHIERARCHYWINDOWCALLBACKS + EditorApplication.hierarchyChanged += IconsOnChanged; +#else + EditorApplication.hierarchyWindowChanged += IconsOnChanged; +#endif + EditorApplication.hierarchyWindowItemOnGUI += IconsOnGUI; + IconsOnChanged(); + } + } + + internal static void IconsOnChanged () { + skeletonRendererTable.Clear(); + skeletonUtilityBoneTable.Clear(); + boundingBoxFollowerTable.Clear(); + + SkeletonRenderer[] arr = Object.FindObjectsOfType(); + foreach (SkeletonRenderer r in arr) + skeletonRendererTable[r.gameObject.GetInstanceID()] = r.gameObject; + + SkeletonUtilityBone[] boneArr = Object.FindObjectsOfType(); + foreach (SkeletonUtilityBone b in boneArr) + skeletonUtilityBoneTable[b.gameObject.GetInstanceID()] = b; + + BoundingBoxFollower[] bbfArr = Object.FindObjectsOfType(); + foreach (BoundingBoxFollower bbf in bbfArr) + boundingBoxFollowerTable[bbf.gameObject.GetInstanceID()] = bbf; + } + + internal static void IconsOnGUI (int instanceId, Rect selectionRect) { + Rect r = new Rect(selectionRect); + if (skeletonRendererTable.ContainsKey(instanceId)) { + r.x = r.width - 15; + r.width = 15; + GUI.Label(r, Icons.spine); + } else if (skeletonUtilityBoneTable.ContainsKey(instanceId)) { + r.x -= 26; + if (skeletonUtilityBoneTable[instanceId] != null) { + if (skeletonUtilityBoneTable[instanceId].transform.childCount == 0) + r.x += 13; + r.y += 2; + r.width = 13; + r.height = 13; + if (skeletonUtilityBoneTable[instanceId].mode == SkeletonUtilityBone.Mode.Follow) + GUI.DrawTexture(r, Icons.bone); + else + GUI.DrawTexture(r, Icons.poseBones); + } + } else if (boundingBoxFollowerTable.ContainsKey(instanceId)) { + r.x -= 26; + if (boundingBoxFollowerTable[instanceId] != null) { + if (boundingBoxFollowerTable[instanceId].transform.childCount == 0) + r.x += 13; + r.y += 2; + r.width = 13; + r.height = 13; + GUI.DrawTexture(r, Icons.boundingBox); + } + } + } + + internal static void HandleDragAndDrop (int instanceId, Rect selectionRect) { + // HACK: Uses EditorApplication.hierarchyWindowItemOnGUI. + // Only works when there is at least one item in the scene. + var current = UnityEngine.Event.current; + var eventType = current.type; + bool isDraggingEvent = eventType == EventType.DragUpdated; + bool isDropEvent = eventType == EventType.DragPerform; + if (isDraggingEvent || isDropEvent) { + var mouseOverWindow = EditorWindow.mouseOverWindow; + if (mouseOverWindow != null) { + + // One, existing, valid SkeletonDataAsset + var references = UnityEditor.DragAndDrop.objectReferences; + if (references.Length == 1) { + var skeletonDataAsset = references[0] as SkeletonDataAsset; + if (skeletonDataAsset != null && skeletonDataAsset.GetSkeletonData(true) != null) { + + // Allow drag-and-dropping anywhere in the Hierarchy Window. + // HACK: string-compare because we can't get its type via reflection. + const string HierarchyWindow = "UnityEditor.SceneHierarchyWindow"; + if (HierarchyWindow.Equals(mouseOverWindow.GetType().ToString(), System.StringComparison.Ordinal)) { + if (isDraggingEvent) { + UnityEditor.DragAndDrop.visualMode = DragAndDropVisualMode.Copy; + current.Use(); + } else if (isDropEvent) { + DragAndDropInstantiation.ShowInstantiateContextMenu(skeletonDataAsset, Vector3.zero); + UnityEditor.DragAndDrop.AcceptDrag(); + current.Use(); + return; + } + } + + } + } + } + } + + } + } + + internal static class SpineTK2DEditorUtility { + const string SPINE_TK2D_DEFINE = "SPINE_TK2D"; + + internal static void EnableTK2D () { + SpineBuildEnvUtility.DisableSpineAsmdefFiles(); + SpineBuildEnvUtility.EnableBuildDefine(SPINE_TK2D_DEFINE); + } + + internal static void DisableTK2D () { + SpineBuildEnvUtility.EnableSpineAsmdefFiles(); + SpineBuildEnvUtility.DisableBuildDefine(SPINE_TK2D_DEFINE); + } + } + + public static class SpinePackageDependencyUtility + { + public enum RequestState { + NoRequestIssued = 0, + InProgress, + Success, + Failure + } + +#if NEW_TIMELINE_AS_PACKAGE + const string SPINE_TIMELINE_PACKAGE_DOWNLOADED_DEFINE = "SPINE_TIMELINE_PACKAGE_DOWNLOADED"; + const string TIMELINE_PACKAGE_NAME = "com.unity.timeline"; + const string TIMELINE_ASMDEF_DEPENDENCY_STRING = "\"Unity.Timeline\""; + static UnityEditor.PackageManager.Requests.AddRequest timelineRequest = null; + + /// + /// Enables Spine's Timeline components by downloading the Timeline Package in Unity 2019 and newer + /// and setting respective compile definitions once downloaded. + /// + internal static void EnableTimelineSupport () { + Debug.Log("Downloading Timeline package " + TIMELINE_PACKAGE_NAME + "."); + timelineRequest = UnityEditor.PackageManager.Client.Add(TIMELINE_PACKAGE_NAME); + // Note: unfortunately there is no callback provided, only polling support. + // So polling HandlePendingAsyncTimelineRequest() is necessary. + + EditorApplication.update -= UpdateAsyncTimelineRequest; + EditorApplication.update += UpdateAsyncTimelineRequest; + } + + public static void UpdateAsyncTimelineRequest () { + HandlePendingAsyncTimelineRequest(); + } + + public static RequestState HandlePendingAsyncTimelineRequest () { + if (timelineRequest == null) + return RequestState.NoRequestIssued; + + var status = timelineRequest.Status; + if (status == UnityEditor.PackageManager.StatusCode.InProgress) { + return RequestState.InProgress; + } + else { + EditorApplication.update -= UpdateAsyncTimelineRequest; + timelineRequest = null; + if (status == UnityEditor.PackageManager.StatusCode.Failure) { + Debug.LogError("Download of package " + TIMELINE_PACKAGE_NAME + " failed!"); + return RequestState.Failure; + } + else { // status == UnityEditor.PackageManager.StatusCode.Success + HandleSuccessfulTimelinePackageDownload(); + return RequestState.Success; + } + } + } + + internal static void DisableTimelineSupport () { + SpineBuildEnvUtility.DisableBuildDefine(SPINE_TIMELINE_PACKAGE_DOWNLOADED_DEFINE); + SpineBuildEnvUtility.RemoveDependencyFromAsmdefFile(TIMELINE_ASMDEF_DEPENDENCY_STRING); + } + + internal static void HandleSuccessfulTimelinePackageDownload () { + +#if !SPINE_TK2D + SpineBuildEnvUtility.EnableSpineAsmdefFiles(); +#endif + SpineBuildEnvUtility.AddDependencyToAsmdefFile(TIMELINE_ASMDEF_DEPENDENCY_STRING); + SpineBuildEnvUtility.EnableBuildDefine(SPINE_TIMELINE_PACKAGE_DOWNLOADED_DEFINE); + + ReimportTimelineScripts(); + } + + internal static void ReimportTimelineScripts () { + // Note: unfortunately AssetDatabase::Refresh is not enough and + // ImportAsset on a dir does not have the desired effect. + List searchStrings = new List(); + searchStrings.Add("SpineAnimationStateBehaviour t:script"); + searchStrings.Add("SpineAnimationStateClip t:script"); + searchStrings.Add("SpineAnimationStateMixerBehaviour t:script"); + searchStrings.Add("SpineAnimationStateTrack t:script"); + + searchStrings.Add("SpineSkeletonFlipBehaviour t:script"); + searchStrings.Add("SpineSkeletonFlipClip t:script"); + searchStrings.Add("SpineSkeletonFlipMixerBehaviour t:script"); + searchStrings.Add("SpineSkeletonFlipTrack t:script"); + + searchStrings.Add("SkeletonAnimationPlayableHandle t:script"); + searchStrings.Add("SpinePlayableHandleBase t:script"); + + foreach (string searchString in searchStrings) { + string[] guids = AssetDatabase.FindAssets(searchString); + foreach (string guid in guids) { + string currentPath = AssetDatabase.GUIDToAssetPath(guid); + AssetDatabase.ImportAsset(currentPath, ImportAssetOptions.ForceUpdate); + } + } + } +#endif + } + } + + public static class SpineBuildEnvUtility + { + static bool IsInvalidGroup (BuildTargetGroup group) { + int gi = (int)group; + return + gi == 15 || gi == 16 + || + group == BuildTargetGroup.Unknown; + } + + public static bool EnableBuildDefine (string define) { + + bool wasDefineAdded = false; + Debug.LogWarning("Please ignore errors \"PlayerSettings Validation: Requested build target group doesn't exist\" below"); + foreach (BuildTargetGroup group in System.Enum.GetValues(typeof(BuildTargetGroup))) { + if (IsInvalidGroup(group)) + continue; + + string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(group); + if (!defines.Contains(define)) { + wasDefineAdded = true; + if (defines.EndsWith(";", System.StringComparison.Ordinal)) + defines += define; + else + defines += ";" + define; + + PlayerSettings.SetScriptingDefineSymbolsForGroup(group, defines); + } + } + Debug.LogWarning("Please ignore errors \"PlayerSettings Validation: Requested build target group doesn't exist\" above"); + + if (wasDefineAdded) { + Debug.LogWarning("Setting Scripting Define Symbol " + define); + } + else { + Debug.LogWarning("Already Set Scripting Define Symbol " + define); + } + return wasDefineAdded; + } + + public static bool DisableBuildDefine (string define) { + + bool wasDefineRemoved = false; + foreach (BuildTargetGroup group in System.Enum.GetValues(typeof(BuildTargetGroup))) { + if (IsInvalidGroup(group)) + continue; + + string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(group); + if (defines.Contains(define)) { + wasDefineRemoved = true; + if (defines.Contains(define + ";")) + defines = defines.Replace(define + ";", ""); + else + defines = defines.Replace(define, ""); + + PlayerSettings.SetScriptingDefineSymbolsForGroup(group, defines); + } + } + + if (wasDefineRemoved) { + Debug.LogWarning("Removing Scripting Define Symbol " + define); + } + else { + Debug.LogWarning("Already Removed Scripting Define Symbol " + define); + } + return wasDefineRemoved; + } + + public static void DisableSpineAsmdefFiles () { + SetAsmdefFileActive("spine-unity-editor", false); + SetAsmdefFileActive("spine-unity", false); + } + + public static void EnableSpineAsmdefFiles () { + SetAsmdefFileActive("spine-unity-editor", true); + SetAsmdefFileActive("spine-unity", true); + } + + public static void AddDependencyToAsmdefFile (string dependencyName) { + string asmdefName = "spine-unity"; + string filePath = FindAsmdefFile(asmdefName); + if (string.IsNullOrEmpty(filePath)) + return; + + if (System.IO.File.Exists(filePath)) { + string fileContent = File.ReadAllText(filePath); + + if (!fileContent.Contains("references")) { + string nameLine = string.Concat("\"name\": \"", asmdefName, "\""); + fileContent = fileContent.Replace(nameLine, + nameLine + + @",\n""references"": []"); + } + + if (!fileContent.Contains(dependencyName)) { + fileContent = fileContent.Replace(@"""references"": [", + @"""references"": [" + dependencyName); + File.WriteAllText(filePath, fileContent); + } + } + } + + public static void RemoveDependencyFromAsmdefFile (string dependencyName) { + string asmdefName = "spine-unity"; + string filePath = FindAsmdefFile(asmdefName); + if (string.IsNullOrEmpty(filePath)) + return; + + if (System.IO.File.Exists(filePath)) { + string fileContent = File.ReadAllText(filePath); + // this simple implementation shall suffice for now. + if (fileContent.Contains(dependencyName)) { + fileContent = fileContent.Replace(dependencyName, ""); + File.WriteAllText(filePath, fileContent); + } + } + } + + internal static string FindAsmdefFile (string filename) { + string filePath = FindAsmdefFile(filename, isDisabledFile: false); + if (string.IsNullOrEmpty(filePath)) + filePath = FindAsmdefFile(filename, isDisabledFile: true); + return filePath; + } + + internal static string FindAsmdefFile (string filename, bool isDisabledFile) { + + string typeSearchString = isDisabledFile ? " t:TextAsset" : " t:AssemblyDefinitionAsset"; + string extension = isDisabledFile ? ".txt" : ".asmdef"; + string filenameWithExtension = filename + (isDisabledFile ? ".txt" : ".asmdef"); + string[] guids = AssetDatabase.FindAssets(filename + typeSearchString); + foreach (string guid in guids) { + string currentPath = AssetDatabase.GUIDToAssetPath(guid); + if (!string.IsNullOrEmpty(currentPath)) { + if (System.IO.Path.GetFileName(currentPath) == filenameWithExtension) + return currentPath; + } + } + return null; + } + + internal static void SetAsmdefFileActive (string filename, bool setActive) { + + string typeSearchString = setActive ? " t:TextAsset" : " t:AssemblyDefinitionAsset"; + string extensionBeforeChange = setActive ? "txt" : "asmdef"; + string[] guids = AssetDatabase.FindAssets(filename + typeSearchString); + foreach (string guid in guids) { + string currentPath = AssetDatabase.GUIDToAssetPath(guid); + if (!System.IO.Path.HasExtension(extensionBeforeChange)) // asmdef is also found as t:TextAsset, so check + continue; + + string targetPath = System.IO.Path.ChangeExtension(currentPath, setActive ? "asmdef" : "txt"); + if (System.IO.File.Exists(currentPath) && !System.IO.File.Exists(targetPath)) { + System.IO.File.Copy(currentPath, targetPath); + System.IO.File.Copy(currentPath + ".meta", targetPath + ".meta"); + } + AssetDatabase.DeleteAsset(currentPath); + } + } + } + + public class TextureModificationWarningProcessor : UnityEditor.AssetModificationProcessor + { + static string[] OnWillSaveAssets(string[] paths) + { + if (SpineEditorUtilities.Preferences.textureImporterWarning) { + foreach (string path in paths) { + if (path.EndsWith(".png.meta", System.StringComparison.Ordinal) || + path.EndsWith(".jpg.meta", System.StringComparison.Ordinal)) { + + string texturePath = System.IO.Path.ChangeExtension(path, null); // .meta removed + string atlasPath = System.IO.Path.ChangeExtension(texturePath, "atlas.txt"); + if (System.IO.File.Exists(atlasPath)) + SpineEditorUtilities.IssueWarningsForUnrecommendedTextureSettings(texturePath); + } + } + } + return paths; + } + } + + public static class SpineHandles { + internal static float handleScale = 1f; + public static Color BoneColor { get { return new Color(0.8f, 0.8f, 0.8f, 0.4f); } } + public static Color PathColor { get { return new Color(254/255f, 127/255f, 0); } } + public static Color TransformContraintColor { get { return new Color(170/255f, 226/255f, 35/255f); } } + public static Color IkColor { get { return new Color(228/255f,90/255f,43/255f); } } + public static Color PointColor { get { return new Color(1f, 1f, 0f, 1f); } } + + static Vector3[] _boneMeshVerts = { + new Vector3(0, 0, 0), + new Vector3(0.1f, 0.1f, 0), + new Vector3(1, 0, 0), + new Vector3(0.1f, -0.1f, 0) + }; + static Mesh _boneMesh; + public static Mesh BoneMesh { + get { + if (_boneMesh == null) { + _boneMesh = new Mesh { + vertices = _boneMeshVerts, + uv = new Vector2[4], + triangles = new [] { 0, 1, 2, 2, 3, 0 } + }; + _boneMesh.RecalculateBounds(); + _boneMesh.RecalculateNormals(); + } + return _boneMesh; + } + } + + static Mesh _arrowheadMesh; + public static Mesh ArrowheadMesh { + get { + if (_arrowheadMesh == null) { + _arrowheadMesh = new Mesh { + vertices = new [] { + new Vector3(0, 0), + new Vector3(-0.1f, 0.05f), + new Vector3(-0.1f, -0.05f) + }, + uv = new Vector2[3], + triangles = new [] { 0, 1, 2 } + }; + _arrowheadMesh.RecalculateBounds(); + _arrowheadMesh.RecalculateNormals(); + } + return _arrowheadMesh; + } + } + + static Material _boneMaterial; + static Material BoneMaterial { + get { + if (_boneMaterial == null) { + _boneMaterial = new Material(Shader.Find("Hidden/Spine/Bones")); + _boneMaterial.SetColor("_Color", SpineHandles.BoneColor); + } + + return _boneMaterial; + } + } + public static Material GetBoneMaterial () { + BoneMaterial.SetColor("_Color", SpineHandles.BoneColor); + return BoneMaterial; + } + + public static Material GetBoneMaterial (Color color) { + BoneMaterial.SetColor("_Color", color); + return BoneMaterial; + } + + static Material _ikMaterial; + public static Material IKMaterial { + get { + if (_ikMaterial == null) { + _ikMaterial = new Material(Shader.Find("Hidden/Spine/Bones")); + _ikMaterial.SetColor("_Color", SpineHandles.IkColor); + } + return _ikMaterial; + } + } + + static GUIStyle _boneNameStyle; + public static GUIStyle BoneNameStyle { + get { + if (_boneNameStyle == null) { + _boneNameStyle = new GUIStyle(EditorStyles.whiteMiniLabel) { + alignment = TextAnchor.MiddleCenter, + stretchWidth = true, + padding = new RectOffset(0, 0, 0, 0), + contentOffset = new Vector2(-5f, 0f) + }; + } + return _boneNameStyle; + } + } + + static GUIStyle _pathNameStyle; + public static GUIStyle PathNameStyle { + get { + if (_pathNameStyle == null) { + _pathNameStyle = new GUIStyle(SpineHandles.BoneNameStyle); + _pathNameStyle.normal.textColor = SpineHandles.PathColor; + } + return _pathNameStyle; + } + } + + static GUIStyle _pointNameStyle; + public static GUIStyle PointNameStyle { + get { + if (_pointNameStyle == null) { + _pointNameStyle = new GUIStyle(SpineHandles.BoneNameStyle); + _pointNameStyle.normal.textColor = SpineHandles.PointColor; + } + return _pointNameStyle; + } + } + + public static void DrawBoneNames (Transform transform, Skeleton skeleton, float positionScale = 1f) { + GUIStyle style = BoneNameStyle; + foreach (Bone b in skeleton.Bones) { + var pos = new Vector3(b.WorldX * positionScale, b.WorldY * positionScale, 0) + (new Vector3(b.A, b.C) * (b.Data.Length * 0.5f)); + pos = transform.TransformPoint(pos); + Handles.Label(pos, b.Data.Name, style); + } + } + + public static void DrawBones (Transform transform, Skeleton skeleton, float positionScale = 1f) { + float boneScale = 1.8f; // Draw the root bone largest; + DrawCrosshairs2D(skeleton.Bones.Items[0].GetWorldPosition(transform), 0.08f, positionScale); + + foreach (Bone b in skeleton.Bones) { + DrawBone(transform, b, boneScale, positionScale); + boneScale = 1f; + } + } + + static Vector3[] _boneWireBuffer = new Vector3[5]; + static Vector3[] GetBoneWireBuffer (Matrix4x4 m) { + for (int i = 0, n = _boneMeshVerts.Length; i < n; i++) + _boneWireBuffer[i] = m.MultiplyPoint(_boneMeshVerts[i]); + + _boneWireBuffer[4] = _boneWireBuffer[0]; // closed polygon. + return _boneWireBuffer; + } + public static void DrawBoneWireframe (Transform transform, Bone b, Color color, float skeletonRenderScale = 1f) { + Handles.color = color; + var pos = new Vector3(b.WorldX * skeletonRenderScale, b.WorldY * skeletonRenderScale, 0); + float length = b.Data.Length; + + if (length > 0) { + Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX); + Vector3 scale = Vector3.one * length * b.WorldScaleX * skeletonRenderScale; + const float my = 1.5f; + scale.y *= (SpineHandles.handleScale + 1) * 0.5f; + scale.y = Mathf.Clamp(scale.x, -my * skeletonRenderScale, my * skeletonRenderScale); + Handles.DrawPolyLine(GetBoneWireBuffer(transform.localToWorldMatrix * Matrix4x4.TRS(pos, rot, scale))); + var wp = transform.TransformPoint(pos); + DrawBoneCircle(wp, color, transform.forward, skeletonRenderScale); + } else { + var wp = transform.TransformPoint(pos); + DrawBoneCircle(wp, color, transform.forward, skeletonRenderScale); + } + } + + public static void DrawBone (Transform transform, Bone b, float boneScale, float skeletonRenderScale = 1f) { + var pos = new Vector3(b.WorldX * skeletonRenderScale, b.WorldY * skeletonRenderScale, 0); + float length = b.Data.Length; + if (length > 0) { + Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX); + Vector3 scale = Vector3.one * length * b.WorldScaleX * skeletonRenderScale; + const float my = 1.5f; + scale.y *= (SpineHandles.handleScale + 1f) * 0.5f; + scale.y = Mathf.Clamp(scale.x, -my * skeletonRenderScale, my * skeletonRenderScale); + SpineHandles.GetBoneMaterial().SetPass(0); + Graphics.DrawMeshNow(SpineHandles.BoneMesh, transform.localToWorldMatrix * Matrix4x4.TRS(pos, rot, scale)); + } else { + var wp = transform.TransformPoint(pos); + DrawBoneCircle(wp, SpineHandles.BoneColor, transform.forward, boneScale * skeletonRenderScale); + } + } + + public static void DrawBone (Transform transform, Bone b, float boneScale, Color color, float skeletonRenderScale = 1f) { + var pos = new Vector3(b.WorldX * skeletonRenderScale, b.WorldY * skeletonRenderScale, 0); + float length = b.Data.Length; + if (length > 0) { + Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX); + Vector3 scale = Vector3.one * length * b.WorldScaleX; + const float my = 1.5f; + scale.y *= (SpineHandles.handleScale + 1f) * 0.5f; + scale.y = Mathf.Clamp(scale.x, -my, my); + SpineHandles.GetBoneMaterial(color).SetPass(0); + Graphics.DrawMeshNow(SpineHandles.BoneMesh, transform.localToWorldMatrix * Matrix4x4.TRS(pos, rot, scale)); + } else { + var wp = transform.TransformPoint(pos); + DrawBoneCircle(wp, color, transform.forward, boneScale * skeletonRenderScale); + } + } + + public static void DrawPaths (Transform transform, Skeleton skeleton) { + foreach (Slot s in skeleton.DrawOrder) { + var p = s.Attachment as PathAttachment; + if (p != null) SpineHandles.DrawPath(s, p, transform, true); + } + } + + static float[] pathVertexBuffer; + public static void DrawPath (Slot s, PathAttachment p, Transform t, bool includeName) { + int worldVerticesLength = p.WorldVerticesLength; + + if (pathVertexBuffer == null || pathVertexBuffer.Length < worldVerticesLength) + pathVertexBuffer = new float[worldVerticesLength]; + + float[] pv = pathVertexBuffer; + p.ComputeWorldVertices(s, pv); + + var ocolor = Handles.color; + Handles.color = SpineHandles.PathColor; + + Matrix4x4 m = t.localToWorldMatrix; + const int step = 6; + int n = worldVerticesLength - step; + Vector3 p0, p1, p2, p3; + for (int i = 2; i < n; i += step) { + p0 = m.MultiplyPoint(new Vector3(pv[i], pv[i+1])); + p1 = m.MultiplyPoint(new Vector3(pv[i+2], pv[i+3])); + p2 = m.MultiplyPoint(new Vector3(pv[i+4], pv[i+5])); + p3 = m.MultiplyPoint(new Vector3(pv[i+6], pv[i+7])); + DrawCubicBezier(p0, p1, p2, p3); + } + + n += step; + if (p.Closed) { + p0 = m.MultiplyPoint(new Vector3(pv[n - 4], pv[n - 3])); + p1 = m.MultiplyPoint(new Vector3(pv[n - 2], pv[n - 1])); + p2 = m.MultiplyPoint(new Vector3(pv[0], pv[1])); + p3 = m.MultiplyPoint(new Vector3(pv[2], pv[3])); + DrawCubicBezier(p0, p1, p2, p3); + } + + const float endCapSize = 0.05f; + Vector3 firstPoint = m.MultiplyPoint(new Vector3(pv[2], pv[3])); + SpineHandles.DrawDot(firstPoint, endCapSize); + + //if (!p.Closed) SpineHandles.DrawDot(m.MultiplyPoint(new Vector3(pv[n - 4], pv[n - 3])), endCapSize); + if (includeName) Handles.Label(firstPoint + new Vector3(0,0.1f), p.Name, PathNameStyle); + + Handles.color = ocolor; + } + + public static void DrawDot (Vector3 position, float size) { + Handles.DotHandleCap(0, position, Quaternion.identity, size * HandleUtility.GetHandleSize(position), EventType.Ignore); //Handles.DotCap(0, position, Quaternion.identity, size * HandleUtility.GetHandleSize(position)); + } + + public static void DrawBoundingBoxes (Transform transform, Skeleton skeleton) { + foreach (var slot in skeleton.Slots) { + var bba = slot.Attachment as BoundingBoxAttachment; + if (bba != null) SpineHandles.DrawBoundingBox(slot, bba, transform); + } + } + + public static void DrawBoundingBox (Slot slot, BoundingBoxAttachment box, Transform t) { + if (box.Vertices.Length <= 2) return; // Handle cases where user creates a BoundingBoxAttachment but doesn't actually define it. + + var worldVerts = new float[box.WorldVerticesLength]; + box.ComputeWorldVertices(slot, worldVerts); + + Handles.color = Color.green; + Vector3 lastVert = Vector3.zero; + Vector3 vert = Vector3.zero; + Vector3 firstVert = t.TransformPoint(new Vector3(worldVerts[0], worldVerts[1], 0)); + for (int i = 0; i < worldVerts.Length; i += 2) { + vert.x = worldVerts[i]; + vert.y = worldVerts[i + 1]; + vert.z = 0; + + vert = t.TransformPoint(vert); + + if (i > 0) + Handles.DrawLine(lastVert, vert); + + lastVert = vert; + } + + Handles.DrawLine(lastVert, firstVert); + } + + public static void DrawPointAttachment (Bone bone, PointAttachment pointAttachment, Transform skeletonTransform) { + if (bone == null) return; + if (pointAttachment == null) return; + + Vector2 localPos; + pointAttachment.ComputeWorldPosition(bone, out localPos.x, out localPos.y); + float localRotation = pointAttachment.ComputeWorldRotation(bone); + Matrix4x4 m = Matrix4x4.TRS(localPos, Quaternion.Euler(0, 0, localRotation), Vector3.one) * Matrix4x4.TRS(Vector3.right * 0.25f, Quaternion.identity, Vector3.one); + + DrawBoneCircle(skeletonTransform.TransformPoint(localPos), SpineHandles.PointColor, Vector3.back, 1.3f); + DrawArrowhead(skeletonTransform.localToWorldMatrix * m); + } + + public static void DrawConstraints (Transform transform, Skeleton skeleton, float skeletonRenderScale = 1f) { + Vector3 targetPos; + Vector3 pos; + bool active; + Color handleColor; + const float Thickness = 4f; + Vector3 normal = transform.forward; + + // Transform Constraints + handleColor = SpineHandles.TransformContraintColor; + foreach (var tc in skeleton.TransformConstraints) { + var targetBone = tc.Target; + targetPos = targetBone.GetWorldPosition(transform, skeletonRenderScale); + + if (tc.TranslateMix > 0) { + if (tc.TranslateMix != 1f) { + Handles.color = handleColor; + foreach (var b in tc.Bones) { + pos = b.GetWorldPosition(transform, skeletonRenderScale); + Handles.DrawDottedLine(targetPos, pos, Thickness); + } + } + SpineHandles.DrawBoneCircle(targetPos, handleColor, normal, 1.3f * skeletonRenderScale); + Handles.color = handleColor; + SpineHandles.DrawCrosshairs(targetPos, 0.2f, targetBone.A, targetBone.B, targetBone.C, targetBone.D, transform, skeletonRenderScale); + } + } + + // IK Constraints + handleColor = SpineHandles.IkColor; + foreach (var ikc in skeleton.IkConstraints) { + Bone targetBone = ikc.Target; + targetPos = targetBone.GetWorldPosition(transform, skeletonRenderScale); + var bones = ikc.Bones; + active = ikc.Mix > 0; + if (active) { + pos = bones.Items[0].GetWorldPosition(transform, skeletonRenderScale); + switch (bones.Count) { + case 1: { + Handles.color = handleColor; + Handles.DrawLine(targetPos, pos); + SpineHandles.DrawBoneCircle(targetPos, handleColor, normal); + var m = bones.Items[0].GetMatrix4x4(); + m.m03 = targetBone.WorldX * skeletonRenderScale; + m.m13 = targetBone.WorldY * skeletonRenderScale; + SpineHandles.DrawArrowhead(transform.localToWorldMatrix * m); + break; + } + case 2: { + Bone childBone = bones.Items[1]; + Vector3 child = childBone.GetWorldPosition(transform, skeletonRenderScale); + Handles.color = handleColor; + Handles.DrawLine(child, pos); + Handles.DrawLine(targetPos, child); + SpineHandles.DrawBoneCircle(pos, handleColor, normal, 0.5f); + SpineHandles.DrawBoneCircle(child, handleColor, normal, 0.5f); + SpineHandles.DrawBoneCircle(targetPos, handleColor, normal); + var m = childBone.GetMatrix4x4(); + m.m03 = targetBone.WorldX * skeletonRenderScale; + m.m13 = targetBone.WorldY * skeletonRenderScale; + SpineHandles.DrawArrowhead(transform.localToWorldMatrix * m); + break; + } + } + } + //Handles.Label(targetPos, ikc.Data.Name, SpineHandles.BoneNameStyle); + } + + // Path Constraints + handleColor = SpineHandles.PathColor; + foreach (var pc in skeleton.PathConstraints) { + active = pc.TranslateMix > 0; + if (active) + foreach (var b in pc.Bones) + SpineHandles.DrawBoneCircle(b.GetWorldPosition(transform, skeletonRenderScale), handleColor, normal, 1f * skeletonRenderScale); + } + } + + static void DrawCrosshairs2D (Vector3 position, float scale, float skeletonRenderScale = 1f) { + scale *= SpineHandles.handleScale * skeletonRenderScale; + Handles.DrawLine(position + new Vector3(-scale, 0), position + new Vector3(scale, 0)); + Handles.DrawLine(position + new Vector3(0, -scale), position + new Vector3(0, scale)); + } + + static void DrawCrosshairs (Vector3 position, float scale, float a, float b, float c, float d, Transform transform, float skeletonRenderScale = 1f) { + scale *= SpineHandles.handleScale * skeletonRenderScale; + + var xOffset = (Vector3)(new Vector2(a, c).normalized * scale); + var yOffset = (Vector3)(new Vector2(b, d).normalized * scale); + xOffset = transform.TransformDirection(xOffset); + yOffset = transform.TransformDirection(yOffset); + + Handles.DrawLine(position + xOffset, position - xOffset); + Handles.DrawLine(position + yOffset, position - yOffset); + } + + static void DrawArrowhead2D (Vector3 pos, float localRotation, float scale = 1f) { + scale *= SpineHandles.handleScale; + + SpineHandles.IKMaterial.SetPass(0); + Graphics.DrawMeshNow(SpineHandles.ArrowheadMesh, Matrix4x4.TRS(pos, Quaternion.Euler(0, 0, localRotation), new Vector3(scale, scale, scale))); + } + + static void DrawArrowhead (Vector3 pos, Quaternion worldQuaternion) { + Graphics.DrawMeshNow(SpineHandles.ArrowheadMesh, pos, worldQuaternion, 0); + } + + static void DrawArrowhead (Matrix4x4 m) { + float s = SpineHandles.handleScale; + m.m00 *= s; + m.m01 *= s; + m.m02 *= s; + m.m10 *= s; + m.m11 *= s; + m.m12 *= s; + m.m20 *= s; + m.m21 *= s; + m.m22 *= s; + + SpineHandles.IKMaterial.SetPass(0); + Graphics.DrawMeshNow(SpineHandles.ArrowheadMesh, m); + } + + static void DrawBoneCircle (Vector3 pos, Color outlineColor, Vector3 normal, float scale = 1f) { + scale *= SpineHandles.handleScale; + + Color o = Handles.color; + Handles.color = outlineColor; + float firstScale = 0.08f * scale; + Handles.DrawSolidDisc(pos, normal, firstScale); + const float Thickness = 0.03f; + float secondScale = firstScale - (Thickness * SpineHandles.handleScale * scale); + + if (secondScale > 0f) { + Handles.color = new Color(0.3f, 0.3f, 0.3f, 0.5f); + Handles.DrawSolidDisc(pos, normal, secondScale); + } + + Handles.color = o; + } + + internal static void DrawCubicBezier (Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3) { + Handles.DrawBezier(p0, p3, p1, p2, Handles.color, Texture2D.whiteTexture, 2f); + // const float dotSize = 0.01f; + // Quaternion q = Quaternion.identity; + // Handles.DotCap(0, p0, q, dotSize); + // Handles.DotCap(0, p1, q, dotSize); + // Handles.DotCap(0, p2, q, dotSize); + // Handles.DotCap(0, p3, q, dotSize); + // Handles.DrawLine(p0, p1); + // Handles.DrawLine(p3, p2); + } + } + +} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineInspectorUtility.cs b/Assets/Spine/Editor/spine-unity/Editor/SpineInspectorUtility.cs similarity index 92% rename from Assets/Spine/Editor/spine-unity/Editor/Utility/SpineInspectorUtility.cs rename to Assets/Spine/Editor/spine-unity/Editor/SpineInspectorUtility.cs index 7842686c1..99567b488 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineInspectorUtility.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/SpineInspectorUtility.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEngine; @@ -127,7 +127,7 @@ namespace Spine.Unity.Editor { SerializedProperty relativeProperty = property.serializedObject.FindProperty(propertyName); // baseProperty // If base property is not found, look for the sibling property. - if (relativeProperty == null) { + if (relativeProperty == null) { string propertyPath = property.propertyPath; int localPathLength = property.name.Length; @@ -210,7 +210,7 @@ namespace Spine.Unity.Editor { EditorGUILayout.BeginVertical(BoxScopeStyle); if (indent) EditorGUI.indentLevel++; } - + public void Dispose () { if (indent) EditorGUI.indentLevel--; EditorGUILayout.EndVertical(); @@ -220,12 +220,13 @@ namespace Spine.Unity.Editor { #region Button const float CenterButtonMaxWidth = 270f; - const float CenterButtonHeight = 30f; + const float CenterButtonHeight = 35f; static GUIStyle spineButtonStyle; static GUIStyle SpineButtonStyle { get { if (spineButtonStyle == null) { spineButtonStyle = new GUIStyle(GUI.skin.button); + spineButtonStyle.name = "Spine Button"; spineButtonStyle.padding = new RectOffset(10, 10, 10, 10); } return spineButtonStyle; @@ -299,7 +300,7 @@ namespace Spine.Unity.Editor { var component = o as Component; if (component != null) { var renderer = component.GetComponent(); - if (renderer != null) + if (renderer != null) renderers.Add(renderer); } } diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineInspectorUtility.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/SpineInspectorUtility.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Utility/SpineInspectorUtility.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/SpineInspectorUtility.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineMaskUtilities.cs b/Assets/Spine/Editor/spine-unity/Editor/SpineMaskUtilities.cs similarity index 91% rename from Assets/Spine/Editor/spine-unity/Editor/Utility/SpineMaskUtilities.cs rename to Assets/Spine/Editor/spine-unity/Editor/SpineMaskUtilities.cs index f3e3dc266..d29f19672 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineMaskUtilities.cs +++ b/Assets/Spine/Editor/spine-unity/Editor/SpineMaskUtilities.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #pragma warning disable 0219 diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineMaskUtilities.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/SpineMaskUtilities.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Utility/SpineMaskUtilities.cs.meta rename to Assets/Spine/Editor/spine-unity/Editor/SpineMaskUtilities.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs b/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs deleted file mode 100644 index 1ce022c1c..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs +++ /dev/null @@ -1,1315 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma warning disable 0219 - -#define SPINE_SKELETONMECANIM - -#if UNITY_2017_2_OR_NEWER -#define NEWPLAYMODECALLBACKS -#endif - -#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER -#define NEW_PREFAB_SYSTEM -#endif - -#if UNITY_2018_3_OR_NEWER -#define NEW_PREFERENCES_SETTINGS_PROVIDER -#endif - -#if UNITY_2018_2_OR_NEWER -#define EXPOSES_SPRITE_ATLAS_UTILITIES -#endif - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Linq; -using System.Reflection; - -using CompatibilityProblemInfo = Spine.Unity.SkeletonDataCompatibility.CompatibilityProblemInfo; - -namespace Spine.Unity.Editor { - - public class PathAndProblemInfo { - public string path; - public CompatibilityProblemInfo compatibilityProblems; - public string otherProblemDescription; - - public PathAndProblemInfo (string path, CompatibilityProblemInfo compatibilityInfo, string otherProblemDescription) { - this.path = path; - this.compatibilityProblems = compatibilityInfo; - this.otherProblemDescription = otherProblemDescription; - } - } - - public static class AssetUtility { - - public const string SkeletonDataSuffix = "_SkeletonData"; - public const string AtlasSuffix = "_Atlas"; - public const string SpriteAtlasSuffix = "_SpriteAtlas"; - - /// HACK: This list keeps the asset reference temporarily during importing. - /// - /// In cases of very large projects/sufficient RAM pressure, when AssetDatabase.SaveAssets is called, - /// Unity can mistakenly unload assets whose references are only on the stack. - /// This leads to MissingReferenceException and other errors. - public static readonly List protectFromStackGarbageCollection = new List(); - public static HashSet assetsImportedInWrongState = new HashSet(); - - public static void HandleOnPostprocessAllAssets (string[] imported, List texturesWithoutMetaFile) { - // In case user used "Assets -> Reimport All", during the import process, - // asset database is not initialized until some point. During that period, - // all attempts to load any assets using API (i.e. AssetDatabase.LoadAssetAtPath) - // will return null, and as result, assets won't be loaded even if they actually exists, - // which may lead to numerous importing errors. - // This situation also happens if Library folder is deleted from the project, which is a pretty - // common case, since when using version control systems, the Library folder must be excluded. - // - // So to avoid this, in case asset database is not available, we delay loading the assets - // until next time. - // - // Unity *always* reimports some internal assets after the process is done, so this method - // is always called once again in a state when asset database is available. - // - // Checking whether AssetDatabase is initialized is done by attempting to load - // a known "marker" asset that should always be available. Failing to load this asset - // means that AssetDatabase is not initialized. - AssetUtility.assetsImportedInWrongState.UnionWith(imported); - if (AssetDatabaseAvailabilityDetector.IsAssetDatabaseAvailable()) { - string[] combinedAssets = AssetUtility.assetsImportedInWrongState.ToArray(); - AssetUtility.assetsImportedInWrongState.Clear(); - AssetUtility.ImportSpineContent(combinedAssets, texturesWithoutMetaFile); - } - } - -#region Match SkeletonData with Atlases - static readonly AttachmentType[] AtlasTypes = { AttachmentType.Region, AttachmentType.Linkedmesh, AttachmentType.Mesh }; - - public static List GetRequiredAtlasRegions (string skeletonDataPath) { - List requiredPaths = new List(); - - if (skeletonDataPath.Contains(".skel")) { - AddRequiredAtlasRegionsFromBinary(skeletonDataPath, requiredPaths); - return requiredPaths; - } - - TextReader reader = null; - TextAsset spineJson = AssetDatabase.LoadAssetAtPath(skeletonDataPath); - Dictionary root = null; - try { - if (spineJson != null) { - reader = new StringReader(spineJson.text); - } - else { - // On a "Reimport All" the order of imports can be wrong, thus LoadAssetAtPath() above could return null. - // as a workaround, we provide a fallback reader. - reader = new StreamReader(skeletonDataPath); - } - root = Json.Deserialize(reader) as Dictionary; - } - finally { - if (reader != null) - reader.Dispose(); - } - - if (root == null || !root.ContainsKey("skins")) - return requiredPaths; - - var skinsList = root["skins"] as List; - if (skinsList == null) - return requiredPaths; - - foreach (Dictionary skinMap in skinsList) { - if (!skinMap.ContainsKey("attachments")) - continue; - foreach (var slot in (Dictionary)skinMap["attachments"]) { - foreach (var attachment in ((Dictionary)slot.Value)) { - var data = ((Dictionary)attachment.Value); - - // Ignore non-atlas-requiring types. - if (data.ContainsKey("type")) { - AttachmentType attachmentType; - string typeString = (string)data["type"]; - try { - attachmentType = (AttachmentType)System.Enum.Parse(typeof(AttachmentType), typeString, true); - } catch (System.ArgumentException e) { - // For more info, visit: http://esotericsoftware.com/forum/Spine-editor-and-runtime-version-management-6534 - Debug.LogWarning(string.Format("Unidentified Attachment type: \"{0}\". Skeleton may have been exported from an incompatible Spine version.", typeString), spineJson); - throw e; - } - - if (!AtlasTypes.Contains(attachmentType)) - continue; - } - - if (data.ContainsKey("path")) - requiredPaths.Add((string)data["path"]); - else if (data.ContainsKey("name")) - requiredPaths.Add((string)data["name"]); - else - requiredPaths.Add(attachment.Key); - } - } - } - - return requiredPaths; - } - - internal static void AddRequiredAtlasRegionsFromBinary (string skeletonDataPath, List requiredPaths) { - SkeletonBinary binary = new SkeletonBinary(new AtlasRequirementLoader(requiredPaths)); - Stream input = null; - TextAsset data = AssetDatabase.LoadAssetAtPath(skeletonDataPath); - try { - if (data != null) { - input = new MemoryStream(data.bytes); - } - else { - // On a "Reimport All" the order of imports can be wrong, thus LoadAssetAtPath() above could return null. - // as a workaround, we provide a fallback reader. - input = File.Open(skeletonDataPath, FileMode.Open, FileAccess.Read); - } - binary.ReadSkeletonData(input); - } - finally { - if (input != null) - input.Dispose(); - } - binary = null; - } - - internal static AtlasAssetBase GetMatchingAtlas (List requiredPaths, List atlasAssets) { - AtlasAssetBase atlasAssetMatch = null; - - foreach (AtlasAssetBase a in atlasAssets) { - Atlas atlas = a.GetAtlas(); - bool failed = false; - foreach (string regionPath in requiredPaths) { - if (atlas.FindRegion(regionPath) == null) { - failed = true; - break; - } - } - - if (!failed) { - atlasAssetMatch = a; - break; - } - } - - return atlasAssetMatch; - } - - public class AtlasRequirementLoader : AttachmentLoader { - List requirementList; - - public AtlasRequirementLoader (List requirementList) { - this.requirementList = requirementList; - } - - public RegionAttachment NewRegionAttachment (Skin skin, string name, string path) { - requirementList.Add(path); - return new RegionAttachment(name); - } - - public MeshAttachment NewMeshAttachment (Skin skin, string name, string path) { - requirementList.Add(path); - return new MeshAttachment(name); - } - - public BoundingBoxAttachment NewBoundingBoxAttachment (Skin skin, string name) { - return new BoundingBoxAttachment(name); - } - - public PathAttachment NewPathAttachment (Skin skin, string name) { - return new PathAttachment(name); - } - - public PointAttachment NewPointAttachment (Skin skin, string name) { - return new PointAttachment(name); - } - - public ClippingAttachment NewClippingAttachment (Skin skin, string name) { - return new ClippingAttachment(name); - } - } -#endregion - - public static void ImportSpineContent (string[] imported, List texturesWithoutMetaFile, - bool reimport = false) { - - var atlasPaths = new List(); - var imagePaths = new List(); - var skeletonPaths = new List(); - CompatibilityProblemInfo compatibilityProblemInfo = null; - - foreach (string str in imported) { - string extension = Path.GetExtension(str).ToLower(); - switch (extension) { - case ".atlas": - if (SpineEditorUtilities.Preferences.atlasTxtImportWarning) { - Debug.LogWarningFormat("`{0}` : If this file is a Spine atlas, please change its extension to `.atlas.txt`. This is to allow Unity to recognize it and avoid filename collisions. You can also set this file extension when exporting from the Spine editor.", str); - } - break; - case ".txt": - if (str.EndsWith(".atlas.txt", System.StringComparison.Ordinal)) - atlasPaths.Add(str); - break; - case ".png": - case ".jpg": - imagePaths.Add(str); - break; - case ".json": { - var jsonAsset = AssetDatabase.LoadAssetAtPath(str); - string problemDescription = null; - if (jsonAsset != null && IsSpineData(jsonAsset, out compatibilityProblemInfo, ref problemDescription)) - skeletonPaths.Add(new PathAndProblemInfo(str, compatibilityProblemInfo, problemDescription)); - if (problemDescription != null) - Debug.LogError(problemDescription, jsonAsset); - break; - } - case ".bytes": { - if (str.ToLower().EndsWith(".skel.bytes", System.StringComparison.Ordinal)) { - var binaryAsset = AssetDatabase.LoadAssetAtPath(str); - string problemDescription = null; - if (IsSpineData(binaryAsset, out compatibilityProblemInfo, ref problemDescription)) - skeletonPaths.Add(new PathAndProblemInfo(str, compatibilityProblemInfo, problemDescription)); - if (problemDescription != null) - Debug.LogError(problemDescription, binaryAsset); - } - break; - } - } - } - - // Import atlases first. - var newAtlases = new List(); - foreach (string ap in atlasPaths) { - if (ap.StartsWith("Packages")) - continue; - TextAsset atlasText = AssetDatabase.LoadAssetAtPath(ap); - AtlasAssetBase atlas = IngestSpineAtlas(atlasText, texturesWithoutMetaFile); - newAtlases.Add(atlas); - } - AddDependentSkeletonIfAtlasChanged(skeletonPaths, atlasPaths); - - // Import skeletons and match them with atlases. - bool abortSkeletonImport = false; - foreach (var skeletonPathEntry in skeletonPaths) { - string skeletonPath = skeletonPathEntry.path; - var compatibilityProblems = skeletonPathEntry.compatibilityProblems; - string otherProblemDescription = skeletonPathEntry.otherProblemDescription; - if (skeletonPath.StartsWith("Packages")) - continue; - if (!reimport && CheckForValidSkeletonData(skeletonPath)) { - ReloadSkeletonData(skeletonPath, compatibilityProblems); - continue; - } - - var loadedAsset = AssetDatabase.LoadAssetAtPath(skeletonPath); - if (compatibilityProblems != null) { - IngestIncompatibleSpineProject(loadedAsset, compatibilityProblems); - continue; - } - if (otherProblemDescription != null) { - continue; - } - - string dir = Path.GetDirectoryName(skeletonPath).Replace('\\', '/'); - -#if SPINE_TK2D - IngestSpineProject(loadedAsset, null); -#else - string skeletonName = Path.GetFileNameWithoutExtension(skeletonPath); - var atlasesForSkeleton = FindAtlasesAtPath(dir); - atlasesForSkeleton = atlasesForSkeleton.Union(newAtlases).ToList(); - var requiredPaths = GetRequiredAtlasRegions(skeletonPath); - atlasesForSkeleton.Sort((a, b) => ( - string.CompareOrdinal(b.name, skeletonName) - - string.CompareOrdinal(a.name, skeletonName))); - var atlasMatch = GetMatchingAtlas(requiredPaths, atlasesForSkeleton); - if (atlasMatch != null || requiredPaths.Count == 0) { - IngestSpineProject(loadedAsset, atlasMatch); - } else { - SkeletonImportDialog(skeletonPath, atlasesForSkeleton, requiredPaths, ref abortSkeletonImport); - } - - if (abortSkeletonImport) - break; -#endif - } - - if (atlasPaths.Count > 0 || imagePaths.Count > 0 || skeletonPaths.Count > 0) { - SkeletonDataAssetInspector[] skeletonDataInspectors = Resources.FindObjectsOfTypeAll(); - foreach (var inspector in skeletonDataInspectors) { - inspector.UpdateSkeletonData(); - } - } - - // Any post processing of images - - // Under some circumstances (e.g. on first import) SkeletonGraphic objects - // have their skeletonGraphic.skeletonDataAsset reference corrupted - // by the instance of the ScriptableObject being destroyed but still assigned. - // Here we restore broken skeletonGraphic.skeletonDataAsset references. - var skeletonGraphicObjects = Resources.FindObjectsOfTypeAll(typeof(SkeletonGraphic)) as SkeletonGraphic[]; - foreach (var skeletonGraphic in skeletonGraphicObjects) { - - if (skeletonGraphic.skeletonDataAsset == null) { - var skeletonGraphicID = skeletonGraphic.GetInstanceID(); - if (SpineEditorUtilities.DataReloadHandler.savedSkeletonDataAssetAtSKeletonGraphicID.ContainsKey(skeletonGraphicID)) { - string assetPath = SpineEditorUtilities.DataReloadHandler.savedSkeletonDataAssetAtSKeletonGraphicID[skeletonGraphicID]; - skeletonGraphic.skeletonDataAsset = (SkeletonDataAsset)AssetDatabase.LoadAssetAtPath(assetPath); - } - } - } - } - - static void AddDependentSkeletonIfAtlasChanged(List skeletonPaths, List atlasPaths) { - foreach (var atlasPath in atlasPaths) { - string skeletonPathJson = atlasPath.Replace(".atlas.txt", ".json"); - string skeletonPathBinary = atlasPath.Replace(".atlas.txt", ".skel.bytes"); - string usedSkeletonPath = System.IO.File.Exists(skeletonPathJson) ? skeletonPathJson : - System.IO.File.Exists(skeletonPathBinary) ? skeletonPathBinary : null; - if (usedSkeletonPath == null) - continue; - - if (skeletonPaths.FindIndex(p => { return p.path == usedSkeletonPath; } ) < 0) { - string problemDescription = null; - CompatibilityProblemInfo compatibilityProblemInfo = null; - TextAsset textAsset = AssetDatabase.LoadAssetAtPath(usedSkeletonPath); - if (textAsset != null && IsSpineData(textAsset, out compatibilityProblemInfo, ref problemDescription)) - skeletonPaths.Add(new PathAndProblemInfo(usedSkeletonPath, compatibilityProblemInfo, problemDescription)); - } - } - } - - static void ReloadSkeletonData (string skeletonJSONPath, CompatibilityProblemInfo compatibilityProblemInfo) { - string dir = Path.GetDirectoryName(skeletonJSONPath).Replace('\\', '/'); - TextAsset textAsset = AssetDatabase.LoadAssetAtPath(skeletonJSONPath); - DirectoryInfo dirInfo = new DirectoryInfo(dir); - FileInfo[] files = dirInfo.GetFiles("*.asset"); - - foreach (var f in files) { - string localPath = dir + "/" + f.Name; - var obj = AssetDatabase.LoadAssetAtPath(localPath, typeof(Object)); - var skeletonDataAsset = obj as SkeletonDataAsset; - if (skeletonDataAsset != null) { - if (skeletonDataAsset.skeletonJSON == textAsset) { - if (Selection.activeObject == skeletonDataAsset) - Selection.activeObject = null; - - if (compatibilityProblemInfo != null) { - SkeletonDataCompatibility.DisplayCompatibilityProblem(compatibilityProblemInfo.DescriptionString(), textAsset); - return; - } - - Debug.LogFormat("Changes to '{0}' or atlas detected. Clearing SkeletonDataAsset: {1}", skeletonJSONPath, localPath); - skeletonDataAsset.Clear(); - - string guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(skeletonDataAsset)); - string lastHash = EditorPrefs.GetString(guid + "_hash"); - - // For some weird reason sometimes Unity loses the internal Object pointer, - // and as a result, all comparisons with null returns true. - // But the C# wrapper is still alive, so we can "restore" the object - // by reloading it from its Instance ID. - AtlasAssetBase[] skeletonDataAtlasAssets = skeletonDataAsset.atlasAssets; - if (skeletonDataAtlasAssets != null) { - for (int i = 0; i < skeletonDataAtlasAssets.Length; i++) { - if (!ReferenceEquals(null, skeletonDataAtlasAssets[i]) && - skeletonDataAtlasAssets[i].Equals(null) && - skeletonDataAtlasAssets[i].GetInstanceID() != 0 - ) { - skeletonDataAtlasAssets[i] = EditorUtility.InstanceIDToObject(skeletonDataAtlasAssets[i].GetInstanceID()) as AtlasAssetBase; - } - } - } - - SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(true); - if (skeletonData != null) - BlendModeMaterialsUtility.UpdateBlendModeMaterials(skeletonDataAsset, ref skeletonData); - - string currentHash = skeletonData != null ? skeletonData.Hash : null; - -#if SPINE_SKELETONMECANIM - if (currentHash == null || lastHash != currentHash) - SkeletonBaker.UpdateMecanimClips(skeletonDataAsset); -#endif - - // if (currentHash == null || lastHash != currentHash) - // Do any upkeep on synchronized assets - - if (currentHash != null) - EditorPrefs.SetString(guid + "_hash", currentHash); - } - SpineEditorUtilities.DataReloadHandler.ReloadSceneSkeletonComponents(skeletonDataAsset); - SpineEditorUtilities.DataReloadHandler.ReloadAnimationReferenceAssets(skeletonDataAsset); - } - } - } - -#region Import Atlases - static List FindAtlasesAtPath (string path) { - List arr = new List(); - DirectoryInfo dir = new DirectoryInfo(path); - FileInfo[] assetInfoArr = dir.GetFiles("*.asset"); - - int subLen = Application.dataPath.Length - 6; - foreach (var f in assetInfoArr) { - string assetRelativePath = f.FullName.Substring(subLen, f.FullName.Length - subLen).Replace("\\", "/"); - Object obj = AssetDatabase.LoadAssetAtPath(assetRelativePath, typeof(AtlasAssetBase)); - if (obj != null) - arr.Add(obj as AtlasAssetBase); - } - - return arr; - } - - static AtlasAssetBase IngestSpineAtlas (TextAsset atlasText, List texturesWithoutMetaFile) { - if (atlasText == null) { - Debug.LogWarning("Atlas source cannot be null!"); - return null; - } - - string primaryName = Path.GetFileNameWithoutExtension(atlasText.name).Replace(".atlas", ""); - string assetPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(atlasText)).Replace('\\', '/'); - - string atlasPath = assetPath + "/" + primaryName + AtlasSuffix + ".asset"; - - SpineAtlasAsset atlasAsset = (SpineAtlasAsset)AssetDatabase.LoadAssetAtPath(atlasPath, typeof(SpineAtlasAsset)); - - List vestigialMaterials = new List(); - - if (atlasAsset == null) - atlasAsset = SpineAtlasAsset.CreateInstance(); - else { - foreach (Material m in atlasAsset.materials) - vestigialMaterials.Add(m); - } - - protectFromStackGarbageCollection.Add(atlasAsset); - atlasAsset.atlasFile = atlasText; - - //strip CR - string atlasStr = atlasText.text; - atlasStr = atlasStr.Replace("\r", ""); - - string[] atlasLines = atlasStr.Split('\n'); - List pageFiles = new List(); - for (int i = 0; i < atlasLines.Length - 1; i++) { - if (atlasLines[i].Trim().Length == 0) - pageFiles.Add(atlasLines[i + 1].Trim()); - } - - var populatingMaterials = new List(pageFiles.Count);//atlasAsset.materials = new Material[pageFiles.Count]; - - for (int i = 0; i < pageFiles.Count; i++) { - string texturePath = assetPath + "/" + pageFiles[i]; - Texture2D texture = (Texture2D)AssetDatabase.LoadAssetAtPath(texturePath, typeof(Texture2D)); - bool textureIsUninitialized = texturesWithoutMetaFile != null && texturesWithoutMetaFile.Contains(texturePath); - if (SpineEditorUtilities.Preferences.setTextureImporterSettings && textureIsUninitialized) { - if (string.IsNullOrEmpty(SpineEditorUtilities.Preferences.textureSettingsReference)) - SetDefaultTextureSettings(texturePath, atlasAsset); - else - SetReferenceTextureSettings(texturePath, atlasAsset, SpineEditorUtilities.Preferences.textureSettingsReference); - } - - string pageName = Path.GetFileNameWithoutExtension(pageFiles[i]); - - //because this looks silly - if (pageName == primaryName && pageFiles.Count == 1) - pageName = "Material"; - - string materialPath = assetPath + "/" + primaryName + "_" + pageName + ".mat"; - Material mat = (Material)AssetDatabase.LoadAssetAtPath(materialPath, typeof(Material)); - - if (mat == null) { - mat = new Material(Shader.Find(SpineEditorUtilities.Preferences.defaultShader)); - ApplyPMAOrStraightAlphaSettings(mat, SpineEditorUtilities.Preferences.textureSettingsReference); - AssetDatabase.CreateAsset(mat, materialPath); - } else { - vestigialMaterials.Remove(mat); - } - - if (texture != null) - mat.mainTexture = texture; - - EditorUtility.SetDirty(mat); - // note: don't call AssetDatabase.SaveAssets() since this would trigger OnPostprocessAllAssets() every time unnecessarily. - populatingMaterials.Add(mat); //atlasAsset.materials[i] = mat; - } - - atlasAsset.materials = populatingMaterials.ToArray(); - - for (int i = 0; i < vestigialMaterials.Count; i++) - AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(vestigialMaterials[i])); - - if (AssetDatabase.GetAssetPath(atlasAsset) == "") - AssetDatabase.CreateAsset(atlasAsset, atlasPath); - else - atlasAsset.Clear(); - - EditorUtility.SetDirty(atlasAsset); - AssetDatabase.SaveAssets(); - - if (pageFiles.Count != atlasAsset.materials.Length) - Debug.LogWarning(string.Format("{0} :: Not all atlas pages were imported. If you rename your image files, please make sure you also edit the filenames specified in the atlas file.", atlasAsset.name), atlasAsset); - else - Debug.Log(string.Format("{0} :: Imported with {1} material", atlasAsset.name, atlasAsset.materials.Length), atlasAsset); - - // Iterate regions and bake marked. - Atlas atlas = atlasAsset.GetAtlas(); - if (atlas != null) { - FieldInfo field = typeof(Atlas).GetField("regions", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.NonPublic); - var regions = (List)field.GetValue(atlas); - string atlasAssetPath = AssetDatabase.GetAssetPath(atlasAsset); - string atlasAssetDirPath = Path.GetDirectoryName(atlasAssetPath).Replace('\\', '/'); - string bakedDirPath = Path.Combine(atlasAssetDirPath, atlasAsset.name); - - bool hasBakedRegions = false; - for (int i = 0; i < regions.Count; i++) { - AtlasRegion region = regions[i]; - string bakedPrefabPath = Path.Combine(bakedDirPath, AssetUtility.GetPathSafeName(region.name) + ".prefab").Replace("\\", "/"); - GameObject prefab = (GameObject)AssetDatabase.LoadAssetAtPath(bakedPrefabPath, typeof(GameObject)); - if (prefab != null) { - SkeletonBaker.BakeRegion(atlasAsset, region, false); - hasBakedRegions = true; - } - } - - if (hasBakedRegions) { - AssetDatabase.SaveAssets(); - AssetDatabase.Refresh(); - } - } - - protectFromStackGarbageCollection.Remove(atlasAsset); - // note: at Asset Pipeline V2 this LoadAssetAtPath of the just created - // asset returns null, regardless of refresh calls. - var loadedAtlas = (AtlasAssetBase)AssetDatabase.LoadAssetAtPath(atlasPath, typeof(AtlasAssetBase)); - return loadedAtlas != null ? loadedAtlas : atlasAsset; - } - - public static bool SpriteAtlasSettingsNeedAdjustment (UnityEngine.U2D.SpriteAtlas spriteAtlas) { - #if EXPOSES_SPRITE_ATLAS_UTILITIES - UnityEditor.U2D.SpriteAtlasPackingSettings packingSettings = UnityEditor.U2D.SpriteAtlasExtensions.GetPackingSettings(spriteAtlas); - UnityEditor.U2D.SpriteAtlasTextureSettings textureSettings = UnityEditor.U2D.SpriteAtlasExtensions.GetTextureSettings(spriteAtlas); - - bool areSettingsAsDesired = - packingSettings.enableRotation == true && - packingSettings.enableTightPacking == false && - textureSettings.readable == true && - textureSettings.generateMipMaps == false; - // note: platformSettings.textureCompression is always providing "Compressed", so we have to skip it. - return !areSettingsAsDesired; - #else - return false; - #endif - } - - public static bool AdjustSpriteAtlasSettings (UnityEngine.U2D.SpriteAtlas spriteAtlas) { - #if EXPOSES_SPRITE_ATLAS_UTILITIES - UnityEditor.U2D.SpriteAtlasPackingSettings packingSettings = UnityEditor.U2D.SpriteAtlasExtensions.GetPackingSettings(spriteAtlas); - UnityEditor.U2D.SpriteAtlasTextureSettings textureSettings = UnityEditor.U2D.SpriteAtlasExtensions.GetTextureSettings(spriteAtlas); - - packingSettings.enableRotation = true; - packingSettings.enableTightPacking = false; - UnityEditor.U2D.SpriteAtlasExtensions.SetPackingSettings(spriteAtlas, packingSettings); - - textureSettings.readable = true; - textureSettings.generateMipMaps = false; - UnityEditor.U2D.SpriteAtlasExtensions.SetTextureSettings(spriteAtlas, textureSettings); - - TextureImporterPlatformSettings platformSettings = new TextureImporterPlatformSettings(); - platformSettings.textureCompression = TextureImporterCompression.Uncompressed; - platformSettings.crunchedCompression = false; - UnityEditor.U2D.SpriteAtlasExtensions.SetPlatformSettings(spriteAtlas, platformSettings); - - string atlasPath = AssetDatabase.GetAssetPath(spriteAtlas); - Debug.Log(string.Format("Adjusted unsuitable SpriteAtlas settings '{0}'", atlasPath), spriteAtlas); - return false; - #else - return true; - #endif - } - - public static bool GeneratePngFromSpriteAtlas (UnityEngine.U2D.SpriteAtlas spriteAtlas, out string texturePath) { - texturePath = System.IO.Path.ChangeExtension(AssetDatabase.GetAssetPath(spriteAtlas), ".png"); - if (spriteAtlas == null) - return false; - - Texture2D tempTexture = SpineSpriteAtlasAsset.AccessPackedTextureEditor(spriteAtlas); - if (tempTexture == null) - return false; - - byte[] bytes = null; - try { - bytes = tempTexture.EncodeToPNG(); - } - catch (System.Exception) { - // handled below - } - if (bytes == null || bytes.Length == 0) { - Debug.LogError("Could not read Compressed SpriteAtlas. Please enable 'Read/Write Enabled' and ensure 'Compression' is set to 'None' in Inspector.", spriteAtlas); - return false; - } - System.IO.File.WriteAllBytes(texturePath, bytes); - AssetDatabase.SaveAssets(); - AssetDatabase.Refresh(); - return System.IO.File.Exists(texturePath); - } - - public static AtlasAssetBase IngestSpriteAtlas (UnityEngine.U2D.SpriteAtlas spriteAtlas, List texturesWithoutMetaFile) { - if (spriteAtlas == null) { - Debug.LogWarning("SpriteAtlas source cannot be null!"); - return null; - } - - if (SpriteAtlasSettingsNeedAdjustment(spriteAtlas)) { - // settings need to be adjusted via the 'Spine SpriteAtlas Import' window if you want to use it as a Spine atlas. - return null; - } - - Texture2D texture = null; - { // only one page file - string texturePath; - GeneratePngFromSpriteAtlas(spriteAtlas, out texturePath); - texture = AssetDatabase.LoadAssetAtPath(texturePath); - if (texture == null && System.IO.File.Exists(texturePath)) { - EditorUtility.SetDirty(spriteAtlas); - return null; // next iteration will load the texture as well. - } - } - - string primaryName = spriteAtlas.name; - string assetPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(spriteAtlas)).Replace('\\', '/'); - - string atlasPath = assetPath + "/" + primaryName + SpriteAtlasSuffix + ".asset"; - - SpineSpriteAtlasAsset atlasAsset = AssetDatabase.LoadAssetAtPath(atlasPath); - - List vestigialMaterials = new List(); - - if (atlasAsset == null) - atlasAsset = SpineSpriteAtlasAsset.CreateInstance(); - else { - foreach (Material m in atlasAsset.materials) - vestigialMaterials.Add(m); - } - - protectFromStackGarbageCollection.Add(atlasAsset); - atlasAsset.spriteAtlasFile = spriteAtlas; - - int pagesCount = 1; - var populatingMaterials = new List(pagesCount); - - { - string pageName = "SpriteAtlas"; - - string materialPath = assetPath + "/" + primaryName + "_" + pageName + ".mat"; - Material mat = AssetDatabase.LoadAssetAtPath(materialPath); - - if (mat == null) { - mat = new Material(Shader.Find(SpineEditorUtilities.Preferences.defaultShader)); - ApplyPMAOrStraightAlphaSettings(mat, SpineEditorUtilities.Preferences.textureSettingsReference); - AssetDatabase.CreateAsset(mat, materialPath); - } - else { - vestigialMaterials.Remove(mat); - } - - if (texture != null) - mat.mainTexture = texture; - - EditorUtility.SetDirty(mat); - // note: don't call AssetDatabase.SaveAssets() since this would trigger OnPostprocessAllAssets() every time unnecessarily. - populatingMaterials.Add(mat); //atlasAsset.materials[i] = mat; - } - - atlasAsset.materials = populatingMaterials.ToArray(); - - for (int i = 0; i < vestigialMaterials.Count; i++) - AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(vestigialMaterials[i])); - - if (AssetDatabase.GetAssetPath(atlasAsset) == "") - AssetDatabase.CreateAsset(atlasAsset, atlasPath); - else - atlasAsset.Clear(); - - atlasAsset.GetAtlas(); - atlasAsset.updateRegionsInPlayMode = true; - - EditorUtility.SetDirty(atlasAsset); - AssetDatabase.SaveAssets(); - - Debug.Log(string.Format("{0} :: Imported with {1} material", atlasAsset.name, atlasAsset.materials.Length), atlasAsset); - - protectFromStackGarbageCollection.Remove(atlasAsset); - return (AtlasAssetBase)AssetDatabase.LoadAssetAtPath(atlasPath, typeof(AtlasAssetBase)); - } - - static bool SetDefaultTextureSettings (string texturePath, SpineAtlasAsset atlasAsset) { - TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath); - if (texImporter == null) { - Debug.LogWarning(string.Format("{0}: Texture asset \"{1}\" not found. Skipping. Please check your atlas file for renamed files.", atlasAsset.name, texturePath), atlasAsset); - return false; - } - - texImporter.textureCompression = TextureImporterCompression.Uncompressed; - texImporter.alphaSource = TextureImporterAlphaSource.FromInput; - texImporter.mipmapEnabled = false; - texImporter.alphaIsTransparency = false; // Prevent the texture importer from applying bleed to the transparent parts for PMA. - texImporter.spriteImportMode = SpriteImportMode.None; - texImporter.maxTextureSize = 2048; - - EditorUtility.SetDirty(texImporter); - AssetDatabase.ImportAsset(texturePath); - AssetDatabase.SaveAssets(); - return true; - } - -#if NEW_PREFERENCES_SETTINGS_PROVIDER - static bool SetReferenceTextureSettings (string texturePath, SpineAtlasAsset atlasAsset, string referenceAssetPath) { - var texturePreset = AssetDatabase.LoadAssetAtPath(referenceAssetPath); - bool isTexturePreset = texturePreset != null && texturePreset.GetTargetTypeName() == "TextureImporter"; - if (!isTexturePreset) - return SetDefaultTextureSettings(texturePath, atlasAsset); - - TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath); - if (texImporter == null) { - Debug.LogWarning(string.Format("{0}: Texture asset \"{1}\" not found. Skipping. Please check your atlas file for renamed files.", atlasAsset.name, texturePath), atlasAsset); - return false; - } - - texturePreset.ApplyTo(texImporter); - AssetDatabase.ImportAsset(texturePath); - AssetDatabase.SaveAssets(); - return true; - } -#else - static bool SetReferenceTextureSettings (string texturePath, SpineAtlasAsset atlasAsset, string referenceAssetPath) { - TextureImporter reference = TextureImporter.GetAtPath(referenceAssetPath) as TextureImporter; - if (reference == null) - return SetDefaultTextureSettings(texturePath, atlasAsset); - - TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath); - if (texImporter == null) { - Debug.LogWarning(string.Format("{0}: Texture asset \"{1}\" not found. Skipping. Please check your atlas file for renamed files.", atlasAsset.name, texturePath), atlasAsset); - return false; - } - - texImporter.sRGBTexture = reference.sRGBTexture; - texImporter.textureCompression = reference.textureCompression; - texImporter.alphaSource = reference.alphaSource; - texImporter.mipmapEnabled = reference.mipmapEnabled; - texImporter.alphaIsTransparency = reference.alphaIsTransparency; - texImporter.spriteImportMode = reference.spriteImportMode; - texImporter.maxTextureSize = reference.maxTextureSize; - texImporter.isReadable = reference.isReadable; - texImporter.filterMode = reference.filterMode; - texImporter.mipmapFilter = reference.mipmapFilter; - texImporter.textureType = reference.textureType; - - EditorUtility.SetDirty(texImporter); - AssetDatabase.ImportAsset(texturePath); - AssetDatabase.SaveAssets(); - return true; - } -#endif - - static void ApplyPMAOrStraightAlphaSettings (Material material, string referenceTextureSettings) { - bool isUsingPMAWorkflow = string.IsNullOrEmpty(referenceTextureSettings) || - (!referenceTextureSettings.ToLower().Contains("straight") && referenceTextureSettings.ToLower().Contains("pma")); - - MaterialChecks.EnablePMAAtMaterial(material, isUsingPMAWorkflow); - } -#endregion - -#region Import SkeletonData (json or binary) - internal static string GetSkeletonDataAssetFilePath(TextAsset spineJson) { - string primaryName = Path.GetFileNameWithoutExtension(spineJson.name); - string assetPath = Path.GetDirectoryName(AssetDatabase.GetAssetPath(spineJson)).Replace('\\', '/'); - return assetPath + "/" + primaryName + SkeletonDataSuffix + ".asset"; - } - - internal static SkeletonDataAsset IngestIncompatibleSpineProject(TextAsset spineJson, - CompatibilityProblemInfo compatibilityProblemInfo) { - - if (spineJson == null) - return null; - - string filePath = GetSkeletonDataAssetFilePath(spineJson); - SkeletonDataAsset skeletonDataAsset = (SkeletonDataAsset)AssetDatabase.LoadAssetAtPath(filePath, typeof(SkeletonDataAsset)); - if (skeletonDataAsset == null) { - skeletonDataAsset = SkeletonDataAsset.CreateInstance(); - skeletonDataAsset.skeletonJSON = spineJson; - AssetDatabase.CreateAsset(skeletonDataAsset, filePath); - } - EditorUtility.SetDirty(skeletonDataAsset); - - SkeletonDataCompatibility.DisplayCompatibilityProblem(compatibilityProblemInfo.DescriptionString(), spineJson); - return skeletonDataAsset; - } - - internal static SkeletonDataAsset IngestSpineProject (TextAsset spineJson, params AtlasAssetBase[] atlasAssets) { - string filePath = GetSkeletonDataAssetFilePath(spineJson); - -#if SPINE_TK2D - if (spineJson != null) { - SkeletonDataAsset skeletonDataAsset = (SkeletonDataAsset)AssetDatabase.LoadAssetAtPath(filePath, typeof(SkeletonDataAsset)); - if (skeletonDataAsset == null) { - skeletonDataAsset = SkeletonDataAsset.CreateInstance(); - skeletonDataAsset.skeletonJSON = spineJson; - skeletonDataAsset.fromAnimation = new string[0]; - skeletonDataAsset.toAnimation = new string[0]; - skeletonDataAsset.duration = new float[0]; - skeletonDataAsset.defaultMix = SpineEditorUtilities.Preferences.defaultMix; - skeletonDataAsset.scale = SpineEditorUtilities.Preferences.defaultScale; - - AssetDatabase.CreateAsset(skeletonDataAsset, filePath); - AssetDatabase.SaveAssets(); - } else { - skeletonDataAsset.Clear(); - skeletonDataAsset.GetSkeletonData(true); - } - - return skeletonDataAsset; - } else { - EditorUtility.DisplayDialog("Error!", "Tried to ingest null Spine data.", "OK"); - return null; - } - -#else - if (spineJson != null && atlasAssets != null) { - SkeletonDataAsset skeletonDataAsset = (SkeletonDataAsset)AssetDatabase.LoadAssetAtPath(filePath, typeof(SkeletonDataAsset)); - if (skeletonDataAsset == null) { - skeletonDataAsset = ScriptableObject.CreateInstance(); - { - skeletonDataAsset.atlasAssets = atlasAssets; - skeletonDataAsset.skeletonJSON = spineJson; - skeletonDataAsset.defaultMix = SpineEditorUtilities.Preferences.defaultMix; - skeletonDataAsset.scale = SpineEditorUtilities.Preferences.defaultScale; - skeletonDataAsset.blendModeMaterials.applyAdditiveMaterial = !SpineEditorUtilities.Preferences.UsesPMAWorkflow; - } - AssetDatabase.CreateAsset(skeletonDataAsset, filePath); - } else { - skeletonDataAsset.atlasAssets = atlasAssets; - skeletonDataAsset.Clear(); - } - var skeletonData = skeletonDataAsset.GetSkeletonData(true); - BlendModeMaterialsUtility.UpdateBlendModeMaterials(skeletonDataAsset, ref skeletonData); - AssetDatabase.SaveAssets(); - - return skeletonDataAsset; - } else { - EditorUtility.DisplayDialog("Error!", "Must specify both Spine JSON and AtlasAsset array", "OK"); - return null; - } -#endif - } -#endregion - -#region Spine Skeleton Data File Validation - public static bool CheckForValidSkeletonData (string skeletonJSONPath) { - string dir = Path.GetDirectoryName(skeletonJSONPath).Replace('\\', '/'); - TextAsset textAsset = AssetDatabase.LoadAssetAtPath(skeletonJSONPath); - DirectoryInfo dirInfo = new DirectoryInfo(dir); - FileInfo[] files = dirInfo.GetFiles("*.asset"); - - foreach (var path in files) { - string localPath = dir + "/" + path.Name; - var obj = AssetDatabase.LoadAssetAtPath(localPath, typeof(Object)); - var skeletonDataAsset = obj as SkeletonDataAsset; - if (skeletonDataAsset != null && skeletonDataAsset.skeletonJSON == textAsset) - return true; - } - return false; - } - - public static bool IsSpineData (TextAsset asset, out CompatibilityProblemInfo compatibilityProblemInfo, ref string problemDescription) { - bool isSpineSkeletonData; - SkeletonDataCompatibility.VersionInfo fileVersion = SkeletonDataCompatibility.GetVersionInfo(asset, out isSpineSkeletonData, ref problemDescription); - compatibilityProblemInfo = SkeletonDataCompatibility.GetCompatibilityProblemInfo(fileVersion); - return isSpineSkeletonData; - } -#endregion - -#region Dialogs - public static void SkeletonImportDialog (string skeletonPath, List localAtlases, List requiredPaths, ref bool abortSkeletonImport) { - bool resolved = false; - while (!resolved) { - - string filename = Path.GetFileNameWithoutExtension(skeletonPath); - int result = EditorUtility.DisplayDialogComplex( - string.Format("AtlasAsset for \"{0}\"", filename), - string.Format("Could not automatically set the AtlasAsset for \"{0}\".\n\n (You may resolve this manually later.)", filename), - "Resolve atlases...", "Import without atlases", "Stop importing" - ); - - switch (result) { - case -1: - //Debug.Log("Select Atlas"); - AtlasAssetBase selectedAtlas = BrowseAtlasDialog(Path.GetDirectoryName(skeletonPath).Replace('\\', '/')); - if (selectedAtlas != null) { - localAtlases.Clear(); - localAtlases.Add(selectedAtlas); - var atlasMatch = AssetUtility.GetMatchingAtlas(requiredPaths, localAtlases); - if (atlasMatch != null) { - resolved = true; - AssetUtility.IngestSpineProject(AssetDatabase.LoadAssetAtPath(skeletonPath), atlasMatch); - } - } - break; - case 0: // Resolve AtlasAssets... - var atlasList = MultiAtlasDialog(requiredPaths, Path.GetDirectoryName(skeletonPath).Replace('\\', '/'), - Path.GetFileNameWithoutExtension(skeletonPath)); - if (atlasList != null) - AssetUtility.IngestSpineProject(AssetDatabase.LoadAssetAtPath(skeletonPath), atlasList.ToArray()); - - resolved = true; - break; - case 1: // Import without atlas - Debug.LogWarning("Imported with missing atlases. Skeleton will not render: " + Path.GetFileName(skeletonPath)); - AssetUtility.IngestSpineProject(AssetDatabase.LoadAssetAtPath(skeletonPath), new AtlasAssetBase[] { }); - resolved = true; - break; - case 2: // Stop importing all - abortSkeletonImport = true; - resolved = true; - break; - } - } - } - - public static List MultiAtlasDialog (List requiredPaths, string initialDirectory, string filename = "") { - List atlasAssets = new List(); - bool resolved = false; - string lastAtlasPath = initialDirectory; - while (!resolved) { - - // Build dialog box message. - var missingRegions = new List(requiredPaths); - var dialogText = new StringBuilder(); - { - dialogText.AppendLine(string.Format("SkeletonDataAsset for \"{0}\"", filename)); - dialogText.AppendLine("has missing regions."); - dialogText.AppendLine(); - dialogText.AppendLine("Current Atlases:"); - - if (atlasAssets.Count == 0) - dialogText.AppendLine("\t--none--"); - - for (int i = 0; i < atlasAssets.Count; i++) - dialogText.AppendLine("\t" + atlasAssets[i].name); - - dialogText.AppendLine(); - dialogText.AppendLine("Missing Regions:"); - - foreach (var atlasAsset in atlasAssets) { - var atlas = atlasAsset.GetAtlas(); - for (int i = 0; i < missingRegions.Count; i++) { - if (atlas.FindRegion(missingRegions[i]) != null) { - missingRegions.RemoveAt(i); - i--; - } - } - } - - int n = missingRegions.Count; - if (n == 0) - break; - - const int MaxListLength = 15; - for (int i = 0; (i < n && i < MaxListLength); i++) - dialogText.AppendLine(string.Format("\t {0}", missingRegions[i])); - - if (n > MaxListLength) - dialogText.AppendLine(string.Format("\t... {0} more...", n - MaxListLength)); - } - - // Show dialog box. - int result = EditorUtility.DisplayDialogComplex( - "SkeletonDataAsset has missing Atlas.", - dialogText.ToString(), - "Browse Atlas...", "Import anyway", "Cancel import" - ); - - switch (result) { - case 0: // Browse... - AtlasAssetBase selectedAtlasAsset = BrowseAtlasDialog(lastAtlasPath); - if (selectedAtlasAsset != null) { - if (!atlasAssets.Contains(selectedAtlasAsset)) { - var atlas = selectedAtlasAsset.GetAtlas(); - bool hasValidRegion = false; - foreach (string str in missingRegions) { - if (atlas.FindRegion(str) != null) { - hasValidRegion = true; - break; - } - } - atlasAssets.Add(selectedAtlasAsset); - } - } - break; - case 1: // Import anyway - resolved = true; - break; - case 2: // Cancel - atlasAssets = null; - resolved = true; - break; - } - } - - return atlasAssets; - } - - public static AtlasAssetBase BrowseAtlasDialog (string dirPath) { - string path = EditorUtility.OpenFilePanel("Select AtlasAsset...", dirPath, "asset"); - if (path == "") - return null; // Canceled or closed by user. - - int subLen = Application.dataPath.Length - 6; - string assetRelativePath = path.Substring(subLen, path.Length - subLen).Replace("\\", "/"); - - var obj = AssetDatabase.LoadAssetAtPath(assetRelativePath, typeof(AtlasAssetBase)); - if (obj == null || !(obj is AtlasAssetBase)) { - Debug.Log("Chosen asset was not of type AtlasAssetBase"); - return null; - } - - return (AtlasAssetBase)obj; - } -#endregion - - public static string GetPathSafeName (string name) { - foreach (char c in System.IO.Path.GetInvalidFileNameChars()) { // Doesn't handle more obscure file name limitations. - name = name.Replace(c, '_'); - } - return name; - } - } - - public static class EditorInstantiation { - public delegate Component InstantiateDelegate (SkeletonDataAsset skeletonDataAsset); - - public class SkeletonComponentSpawnType { - public string menuLabel; - public InstantiateDelegate instantiateDelegate; - public bool isUI; - } - - internal static readonly List additionalSpawnTypes = new List(); - - public static void TryInitializeSkeletonRendererSettings (SkeletonRenderer skeletonRenderer, Skin skin = null) { - const string PMAShaderQuery = "Spine/Skeleton"; - const string TintBlackShaderQuery = "Tint Black"; - - if (skeletonRenderer == null) return; - var skeletonDataAsset = skeletonRenderer.skeletonDataAsset; - if (skeletonDataAsset == null) return; - - bool pmaVertexColors = false; - bool tintBlack = false; - foreach (AtlasAssetBase atlasAsset in skeletonDataAsset.atlasAssets) { - if (!pmaVertexColors) { - foreach (Material m in atlasAsset.Materials) { - if (m.shader.name.Contains(PMAShaderQuery)) { - pmaVertexColors = true; - break; - } - } - } - - if (!tintBlack) { - foreach (Material m in atlasAsset.Materials) { - if (m.shader.name.Contains(TintBlackShaderQuery)) { - tintBlack = true; - break; - } - } - } - } - - skeletonRenderer.pmaVertexColors = pmaVertexColors; - skeletonRenderer.tintBlack = tintBlack; - skeletonRenderer.zSpacing = SpineEditorUtilities.Preferences.defaultZSpacing; - - var data = skeletonDataAsset.GetSkeletonData(false); - bool noSkins = data.DefaultSkin == null && (data.Skins == null || data.Skins.Count == 0); // Support attachmentless/skinless SkeletonData. - skin = skin ?? data.DefaultSkin ?? (noSkins ? null : data.Skins.Items[0]); - if (skin != null && skin != data.DefaultSkin) { - skeletonRenderer.initialSkinName = skin.Name; - } - } - - public static SkeletonAnimation InstantiateSkeletonAnimation (SkeletonDataAsset skeletonDataAsset, string skinName, - bool destroyInvalid = true, bool useObjectFactory = true) { - - var skeletonData = skeletonDataAsset.GetSkeletonData(true); - var skin = skeletonData != null ? skeletonData.FindSkin(skinName) : null; - return InstantiateSkeletonAnimation(skeletonDataAsset, skin, destroyInvalid, useObjectFactory); - } - - public static SkeletonAnimation InstantiateSkeletonAnimation (SkeletonDataAsset skeletonDataAsset, Skin skin = null, - bool destroyInvalid = true, bool useObjectFactory = true) { - - SkeletonData data = skeletonDataAsset.GetSkeletonData(true); - - if (data == null) { - for (int i = 0; i < skeletonDataAsset.atlasAssets.Length; i++) { - string reloadAtlasPath = AssetDatabase.GetAssetPath(skeletonDataAsset.atlasAssets[i]); - skeletonDataAsset.atlasAssets[i] = (AtlasAssetBase)AssetDatabase.LoadAssetAtPath(reloadAtlasPath, typeof(AtlasAssetBase)); - } - data = skeletonDataAsset.GetSkeletonData(false); - } - - if (data == null) { - Debug.LogWarning("InstantiateSkeletonAnimation tried to instantiate a skeleton from an invalid SkeletonDataAsset.", skeletonDataAsset); - return null; - } - - string spineGameObjectName = string.Format("Spine GameObject ({0})", skeletonDataAsset.name.Replace(AssetUtility.SkeletonDataSuffix, "")); - GameObject go = EditorInstantiation.NewGameObject(spineGameObjectName, useObjectFactory, - typeof(MeshFilter), typeof(MeshRenderer), typeof(SkeletonAnimation)); - SkeletonAnimation newSkeletonAnimation = go.GetComponent(); - newSkeletonAnimation.skeletonDataAsset = skeletonDataAsset; - TryInitializeSkeletonRendererSettings(newSkeletonAnimation, skin); - - // Initialize - try { - newSkeletonAnimation.Initialize(false); - } catch (System.Exception e) { - if (destroyInvalid) { - Debug.LogWarning("Editor-instantiated SkeletonAnimation threw an Exception. Destroying GameObject to prevent orphaned GameObject.\n" + e.Message, skeletonDataAsset); - GameObject.DestroyImmediate(go); - } - throw e; - } - - newSkeletonAnimation.loop = SpineEditorUtilities.Preferences.defaultInstantiateLoop; - newSkeletonAnimation.skeleton.Update(0); - newSkeletonAnimation.state.Update(0); - newSkeletonAnimation.state.Apply(newSkeletonAnimation.skeleton); - newSkeletonAnimation.skeleton.UpdateWorldTransform(); - - return newSkeletonAnimation; - } - - /// Handles creating a new GameObject in the Unity Editor. This uses the new ObjectFactory API where applicable. - public static GameObject NewGameObject (string name, bool useObjectFactory) { -#if NEW_PREFAB_SYSTEM - if (useObjectFactory) - return ObjectFactory.CreateGameObject(name); -#endif - return new GameObject(name); - } - - /// Handles creating a new GameObject in the Unity Editor. This uses the new ObjectFactory API where applicable. - public static GameObject NewGameObject (string name, bool useObjectFactory, params System.Type[] components) { -#if NEW_PREFAB_SYSTEM - if (useObjectFactory) - return ObjectFactory.CreateGameObject(name, components); -#endif - return new GameObject(name, components); - } - - public static void InstantiateEmptySpineGameObject (string name, bool useObjectFactory) where T : MonoBehaviour { - var parentGameObject = Selection.activeObject as GameObject; - var parentTransform = parentGameObject == null ? null : parentGameObject.transform; - - var gameObject = EditorInstantiation.NewGameObject(name, useObjectFactory, typeof(T)); - gameObject.transform.SetParent(parentTransform, false); - EditorUtility.FocusProjectWindow(); - Selection.activeObject = gameObject; - EditorGUIUtility.PingObject(Selection.activeObject); - } - -#region SkeletonMecanim -#if SPINE_SKELETONMECANIM - public static SkeletonMecanim InstantiateSkeletonMecanim (SkeletonDataAsset skeletonDataAsset, string skinName) { - return InstantiateSkeletonMecanim(skeletonDataAsset, skeletonDataAsset.GetSkeletonData(true).FindSkin(skinName)); - } - - public static SkeletonMecanim InstantiateSkeletonMecanim (SkeletonDataAsset skeletonDataAsset, Skin skin = null, - bool destroyInvalid = true, bool useObjectFactory = true) { - SkeletonData data = skeletonDataAsset.GetSkeletonData(true); - - if (data == null) { - for (int i = 0; i < skeletonDataAsset.atlasAssets.Length; i++) { - string reloadAtlasPath = AssetDatabase.GetAssetPath(skeletonDataAsset.atlasAssets[i]); - skeletonDataAsset.atlasAssets[i] = (AtlasAssetBase)AssetDatabase.LoadAssetAtPath(reloadAtlasPath, typeof(AtlasAssetBase)); - } - data = skeletonDataAsset.GetSkeletonData(false); - } - - if (data == null) { - Debug.LogWarning("InstantiateSkeletonMecanim tried to instantiate a skeleton from an invalid SkeletonDataAsset.", skeletonDataAsset); - return null; - } - - string spineGameObjectName = string.Format("Spine Mecanim GameObject ({0})", skeletonDataAsset.name.Replace(AssetUtility.SkeletonDataSuffix, "")); - GameObject go = EditorInstantiation.NewGameObject(spineGameObjectName, useObjectFactory, - typeof(MeshFilter), typeof(MeshRenderer), typeof(Animator), typeof(SkeletonMecanim)); - - if (skeletonDataAsset.controller == null) { - SkeletonBaker.GenerateMecanimAnimationClips(skeletonDataAsset); - Debug.Log(string.Format("Mecanim controller was automatically generated and assigned for {0}", skeletonDataAsset.name), skeletonDataAsset); - } - - go.GetComponent().runtimeAnimatorController = skeletonDataAsset.controller; - - SkeletonMecanim newSkeletonMecanim = go.GetComponent(); - newSkeletonMecanim.skeletonDataAsset = skeletonDataAsset; - TryInitializeSkeletonRendererSettings(newSkeletonMecanim, skin); - - // Initialize - try { - newSkeletonMecanim.Initialize(false); - } catch (System.Exception e) { - if (destroyInvalid) { - Debug.LogWarning("Editor-instantiated SkeletonAnimation threw an Exception. Destroying GameObject to prevent orphaned GameObject.", skeletonDataAsset); - GameObject.DestroyImmediate(go); - } - throw e; - } - - newSkeletonMecanim.skeleton.Update(0); - newSkeletonMecanim.skeleton.UpdateWorldTransform(); - newSkeletonMecanim.LateUpdate(); - - return newSkeletonMecanim; - } -#endif -#endregion - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/BlendModeMaterialsUtility.cs b/Assets/Spine/Editor/spine-unity/Editor/Utility/BlendModeMaterialsUtility.cs deleted file mode 100644 index 91baf3c7e..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/BlendModeMaterialsUtility.cs +++ /dev/null @@ -1,282 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#if UNITY_2020_1_OR_NEWER -#define UPGRADE_ALL_BLEND_MODE_MATERIALS -#endif - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.IO; -using System; - -namespace Spine.Unity.Editor { - - public class BlendModeMaterialsUtility { - - public const string MATERIAL_SUFFIX_MULTIPLY = "-Multiply"; - public const string MATERIAL_SUFFIX_SCREEN = "-Screen"; - public const string MATERIAL_SUFFIX_ADDITIVE = "-Additive"; - -#if UPGRADE_ALL_BLEND_MODE_MATERIALS - public const bool ShallUpgradeBlendModeMaterials = true; -#else - public const bool ShallUpgradeBlendModeMaterials = false; -#endif - - protected class TemplateMaterials { - public Material multiplyTemplate; - public Material screenTemplate; - public Material additiveTemplate; - }; - - public static void UpgradeBlendModeMaterials (SkeletonDataAsset skeletonDataAsset) { - var skeletonData = skeletonDataAsset.GetSkeletonData(true); - if (skeletonData == null) - return; - UpdateBlendModeMaterials(skeletonDataAsset, ref skeletonData, true); - } - - public static void UpdateBlendModeMaterials (SkeletonDataAsset skeletonDataAsset) { - var skeletonData = skeletonDataAsset.GetSkeletonData(true); - if (skeletonData == null) - return; - UpdateBlendModeMaterials(skeletonDataAsset, ref skeletonData, false); - } - - public static void UpdateBlendModeMaterials (SkeletonDataAsset skeletonDataAsset, ref SkeletonData skeletonData, - bool upgradeFromModifierAssets = ShallUpgradeBlendModeMaterials) { - - TemplateMaterials templateMaterials = new TemplateMaterials(); - bool anyMaterialsChanged = ClearUndesiredMaterialEntries(skeletonDataAsset); - - var blendModesModifierAsset = FindBlendModeMaterialsModifierAsset(skeletonDataAsset); - if (blendModesModifierAsset) { - if (upgradeFromModifierAssets) { - TransferSettingsFromModifierAsset(blendModesModifierAsset, - skeletonDataAsset, templateMaterials); - UpdateBlendmodeMaterialsRequiredState(skeletonDataAsset, skeletonData); - } - else - return; - } - else { - if (!UpdateBlendmodeMaterialsRequiredState(skeletonDataAsset, skeletonData)) - return; - AssignPreferencesTemplateMaterials(templateMaterials); - } - bool success = CreateAndAssignMaterials(skeletonDataAsset, templateMaterials, ref anyMaterialsChanged); - if (success) { - if (blendModesModifierAsset != null) { - RemoveObsoleteModifierAsset(blendModesModifierAsset, skeletonDataAsset); - } - } - - skeletonDataAsset.Clear(); - skeletonData = skeletonDataAsset.GetSkeletonData(true); - if (anyMaterialsChanged) - ReloadSceneSkeletons(skeletonDataAsset); - AssetDatabase.SaveAssets(); - } - - protected static bool ClearUndesiredMaterialEntries (SkeletonDataAsset skeletonDataAsset) { - Predicate ifMaterialMissing = r => r.material == null; - - bool anyMaterialsChanged = false; - if (!skeletonDataAsset.blendModeMaterials.applyAdditiveMaterial) { - anyMaterialsChanged |= skeletonDataAsset.blendModeMaterials.additiveMaterials.Count > 0; - skeletonDataAsset.blendModeMaterials.additiveMaterials.Clear(); - } - else - anyMaterialsChanged |= skeletonDataAsset.blendModeMaterials.additiveMaterials.RemoveAll(ifMaterialMissing) != 0; - anyMaterialsChanged |= skeletonDataAsset.blendModeMaterials.multiplyMaterials.RemoveAll(ifMaterialMissing) != 0; - anyMaterialsChanged |= skeletonDataAsset.blendModeMaterials.screenMaterials.RemoveAll(ifMaterialMissing) != 0; - return anyMaterialsChanged; - } - - protected static BlendModeMaterialsAsset FindBlendModeMaterialsModifierAsset (SkeletonDataAsset skeletonDataAsset) { - foreach (var modifierAsset in skeletonDataAsset.skeletonDataModifiers) { - if (modifierAsset is BlendModeMaterialsAsset) - return (BlendModeMaterialsAsset)modifierAsset; - } - return null; - } - - protected static bool UpdateBlendmodeMaterialsRequiredState (SkeletonDataAsset skeletonDataAsset, SkeletonData skeletonData) { - return skeletonDataAsset.blendModeMaterials.UpdateBlendmodeMaterialsRequiredState(skeletonData); - } - - protected static void TransferSettingsFromModifierAsset (BlendModeMaterialsAsset modifierAsset, - SkeletonDataAsset skeletonDataAsset, TemplateMaterials templateMaterials) { - - skeletonDataAsset.blendModeMaterials.TransferSettingsFrom(modifierAsset); - - templateMaterials.multiplyTemplate = modifierAsset.multiplyMaterialTemplate; - templateMaterials.screenTemplate = modifierAsset.screenMaterialTemplate; - templateMaterials.additiveTemplate = modifierAsset.additiveMaterialTemplate; - } - - protected static void RemoveObsoleteModifierAsset (BlendModeMaterialsAsset modifierAsset, - SkeletonDataAsset skeletonDataAsset) { - - skeletonDataAsset.skeletonDataModifiers.Remove(modifierAsset); - Debug.Log(string.Format("BlendModeMaterialsAsset upgraded to built-in BlendModeMaterials at SkeletonDataAsset '{0}'.", - skeletonDataAsset.name), skeletonDataAsset); - EditorUtility.SetDirty(skeletonDataAsset); - } - - protected static void AssignPreferencesTemplateMaterials (TemplateMaterials templateMaterials) { - - templateMaterials.multiplyTemplate = SpineEditorUtilities.Preferences.BlendModeMaterialMultiply; - templateMaterials.screenTemplate = SpineEditorUtilities.Preferences.BlendModeMaterialScreen; - templateMaterials.additiveTemplate = SpineEditorUtilities.Preferences.BlendModeMaterialAdditive; - } - - protected static bool CreateAndAssignMaterials (SkeletonDataAsset skeletonDataAsset, - TemplateMaterials templateMaterials, ref bool anyReplacementMaterialsChanged) { - - bool anyCreationFailed = false; - var blendModeMaterials = skeletonDataAsset.blendModeMaterials; - bool applyAdditiveMaterial = blendModeMaterials.applyAdditiveMaterial; - - var skinEntries = new List(); - - skeletonDataAsset.Clear(); - skeletonDataAsset.isUpgradingBlendModeMaterials = true; - SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(true); - - var slotsItems = skeletonData.Slots.Items; - for (int slotIndex = 0, slotCount = skeletonData.Slots.Count; slotIndex < slotCount; slotIndex++) { - var slot = slotsItems[slotIndex]; - if (slot.BlendMode == BlendMode.Normal) continue; - if (!applyAdditiveMaterial && slot.BlendMode == BlendMode.Additive) continue; - - List replacementMaterials = null; - Material materialTemplate = null; - string materialSuffix = null; - switch (slot.BlendMode) { - case BlendMode.Multiply: - replacementMaterials = blendModeMaterials.multiplyMaterials; - materialTemplate = templateMaterials.multiplyTemplate; - materialSuffix = MATERIAL_SUFFIX_MULTIPLY; - break; - case BlendMode.Screen: - replacementMaterials = blendModeMaterials.screenMaterials; - materialTemplate = templateMaterials.screenTemplate; - materialSuffix = MATERIAL_SUFFIX_SCREEN; - break; - case BlendMode.Additive: - replacementMaterials = blendModeMaterials.additiveMaterials; - materialTemplate = templateMaterials.additiveTemplate; - materialSuffix = MATERIAL_SUFFIX_ADDITIVE; - break; - } - - skinEntries.Clear(); - foreach (var skin in skeletonData.Skins) - skin.GetAttachments(slotIndex, skinEntries); - - foreach (var entry in skinEntries) { - var renderableAttachment = entry.Attachment as IHasRendererObject; - if (renderableAttachment != null) { - var originalRegion = (AtlasRegion)renderableAttachment.RendererObject; - bool replacementExists = replacementMaterials.Exists( - replacement => replacement.pageName == originalRegion.page.name); - if (!replacementExists) { - bool createdNewMaterial; - var replacement = CreateOrLoadReplacementMaterial(originalRegion, materialTemplate, materialSuffix, out createdNewMaterial); - if (replacement != null) { - replacementMaterials.Add(replacement); - anyReplacementMaterialsChanged = true; - if (createdNewMaterial) { - Debug.Log(string.Format("Created blend mode Material '{0}' for SkeletonDataAsset '{1}'.", - replacement.material.name, skeletonDataAsset), replacement.material); - } - } - else { - Debug.LogError(string.Format("Failed creating blend mode Material for SkeletonDataAsset '{0}',"+ - " atlas page '{1}', template '{2}'.", - skeletonDataAsset.name, originalRegion.page.name, materialTemplate.name), - skeletonDataAsset); - anyCreationFailed = true; - } - } - } - } - } - - skeletonDataAsset.isUpgradingBlendModeMaterials = false; - EditorUtility.SetDirty(skeletonDataAsset); - return !anyCreationFailed; - } - - protected static string GetBlendModeMaterialPath(AtlasPage originalPage, string materialSuffix) { - var originalMaterial = originalPage.rendererObject as Material; - var originalPath = AssetDatabase.GetAssetPath(originalMaterial); - return originalPath.Replace(".mat", materialSuffix + ".mat"); - } - - protected static BlendModeMaterials.ReplacementMaterial CreateOrLoadReplacementMaterial ( - AtlasRegion originalRegion, Material materialTemplate, string materialSuffix, out bool createdNewMaterial) { - - createdNewMaterial = false; - var newReplacement = new BlendModeMaterials.ReplacementMaterial(); - var originalPage = originalRegion.page; - var originalMaterial = originalPage.rendererObject as Material; - var blendMaterialPath = GetBlendModeMaterialPath(originalPage, materialSuffix); - - newReplacement.pageName = originalPage.name; - if (File.Exists(blendMaterialPath)) { - newReplacement.material = AssetDatabase.LoadAssetAtPath(blendMaterialPath); - } - else { - var blendModeMaterial = new Material(materialTemplate) { - name = originalMaterial.name + " " + materialTemplate.name, - mainTexture = originalMaterial.mainTexture - }; - newReplacement.material = blendModeMaterial; - - AssetDatabase.CreateAsset(blendModeMaterial, blendMaterialPath); - EditorUtility.SetDirty(blendModeMaterial); - createdNewMaterial = true; - } - - if (newReplacement.material) - return newReplacement; - else - return null; - } - - protected static void ReloadSceneSkeletons (SkeletonDataAsset skeletonDataAsset) { - if (SpineEditorUtilities.Preferences.autoReloadSceneSkeletons) - SpineEditorUtilities.DataReloadHandler.ReloadSceneSkeletonComponents(skeletonDataAsset); - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/BuildSettings.cs b/Assets/Spine/Editor/spine-unity/Editor/Utility/BuildSettings.cs deleted file mode 100644 index b3a2156aa..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/BuildSettings.cs +++ /dev/null @@ -1,182 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma warning disable 0219 - -#define SPINE_SKELETONMECANIM - -#if UNITY_2017_2_OR_NEWER -#define NEWPLAYMODECALLBACKS -#endif - -#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER -#define NEW_PREFAB_SYSTEM -#endif - -#if UNITY_2018 || UNITY_2019 || UNITY_2018_3_OR_NEWER -#define NEWHIERARCHYWINDOWCALLBACKS -#endif - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Linq; -using System.Reflection; -using System.Globalization; - -namespace Spine.Unity.Editor { - public partial class SpineEditorUtilities { - public static class SpineTK2DEditorUtility { - const string SPINE_TK2D_DEFINE = "SPINE_TK2D"; - - internal static bool IsTK2DInstalled () { - return (Shader.Find("tk2d/SolidVertexColor") != null || - Shader.Find("tk2d/AdditiveVertexColor") != null); - } - - internal static bool IsTK2DAllowed { - get { - return false; // replace with "return true;" to allow TK2D support - } - } - - internal static void EnableTK2D () { - if (!IsTK2DAllowed) - return; - SpineBuildEnvUtility.DisableSpineAsmdefFiles(); - SpineBuildEnvUtility.EnableBuildDefine(SPINE_TK2D_DEFINE); - } - - internal static void DisableTK2D () { - SpineBuildEnvUtility.EnableSpineAsmdefFiles(); - SpineBuildEnvUtility.DisableBuildDefine(SPINE_TK2D_DEFINE); - } - } - } - - public static class SpineBuildEnvUtility - { - static bool IsInvalidGroup (BuildTargetGroup group) { - int gi = (int)group; - return - gi == 15 || gi == 16 - || - group == BuildTargetGroup.Unknown; - } - - public static bool EnableBuildDefine (string define) { - - bool wasDefineAdded = false; - Debug.LogWarning("Please ignore errors \"PlayerSettings Validation: Requested build target group doesn't exist\" below"); - foreach (BuildTargetGroup group in System.Enum.GetValues(typeof(BuildTargetGroup))) { - if (IsInvalidGroup(group)) - continue; - - string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(group); - if (!defines.Contains(define)) { - wasDefineAdded = true; - if (defines.EndsWith(";", System.StringComparison.Ordinal)) - defines += define; - else - defines += ";" + define; - - PlayerSettings.SetScriptingDefineSymbolsForGroup(group, defines); - } - } - Debug.LogWarning("Please ignore errors \"PlayerSettings Validation: Requested build target group doesn't exist\" above"); - - if (wasDefineAdded) { - Debug.LogWarning("Setting Scripting Define Symbol " + define); - } - else { - Debug.LogWarning("Already Set Scripting Define Symbol " + define); - } - return wasDefineAdded; - } - - public static bool DisableBuildDefine (string define) { - - bool wasDefineRemoved = false; - foreach (BuildTargetGroup group in System.Enum.GetValues(typeof(BuildTargetGroup))) { - if (IsInvalidGroup(group)) - continue; - - string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(group); - if (defines.Contains(define)) { - wasDefineRemoved = true; - if (defines.Contains(define + ";")) - defines = defines.Replace(define + ";", ""); - else - defines = defines.Replace(define, ""); - - PlayerSettings.SetScriptingDefineSymbolsForGroup(group, defines); - } - } - - if (wasDefineRemoved) { - Debug.LogWarning("Removing Scripting Define Symbol " + define); - } - else { - Debug.LogWarning("Already Removed Scripting Define Symbol " + define); - } - return wasDefineRemoved; - } - - public static void DisableSpineAsmdefFiles () { - SetAsmdefFileActive("spine-unity-editor", false); - SetAsmdefFileActive("spine-unity", false); - } - - public static void EnableSpineAsmdefFiles () { - SetAsmdefFileActive("spine-unity-editor", true); - SetAsmdefFileActive("spine-unity", true); - } - - internal static void SetAsmdefFileActive (string filename, bool setActive) { - - string typeSearchString = setActive ? " t:TextAsset" : " t:AssemblyDefinitionAsset"; - string extensionBeforeChange = setActive ? ".txt" : ".asmdef"; - string[] guids = AssetDatabase.FindAssets(filename + typeSearchString); - foreach (string guid in guids) { - string currentPath = AssetDatabase.GUIDToAssetPath(guid); - if (System.IO.Path.GetExtension(currentPath) != extensionBeforeChange) // asmdef is also found as t:TextAsset, so check - continue; - - string targetPath = System.IO.Path.ChangeExtension(currentPath, setActive ? "asmdef" : "txt"); - if (System.IO.File.Exists(currentPath) && !System.IO.File.Exists(targetPath)) { - System.IO.File.Copy(currentPath, targetPath); - System.IO.File.Copy(currentPath + ".meta", targetPath + ".meta"); - } - AssetDatabase.DeleteAsset(currentPath); - } - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/DataReloadHandler.cs b/Assets/Spine/Editor/spine-unity/Editor/Utility/DataReloadHandler.cs deleted file mode 100644 index e14c0dbff..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/DataReloadHandler.cs +++ /dev/null @@ -1,145 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma warning disable 0219 - -#define SPINE_SKELETONMECANIM - -#if UNITY_2017_2_OR_NEWER -#define NEWPLAYMODECALLBACKS -#endif - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Linq; -using System.Reflection; -using System.Globalization; - -namespace Spine.Unity.Editor { - - public partial class SpineEditorUtilities { - public static class DataReloadHandler { - - internal static Dictionary savedSkeletonDataAssetAtSKeletonGraphicID = new Dictionary(); - - #if NEWPLAYMODECALLBACKS - internal static void OnPlaymodeStateChanged (PlayModeStateChange stateChange) { - #else - internal static void OnPlaymodeStateChanged () { - #endif - ReloadAllActiveSkeletonsEditMode(); - } - - public static void ReloadAllActiveSkeletonsEditMode () { - - if (EditorApplication.isPaused) return; - if (EditorApplication.isPlaying) return; - if (EditorApplication.isCompiling) return; - if (EditorApplication.isPlayingOrWillChangePlaymode) return; - - var skeletonDataAssetsToReload = new HashSet(); - - var activeSkeletonRenderers = GameObject.FindObjectsOfType(); - foreach (var sr in activeSkeletonRenderers) { - var skeletonDataAsset = sr.skeletonDataAsset; - if (skeletonDataAsset != null) skeletonDataAssetsToReload.Add(skeletonDataAsset); - } - - // Under some circumstances (e.g. on first import) SkeletonGraphic objects - // have their skeletonGraphic.skeletonDataAsset reference corrupted - // by the instance of the ScriptableObject being destroyed but still assigned. - // Here we save the skeletonGraphic.skeletonDataAsset asset path in order - // to restore it later. - var activeSkeletonGraphics = GameObject.FindObjectsOfType(); - foreach (var sg in activeSkeletonGraphics) { - var skeletonDataAsset = sg.skeletonDataAsset; - if (skeletonDataAsset != null) { - var assetPath = AssetDatabase.GetAssetPath(skeletonDataAsset); - var sgID = sg.GetInstanceID(); - savedSkeletonDataAssetAtSKeletonGraphicID[sgID] = assetPath; - skeletonDataAssetsToReload.Add(skeletonDataAsset); - } - } - - foreach (var sda in skeletonDataAssetsToReload) { - sda.Clear(); - sda.GetSkeletonData(true); - } - - foreach (var sr in activeSkeletonRenderers) { - var meshRenderer = sr.GetComponent(); - var sharedMaterials = meshRenderer.sharedMaterials; - foreach (var m in sharedMaterials) { - if (m == null) { - sr.Initialize(true); - break; - } - } - } - - foreach (var sg in activeSkeletonGraphics) { - if (sg.mainTexture == null) - sg.Initialize(true); - } - } - - public static void ReloadSceneSkeletonComponents (SkeletonDataAsset skeletonDataAsset) { - if (EditorApplication.isPaused) return; - if (EditorApplication.isPlaying) return; - if (EditorApplication.isCompiling) return; - if (EditorApplication.isPlayingOrWillChangePlaymode) return; - - var activeSkeletonRenderers = GameObject.FindObjectsOfType(); - foreach (var sr in activeSkeletonRenderers) { - if (sr.isActiveAndEnabled && sr.skeletonDataAsset == skeletonDataAsset) sr.Initialize(true); - } - - var activeSkeletonGraphics = GameObject.FindObjectsOfType(); - foreach (var sg in activeSkeletonGraphics) { - if (sg.isActiveAndEnabled && sg.skeletonDataAsset == skeletonDataAsset) sg.Initialize(true); - } - } - - public static void ReloadAnimationReferenceAssets (SkeletonDataAsset skeletonDataAsset) { - string[] guids = UnityEditor.AssetDatabase.FindAssets("t:AnimationReferenceAsset"); - foreach (string guid in guids) { - string path = UnityEditor.AssetDatabase.GUIDToAssetPath(guid); - if (!string.IsNullOrEmpty(path)) { - var referenceAsset = UnityEditor.AssetDatabase.LoadAssetAtPath(path); - if (referenceAsset.SkeletonDataAsset == skeletonDataAsset) - referenceAsset.Initialize(); - } - } - } - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/Icons.cs b/Assets/Spine/Editor/spine-unity/Editor/Utility/Icons.cs deleted file mode 100644 index 71e7ce15c..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/Icons.cs +++ /dev/null @@ -1,147 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma warning disable 0219 - -#define SPINE_SKELETONMECANIM - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Linq; -using System.Reflection; -using System.Globalization; - -namespace Spine.Unity.Editor { - public partial class SpineEditorUtilities { - public static class Icons { - public static Texture2D skeleton; - public static Texture2D nullBone; - public static Texture2D bone; - public static Texture2D poseBones; - public static Texture2D boneNib; - public static Texture2D slot; - public static Texture2D slotRoot; - public static Texture2D skinPlaceholder; - public static Texture2D image; - public static Texture2D genericAttachment; - public static Texture2D boundingBox; - public static Texture2D point; - public static Texture2D mesh; - public static Texture2D weights; - public static Texture2D path; - public static Texture2D clipping; - public static Texture2D skin; - public static Texture2D skinsRoot; - public static Texture2D animation; - public static Texture2D animationRoot; - public static Texture2D spine; - public static Texture2D userEvent; - public static Texture2D constraintNib; - public static Texture2D constraintRoot; - public static Texture2D constraintTransform; - public static Texture2D constraintPath; - public static Texture2D constraintIK; - public static Texture2D warning; - public static Texture2D skeletonUtility; - public static Texture2D hingeChain; - public static Texture2D subMeshRenderer; - public static Texture2D skeletonDataAssetIcon; - public static Texture2D info; - public static Texture2D unity; - - static Texture2D LoadIcon (string filename) { - return (Texture2D)AssetDatabase.LoadMainAssetAtPath(SpineEditorUtilities.editorGUIPath + "/" + filename); - } - - public static void Initialize () { - skeleton = LoadIcon("icon-skeleton.png"); - nullBone = LoadIcon("icon-null.png"); - bone = LoadIcon("icon-bone.png"); - poseBones = LoadIcon("icon-poseBones.png"); - boneNib = LoadIcon("icon-boneNib.png"); - slot = LoadIcon("icon-slot.png"); - slotRoot = LoadIcon("icon-slotRoot.png"); - skinPlaceholder = LoadIcon("icon-skinPlaceholder.png"); - - genericAttachment = LoadIcon("icon-attachment.png"); - image = LoadIcon("icon-image.png"); - boundingBox = LoadIcon("icon-boundingBox.png"); - point = LoadIcon("icon-point.png"); - mesh = LoadIcon("icon-mesh.png"); - weights = LoadIcon("icon-weights.png"); - path = LoadIcon("icon-path.png"); - clipping = LoadIcon("icon-clipping.png"); - - skin = LoadIcon("icon-skin.png"); - skinsRoot = LoadIcon("icon-skinsRoot.png"); - animation = LoadIcon("icon-animation.png"); - animationRoot = LoadIcon("icon-animationRoot.png"); - spine = LoadIcon("icon-spine.png"); - userEvent = LoadIcon("icon-event.png"); - constraintNib = LoadIcon("icon-constraintNib.png"); - - constraintRoot = LoadIcon("icon-constraints.png"); - constraintTransform = LoadIcon("icon-constraintTransform.png"); - constraintPath = LoadIcon("icon-constraintPath.png"); - constraintIK = LoadIcon("icon-constraintIK.png"); - - warning = LoadIcon("icon-warning.png"); - skeletonUtility = LoadIcon("icon-skeletonUtility.png"); - hingeChain = LoadIcon("icon-hingeChain.png"); - subMeshRenderer = LoadIcon("icon-subMeshRenderer.png"); - - skeletonDataAssetIcon = LoadIcon("SkeletonDataAsset Icon.png"); - - info = EditorGUIUtility.FindTexture("console.infoicon.sml"); - unity = EditorGUIUtility.FindTexture("SceneAsset Icon"); - } - - public static Texture2D GetAttachmentIcon (Attachment attachment) { - // Analysis disable once CanBeReplacedWithTryCastAndCheckForNull - if (attachment is RegionAttachment) - return Icons.image; - else if (attachment is MeshAttachment) - return ((MeshAttachment)attachment).IsWeighted() ? Icons.weights : Icons.mesh; - else if (attachment is BoundingBoxAttachment) - return Icons.boundingBox; - else if (attachment is PointAttachment) - return Icons.point; - else if (attachment is PathAttachment) - return Icons.path; - else if (attachment is ClippingAttachment) - return Icons.clipping; - else - return Icons.warning; - } - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/Icons.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/Utility/Icons.cs.meta deleted file mode 100644 index c8cf2c28c..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/Icons.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8603301469b2a284db8eaa26dc60ada8 -timeCreated: 1563312057 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/Instantiation.cs b/Assets/Spine/Editor/spine-unity/Editor/Utility/Instantiation.cs deleted file mode 100644 index d76a7709d..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/Instantiation.cs +++ /dev/null @@ -1,193 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma warning disable 0219 - -#define SPINE_SKELETONMECANIM - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Linq; -using System.Reflection; -using System.Globalization; - -namespace Spine.Unity.Editor { - using EventType = UnityEngine.EventType; - - public partial class SpineEditorUtilities { - public static class DragAndDropInstantiation { - public struct SpawnMenuData { - public Vector3 spawnPoint; - public Transform parent; - public SkeletonDataAsset skeletonDataAsset; - public EditorInstantiation.InstantiateDelegate instantiateDelegate; - public bool isUI; - } - - public static void SceneViewDragAndDrop (SceneView sceneview) { - var current = UnityEngine.Event.current; - var references = DragAndDrop.objectReferences; - if (current.type == EventType.Layout) - return; - - // Allow drag and drop of one SkeletonDataAsset. - if (references.Length == 1) { - var skeletonDataAsset = references[0] as SkeletonDataAsset; - if (skeletonDataAsset != null) { - var mousePos = current.mousePosition; - - bool invalidSkeletonData = skeletonDataAsset.GetSkeletonData(true) == null; - if (invalidSkeletonData) { - DragAndDrop.visualMode = DragAndDropVisualMode.Rejected; - Handles.BeginGUI(); - GUI.Label(new Rect(mousePos + new Vector2(20f, 20f), new Vector2(400f, 40f)), new GUIContent(string.Format("{0} is invalid.\nCannot create new Spine GameObject.", skeletonDataAsset.name), SpineEditorUtilities.Icons.warning)); - Handles.EndGUI(); - return; - } else { - DragAndDrop.visualMode = DragAndDropVisualMode.Copy; - Handles.BeginGUI(); - GUI.Label(new Rect(mousePos + new Vector2(20f, 20f), new Vector2(400f, 20f)), new GUIContent(string.Format("Create Spine GameObject ({0})", skeletonDataAsset.skeletonJSON.name), SpineEditorUtilities.Icons.skeletonDataAssetIcon)); - Handles.EndGUI(); - - if (current.type == EventType.DragPerform) { - RectTransform rectTransform = (Selection.activeGameObject == null) ? null : Selection.activeGameObject.GetComponent(); - Plane plane = (rectTransform == null) ? new Plane(Vector3.back, Vector3.zero) : new Plane(-rectTransform.forward, rectTransform.position); - Vector3 spawnPoint = MousePointToWorldPoint2D(mousePos, sceneview.camera, plane); - ShowInstantiateContextMenu(skeletonDataAsset, spawnPoint, null); - DragAndDrop.AcceptDrag(); - current.Use(); - } - } - } - } - } - - public static void ShowInstantiateContextMenu (SkeletonDataAsset skeletonDataAsset, Vector3 spawnPoint, Transform parent) { - var menu = new GenericMenu(); - - // SkeletonAnimation - menu.AddItem(new GUIContent("SkeletonAnimation"), false, HandleSkeletonComponentDrop, new SpawnMenuData { - skeletonDataAsset = skeletonDataAsset, - spawnPoint = spawnPoint, - parent = parent, - instantiateDelegate = (data) => EditorInstantiation.InstantiateSkeletonAnimation(data), - isUI = false - }); - - // SkeletonGraphic - var skeletonGraphicInspectorType = System.Type.GetType("Spine.Unity.Editor.SkeletonGraphicInspector"); - if (skeletonGraphicInspectorType != null) { - var graphicInstantiateDelegate = skeletonGraphicInspectorType.GetMethod("SpawnSkeletonGraphicFromDrop", BindingFlags.Static | BindingFlags.Public); - if (graphicInstantiateDelegate != null) - menu.AddItem(new GUIContent("SkeletonGraphic (UI)"), false, HandleSkeletonComponentDrop, new SpawnMenuData { - skeletonDataAsset = skeletonDataAsset, - spawnPoint = spawnPoint, - parent = parent, - instantiateDelegate = System.Delegate.CreateDelegate(typeof(EditorInstantiation.InstantiateDelegate), graphicInstantiateDelegate) as EditorInstantiation.InstantiateDelegate, - isUI = true - }); - } - -#if SPINE_SKELETONMECANIM - menu.AddSeparator(""); - // SkeletonMecanim - menu.AddItem(new GUIContent("SkeletonMecanim"), false, HandleSkeletonComponentDrop, new SpawnMenuData { - skeletonDataAsset = skeletonDataAsset, - spawnPoint = spawnPoint, - parent = parent, - instantiateDelegate = (data) => EditorInstantiation.InstantiateSkeletonMecanim(data), - isUI = false - }); -#endif - - menu.ShowAsContext(); - } - - public static void HandleSkeletonComponentDrop (object spawnMenuData) { - var data = (SpawnMenuData)spawnMenuData; - - if (data.skeletonDataAsset.GetSkeletonData(true) == null) { - EditorUtility.DisplayDialog("Invalid SkeletonDataAsset", "Unable to create Spine GameObject.\n\nPlease check your SkeletonDataAsset.", "Ok"); - return; - } - - bool isUI = data.isUI; - - Component newSkeletonComponent = data.instantiateDelegate.Invoke(data.skeletonDataAsset); - GameObject newGameObject = newSkeletonComponent.gameObject; - Transform newTransform = newGameObject.transform; - - var usedParent = data.parent != null ? data.parent.gameObject : isUI ? Selection.activeGameObject : null; - if (usedParent) - newTransform.SetParent(usedParent.transform, false); - - newTransform.position = isUI ? data.spawnPoint : RoundVector(data.spawnPoint, 2); - - if (isUI) { - if (usedParent != null && usedParent.GetComponent() != null) { - ((SkeletonGraphic)newSkeletonComponent).MatchRectTransformWithBounds(); - } - else - Debug.Log("Created a UI Skeleton GameObject not under a RectTransform. It may not be visible until you parent it to a canvas."); - } - - if (!isUI && usedParent != null && usedParent.transform.localScale != Vector3.one) - Debug.Log("New Spine GameObject was parented to a scaled Transform. It may not be the intended size."); - - Selection.activeGameObject = newGameObject; - //EditorGUIUtility.PingObject(newGameObject); // Doesn't work when setting activeGameObject. - Undo.RegisterCreatedObjectUndo(newGameObject, "Create Spine GameObject"); - } - - /// - /// Rounds off vector components to a number of decimal digits. - /// - public static Vector3 RoundVector (Vector3 vector, int digits) { - vector.x = (float)System.Math.Round(vector.x, digits); - vector.y = (float)System.Math.Round(vector.y, digits); - vector.z = (float)System.Math.Round(vector.z, digits); - return vector; - } - - /// - /// Converts a mouse point to a world point on a plane. - /// - static Vector3 MousePointToWorldPoint2D (Vector2 mousePosition, Camera camera, Plane plane) { - var screenPos = new Vector3(mousePosition.x, camera.pixelHeight - mousePosition.y, 0f); - var ray = camera.ScreenPointToRay(screenPos); - float distance; - bool hit = plane.Raycast(ray, out distance); - return ray.GetPoint(distance); - } - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/Instantiation.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/Utility/Instantiation.cs.meta deleted file mode 100644 index 442ea7aff..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/Instantiation.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 94ecc7f73dfc0484e848a0e6a1a11f2b -timeCreated: 1563311945 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/Preferences.cs b/Assets/Spine/Editor/spine-unity/Editor/Utility/Preferences.cs deleted file mode 100644 index def876116..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/Preferences.cs +++ /dev/null @@ -1,434 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma warning disable 0219 - -#define SPINE_SKELETONMECANIM - -#if UNITY_2017_2_OR_NEWER -#define NEWPLAYMODECALLBACKS -#endif - -#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER -#define NEW_PREFAB_SYSTEM -#endif - -#if UNITY_2018_3_OR_NEWER -#define NEW_PREFERENCES_SETTINGS_PROVIDER -#endif - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Linq; -using System.Reflection; -using System.Globalization; - -namespace Spine.Unity.Editor { - public partial class SpineEditorUtilities { - - #if NEW_PREFERENCES_SETTINGS_PROVIDER - static class SpineSettingsProviderRegistration - { - [SettingsProvider] - public static SettingsProvider CreateSpineSettingsProvider() - { - var provider = new SettingsProvider("Spine", SettingsScope.User) - { - label = "Spine", - guiHandler = (searchContext) => - { - var settings = SpinePreferences.GetOrCreateSettings(); - var serializedSettings = new SerializedObject(settings); - SpinePreferences.HandlePreferencesGUI(serializedSettings); - if (serializedSettings.ApplyModifiedProperties()) - OldPreferences.SaveToEditorPrefs(settings); - }, - - // Populate the search keywords to enable smart search filtering and label highlighting: - keywords = new HashSet(new[] { "Spine", "Preferences", "Skeleton", "Default", "Mix", "Duration" }) - }; - return provider; - } - } - #else - // Preferences entry point - [PreferenceItem("Spine")] - static void PreferencesGUI () { - Preferences.HandlePreferencesGUI(); - } - #endif - - #if NEW_PREFERENCES_SETTINGS_PROVIDER - public static SpinePreferences Preferences { - get { - return SpinePreferences.GetOrCreateSettings(); - } - } - #endif - - #if NEW_PREFERENCES_SETTINGS_PROVIDER - public static class OldPreferences { - #else - public static class Preferences { - #endif - const string DEFAULT_SCALE_KEY = "SPINE_DEFAULT_SCALE"; - public static float defaultScale = SpinePreferences.DEFAULT_DEFAULT_SCALE; - - const string DEFAULT_MIX_KEY = "SPINE_DEFAULT_MIX"; - public static float defaultMix = SpinePreferences.DEFAULT_DEFAULT_MIX; - - const string DEFAULT_SHADER_KEY = "SPINE_DEFAULT_SHADER"; - public static string defaultShader = SpinePreferences.DEFAULT_DEFAULT_SHADER; - - const string DEFAULT_ZSPACING_KEY = "SPINE_DEFAULT_ZSPACING"; - public static float defaultZSpacing = SpinePreferences.DEFAULT_DEFAULT_ZSPACING; - - const string DEFAULT_INSTANTIATE_LOOP_KEY = "SPINE_DEFAULT_INSTANTIATE_LOOP"; - public static bool defaultInstantiateLoop = SpinePreferences.DEFAULT_DEFAULT_INSTANTIATE_LOOP; - - const string SHOW_HIERARCHY_ICONS_KEY = "SPINE_SHOW_HIERARCHY_ICONS"; - public static bool showHierarchyIcons = SpinePreferences.DEFAULT_SHOW_HIERARCHY_ICONS; - - const string SET_TEXTUREIMPORTER_SETTINGS_KEY = "SPINE_SET_TEXTUREIMPORTER_SETTINGS"; - public static bool setTextureImporterSettings = SpinePreferences.DEFAULT_SET_TEXTUREIMPORTER_SETTINGS; - - const string TEXTURE_SETTINGS_REFERENCE_KEY = "SPINE_TEXTURE_SETTINGS_REFERENCE"; - public static string textureSettingsReference = SpinePreferences.DEFAULT_TEXTURE_SETTINGS_REFERENCE; - - public static bool UsesPMAWorkflow { - get { - return SpinePreferences.IsPMAWorkflow(textureSettingsReference); - } - } - - const string BLEND_MODE_MATERIAL_MULTIPLY_KEY = "SPINE_BLENDMODE_MATERIAL_MULTIPLY"; - const string BLEND_MODE_MATERIAL_SCREEN_KEY = "SPINE_BLENDMODE_MATERIAL_SCREEN"; - const string BLEND_MODE_MATERIAL_ADDITIVE_KEY = "SPINE_BLENDMODE_MATERIAL_ADDITIVE"; - public static string blendModeMaterialMultiply = ""; - public static string blendModeMaterialScreen = ""; - public static string blendModeMaterialAdditive = ""; - public const string DEFAULT_BLEND_MODE_MULTIPLY_MATERIAL = SpinePreferences.DEFAULT_BLEND_MODE_MULTIPLY_MATERIAL; - public const string DEFAULT_BLEND_MODE_SCREEN_MATERIAL = SpinePreferences.DEFAULT_BLEND_MODE_SCREEN_MATERIAL; - public const string DEFAULT_BLEND_MODE_ADDITIVE_MATERIAL = SpinePreferences.DEFAULT_BLEND_MODE_ADDITIVE_MATERIAL; - - public static Material BlendModeMaterialMultiply { - get { return AssetDatabase.LoadAssetAtPath(blendModeMaterialMultiply); } - } - public static Material BlendModeMaterialScreen { - get { return AssetDatabase.LoadAssetAtPath(blendModeMaterialScreen); } - } - public static Material BlendModeMaterialAdditive { - get { return AssetDatabase.LoadAssetAtPath(blendModeMaterialAdditive); } - } - - const string ATLASTXT_WARNING_KEY = "SPINE_ATLASTXT_WARNING"; - public static bool atlasTxtImportWarning = SpinePreferences.DEFAULT_ATLASTXT_WARNING; - - const string TEXTUREIMPORTER_WARNING_KEY = "SPINE_TEXTUREIMPORTER_WARNING"; - public static bool textureImporterWarning = SpinePreferences.DEFAULT_TEXTUREIMPORTER_WARNING; - - const string COMPONENTMATERIAL_WARNING_KEY = "SPINE_COMPONENTMATERIAL_WARNING"; - public static bool componentMaterialWarning = SpinePreferences.DEFAULT_COMPONENTMATERIAL_WARNING; - - public const float DEFAULT_MIPMAPBIAS = SpinePreferences.DEFAULT_MIPMAPBIAS; - - public const string SCENE_ICONS_SCALE_KEY = "SPINE_SCENE_ICONS_SCALE"; - public static float handleScale = SpinePreferences.DEFAULT_SCENE_ICONS_SCALE; - - const string AUTO_RELOAD_SCENESKELETONS_KEY = "SPINE_AUTO_RELOAD_SCENESKELETONS"; - public static bool autoReloadSceneSkeletons = SpinePreferences.DEFAULT_AUTO_RELOAD_SCENESKELETONS; - - const string MECANIM_EVENT_INCLUDE_FOLDERNAME_KEY = "SPINE_MECANIM_EVENT_INCLUDE_FOLDERNAME"; - public static bool mecanimEventIncludeFolderName = SpinePreferences.DEFAULT_MECANIM_EVENT_INCLUDE_FOLDERNAME; - - const string TIMELINE_USE_BLEND_DURATION_KEY = "SPINE_TIMELINE_USE_BLEND_DURATION_KEY"; - public static bool timelineUseBlendDuration = SpinePreferences.DEFAULT_TIMELINE_USE_BLEND_DURATION; - - - static bool preferencesLoaded = false; - - public static void Load () { - if (preferencesLoaded) - return; - - defaultMix = EditorPrefs.GetFloat(DEFAULT_MIX_KEY, SpinePreferences.DEFAULT_DEFAULT_MIX); - defaultScale = EditorPrefs.GetFloat(DEFAULT_SCALE_KEY, SpinePreferences.DEFAULT_DEFAULT_SCALE); - defaultZSpacing = EditorPrefs.GetFloat(DEFAULT_ZSPACING_KEY, SpinePreferences.DEFAULT_DEFAULT_ZSPACING); - defaultShader = EditorPrefs.GetString(DEFAULT_SHADER_KEY, SpinePreferences.DEFAULT_DEFAULT_SHADER); - showHierarchyIcons = EditorPrefs.GetBool(SHOW_HIERARCHY_ICONS_KEY, SpinePreferences.DEFAULT_SHOW_HIERARCHY_ICONS); - setTextureImporterSettings = EditorPrefs.GetBool(SET_TEXTUREIMPORTER_SETTINGS_KEY, SpinePreferences.DEFAULT_SET_TEXTUREIMPORTER_SETTINGS); - textureSettingsReference = EditorPrefs.GetString(TEXTURE_SETTINGS_REFERENCE_KEY, SpinePreferences.DEFAULT_TEXTURE_SETTINGS_REFERENCE); - blendModeMaterialMultiply = EditorPrefs.GetString(BLEND_MODE_MATERIAL_MULTIPLY_KEY, ""); - blendModeMaterialScreen = EditorPrefs.GetString(BLEND_MODE_MATERIAL_SCREEN_KEY, ""); - blendModeMaterialAdditive = EditorPrefs.GetString(BLEND_MODE_MATERIAL_ADDITIVE_KEY, ""); - autoReloadSceneSkeletons = EditorPrefs.GetBool(AUTO_RELOAD_SCENESKELETONS_KEY, SpinePreferences.DEFAULT_AUTO_RELOAD_SCENESKELETONS); - mecanimEventIncludeFolderName = EditorPrefs.GetBool(MECANIM_EVENT_INCLUDE_FOLDERNAME_KEY, SpinePreferences.DEFAULT_MECANIM_EVENT_INCLUDE_FOLDERNAME); - atlasTxtImportWarning = EditorPrefs.GetBool(ATLASTXT_WARNING_KEY, SpinePreferences.DEFAULT_ATLASTXT_WARNING); - textureImporterWarning = EditorPrefs.GetBool(TEXTUREIMPORTER_WARNING_KEY, SpinePreferences.DEFAULT_TEXTUREIMPORTER_WARNING); - componentMaterialWarning = EditorPrefs.GetBool(COMPONENTMATERIAL_WARNING_KEY, SpinePreferences.DEFAULT_COMPONENTMATERIAL_WARNING); - timelineUseBlendDuration = EditorPrefs.GetBool(TIMELINE_USE_BLEND_DURATION_KEY, SpinePreferences.DEFAULT_TIMELINE_USE_BLEND_DURATION); - handleScale = EditorPrefs.GetFloat(SCENE_ICONS_SCALE_KEY, SpinePreferences.DEFAULT_SCENE_ICONS_SCALE); - preferencesLoaded = true; - } - -#if NEW_PREFERENCES_SETTINGS_PROVIDER - public static void CopyOldToNewPreferences(ref SpinePreferences newPreferences) { - newPreferences.defaultMix = EditorPrefs.GetFloat(DEFAULT_MIX_KEY, SpinePreferences.DEFAULT_DEFAULT_MIX); - newPreferences.defaultScale = EditorPrefs.GetFloat(DEFAULT_SCALE_KEY, SpinePreferences.DEFAULT_DEFAULT_SCALE); - newPreferences.defaultZSpacing = EditorPrefs.GetFloat(DEFAULT_ZSPACING_KEY, SpinePreferences.DEFAULT_DEFAULT_ZSPACING); - newPreferences.defaultShader = EditorPrefs.GetString(DEFAULT_SHADER_KEY, SpinePreferences.DEFAULT_DEFAULT_SHADER); - newPreferences.showHierarchyIcons = EditorPrefs.GetBool(SHOW_HIERARCHY_ICONS_KEY, SpinePreferences.DEFAULT_SHOW_HIERARCHY_ICONS); - newPreferences.setTextureImporterSettings = EditorPrefs.GetBool(SET_TEXTUREIMPORTER_SETTINGS_KEY, SpinePreferences.DEFAULT_SET_TEXTUREIMPORTER_SETTINGS); - newPreferences.textureSettingsReference = EditorPrefs.GetString(TEXTURE_SETTINGS_REFERENCE_KEY, SpinePreferences.DEFAULT_TEXTURE_SETTINGS_REFERENCE); - newPreferences.autoReloadSceneSkeletons = EditorPrefs.GetBool(AUTO_RELOAD_SCENESKELETONS_KEY, SpinePreferences.DEFAULT_AUTO_RELOAD_SCENESKELETONS); - newPreferences.mecanimEventIncludeFolderName = EditorPrefs.GetBool(MECANIM_EVENT_INCLUDE_FOLDERNAME_KEY, SpinePreferences.DEFAULT_MECANIM_EVENT_INCLUDE_FOLDERNAME); - newPreferences.atlasTxtImportWarning = EditorPrefs.GetBool(ATLASTXT_WARNING_KEY, SpinePreferences.DEFAULT_ATLASTXT_WARNING); - newPreferences.textureImporterWarning = EditorPrefs.GetBool(TEXTUREIMPORTER_WARNING_KEY, SpinePreferences.DEFAULT_TEXTUREIMPORTER_WARNING); - newPreferences.componentMaterialWarning = EditorPrefs.GetBool(COMPONENTMATERIAL_WARNING_KEY, SpinePreferences.DEFAULT_COMPONENTMATERIAL_WARNING); - newPreferences.timelineUseBlendDuration = EditorPrefs.GetBool(TIMELINE_USE_BLEND_DURATION_KEY, SpinePreferences.DEFAULT_TIMELINE_USE_BLEND_DURATION); - newPreferences.handleScale = EditorPrefs.GetFloat(SCENE_ICONS_SCALE_KEY, SpinePreferences.DEFAULT_SCENE_ICONS_SCALE); - } - - public static void SaveToEditorPrefs(SpinePreferences preferences) { - EditorPrefs.SetFloat(DEFAULT_MIX_KEY, preferences.defaultMix); - EditorPrefs.SetFloat(DEFAULT_SCALE_KEY, preferences.defaultScale); - EditorPrefs.SetFloat(DEFAULT_ZSPACING_KEY, preferences.defaultZSpacing); - EditorPrefs.SetString(DEFAULT_SHADER_KEY, preferences.defaultShader); - EditorPrefs.SetBool(SHOW_HIERARCHY_ICONS_KEY, preferences.showHierarchyIcons); - EditorPrefs.SetBool(SET_TEXTUREIMPORTER_SETTINGS_KEY, preferences.setTextureImporterSettings); - EditorPrefs.SetString(TEXTURE_SETTINGS_REFERENCE_KEY, preferences.textureSettingsReference); - EditorPrefs.SetBool(AUTO_RELOAD_SCENESKELETONS_KEY, preferences.autoReloadSceneSkeletons); - EditorPrefs.SetBool(MECANIM_EVENT_INCLUDE_FOLDERNAME_KEY, preferences.mecanimEventIncludeFolderName); - EditorPrefs.SetBool(ATLASTXT_WARNING_KEY, preferences.atlasTxtImportWarning); - EditorPrefs.SetBool(TEXTUREIMPORTER_WARNING_KEY, preferences.textureImporterWarning); - EditorPrefs.SetBool(COMPONENTMATERIAL_WARNING_KEY, preferences.componentMaterialWarning); - EditorPrefs.SetBool(TIMELINE_USE_BLEND_DURATION_KEY, preferences.timelineUseBlendDuration); - EditorPrefs.SetFloat(SCENE_ICONS_SCALE_KEY, preferences.handleScale); - } -#endif - -#if !NEW_PREFERENCES_SETTINGS_PROVIDER - public static void HandlePreferencesGUI () { - if (!preferencesLoaded) - Load(); - - EditorGUI.BeginChangeCheck(); - showHierarchyIcons = EditorGUILayout.Toggle(new GUIContent("Show Hierarchy Icons", "Show relevant icons on GameObjects with Spine Components on them. Disable this if you have large, complex scenes."), showHierarchyIcons); - if (EditorGUI.EndChangeCheck()) { - EditorPrefs.SetBool(SHOW_HIERARCHY_ICONS_KEY, showHierarchyIcons); -#if NEWPLAYMODECALLBACKS - HierarchyHandler.IconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode); -#else - HierarchyHandler.IconsOnPlaymodeStateChanged(); -#endif - } - - BoolPrefsField(ref autoReloadSceneSkeletons, AUTO_RELOAD_SCENESKELETONS_KEY, new GUIContent("Auto-reload scene components", "Reloads Skeleton components in the scene whenever their SkeletonDataAsset is modified. This makes it so changes in the SkeletonDataAsset inspector are immediately reflected. This may be slow when your scenes have large numbers of SkeletonRenderers or SkeletonGraphic.")); - - EditorGUILayout.Separator(); - EditorGUILayout.LabelField("Auto-Import Settings", EditorStyles.boldLabel); - { - SpineEditorUtilities.FloatPrefsField(ref defaultMix, DEFAULT_MIX_KEY, new GUIContent("Default Mix", "The Default Mix Duration for newly imported SkeletonDataAssets."), min: 0); - SpineEditorUtilities.FloatPrefsField(ref defaultScale, DEFAULT_SCALE_KEY, new GUIContent("Default SkeletonData Scale", "The Default skeleton import scale for newly imported SkeletonDataAssets."), min: 0.0000001f); - - EditorGUI.BeginChangeCheck(); - var shader = (EditorGUILayout.ObjectField("Default Shader", Shader.Find(defaultShader), typeof(Shader), false) as Shader); - defaultShader = shader != null ? shader.name : SpinePreferences.DEFAULT_DEFAULT_SHADER; - if (EditorGUI.EndChangeCheck()) - EditorPrefs.SetString(DEFAULT_SHADER_KEY, defaultShader); - - SpineEditorUtilities.BoolPrefsField(ref setTextureImporterSettings, SET_TEXTUREIMPORTER_SETTINGS_KEY, new GUIContent("Apply Atlas Texture Settings", "Apply the recommended settings for Texture Importers.")); - SpineEditorUtilities.Texture2DPrefsField(ref textureSettingsReference, TEXTURE_SETTINGS_REFERENCE_KEY, new GUIContent("Atlas Texture Reference Settings", "Apply the selected reference texture import settings at newly imported atlas textures. When exporting atlas textures from Spine with \"Premultiply alpha\" enabled (the default), you can leave it at \"PMAPresetTemplate\". If you have disabled \"Premultiply alpha\", set it to \"StraightAlphaPresetTemplate\". You can also create your own reference texture asset and assign it here.")); - if (string.IsNullOrEmpty(textureSettingsReference)) { - var pmaTextureSettingsReferenceGUIDS = AssetDatabase.FindAssets("PMAPresetTemplate"); - if (pmaTextureSettingsReferenceGUIDS.Length > 0) { - textureSettingsReference = AssetDatabase.GUIDToAssetPath(pmaTextureSettingsReferenceGUIDS[0]); - EditorPrefs.SetString(TEXTURE_SETTINGS_REFERENCE_KEY, textureSettingsReference); - } - } - - SpineEditorUtilities.MaterialPrefsField(ref blendModeMaterialAdditive, BLEND_MODE_MATERIAL_ADDITIVE_KEY, new GUIContent("Additive Material", "Additive blend mode Material template.")); - if (string.IsNullOrEmpty(blendModeMaterialAdditive)) { - var blendModeMaterialAdditiveGUIDS = AssetDatabase.FindAssets(DEFAULT_BLEND_MODE_ADDITIVE_MATERIAL); - if (blendModeMaterialAdditiveGUIDS.Length > 0) { - blendModeMaterialAdditive = AssetDatabase.GUIDToAssetPath(blendModeMaterialAdditiveGUIDS[0]); - } - } - SpineEditorUtilities.MaterialPrefsField(ref blendModeMaterialMultiply, BLEND_MODE_MATERIAL_MULTIPLY_KEY, new GUIContent("Multiply Material", "Multiply blend mode Material template.")); - if (string.IsNullOrEmpty(blendModeMaterialMultiply)) { - var blendModeMaterialMultiplyGUIDS = AssetDatabase.FindAssets(DEFAULT_BLEND_MODE_MULTIPLY_MATERIAL); - if (blendModeMaterialMultiplyGUIDS.Length > 0) { - blendModeMaterialMultiply = AssetDatabase.GUIDToAssetPath(blendModeMaterialMultiplyGUIDS[0]); - } - } - SpineEditorUtilities.MaterialPrefsField(ref blendModeMaterialScreen, BLEND_MODE_MATERIAL_SCREEN_KEY, new GUIContent("Screen Material", "Screen blend mode Material template.")); - if (string.IsNullOrEmpty(blendModeMaterialScreen)) { - var blendModeMaterialScreenGUIDS = AssetDatabase.FindAssets(DEFAULT_BLEND_MODE_SCREEN_MATERIAL); - if (blendModeMaterialScreenGUIDS.Length > 0) { - blendModeMaterialScreen = AssetDatabase.GUIDToAssetPath(blendModeMaterialScreenGUIDS[0]); - } - } - } - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Warnings", EditorStyles.boldLabel); - { - SpineEditorUtilities.BoolPrefsField(ref atlasTxtImportWarning, ATLASTXT_WARNING_KEY, new GUIContent("Atlas Extension Warning", "Log a warning and recommendation whenever a `.atlas` file is found.")); - SpineEditorUtilities.BoolPrefsField(ref textureImporterWarning, TEXTUREIMPORTER_WARNING_KEY, new GUIContent("Texture Settings Warning", "Log a warning and recommendation whenever Texture Import Settings are detected that could lead to undesired effects, e.g. white border artifacts.")); - SpineEditorUtilities.BoolPrefsField(ref componentMaterialWarning, COMPONENTMATERIAL_WARNING_KEY, new GUIContent("Component & Material Warning", "Log a warning and recommendation whenever Component and Material settings are not compatible.")); - } - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Editor Instantiation", EditorStyles.boldLabel); - { - EditorGUI.BeginChangeCheck(); - defaultZSpacing = EditorGUILayout.Slider("Default Slot Z-Spacing", defaultZSpacing, -0.1f, 0f); - if (EditorGUI.EndChangeCheck()) - EditorPrefs.SetFloat(DEFAULT_ZSPACING_KEY, defaultZSpacing); - - SpineEditorUtilities.BoolPrefsField(ref defaultInstantiateLoop, DEFAULT_INSTANTIATE_LOOP_KEY, new GUIContent("Default Loop", "Spawn Spine GameObjects with loop enabled.")); - } - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Mecanim Bake Settings", EditorStyles.boldLabel); - { - SpineEditorUtilities.BoolPrefsField(ref mecanimEventIncludeFolderName, MECANIM_EVENT_INCLUDE_FOLDERNAME_KEY, new GUIContent("Include Folder Name in Event", "When enabled, Mecanim events will call methods named 'FolderNameEventName', when disabled it will call 'EventName'.")); - } - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Handles and Gizmos", EditorStyles.boldLabel); - { - EditorGUI.BeginChangeCheck(); - handleScale = EditorGUILayout.Slider("Editor Bone Scale", handleScale, 0.01f, 2f); - handleScale = Mathf.Max(0.01f, handleScale); - if (EditorGUI.EndChangeCheck()) { - EditorPrefs.SetFloat(SCENE_ICONS_SCALE_KEY, handleScale); - SceneView.RepaintAll(); - } - } - -#if SPINE_TK2D_DEFINE - bool isTK2DDefineSet = true; -#else - bool isTK2DDefineSet = false; -#endif - bool isTK2DAllowed = SpineTK2DEditorUtility.IsTK2DAllowed; - if (SpineTK2DEditorUtility.IsTK2DInstalled() || isTK2DDefineSet) { - GUILayout.Space(20); - EditorGUILayout.LabelField("3rd Party Settings", EditorStyles.boldLabel); - using (new GUILayout.HorizontalScope()) { - EditorGUILayout.PrefixLabel("Define TK2D"); - if (isTK2DAllowed && GUILayout.Button("Enable", GUILayout.Width(64))) - SpineTK2DEditorUtility.EnableTK2D(); - if (GUILayout.Button("Disable", GUILayout.Width(64))) - SpineTK2DEditorUtility.DisableTK2D(); - } -#if !SPINE_TK2D_DEFINE - if (!isTK2DAllowed) { - EditorGUILayout.LabelField("To allow TK2D support, please modify line 67 in", EditorStyles.boldLabel); - EditorGUILayout.LabelField("Spine/Editor/spine-unity/Editor/Util./BuildSettings.cs", EditorStyles.boldLabel); - } -#endif - } - - GUILayout.Space(20); - EditorGUILayout.LabelField("Timeline Extension", EditorStyles.boldLabel); - { - SpineEditorUtilities.BoolPrefsField(ref timelineUseBlendDuration, TIMELINE_USE_BLEND_DURATION_KEY, new GUIContent("Use Blend Duration", "When enabled, MixDuration will be synced with timeline clip transition duration 'Ease In Duration'.")); - } - } -#endif // !NEW_PREFERENCES_SETTINGS_PROVIDER - } - - static void BoolPrefsField (ref bool currentValue, string editorPrefsKey, GUIContent label) { - EditorGUI.BeginChangeCheck(); - currentValue = EditorGUILayout.Toggle(label, currentValue); - if (EditorGUI.EndChangeCheck()) - EditorPrefs.SetBool(editorPrefsKey, currentValue); - } - - static void FloatPrefsField (ref float currentValue, string editorPrefsKey, GUIContent label, float min = float.NegativeInfinity, float max = float.PositiveInfinity) { - EditorGUI.BeginChangeCheck(); - currentValue = EditorGUILayout.DelayedFloatField(label, currentValue); - if (EditorGUI.EndChangeCheck()) { - currentValue = Mathf.Clamp(currentValue, min, max); - EditorPrefs.SetFloat(editorPrefsKey, currentValue); - } - } - - static void Texture2DPrefsField (ref string currentValue, string editorPrefsKey, GUIContent label) { - EditorGUI.BeginChangeCheck(); - EditorGUIUtility.wideMode = true; - var texture = (EditorGUILayout.ObjectField(label, AssetDatabase.LoadAssetAtPath(currentValue), typeof(Object), false) as Texture2D); - currentValue = texture != null ? AssetDatabase.GetAssetPath(texture) : ""; - if (EditorGUI.EndChangeCheck()) { - EditorPrefs.SetString(editorPrefsKey, currentValue); - } - } - - static void MaterialPrefsField (ref string currentValue, string editorPrefsKey, GUIContent label) { - EditorGUI.BeginChangeCheck(); - EditorGUIUtility.wideMode = true; - var material = (EditorGUILayout.ObjectField(label, AssetDatabase.LoadAssetAtPath(currentValue), typeof(Object), false) as Material); - currentValue = material != null ? AssetDatabase.GetAssetPath(material) : ""; - if (EditorGUI.EndChangeCheck()) { - EditorPrefs.SetString(editorPrefsKey, currentValue); - } - } - - public static void FloatPropertyField (SerializedProperty property, GUIContent label, float min = float.NegativeInfinity, float max = float.PositiveInfinity) { - EditorGUI.BeginChangeCheck(); - property.floatValue = EditorGUILayout.DelayedFloatField(label, property.floatValue); - if (EditorGUI.EndChangeCheck()) { - property.floatValue = Mathf.Clamp(property.floatValue, min, max); - } - } - - public static void ShaderPropertyField (SerializedProperty property, GUIContent label, string fallbackShaderName) { - var shader = (EditorGUILayout.ObjectField(label, Shader.Find(property.stringValue), typeof(Shader), false) as Shader); - property.stringValue = shader != null ? shader.name : fallbackShaderName; - } - - public static void MaterialPropertyField (SerializedProperty property, GUIContent label) { - var material = (EditorGUILayout.ObjectField(label, AssetDatabase.LoadAssetAtPath(property.stringValue), typeof(Material), false) as Material); - property.stringValue = material ? AssetDatabase.GetAssetPath(material) : ""; - } - - #if NEW_PREFERENCES_SETTINGS_PROVIDER - public static void PresetAssetPropertyField (SerializedProperty property, GUIContent label) { - var texturePreset = (EditorGUILayout.ObjectField(label, AssetDatabase.LoadAssetAtPath(property.stringValue), typeof(UnityEditor.Presets.Preset), false) as UnityEditor.Presets.Preset); - bool isTexturePreset = texturePreset != null && texturePreset.GetTargetTypeName() == "TextureImporter"; - property.stringValue = isTexturePreset ? AssetDatabase.GetAssetPath(texturePreset) : ""; - } - #endif - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/Preferences.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/Utility/Preferences.cs.meta deleted file mode 100644 index 3c2d5ac3b..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/Preferences.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6d80c945a2e3436459a97b7a9a16ef46 -timeCreated: 1563311495 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs b/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs deleted file mode 100644 index 5c8016b0d..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs +++ /dev/null @@ -1,459 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma warning disable 0219 -#pragma warning disable 0618 // for 3.7 branch only. Avoids "PreferenceItem' is obsolete: '[PreferenceItem] is deprecated. Use [SettingsProvider] instead." - -// Original contribution by: Mitch Thompson - -#define SPINE_SKELETONMECANIM - -#if UNITY_2017_2_OR_NEWER -#define NEWPLAYMODECALLBACKS -#endif - -#if UNITY_2018 || UNITY_2019 || UNITY_2018_3_OR_NEWER -#define NEWHIERARCHYWINDOWCALLBACKS -#endif - -#if UNITY_2018_3_OR_NEWER -#define NEW_PREFERENCES_SETTINGS_PROVIDER -#endif - -#if UNITY_2017_1_OR_NEWER -#define BUILT_IN_SPRITE_MASK_COMPONENT -#endif - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Linq; -using System.Reflection; -using System.Globalization; - -namespace Spine.Unity.Editor { - using EventType = UnityEngine.EventType; - - // Analysis disable once ConvertToStaticType - [InitializeOnLoad] - public partial class SpineEditorUtilities : AssetPostprocessor { - - public static string editorPath = ""; - public static string editorGUIPath = ""; - public static bool initialized; - private static List texturesWithoutMetaFile = new List(); - - // Auto-import entry point for textures - void OnPreprocessTexture () { - #if UNITY_2018_1_OR_NEWER - bool customTextureSettingsExist = !assetImporter.importSettingsMissing; - #else - bool customTextureSettingsExist = System.IO.File.Exists(assetImporter.assetPath + ".meta"); - #endif - if (!customTextureSettingsExist) { - texturesWithoutMetaFile.Add(assetImporter.assetPath); - } - } - - // Auto-import post process entry point for all assets - static void OnPostprocessAllAssets (string[] imported, string[] deleted, string[] moved, string[] movedFromAssetPaths) { - if (imported.Length == 0) - return; - - // we copy the list here to prevent nested calls to OnPostprocessAllAssets() triggering a Clear() of the list - // in the middle of execution. - var texturesWithoutMetaFileCopy = new List(texturesWithoutMetaFile); - AssetUtility.HandleOnPostprocessAllAssets(imported, texturesWithoutMetaFileCopy); - texturesWithoutMetaFile.Clear(); - } - -#region Initialization - static SpineEditorUtilities () { - EditorApplication.delayCall += Initialize; // delayed so that AssetDatabase is ready. - } - - static void Initialize () { - // Note: Preferences need to be loaded when changing play mode - // to initialize handle scale correctly. - #if !NEW_PREFERENCES_SETTINGS_PROVIDER - Preferences.Load(); - #else - SpinePreferences.Load(); - #endif - - if (EditorApplication.isPlayingOrWillChangePlaymode) return; - - string[] assets = AssetDatabase.FindAssets("t:script SpineEditorUtilities"); - string assetPath = AssetDatabase.GUIDToAssetPath(assets[0]); - editorPath = Path.GetDirectoryName(assetPath).Replace('\\', '/'); - - assets = AssetDatabase.FindAssets("t:texture icon-subMeshRenderer"); - if (assets.Length > 0) { - assetPath = AssetDatabase.GUIDToAssetPath(assets[0]); - editorGUIPath = Path.GetDirectoryName(assetPath).Replace('\\', '/'); - } - else { - editorGUIPath = editorPath.Replace("/Utility", "/GUI"); - } - Icons.Initialize(); - - // Drag and Drop - #if UNITY_2019_1_OR_NEWER - SceneView.duringSceneGui -= DragAndDropInstantiation.SceneViewDragAndDrop; - SceneView.duringSceneGui += DragAndDropInstantiation.SceneViewDragAndDrop; - #else - SceneView.onSceneGUIDelegate -= DragAndDropInstantiation.SceneViewDragAndDrop; - SceneView.onSceneGUIDelegate += DragAndDropInstantiation.SceneViewDragAndDrop; - #endif - - EditorApplication.hierarchyWindowItemOnGUI -= HierarchyHandler.HandleDragAndDrop; - EditorApplication.hierarchyWindowItemOnGUI += HierarchyHandler.HandleDragAndDrop; - - // Hierarchy Icons - #if NEWPLAYMODECALLBACKS - EditorApplication.playModeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged; - EditorApplication.playModeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged; - HierarchyHandler.IconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode); - #else - EditorApplication.playmodeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged; - EditorApplication.playmodeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged; - HierarchyHandler.IconsOnPlaymodeStateChanged(); - #endif - - // Data Refresh Edit Mode. - // This prevents deserialized SkeletonData from persisting from play mode to edit mode. - #if NEWPLAYMODECALLBACKS - EditorApplication.playModeStateChanged -= DataReloadHandler.OnPlaymodeStateChanged; - EditorApplication.playModeStateChanged += DataReloadHandler.OnPlaymodeStateChanged; - DataReloadHandler.OnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode); - #else - EditorApplication.playmodeStateChanged -= DataReloadHandler.OnPlaymodeStateChanged; - EditorApplication.playmodeStateChanged += DataReloadHandler.OnPlaymodeStateChanged; - DataReloadHandler.OnPlaymodeStateChanged(); - #endif - - if (SpineEditorUtilities.Preferences.textureImporterWarning) { - IssueWarningsForUnrecommendedTextureSettings(); - } - - initialized = true; - } - - public static void ConfirmInitialization () { - if (!initialized || Icons.skeleton == null) - Initialize(); - } - - public static void IssueWarningsForUnrecommendedTextureSettings() { - - string[] atlasDescriptionGUIDs = AssetDatabase.FindAssets("t:textasset .atlas"); // Note: finds ".atlas.txt" but also ".atlas 1.txt" files. - for (int i = 0; i < atlasDescriptionGUIDs.Length; ++i) { - string atlasDescriptionPath = AssetDatabase.GUIDToAssetPath(atlasDescriptionGUIDs[i]); - if (!atlasDescriptionPath.EndsWith(".atlas.txt")) - continue; - - string texturePath = atlasDescriptionPath.Replace(".atlas.txt", ".png"); - - bool textureExists = IssueWarningsForUnrecommendedTextureSettings(texturePath); - if (!textureExists) { - texturePath = texturePath.Replace(".png", ".jpg"); - textureExists = IssueWarningsForUnrecommendedTextureSettings(texturePath); - } - if (!textureExists) { - continue; - } - } - } - - public static void ReloadSkeletonDataAssetAndComponent (SkeletonRenderer component) { - if (component == null) return; - ReloadSkeletonDataAsset(component.skeletonDataAsset); - ReinitializeComponent(component); - } - - public static void ReloadSkeletonDataAssetAndComponent (SkeletonGraphic component) { - if (component == null) return; - ReloadSkeletonDataAsset(component.skeletonDataAsset); - // Reinitialize. - ReinitializeComponent(component); - } - - public static void ReloadSkeletonDataAsset (SkeletonDataAsset skeletonDataAsset) { - if (skeletonDataAsset != null) { - foreach (AtlasAssetBase aa in skeletonDataAsset.atlasAssets) { - if (aa != null) aa.Clear(); - } - skeletonDataAsset.Clear(); - } - skeletonDataAsset.GetSkeletonData(true); - } - - public static void ReinitializeComponent (SkeletonRenderer component) { - if (component == null) return; - if (!SkeletonDataAssetIsValid(component.SkeletonDataAsset)) return; - - var stateComponent = component as IAnimationStateComponent; - AnimationState oldAnimationState = null; - if (stateComponent != null) { - oldAnimationState = stateComponent.AnimationState; - } - - component.Initialize(true); // implicitly clears any subscribers - - if (oldAnimationState != null) { - stateComponent.AnimationState.AssignEventSubscribersFrom(oldAnimationState); - } - - #if BUILT_IN_SPRITE_MASK_COMPONENT - SpineMaskUtilities.EditorAssignSpriteMaskMaterials(component); - #endif - component.LateUpdate(); - } - - public static void ReinitializeComponent (SkeletonGraphic component) { - if (component == null) return; - if (!SkeletonDataAssetIsValid(component.SkeletonDataAsset)) return; - component.Initialize(true); - component.LateUpdate(); - } - - public static bool SkeletonDataAssetIsValid (SkeletonDataAsset asset) { - return asset != null && asset.GetSkeletonData(quiet: true) != null; - } - - public static bool IssueWarningsForUnrecommendedTextureSettings(string texturePath) - { - TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath); - if (texImporter == null) { - return false; - } - - int extensionPos = texturePath.LastIndexOf('.'); - string materialPath = texturePath.Substring(0, extensionPos) + "_Material.mat"; - Material material = AssetDatabase.LoadAssetAtPath(materialPath); - - if (material == null) - return true; - - string errorMessage = null; - if (MaterialChecks.IsTextureSetupProblematic(material, PlayerSettings.colorSpace, - texImporter. sRGBTexture, texImporter. mipmapEnabled, texImporter. alphaIsTransparency, - texturePath, materialPath, ref errorMessage)) { - Debug.LogWarning(errorMessage, material); - } - return true; - } - #endregion - - public static class HierarchyHandler { - static Dictionary skeletonRendererTable = new Dictionary(); - static Dictionary skeletonUtilityBoneTable = new Dictionary(); - static Dictionary boundingBoxFollowerTable = new Dictionary(); - static Dictionary boundingBoxFollowerGraphicTable = new Dictionary(); - -#if NEWPLAYMODECALLBACKS - internal static void IconsOnPlaymodeStateChanged (PlayModeStateChange stateChange) { -#else - internal static void IconsOnPlaymodeStateChanged () { -#endif - skeletonRendererTable.Clear(); - skeletonUtilityBoneTable.Clear(); - boundingBoxFollowerTable.Clear(); - boundingBoxFollowerGraphicTable.Clear(); - -#if NEWHIERARCHYWINDOWCALLBACKS - EditorApplication.hierarchyChanged -= IconsOnChanged; -#else - EditorApplication.hierarchyWindowChanged -= IconsOnChanged; -#endif - EditorApplication.hierarchyWindowItemOnGUI -= IconsOnGUI; - - if (!Application.isPlaying && Preferences.showHierarchyIcons) { -#if NEWHIERARCHYWINDOWCALLBACKS - EditorApplication.hierarchyChanged += IconsOnChanged; -#else - EditorApplication.hierarchyWindowChanged += IconsOnChanged; -#endif - EditorApplication.hierarchyWindowItemOnGUI += IconsOnGUI; - IconsOnChanged(); - } - } - - internal static void IconsOnChanged () { - skeletonRendererTable.Clear(); - skeletonUtilityBoneTable.Clear(); - boundingBoxFollowerTable.Clear(); - boundingBoxFollowerGraphicTable.Clear(); - - SkeletonRenderer[] arr = Object.FindObjectsOfType(); - foreach (SkeletonRenderer r in arr) - skeletonRendererTable[r.gameObject.GetInstanceID()] = r.gameObject; - - SkeletonUtilityBone[] boneArr = Object.FindObjectsOfType(); - foreach (SkeletonUtilityBone b in boneArr) - skeletonUtilityBoneTable[b.gameObject.GetInstanceID()] = b; - - BoundingBoxFollower[] bbfArr = Object.FindObjectsOfType(); - foreach (BoundingBoxFollower bbf in bbfArr) - boundingBoxFollowerTable[bbf.gameObject.GetInstanceID()] = bbf; - - BoundingBoxFollowerGraphic[] bbfgArr = Object.FindObjectsOfType(); - foreach (BoundingBoxFollowerGraphic bbf in bbfgArr) - boundingBoxFollowerGraphicTable[bbf.gameObject.GetInstanceID()] = bbf; - } - - internal static void IconsOnGUI (int instanceId, Rect selectionRect) { - Rect r = new Rect(selectionRect); - if (skeletonRendererTable.ContainsKey(instanceId)) { - r.x = r.width - 15; - r.width = 15; - GUI.Label(r, Icons.spine); - } else if (skeletonUtilityBoneTable.ContainsKey(instanceId)) { - r.x -= 26; - if (skeletonUtilityBoneTable[instanceId] != null) { - if (skeletonUtilityBoneTable[instanceId].transform.childCount == 0) - r.x += 13; - r.y += 2; - r.width = 13; - r.height = 13; - if (skeletonUtilityBoneTable[instanceId].mode == SkeletonUtilityBone.Mode.Follow) - GUI.DrawTexture(r, Icons.bone); - else - GUI.DrawTexture(r, Icons.poseBones); - } - } else if (boundingBoxFollowerTable.ContainsKey(instanceId)) { - r.x -= 26; - if (boundingBoxFollowerTable[instanceId] != null) { - if (boundingBoxFollowerTable[instanceId].transform.childCount == 0) - r.x += 13; - r.y += 2; - r.width = 13; - r.height = 13; - GUI.DrawTexture(r, Icons.boundingBox); - } - } else if (boundingBoxFollowerGraphicTable.ContainsKey(instanceId)) { - r.x -= 26; - if (boundingBoxFollowerGraphicTable[instanceId] != null) { - if (boundingBoxFollowerGraphicTable[instanceId].transform.childCount == 0) - r.x += 13; - r.y += 2; - r.width = 13; - r.height = 13; - GUI.DrawTexture(r, Icons.boundingBox); - } - } - } - - internal static void HandleDragAndDrop (int instanceId, Rect selectionRect) { - // HACK: Uses EditorApplication.hierarchyWindowItemOnGUI. - // Only works when there is at least one item in the scene. - var current = UnityEngine.Event.current; - var eventType = current.type; - bool isDraggingEvent = eventType == EventType.DragUpdated; - bool isDropEvent = eventType == EventType.DragPerform; - UnityEditor.DragAndDrop.visualMode = DragAndDropVisualMode.Copy; - - if (isDraggingEvent || isDropEvent) { - var mouseOverWindow = EditorWindow.mouseOverWindow; - if (mouseOverWindow != null) { - - // One, existing, valid SkeletonDataAsset - var references = UnityEditor.DragAndDrop.objectReferences; - if (references.Length == 1) { - var skeletonDataAsset = references[0] as SkeletonDataAsset; - if (skeletonDataAsset != null && skeletonDataAsset.GetSkeletonData(true) != null) { - - // Allow drag-and-dropping anywhere in the Hierarchy Window. - // HACK: string-compare because we can't get its type via reflection. - const string HierarchyWindow = "UnityEditor.SceneHierarchyWindow"; - const string GenericDataTargetID = "target"; - if (HierarchyWindow.Equals(mouseOverWindow.GetType().ToString(), System.StringComparison.Ordinal)) { - if (isDraggingEvent) { - var mouseOverTarget = UnityEditor.EditorUtility.InstanceIDToObject(instanceId); - if (mouseOverTarget) - DragAndDrop.SetGenericData(GenericDataTargetID, mouseOverTarget); - // Note: do not call current.Use(), otherwise we get the wrong drop-target parent. - } else if (isDropEvent) { - var parentGameObject = DragAndDrop.GetGenericData(GenericDataTargetID) as UnityEngine.GameObject; - Transform parent = parentGameObject != null ? parentGameObject.transform : null; - // when dragging into empty space in hierarchy below last node, last node would be parent. - if (IsLastNodeInHierarchy(parent)) - parent = null; - DragAndDropInstantiation.ShowInstantiateContextMenu(skeletonDataAsset, Vector3.zero, parent); - UnityEditor.DragAndDrop.AcceptDrag(); - current.Use(); - return; - } - } - } - } - } - } - } - - internal static bool IsLastNodeInHierarchy (Transform node) { - if (node == null) - return false; - - while (node.parent != null) { - if (node.GetSiblingIndex() != node.parent.childCount - 1) - return false; - node = node.parent; - } - - var rootNodes = UnityEngine.SceneManagement.SceneManager.GetActiveScene().GetRootGameObjects(); - bool isLastNode = (rootNodes.Length > 0 && rootNodes[rootNodes.Length - 1].transform == node); - return isLastNode; - } - } - } - - public class TextureModificationWarningProcessor : UnityEditor.AssetModificationProcessor - { - static string[] OnWillSaveAssets(string[] paths) - { - if (SpineEditorUtilities.Preferences.textureImporterWarning) { - foreach (string path in paths) { - if ((path != null) && - (path.EndsWith(".png.meta", System.StringComparison.Ordinal) || - path.EndsWith(".jpg.meta", System.StringComparison.Ordinal))) { - - string texturePath = System.IO.Path.ChangeExtension(path, null); // .meta removed - string atlasPath = System.IO.Path.ChangeExtension(texturePath, "atlas.txt"); - if (System.IO.File.Exists(atlasPath)) - SpineEditorUtilities.IssueWarningsForUnrecommendedTextureSettings(texturePath); - } - } - } - return paths; - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineHandles.cs b/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineHandles.cs deleted file mode 100644 index 84f382785..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineHandles.cs +++ /dev/null @@ -1,501 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma warning disable 0219 - -#define SPINE_SKELETONMECANIM - -using UnityEngine; -using UnityEditor; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Linq; -using System.Reflection; -using System.Globalization; - -namespace Spine.Unity.Editor { - using EventType = UnityEngine.EventType; - - public static class SpineHandles { - public static Color BoneColor { get { return new Color(0.8f, 0.8f, 0.8f, 0.4f); } } - public static Color PathColor { get { return new Color(254/255f, 127/255f, 0); } } - public static Color TransformContraintColor { get { return new Color(170/255f, 226/255f, 35/255f); } } - public static Color IkColor { get { return new Color(228/255f,90/255f,43/255f); } } - public static Color PointColor { get { return new Color(1f, 1f, 0f, 1f); } } - - static Vector3[] _boneMeshVerts = { - new Vector3(0, 0, 0), - new Vector3(0.1f, 0.1f, 0), - new Vector3(1, 0, 0), - new Vector3(0.1f, -0.1f, 0) - }; - static Mesh _boneMesh; - public static Mesh BoneMesh { - get { - if (_boneMesh == null) { - _boneMesh = new Mesh { - vertices = _boneMeshVerts, - uv = new Vector2[4], - triangles = new [] { 0, 1, 2, 2, 3, 0 } - }; - _boneMesh.RecalculateBounds(); - _boneMesh.RecalculateNormals(); - } - return _boneMesh; - } - } - - static Mesh _arrowheadMesh; - public static Mesh ArrowheadMesh { - get { - if (_arrowheadMesh == null) { - _arrowheadMesh = new Mesh { - vertices = new [] { - new Vector3(0, 0), - new Vector3(-0.1f, 0.05f), - new Vector3(-0.1f, -0.05f) - }, - uv = new Vector2[3], - triangles = new [] { 0, 1, 2 } - }; - _arrowheadMesh.RecalculateBounds(); - _arrowheadMesh.RecalculateNormals(); - } - return _arrowheadMesh; - } - } - - static Material _boneMaterial; - static Material BoneMaterial { - get { - if (_boneMaterial == null) { - _boneMaterial = new Material(Shader.Find("Hidden/Spine/Bones")); - _boneMaterial.SetColor("_Color", SpineHandles.BoneColor); - } - - return _boneMaterial; - } - } - public static Material GetBoneMaterial () { - BoneMaterial.SetColor("_Color", SpineHandles.BoneColor); - return BoneMaterial; - } - - public static Material GetBoneMaterial (Color color) { - BoneMaterial.SetColor("_Color", color); - return BoneMaterial; - } - - static Material _ikMaterial; - public static Material IKMaterial { - get { - if (_ikMaterial == null) { - _ikMaterial = new Material(Shader.Find("Hidden/Spine/Bones")); - _ikMaterial.SetColor("_Color", SpineHandles.IkColor); - } - return _ikMaterial; - } - } - - static GUIStyle _boneNameStyle; - public static GUIStyle BoneNameStyle { - get { - if (_boneNameStyle == null) { - _boneNameStyle = new GUIStyle(EditorStyles.whiteMiniLabel) { - alignment = TextAnchor.MiddleCenter, - stretchWidth = true, - padding = new RectOffset(0, 0, 0, 0), - contentOffset = new Vector2(-5f, 0f) - }; - } - return _boneNameStyle; - } - } - - static GUIStyle _pathNameStyle; - public static GUIStyle PathNameStyle { - get { - if (_pathNameStyle == null) { - _pathNameStyle = new GUIStyle(SpineHandles.BoneNameStyle); - _pathNameStyle.normal.textColor = SpineHandles.PathColor; - } - return _pathNameStyle; - } - } - - static GUIStyle _pointNameStyle; - public static GUIStyle PointNameStyle { - get { - if (_pointNameStyle == null) { - _pointNameStyle = new GUIStyle(SpineHandles.BoneNameStyle); - _pointNameStyle.normal.textColor = SpineHandles.PointColor; - } - return _pointNameStyle; - } - } - - public static void DrawBoneNames (Transform transform, Skeleton skeleton, float positionScale = 1f) { - GUIStyle style = BoneNameStyle; - foreach (Bone b in skeleton.Bones) { - if (!b.Active) continue; - var pos = new Vector3(b.WorldX * positionScale, b.WorldY * positionScale, 0) + (new Vector3(b.A, b.C) * (b.Data.Length * 0.5f)); - pos = transform.TransformPoint(pos); - Handles.Label(pos, b.Data.Name, style); - } - } - - public static void DrawBones (Transform transform, Skeleton skeleton, float positionScale = 1f) { - float boneScale = 1.8f; // Draw the root bone largest; - DrawCrosshairs2D(skeleton.Bones.Items[0].GetWorldPosition(transform), 0.08f, positionScale); - - foreach (Bone b in skeleton.Bones) { - if (!b.Active) continue; - DrawBone(transform, b, boneScale, positionScale); - boneScale = 1f; - } - } - - static Vector3[] _boneWireBuffer = new Vector3[5]; - static Vector3[] GetBoneWireBuffer (Matrix4x4 m) { - for (int i = 0, n = _boneMeshVerts.Length; i < n; i++) - _boneWireBuffer[i] = m.MultiplyPoint(_boneMeshVerts[i]); - - _boneWireBuffer[4] = _boneWireBuffer[0]; // closed polygon. - return _boneWireBuffer; - } - public static void DrawBoneWireframe (Transform transform, Bone b, Color color, float skeletonRenderScale = 1f) { - Handles.color = color; - var pos = new Vector3(b.WorldX * skeletonRenderScale, b.WorldY * skeletonRenderScale, 0); - float length = b.Data.Length; - - if (length > 0) { - Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX); - Vector3 scale = Vector3.one * length * b.WorldScaleX * skeletonRenderScale; - const float my = 1.5f; - scale.y *= (SpineEditorUtilities.Preferences.handleScale + 1) * 0.5f; - scale.y = Mathf.Clamp(scale.x, -my * skeletonRenderScale, my * skeletonRenderScale); - Handles.DrawPolyLine(GetBoneWireBuffer(transform.localToWorldMatrix * Matrix4x4.TRS(pos, rot, scale))); - var wp = transform.TransformPoint(pos); - DrawBoneCircle(wp, color, transform.forward, skeletonRenderScale); - } else { - var wp = transform.TransformPoint(pos); - DrawBoneCircle(wp, color, transform.forward, skeletonRenderScale); - } - } - - public static void DrawBone (Transform transform, Bone b, float boneScale, float skeletonRenderScale = 1f) { - var pos = new Vector3(b.WorldX * skeletonRenderScale, b.WorldY * skeletonRenderScale, 0); - float length = b.Data.Length; - if (length > 0) { - Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX); - Vector3 scale = Vector3.one * length * b.WorldScaleX * skeletonRenderScale; - const float my = 1.5f; - scale.y *= (SpineEditorUtilities.Preferences.handleScale + 1f) * 0.5f; - scale.y = Mathf.Clamp(scale.x, -my * skeletonRenderScale, my * skeletonRenderScale); - SpineHandles.GetBoneMaterial().SetPass(0); - Graphics.DrawMeshNow(SpineHandles.BoneMesh, transform.localToWorldMatrix * Matrix4x4.TRS(pos, rot, scale)); - } else { - var wp = transform.TransformPoint(pos); - DrawBoneCircle(wp, SpineHandles.BoneColor, transform.forward, boneScale * skeletonRenderScale); - } - } - - public static void DrawBone (Transform transform, Bone b, float boneScale, Color color, float skeletonRenderScale = 1f) { - var pos = new Vector3(b.WorldX * skeletonRenderScale, b.WorldY * skeletonRenderScale, 0); - float length = b.Data.Length; - if (length > 0) { - Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX); - Vector3 scale = Vector3.one * length * b.WorldScaleX; - const float my = 1.5f; - scale.y *= (SpineEditorUtilities.Preferences.handleScale + 1f) * 0.5f; - scale.y = Mathf.Clamp(scale.x, -my, my); - SpineHandles.GetBoneMaterial(color).SetPass(0); - Graphics.DrawMeshNow(SpineHandles.BoneMesh, transform.localToWorldMatrix * Matrix4x4.TRS(pos, rot, scale)); - } else { - var wp = transform.TransformPoint(pos); - DrawBoneCircle(wp, color, transform.forward, boneScale * skeletonRenderScale); - } - } - - public static void DrawPaths (Transform transform, Skeleton skeleton) { - foreach (Slot s in skeleton.DrawOrder) { - var p = s.Attachment as PathAttachment; - if (p != null) SpineHandles.DrawPath(s, p, transform, true); - } - } - - static float[] pathVertexBuffer; - public static void DrawPath (Slot s, PathAttachment p, Transform t, bool includeName) { - int worldVerticesLength = p.WorldVerticesLength; - - if (pathVertexBuffer == null || pathVertexBuffer.Length < worldVerticesLength) - pathVertexBuffer = new float[worldVerticesLength]; - - float[] pv = pathVertexBuffer; - p.ComputeWorldVertices(s, pv); - - var ocolor = Handles.color; - Handles.color = SpineHandles.PathColor; - - Matrix4x4 m = t.localToWorldMatrix; - const int step = 6; - int n = worldVerticesLength - step; - Vector3 p0, p1, p2, p3; - for (int i = 2; i < n; i += step) { - p0 = m.MultiplyPoint(new Vector3(pv[i], pv[i+1])); - p1 = m.MultiplyPoint(new Vector3(pv[i+2], pv[i+3])); - p2 = m.MultiplyPoint(new Vector3(pv[i+4], pv[i+5])); - p3 = m.MultiplyPoint(new Vector3(pv[i+6], pv[i+7])); - DrawCubicBezier(p0, p1, p2, p3); - } - - n += step; - if (p.Closed) { - p0 = m.MultiplyPoint(new Vector3(pv[n - 4], pv[n - 3])); - p1 = m.MultiplyPoint(new Vector3(pv[n - 2], pv[n - 1])); - p2 = m.MultiplyPoint(new Vector3(pv[0], pv[1])); - p3 = m.MultiplyPoint(new Vector3(pv[2], pv[3])); - DrawCubicBezier(p0, p1, p2, p3); - } - - const float endCapSize = 0.05f; - Vector3 firstPoint = m.MultiplyPoint(new Vector3(pv[2], pv[3])); - SpineHandles.DrawDot(firstPoint, endCapSize); - - //if (!p.Closed) SpineHandles.DrawDot(m.MultiplyPoint(new Vector3(pv[n - 4], pv[n - 3])), endCapSize); - if (includeName) Handles.Label(firstPoint + new Vector3(0,0.1f), p.Name, PathNameStyle); - - Handles.color = ocolor; - } - - public static void DrawDot (Vector3 position, float size) { - Handles.DotHandleCap(0, position, Quaternion.identity, size * HandleUtility.GetHandleSize(position), EventType.Ignore); //Handles.DotCap(0, position, Quaternion.identity, size * HandleUtility.GetHandleSize(position)); - } - - public static void DrawBoundingBoxes (Transform transform, Skeleton skeleton) { - foreach (var slot in skeleton.Slots) { - var bba = slot.Attachment as BoundingBoxAttachment; - if (bba != null) SpineHandles.DrawBoundingBox(slot, bba, transform); - } - } - - public static void DrawBoundingBox (Slot slot, BoundingBoxAttachment box, Transform t) { - if (box.Vertices.Length <= 2) return; // Handle cases where user creates a BoundingBoxAttachment but doesn't actually define it. - - var worldVerts = new float[box.WorldVerticesLength]; - box.ComputeWorldVertices(slot, worldVerts); - - Handles.color = Color.green; - Vector3 lastVert = Vector3.zero; - Vector3 vert = Vector3.zero; - Vector3 firstVert = t.TransformPoint(new Vector3(worldVerts[0], worldVerts[1], 0)); - for (int i = 0; i < worldVerts.Length; i += 2) { - vert.x = worldVerts[i]; - vert.y = worldVerts[i + 1]; - vert.z = 0; - - vert = t.TransformPoint(vert); - - if (i > 0) - Handles.DrawLine(lastVert, vert); - - lastVert = vert; - } - - Handles.DrawLine(lastVert, firstVert); - } - - public static void DrawPointAttachment (Bone bone, PointAttachment pointAttachment, Transform skeletonTransform) { - if (bone == null) return; - if (pointAttachment == null) return; - - Vector2 localPos; - pointAttachment.ComputeWorldPosition(bone, out localPos.x, out localPos.y); - float localRotation = pointAttachment.ComputeWorldRotation(bone); - Matrix4x4 m = Matrix4x4.TRS(localPos, Quaternion.Euler(0, 0, localRotation), Vector3.one) * Matrix4x4.TRS(Vector3.right * 0.25f, Quaternion.identity, Vector3.one); - - DrawBoneCircle(skeletonTransform.TransformPoint(localPos), SpineHandles.PointColor, Vector3.back, 1.3f); - DrawArrowhead(skeletonTransform.localToWorldMatrix * m); - } - - public static void DrawConstraints (Transform transform, Skeleton skeleton, float skeletonRenderScale = 1f) { - Vector3 targetPos; - Vector3 pos; - bool active; - Color handleColor; - const float Thickness = 4f; - Vector3 normal = transform.forward; - - // Transform Constraints - handleColor = SpineHandles.TransformContraintColor; - foreach (var tc in skeleton.TransformConstraints) { - var targetBone = tc.Target; - targetPos = targetBone.GetWorldPosition(transform, skeletonRenderScale); - - if (tc.TranslateMix > 0) { - if (tc.TranslateMix != 1f) { - Handles.color = handleColor; - foreach (var b in tc.Bones) { - pos = b.GetWorldPosition(transform, skeletonRenderScale); - Handles.DrawDottedLine(targetPos, pos, Thickness); - } - } - SpineHandles.DrawBoneCircle(targetPos, handleColor, normal, 1.3f * skeletonRenderScale); - Handles.color = handleColor; - SpineHandles.DrawCrosshairs(targetPos, 0.2f, targetBone.A, targetBone.B, targetBone.C, targetBone.D, transform, skeletonRenderScale); - } - } - - // IK Constraints - handleColor = SpineHandles.IkColor; - foreach (var ikc in skeleton.IkConstraints) { - Bone targetBone = ikc.Target; - targetPos = targetBone.GetWorldPosition(transform, skeletonRenderScale); - var bones = ikc.Bones; - active = ikc.Mix > 0; - if (active) { - pos = bones.Items[0].GetWorldPosition(transform, skeletonRenderScale); - switch (bones.Count) { - case 1: { - Handles.color = handleColor; - Handles.DrawLine(targetPos, pos); - SpineHandles.DrawBoneCircle(targetPos, handleColor, normal); - var m = bones.Items[0].GetMatrix4x4(); - m.m03 = targetBone.WorldX * skeletonRenderScale; - m.m13 = targetBone.WorldY * skeletonRenderScale; - SpineHandles.DrawArrowhead(transform.localToWorldMatrix * m); - break; - } - case 2: { - Bone childBone = bones.Items[1]; - Vector3 child = childBone.GetWorldPosition(transform, skeletonRenderScale); - Handles.color = handleColor; - Handles.DrawLine(child, pos); - Handles.DrawLine(targetPos, child); - SpineHandles.DrawBoneCircle(pos, handleColor, normal, 0.5f); - SpineHandles.DrawBoneCircle(child, handleColor, normal, 0.5f); - SpineHandles.DrawBoneCircle(targetPos, handleColor, normal); - var m = childBone.GetMatrix4x4(); - m.m03 = targetBone.WorldX * skeletonRenderScale; - m.m13 = targetBone.WorldY * skeletonRenderScale; - SpineHandles.DrawArrowhead(transform.localToWorldMatrix * m); - break; - } - } - } - //Handles.Label(targetPos, ikc.Data.Name, SpineHandles.BoneNameStyle); - } - - // Path Constraints - handleColor = SpineHandles.PathColor; - foreach (var pc in skeleton.PathConstraints) { - active = pc.TranslateMix > 0; - if (active) - foreach (var b in pc.Bones) - SpineHandles.DrawBoneCircle(b.GetWorldPosition(transform, skeletonRenderScale), handleColor, normal, 1f * skeletonRenderScale); - } - } - - static void DrawCrosshairs2D (Vector3 position, float scale, float skeletonRenderScale = 1f) { - scale *= SpineEditorUtilities.Preferences.handleScale * skeletonRenderScale; - Handles.DrawLine(position + new Vector3(-scale, 0), position + new Vector3(scale, 0)); - Handles.DrawLine(position + new Vector3(0, -scale), position + new Vector3(0, scale)); - } - - static void DrawCrosshairs (Vector3 position, float scale, float a, float b, float c, float d, Transform transform, float skeletonRenderScale = 1f) { - scale *= SpineEditorUtilities.Preferences.handleScale * skeletonRenderScale; - - var xOffset = (Vector3)(new Vector2(a, c).normalized * scale); - var yOffset = (Vector3)(new Vector2(b, d).normalized * scale); - xOffset = transform.TransformDirection(xOffset); - yOffset = transform.TransformDirection(yOffset); - - Handles.DrawLine(position + xOffset, position - xOffset); - Handles.DrawLine(position + yOffset, position - yOffset); - } - - static void DrawArrowhead2D (Vector3 pos, float localRotation, float scale = 1f) { - scale *= SpineEditorUtilities.Preferences.handleScale; - - SpineHandles.IKMaterial.SetPass(0); - Graphics.DrawMeshNow(SpineHandles.ArrowheadMesh, Matrix4x4.TRS(pos, Quaternion.Euler(0, 0, localRotation), new Vector3(scale, scale, scale))); - } - - static void DrawArrowhead (Vector3 pos, Quaternion worldQuaternion) { - Graphics.DrawMeshNow(SpineHandles.ArrowheadMesh, pos, worldQuaternion, 0); - } - - static void DrawArrowhead (Matrix4x4 m) { - float s = SpineEditorUtilities.Preferences.handleScale; - m.m00 *= s; - m.m01 *= s; - m.m02 *= s; - m.m10 *= s; - m.m11 *= s; - m.m12 *= s; - m.m20 *= s; - m.m21 *= s; - m.m22 *= s; - - SpineHandles.IKMaterial.SetPass(0); - Graphics.DrawMeshNow(SpineHandles.ArrowheadMesh, m); - } - - static void DrawBoneCircle (Vector3 pos, Color outlineColor, Vector3 normal, float scale = 1f) { - scale *= SpineEditorUtilities.Preferences.handleScale; - - Color o = Handles.color; - Handles.color = outlineColor; - float firstScale = 0.08f * scale; - Handles.DrawSolidDisc(pos, normal, firstScale); - const float Thickness = 0.03f; - float secondScale = firstScale - (Thickness * SpineEditorUtilities.Preferences.handleScale * scale); - - if (secondScale > 0f) { - Handles.color = new Color(0.3f, 0.3f, 0.3f, 0.5f); - Handles.DrawSolidDisc(pos, normal, secondScale); - } - - Handles.color = o; - } - - internal static void DrawCubicBezier (Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3) { - Handles.DrawBezier(p0, p3, p1, p2, Handles.color, Texture2D.whiteTexture, 2f); - // const float dotSize = 0.01f; - // Quaternion q = Quaternion.identity; - // Handles.DotCap(0, p0, q, dotSize); - // Handles.DotCap(0, p1, q, dotSize); - // Handles.DotCap(0, p2, q, dotSize); - // Handles.DotCap(0, p3, q, dotSize); - // Handles.DrawLine(p0, p1); - // Handles.DrawLine(p3, p2); - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineHandles.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineHandles.cs.meta deleted file mode 100644 index 6a1532b7b..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineHandles.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f4c97e41d3d90e24bbb40d634e6cc336 -timeCreated: 1563313275 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs b/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs deleted file mode 100644 index c838b9ffe..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs +++ /dev/null @@ -1,317 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#if UNITY_2017_2_OR_NEWER -#define NEWPLAYMODECALLBACKS -#endif - -#if UNITY_2018_3_OR_NEWER -#define NEW_PREFERENCES_SETTINGS_PROVIDER -#endif - -using UnityEngine; -using UnityEditor; -using System.Threading; - -namespace Spine.Unity.Editor { - - public class SpinePreferences : ScriptableObject { - - #if NEW_PREFERENCES_SETTINGS_PROVIDER - static int wasPreferencesDirCreated = 0; - static int wasPreferencesAssetCreated = 0; - #endif - - public const string SPINE_SETTINGS_ASSET_PATH = "Assets/Editor/SpineSettings.asset"; - - #if SPINE_TK2D - internal const float DEFAULT_DEFAULT_SCALE = 1f; - #else - internal const float DEFAULT_DEFAULT_SCALE = 0.01f; - #endif - public float defaultScale = DEFAULT_DEFAULT_SCALE; - - internal const float DEFAULT_DEFAULT_MIX = 0.2f; - public float defaultMix = DEFAULT_DEFAULT_MIX; - - internal const string DEFAULT_DEFAULT_SHADER = "Spine/Skeleton"; - public string defaultShader = DEFAULT_DEFAULT_SHADER; - - internal const float DEFAULT_DEFAULT_ZSPACING = 0f; - public float defaultZSpacing = DEFAULT_DEFAULT_ZSPACING; - - internal const bool DEFAULT_DEFAULT_INSTANTIATE_LOOP = true; - public bool defaultInstantiateLoop = DEFAULT_DEFAULT_INSTANTIATE_LOOP; - - internal const bool DEFAULT_SHOW_HIERARCHY_ICONS = true; - public bool showHierarchyIcons = DEFAULT_SHOW_HIERARCHY_ICONS; - - internal const bool DEFAULT_SET_TEXTUREIMPORTER_SETTINGS = true; - public bool setTextureImporterSettings = DEFAULT_SET_TEXTUREIMPORTER_SETTINGS; - - internal const string DEFAULT_TEXTURE_SETTINGS_REFERENCE = ""; - public string textureSettingsReference = DEFAULT_TEXTURE_SETTINGS_REFERENCE; - - public bool UsesPMAWorkflow { - get { - return IsPMAWorkflow(textureSettingsReference); - } - } - public static bool IsPMAWorkflow(string textureSettingsReference) { - if (textureSettingsReference == null) - return true; - string settingsReference = textureSettingsReference.ToLower(); - if (settingsReference.Contains("straight") || !settingsReference.Contains("pma")) - return false; - return true; - } - - public const string DEFAULT_BLEND_MODE_MULTIPLY_MATERIAL = "SkeletonPMAMultiply"; - public const string DEFAULT_BLEND_MODE_SCREEN_MATERIAL = "SkeletonPMAScreen"; - public const string DEFAULT_BLEND_MODE_ADDITIVE_MATERIAL = "SkeletonPMAAdditive"; - - public Material blendModeMaterialMultiply = null; - public Material blendModeMaterialScreen = null; - public Material blendModeMaterialAdditive = null; - - public string FindPathOfAsset (string assetName) { - string typeSearchString = assetName; - string[] guids = AssetDatabase.FindAssets(typeSearchString); - if (guids.Length > 0) { - return AssetDatabase.GUIDToAssetPath(guids[0]); - } - return null; - } - - public Material BlendModeMaterialMultiply { - get { - if (blendModeMaterialMultiply == null) { - string path = FindPathOfAsset(DEFAULT_BLEND_MODE_MULTIPLY_MATERIAL); - blendModeMaterialMultiply = AssetDatabase.LoadAssetAtPath(path); - } - return blendModeMaterialMultiply; - } - } - public Material BlendModeMaterialScreen { - get { - if (blendModeMaterialScreen == null) { - string path = FindPathOfAsset(DEFAULT_BLEND_MODE_SCREEN_MATERIAL); - blendModeMaterialScreen = AssetDatabase.LoadAssetAtPath(path); - } - return blendModeMaterialScreen; - } - } - public Material BlendModeMaterialAdditive { - get { - if (blendModeMaterialAdditive == null) { - string path = FindPathOfAsset(DEFAULT_BLEND_MODE_ADDITIVE_MATERIAL); - blendModeMaterialAdditive = AssetDatabase.LoadAssetAtPath(path); - } - return blendModeMaterialAdditive; - } - } - - internal const bool DEFAULT_ATLASTXT_WARNING = true; - public bool atlasTxtImportWarning = DEFAULT_ATLASTXT_WARNING; - - internal const bool DEFAULT_TEXTUREIMPORTER_WARNING = true; - public bool textureImporterWarning = DEFAULT_TEXTUREIMPORTER_WARNING; - - internal const bool DEFAULT_COMPONENTMATERIAL_WARNING = true; - public bool componentMaterialWarning = DEFAULT_COMPONENTMATERIAL_WARNING; - - public const float DEFAULT_MIPMAPBIAS = -0.5f; - - public const bool DEFAULT_AUTO_RELOAD_SCENESKELETONS = true; - public bool autoReloadSceneSkeletons = DEFAULT_AUTO_RELOAD_SCENESKELETONS; - - public const string SCENE_ICONS_SCALE_KEY = "SPINE_SCENE_ICONS_SCALE"; - internal const float DEFAULT_SCENE_ICONS_SCALE = 1f; - [Range(0.01f, 2f)] - public float handleScale = DEFAULT_SCENE_ICONS_SCALE; - - public const bool DEFAULT_MECANIM_EVENT_INCLUDE_FOLDERNAME = true; - public bool mecanimEventIncludeFolderName = DEFAULT_MECANIM_EVENT_INCLUDE_FOLDERNAME; - - // Timeline extension module - public const bool DEFAULT_TIMELINE_USE_BLEND_DURATION = true; - public bool timelineUseBlendDuration = DEFAULT_TIMELINE_USE_BLEND_DURATION; - -#if NEW_PREFERENCES_SETTINGS_PROVIDER - public static void Load () { - GetOrCreateSettings(); - } - - static SpinePreferences settings = null; - - internal static SpinePreferences GetOrCreateSettings () { - if (settings != null) - return settings; - - settings = AssetDatabase.LoadAssetAtPath(SPINE_SETTINGS_ASSET_PATH); - if (settings == null) - settings = FindSpinePreferences(); - if (settings == null) - { - settings = ScriptableObject.CreateInstance(); - SpineEditorUtilities.OldPreferences.CopyOldToNewPreferences(ref settings); - // Multiple threads may be calling this method during import, creating the folder - // multiple times with ascending number suffix. Atomic wasPreferencesDirCreated int - // variable is used to prevent any redundant create operations. - if (!AssetDatabase.IsValidFolder("Assets/Editor") && Interlocked.Exchange(ref wasPreferencesDirCreated, 1) == 0) - AssetDatabase.CreateFolder("Assets", "Editor"); - if (Interlocked.Exchange(ref wasPreferencesAssetCreated, 1) == 0) - AssetDatabase.CreateAsset(settings, SPINE_SETTINGS_ASSET_PATH); - } - return settings; - } - - static SpinePreferences FindSpinePreferences () { - string typeSearchString = " t:SpinePreferences"; - string[] guids = AssetDatabase.FindAssets(typeSearchString); - foreach (string guid in guids) { - string path = AssetDatabase.GUIDToAssetPath(guid); - var preferences = AssetDatabase.LoadAssetAtPath(path); - if (preferences != null) - return preferences; - } - return null; - } - - public static void HandlePreferencesGUI (SerializedObject settings) { - - float prevLabelWidth = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = 250; - - using (new EditorGUI.IndentLevelScope()) { - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(settings.FindProperty("showHierarchyIcons"), new GUIContent("Show Hierarchy Icons", "Show relevant icons on GameObjects with Spine Components on them. Disable this if you have large, complex scenes.")); - if (EditorGUI.EndChangeCheck()) { -#if NEWPLAYMODECALLBACKS - SpineEditorUtilities.HierarchyHandler.IconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode); -#else - SpineEditorUtilities.HierarchyHandler.IconsOnPlaymodeStateChanged(); -#endif - } - - EditorGUILayout.PropertyField(settings.FindProperty("autoReloadSceneSkeletons"), new GUIContent("Auto-reload scene components", "Reloads Skeleton components in the scene whenever their SkeletonDataAsset is modified. This makes it so changes in the SkeletonDataAsset inspector are immediately reflected. This may be slow when your scenes have large numbers of SkeletonRenderers or SkeletonGraphic.")); - - EditorGUILayout.Separator(); - EditorGUILayout.LabelField("Auto-Import Settings", EditorStyles.boldLabel); - { - SpineEditorUtilities.FloatPropertyField(settings.FindProperty("defaultMix"), new GUIContent("Default Mix", "The Default Mix Duration for newly imported SkeletonDataAssets."), min: 0f); - SpineEditorUtilities.FloatPropertyField(settings.FindProperty("defaultScale"), new GUIContent("Default SkeletonData Scale", "The Default skeleton import scale for newly imported SkeletonDataAssets."), min: 0.0000001f); - - SpineEditorUtilities.ShaderPropertyField(settings.FindProperty("defaultShader"), new GUIContent("Default Shader"), SpinePreferences.DEFAULT_DEFAULT_SHADER); - - EditorGUILayout.PropertyField(settings.FindProperty("setTextureImporterSettings"), new GUIContent("Apply Atlas Texture Settings", "Apply reference settings for Texture Importers.")); - var textureSettingsRef = settings.FindProperty("textureSettingsReference"); - SpineEditorUtilities.PresetAssetPropertyField(textureSettingsRef, new GUIContent("Atlas Texture Settings", "Apply the selected texture import settings at newly imported atlas textures. When exporting atlas textures from Spine with \"Premultiply alpha\" enabled (the default), you can leave it at \"PMATexturePreset\". If you have disabled \"Premultiply alpha\", set it to \"StraightAlphaTexturePreset\". You can also create your own TextureImporter Preset asset and assign it here.")); - if (string.IsNullOrEmpty(textureSettingsRef.stringValue)) { - var pmaTextureSettingsReferenceGUIDS = AssetDatabase.FindAssets("PMATexturePreset"); - if (pmaTextureSettingsReferenceGUIDS.Length > 0) { - var assetPath = AssetDatabase.GUIDToAssetPath(pmaTextureSettingsReferenceGUIDS[0]); - if (!string.IsNullOrEmpty(assetPath)) - textureSettingsRef.stringValue = assetPath; - } - } - - EditorGUILayout.PropertyField(settings.FindProperty("blendModeMaterialAdditive"), new GUIContent("Additive Material", "Additive blend mode Material template.")); - EditorGUILayout.PropertyField(settings.FindProperty("blendModeMaterialMultiply"), new GUIContent("Multiply Material", "Multiply blend mode Material template.")); - EditorGUILayout.PropertyField(settings.FindProperty("blendModeMaterialScreen"), new GUIContent("Screen Material", "Screen blend mode Material template.")); - } - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Warnings", EditorStyles.boldLabel); - { - EditorGUILayout.PropertyField(settings.FindProperty("atlasTxtImportWarning"), new GUIContent("Atlas Extension Warning", "Log a warning and recommendation whenever a `.atlas` file is found.")); - EditorGUILayout.PropertyField(settings.FindProperty("textureImporterWarning"), new GUIContent("Texture Settings Warning", "Log a warning and recommendation whenever Texture Import Settings are detected that could lead to undesired effects, e.g. white border artifacts.")); - EditorGUILayout.PropertyField(settings.FindProperty("componentMaterialWarning"), new GUIContent("Component & Material Warning", "Log a warning and recommendation whenever Component and Material settings are not compatible.")); - } - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Editor Instantiation", EditorStyles.boldLabel); - { - EditorGUILayout.Slider(settings.FindProperty("defaultZSpacing"), -0.1f, 0f, new GUIContent("Default Slot Z-Spacing")); - EditorGUILayout.PropertyField(settings.FindProperty("defaultInstantiateLoop"), new GUIContent("Default Loop", "Spawn Spine GameObjects with loop enabled.")); - } - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Mecanim Bake Settings", EditorStyles.boldLabel); - { - EditorGUILayout.PropertyField(settings.FindProperty("mecanimEventIncludeFolderName"), new GUIContent("Include Folder Name in Event", "When enabled, Mecanim events will call methods named 'FolderNameEventName', when disabled it will call 'EventName'.")); - } - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Handles and Gizmos", EditorStyles.boldLabel); - { - EditorGUI.BeginChangeCheck(); - var scaleProperty = settings.FindProperty("handleScale"); - EditorGUILayout.PropertyField(scaleProperty, new GUIContent("Editor Bone Scale")); - if (EditorGUI.EndChangeCheck()) { - EditorPrefs.SetFloat(SpinePreferences.SCENE_ICONS_SCALE_KEY, scaleProperty.floatValue); - SceneView.RepaintAll(); - } - } - - #if SPINE_TK2D_DEFINE - bool isTK2DDefineSet = true; - #else - bool isTK2DDefineSet = false; - #endif - bool isTK2DAllowed = SpineEditorUtilities.SpineTK2DEditorUtility.IsTK2DAllowed; - if (SpineEditorUtilities.SpineTK2DEditorUtility.IsTK2DInstalled() || isTK2DDefineSet) { - GUILayout.Space(20); - EditorGUILayout.LabelField("3rd Party Settings", EditorStyles.boldLabel); - using (new GUILayout.HorizontalScope()) { - EditorGUILayout.PrefixLabel("Define TK2D"); - if (isTK2DAllowed && GUILayout.Button("Enable", GUILayout.Width(64))) - SpineEditorUtilities.SpineTK2DEditorUtility.EnableTK2D(); - if (GUILayout.Button("Disable", GUILayout.Width(64))) - SpineEditorUtilities.SpineTK2DEditorUtility.DisableTK2D(); - } - #if !SPINE_TK2D_DEFINE - if (!isTK2DAllowed) { - EditorGUILayout.LabelField("To allow TK2D support, please modify line 67 in", EditorStyles.boldLabel); - EditorGUILayout.LabelField("Spine/Editor/spine-unity/Editor/Util./BuildSettings.cs", EditorStyles.boldLabel); - } - #endif - } - - GUILayout.Space(20); - EditorGUILayout.LabelField("Timeline Extension", EditorStyles.boldLabel); - { - EditorGUILayout.PropertyField(settings.FindProperty("timelineUseBlendDuration"), new GUIContent("Use Blend Duration", "When enabled, MixDuration will be synced with timeline clip transition duration 'Ease In Duration'.")); - } - } - EditorGUIUtility.labelWidth = prevLabelWidth; - } -#endif // NEW_PREFERENCES_SETTINGS_PROVIDER - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Windows/SpriteAtlasImportWindow.cs b/Assets/Spine/Editor/spine-unity/Editor/Windows/SpriteAtlasImportWindow.cs deleted file mode 100644 index 3e6d86620..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Windows/SpriteAtlasImportWindow.cs +++ /dev/null @@ -1,170 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; - -namespace Spine.Unity.Editor { - - using Editor = UnityEditor.Editor; - using Icons = SpineEditorUtilities.Icons; - - public class SpriteAtlasImportWindow : EditorWindow { - const bool IsUtilityWindow = false; - - [MenuItem("Window/Spine/SpriteAtlas Import", false, 5000)] - public static void Init (MenuCommand command) { - var window = EditorWindow.GetWindow(IsUtilityWindow); - window.minSize = new Vector2(284f, 256f); - window.maxSize = new Vector2(500f, 256f); - window.titleContent = new GUIContent("Spine SpriteAtlas Import", Icons.spine); - window.Show(); - } - - public UnityEngine.U2D.SpriteAtlas spriteAtlasAsset; - public TextAsset skeletonDataFile; - public SpineSpriteAtlasAsset spineSpriteAtlasAsset; - - SerializedObject so; - - void OnEnable () { - if (!SpineSpriteAtlasAsset.AnySpriteAtlasNeedsRegionsLoaded()) - return; - EditorApplication.update -= SpineSpriteAtlasAsset.UpdateWhenEditorPlayModeStarted; - EditorApplication.update += SpineSpriteAtlasAsset.UpdateWhenEditorPlayModeStarted; - } - - void OnDisable () { - EditorApplication.update -= SpineSpriteAtlasAsset.UpdateWhenEditorPlayModeStarted; - } - - void OnGUI () { - so = so ?? new SerializedObject(this); - - EditorGUIUtility.wideMode = true; - EditorGUILayout.LabelField("Spine SpriteAtlas Import", EditorStyles.boldLabel); - - using (new SpineInspectorUtility.BoxScope()) { - EditorGUI.BeginChangeCheck(); - var spriteAtlasAssetProperty = so.FindProperty("spriteAtlasAsset"); - EditorGUILayout.PropertyField(spriteAtlasAssetProperty, new GUIContent("SpriteAtlas", EditorGUIUtility.IconContent("SpriteAtlas Icon").image)); - if (EditorGUI.EndChangeCheck()) { - so.ApplyModifiedProperties(); - if (spriteAtlasAsset != null) { - if (AssetUtility.SpriteAtlasSettingsNeedAdjustment(spriteAtlasAsset)) { - AssetUtility.AdjustSpriteAtlasSettings(spriteAtlasAsset); - } - GenerateAssetsFromSpriteAtlas(spriteAtlasAsset); - } - } - - var spineSpriteAtlasAssetProperty = so.FindProperty("spineSpriteAtlasAsset"); - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(spineSpriteAtlasAssetProperty, new GUIContent("SpineSpriteAtlasAsset", EditorGUIUtility.IconContent("ScriptableObject Icon").image)); - if (spineSpriteAtlasAssetProperty.objectReferenceValue == null) { - spineSpriteAtlasAssetProperty.objectReferenceValue = spineSpriteAtlasAsset = FindSpineSpriteAtlasAsset(spriteAtlasAsset); - } - if (EditorGUI.EndChangeCheck()) { - so.ApplyModifiedProperties(); - } - EditorGUILayout.Space(); - - using (new EditorGUI.DisabledScope(spineSpriteAtlasAsset == null)) { - if (SpineInspectorUtility.LargeCenteredButton(new GUIContent("Load regions by entering Play mode"))) { - GenerateAssetsFromSpriteAtlas(spriteAtlasAsset); - SpineSpriteAtlasAsset.UpdateByStartingEditorPlayMode(); - } - } - - using (new SpineInspectorUtility.BoxScope()) { - if (spriteAtlasAsset == null) { - EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("Please assign SpriteAtlas file.", Icons.warning), GUILayout.Height(46)); - } - else if (spineSpriteAtlasAsset == null || spineSpriteAtlasAsset.RegionsNeedLoading) { - EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("Please hit 'Load regions ..' to load\nregion info. Play mode is started\nand stopped automatically.", Icons.warning), GUILayout.Height(54)); - } - else { - EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("SpriteAtlas imported\nsuccessfully.", Icons.spine), GUILayout.Height(46)); - } - } - } - - bool isAtlasComplete = (spineSpriteAtlasAsset != null && !spineSpriteAtlasAsset.RegionsNeedLoading); - bool canImportSkeleton = (spriteAtlasAsset != null && skeletonDataFile != null); - using (new SpineInspectorUtility.BoxScope()) { - - using (new EditorGUI.DisabledScope(!isAtlasComplete)) { - var skeletonDataAssetProperty = so.FindProperty("skeletonDataFile"); - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(skeletonDataAssetProperty, SpineInspectorUtility.TempContent("Skeleton json/skel file", Icons.spine)); - if (EditorGUI.EndChangeCheck()) { - so.ApplyModifiedProperties(); - } - EditorGUILayout.Space(); - } - using (new EditorGUI.DisabledScope(!canImportSkeleton)) { - if (SpineInspectorUtility.LargeCenteredButton(new GUIContent("Import Skeleton"))) { - //AssetUtility.IngestSpriteAtlas(spriteAtlasAsset, null); - string skeletonPath = AssetDatabase.GetAssetPath(skeletonDataFile); - string[] skeletons = new string[] { skeletonPath }; - AssetUtility.ImportSpineContent(skeletons, null); - } - } - } - } - - void GenerateAssetsFromSpriteAtlas (UnityEngine.U2D.SpriteAtlas spriteAtlasAsset) { - AssetUtility.IngestSpriteAtlas(spriteAtlasAsset, null); - string texturePath; - if (AssetUtility.GeneratePngFromSpriteAtlas(spriteAtlasAsset, out texturePath)) { - Debug.Log(string.Format("Generated SpriteAtlas texture '{0}'", texturePath), spriteAtlasAsset); - } - } - - SpineSpriteAtlasAsset FindSpineSpriteAtlasAsset (UnityEngine.U2D.SpriteAtlas spriteAtlasAsset) { - string path = AssetDatabase.GetAssetPath(spriteAtlasAsset).Replace(".spriteatlas", AssetUtility.SpriteAtlasSuffix + ".asset"); - if (System.IO.File.Exists(path)) { - return AssetDatabase.LoadAssetAtPath(path); - } - return null; - } - - SkeletonDataAsset FindSkeletonDataAsset (TextAsset skeletonDataFile) { - string path = AssetDatabase.GetAssetPath(skeletonDataFile); - path = path.Replace(".json", AssetUtility.SkeletonDataSuffix + ".asset"); - path = path.Replace(".skel.bytes", AssetUtility.SkeletonDataSuffix + ".asset"); - if (System.IO.File.Exists(path)) { - return AssetDatabase.LoadAssetAtPath(path); - } - return null; - } - } -} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Windows/SpriteAtlasImportWindow.cs.meta b/Assets/Spine/Editor/spine-unity/Editor/Windows/SpriteAtlasImportWindow.cs.meta deleted file mode 100644 index 2eb64bdcf..000000000 --- a/Assets/Spine/Editor/spine-unity/Editor/Windows/SpriteAtlasImportWindow.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a5b99b091defeef439a0cb8c99fd8a51 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Asset Types.meta b/Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower.meta similarity index 67% rename from Assets/Spine/Editor/spine-unity/Editor/Asset Types.meta rename to Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower.meta index 5ce846be1..f8a738b09 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Asset Types.meta +++ b/Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: eb646ac6e394e534b80d5cac61478488 +guid: 6351693f94cbf774182d4b3f2a756a43 folderAsset: yes -timeCreated: 1563305058 +timeCreated: 1527569401 licenseType: Free DefaultImporter: userData: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Windows.meta b/Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower/Editor.meta similarity index 67% rename from Assets/Spine/Editor/spine-unity/Editor/Windows.meta rename to Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower/Editor.meta index ee5bf8b22..76ca150c2 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Windows.meta +++ b/Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower/Editor.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: b6badf2758b1ea44e8c5ec62ef338e22 +guid: b7f013ad20f0af34e913e21b44466777 folderAsset: yes -timeCreated: 1563305058 +timeCreated: 1455492480 licenseType: Free DefaultImporter: userData: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerInspector.cs b/Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower/Editor/BoundingBoxFollowerInspector.cs similarity index 71% rename from Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerInspector.cs rename to Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower/Editor/BoundingBoxFollowerInspector.cs index 0d68b63c2..18f54b1cf 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerInspector.cs +++ b/Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower/Editor/BoundingBoxFollowerInspector.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -33,7 +33,6 @@ using UnityEngine; using UnityEditor; -using System.Collections.Generic; namespace Spine.Unity.Editor { using Event = UnityEngine.Event; @@ -56,7 +55,7 @@ namespace Spine.Unity.Editor { } } - void InitializeEditor () { + void OnEnable () { skeletonRenderer = serializedObject.FindProperty("skeletonRenderer"); slotName = serializedObject.FindProperty("slotName"); isTrigger = serializedObject.FindProperty("isTrigger"); @@ -65,17 +64,12 @@ namespace Spine.Unity.Editor { } public override void OnInspectorGUI () { - #if !NEW_PREFAB_SYSTEM bool isInspectingPrefab = (PrefabUtility.GetPrefabType(target) == PrefabType.Prefab); #else bool isInspectingPrefab = false; #endif - // Note: when calling InitializeEditor() in OnEnable, it throws exception - // "SerializedObjectNotCreatableException: Object at index 0 is null". - InitializeEditor(); - // Try to auto-assign SkeletonRenderer field. if (skeletonRenderer.objectReferenceValue == null) { var foundSkeletonRenderer = follower.GetComponentInParent(); @@ -86,7 +80,6 @@ namespace Spine.Unity.Editor { skeletonRenderer.objectReferenceValue = foundSkeletonRenderer; serializedObject.ApplyModifiedProperties(); - InitializeEditor(); } var skeletonRendererValue = skeletonRenderer.objectReferenceValue as SkeletonRenderer; @@ -94,7 +87,7 @@ namespace Spine.Unity.Editor { using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox)) { EditorGUILayout.HelpBox("It's ideal to add BoundingBoxFollower to a separate child GameObject of the Spine GameObject.", MessageType.Warning); - if (GUILayout.Button(new GUIContent("Move BoundingBoxFollower to new GameObject", Icons.boundingBox), GUILayout.Height(30f))) { + if (GUILayout.Button(new GUIContent("Move BoundingBoxFollower to new GameObject", Icons.boundingBox), GUILayout.Height(50f))) { AddBoundingBoxFollowerChild(skeletonRendererValue, follower); DestroyImmediate(follower); return; @@ -108,7 +101,6 @@ namespace Spine.Unity.Editor { EditorGUILayout.PropertyField(slotName, new GUIContent("Slot")); if (EditorGUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); - InitializeEditor(); #if !NEW_PREFAB_SYSTEM if (!isInspectingPrefab) rebuildRequired = true; @@ -126,7 +118,6 @@ namespace Spine.Unity.Editor { if (clearStateChanged || triggerChanged) { serializedObject.ApplyModifiedProperties(); - InitializeEditor(); if (triggerChanged) foreach (var col in follower.colliderTable.Values) col.isTrigger = isTrigger.boolValue; @@ -161,8 +152,6 @@ namespace Spine.Unity.Editor { } - if (follower.Slot == null) - follower.Initialize(false); bool hasBoneFollower = follower.GetComponent() != null; if (!hasBoneFollower) { bool buttonDisabled = follower.Slot == null; @@ -199,21 +188,11 @@ namespace Spine.Unity.Editor { var go = AddBoundingBoxFollowerChild((SkeletonRenderer)command.context); Undo.RegisterCreatedObjectUndo(go, "Add BoundingBoxFollower"); } - - [MenuItem("CONTEXT/SkeletonRenderer/Add all BoundingBoxFollower GameObjects")] - static void AddAllBoundingBoxFollowerChildren (MenuCommand command) { - var objects = AddAllBoundingBoxFollowerChildren((SkeletonRenderer)command.context); - foreach (var go in objects) - Undo.RegisterCreatedObjectUndo(go, "Add BoundingBoxFollower"); - } #endregion - public static GameObject AddBoundingBoxFollowerChild (SkeletonRenderer skeletonRenderer, - BoundingBoxFollower original = null, string name = "BoundingBoxFollower", - string slotName = null) { - - var go = EditorInstantiation.NewGameObject(name, true); - go.transform.SetParent(skeletonRenderer.transform, false); + static GameObject AddBoundingBoxFollowerChild (SkeletonRenderer sr, BoundingBoxFollower original = null) { + var go = SpineEditorUtilities.EditorInstantiation.NewGameObject("BoundingBoxFollower"); + go.transform.SetParent(sr.transform, false); var newFollower = go.AddComponent(); if (original != null) { @@ -221,40 +200,16 @@ namespace Spine.Unity.Editor { newFollower.isTrigger = original.isTrigger; newFollower.clearStateOnDisable = original.clearStateOnDisable; } - if (slotName != null) - newFollower.slotName = slotName; - newFollower.skeletonRenderer = skeletonRenderer; + newFollower.skeletonRenderer = sr; newFollower.Initialize(); + Selection.activeGameObject = go; EditorGUIUtility.PingObject(go); return go; } - public static List AddAllBoundingBoxFollowerChildren ( - SkeletonRenderer skeletonRenderer, BoundingBoxFollower original = null) { - - List createdGameObjects = new List(); - foreach (var skin in skeletonRenderer.Skeleton.Data.Skins) { - var attachments = skin.Attachments; - foreach (var entry in attachments) { - var boundingBoxAttachment = entry.Value as BoundingBoxAttachment; - if (boundingBoxAttachment == null) - continue; - int slotIndex = entry.Key.SlotIndex; - var slot = skeletonRenderer.Skeleton.Slots.Items[slotIndex]; - string slotName = slot.Data.Name; - GameObject go = AddBoundingBoxFollowerChild(skeletonRenderer, - original, boundingBoxAttachment.Name, slotName); - var boneFollower = go.AddComponent(); - boneFollower.skeletonRenderer = skeletonRenderer; - boneFollower.SetBone(slot.Data.BoneData.Name); - createdGameObjects.Add(go); - } - } - return createdGameObjects; - } } } diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower/Editor/BoundingBoxFollowerInspector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/Modules/BoundingBoxFollower/Editor/BoundingBoxFollowerInspector.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility.meta b/Assets/Spine/Editor/spine-unity/Modules/CustomMaterials.meta similarity index 67% rename from Assets/Spine/Editor/spine-unity/Editor/Utility.meta rename to Assets/Spine/Editor/spine-unity/Modules/CustomMaterials.meta index b46de85a9..7499980e3 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility.meta +++ b/Assets/Spine/Editor/spine-unity/Modules/CustomMaterials.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 33c080d1c093a2c45b6c72c17a557067 +guid: ffde24e0e567a61418f76218f8cffb4c folderAsset: yes -timeCreated: 1563304704 +timeCreated: 1527569418 licenseType: Free DefaultImporter: userData: diff --git a/Assets/Spine/Runtime/spine-unity/Utility.meta b/Assets/Spine/Editor/spine-unity/Modules/CustomMaterials/Editor.meta similarity index 64% rename from Assets/Spine/Runtime/spine-unity/Utility.meta rename to Assets/Spine/Editor/spine-unity/Modules/CustomMaterials/Editor.meta index 7098b07f0..6b6e2f6d3 100644 --- a/Assets/Spine/Runtime/spine-unity/Utility.meta +++ b/Assets/Spine/Editor/spine-unity/Modules/CustomMaterials/Editor.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 52627c17e6dd4bf4dad4bdfc490ce823 +guid: 99abd7478ddde384cbf86f2ecd396900 folderAsset: yes DefaultImporter: - externalObjects: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererCustomMaterialsInspector.cs b/Assets/Spine/Editor/spine-unity/Modules/CustomMaterials/Editor/SkeletonRendererCustomMaterialsInspector.cs similarity index 86% rename from Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererCustomMaterialsInspector.cs rename to Assets/Spine/Editor/spine-unity/Modules/CustomMaterials/Editor/SkeletonRendererCustomMaterialsInspector.cs index 44c9f4a49..b08ac8976 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererCustomMaterialsInspector.cs +++ b/Assets/Spine/Editor/spine-unity/Modules/CustomMaterials/Editor/SkeletonRendererCustomMaterialsInspector.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #define SPINE_OPTIONAL_MATERIALOVERRIDE @@ -37,7 +37,7 @@ using System.Linq; using System.Reflection; using UnityEditor; using UnityEngine; -using Spine.Unity.Examples; +using Spine.Unity.Modules; namespace Spine.Unity.Editor { @@ -100,13 +100,13 @@ namespace Spine.Unity.Editor { _customSlotMaterialsPrev = CopyList(componentCustomSlotMaterials); } - // Compare new values with saved. If change is detected: + // Compare new values with saved. If change is detected: // store new values, restore old values, remove overrides, restore new values, restore overrides. // 1. Store new values var customMaterialOverridesNew = CopyList(componentCustomMaterialOverrides); var customSlotMaterialsNew = CopyList(componentCustomSlotMaterials); - + // Detect changes if (!_customMaterialOverridesPrev.SequenceEqual(customMaterialOverridesNew) || !_customSlotMaterialsPrev.SequenceEqual(customSlotMaterialsNew)) { @@ -160,6 +160,6 @@ namespace Spine.Unity.Editor { static List CopyList (List list) { return list.GetRange(0, list.Count); - } + } } } diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererCustomMaterialsInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Modules/CustomMaterials/Editor/SkeletonRendererCustomMaterialsInspector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonRendererCustomMaterialsInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/Modules/CustomMaterials/Editor/SkeletonRendererCustomMaterialsInspector.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components.meta b/Assets/Spine/Editor/spine-unity/Modules/Ragdoll.meta similarity index 67% rename from Assets/Spine/Editor/spine-unity/Editor/Components.meta rename to Assets/Spine/Editor/spine-unity/Modules/Ragdoll.meta index a6574b215..194252b11 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Components.meta +++ b/Assets/Spine/Editor/spine-unity/Modules/Ragdoll.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 0134640f881c8d24d812a6f9af9d0761 +guid: a5ca7a6f2b7e25646ad2f5776178bf78 folderAsset: yes -timeCreated: 1563304704 +timeCreated: 1527569438 licenseType: Free DefaultImporter: userData: diff --git a/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor.meta b/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor.meta new file mode 100644 index 000000000..6cac463d2 --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 7220dc1e8d545e849a2eb63e8633349b +folderAsset: yes +DefaultImporter: + userData: diff --git a/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor/SkeletonRagdoll2DInspector.cs b/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor/SkeletonRagdoll2DInspector.cs new file mode 100644 index 000000000..9c4b04275 --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor/SkeletonRagdoll2DInspector.cs @@ -0,0 +1,37 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +// Contributed by: Mitch Thompson + +using UnityEngine; +using UnityEditor; + +namespace Spine.Unity.Modules { + public class SkeletonRagdoll2DInspector {} +} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineShaderWithOutlineGUI.cs.meta b/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor/SkeletonRagdoll2DInspector.cs.meta similarity index 76% rename from Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineShaderWithOutlineGUI.cs.meta rename to Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor/SkeletonRagdoll2DInspector.cs.meta index 394bd693e..08480207a 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineShaderWithOutlineGUI.cs.meta +++ b/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor/SkeletonRagdoll2DInspector.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: efbbf90926e217c40831926fce374905 -timeCreated: 1573666328 +guid: b6dd0b99faf3aeb4d803eb9989cb369c +timeCreated: 1431741936 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor/SkeletonRagdollInspector.cs b/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor/SkeletonRagdollInspector.cs new file mode 100644 index 000000000..118c64b18 --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor/SkeletonRagdollInspector.cs @@ -0,0 +1,46 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +// Contributed by: Mitch Thompson + +using UnityEngine; +using UnityEditor; + +namespace Spine.Unity.Modules { + + public class SkeletonRagdollInspector : UnityEditor.Editor { + [CustomPropertyDrawer(typeof(SkeletonRagdoll.LayerFieldAttribute))] + public class LayerFieldPropertyDrawer : PropertyDrawer { + public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) { + property.intValue = EditorGUI.LayerField(position, label, property.intValue); + } + } + } + +} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs.meta b/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor/SkeletonRagdollInspector.cs.meta similarity index 76% rename from Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs.meta rename to Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor/SkeletonRagdollInspector.cs.meta index 2f6480e83..7c478ae50 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs.meta +++ b/Assets/Spine/Editor/spine-unity/Modules/Ragdoll/Editor/SkeletonRagdollInspector.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 49377c72c37e2c149b106c260a241f3c -timeCreated: 1563311043 +guid: c95a670c56447c644a0f062e4cdd448e +timeCreated: 1431740230 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/Spine/Editor/spine-unity/Editor/Shaders.meta b/Assets/Spine/Editor/spine-unity/Modules/Shaders.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Shaders.meta rename to Assets/Spine/Editor/spine-unity/Modules/Shaders.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite.meta b/Assets/Spine/Editor/spine-unity/Modules/Shaders/Sprite.meta similarity index 67% rename from Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite.meta rename to Assets/Spine/Editor/spine-unity/Modules/Shaders/Sprite.meta index fff5fc632..6550f0405 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite.meta +++ b/Assets/Spine/Editor/spine-unity/Modules/Shaders/Sprite.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 615182d5e489bf3478299e5bbf15dc23 +guid: f9ef69c370f1b0f4db091a85df7f2c96 folderAsset: yes -timeCreated: 1573830740 +timeCreated: 1527569612 licenseType: Free DefaultImporter: userData: diff --git a/Assets/Spine/Editor/spine-unity/Modules/Shaders/Sprite/Editor.meta b/Assets/Spine/Editor/spine-unity/Modules/Shaders/Sprite/Editor.meta new file mode 100644 index 000000000..c34b55854 --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Modules/Shaders/Sprite/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7bebbafa671002646b3a7267b32a0d60 +folderAsset: yes +timeCreated: 1479419399 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineSpriteShaderGUI.cs b/Assets/Spine/Editor/spine-unity/Modules/Shaders/Sprite/Editor/SpineSpriteShaderGUI.cs similarity index 75% rename from Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineSpriteShaderGUI.cs rename to Assets/Spine/Editor/spine-unity/Modules/Shaders/Sprite/Editor/SpineSpriteShaderGUI.cs index 53215cf2a..38e20efef 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineSpriteShaderGUI.cs +++ b/Assets/Spine/Editor/spine-unity/Modules/Shaders/Sprite/Editor/SpineSpriteShaderGUI.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,36 +15,27 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEngine; using UnityEditor; -using Spine.Unity; using SpineInspectorUtility = Spine.Unity.Editor.SpineInspectorUtility; -public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { +public class SpineSpriteShaderGUI : ShaderGUI { static readonly string kShaderVertexLit = "Spine/Sprite/Vertex Lit"; static readonly string kShaderPixelLit = "Spine/Sprite/Pixel Lit"; static readonly string kShaderUnlit = "Spine/Sprite/Unlit"; - - static readonly string kShaderVertexLitOutline = "Spine/Outline/Sprite/Vertex Lit"; - static readonly string kShaderPixelLitOutline = "Spine/Outline/Sprite/Pixel Lit"; - static readonly string kShaderUnlitOutline = "Spine/Outline/Sprite/Unlit"; - - static readonly string kShaderLitLW = "Lightweight Render Pipeline/Spine/Sprite"; - static readonly string kShaderLitURP = "Universal Render Pipeline/Spine/Sprite"; - static readonly string kShaderLitURP2D = "Universal Render Pipeline/2D/Spine/Sprite"; static readonly int kSolidQueue = 2000; static readonly int kAlphaTestQueue = 2450; static readonly int kTransparentQueue = 3000; @@ -63,9 +54,6 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { VertexLit, PixelLit, Unlit, - LitLightweight, - LitUniversal, - LitUniversal2D }; private enum eCulling { @@ -78,22 +66,12 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { MeshNormals = -1, FixedNormalsViewSpace = 0, FixedNormalsModelSpace = 1, - FixedNormalsWorldSpace = 2 }; - private enum eDiffuseRampMode { - NoRampSpecified = -1, - FullRangeHard = 0, - FullRangeSoft = 1, - OldHard = 2, - OldSoft = 3, - - DefaultRampMode = OldHard - }; + MaterialEditor _materialEditor; MaterialProperty _mainTexture = null; MaterialProperty _color = null; - MaterialProperty _maskTexture = null; MaterialProperty _pixelSnap = null; @@ -130,7 +108,6 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { MaterialProperty _smoothnessScale = null; static GUIContent _albedoText = new GUIContent("Albedo", "Albedo (RGB) and Transparency (A)"); - static GUIContent _maskText = new GUIContent("Light Mask", "Light mask texture (secondary Sprite texture)"); static GUIContent _altAlbedoText = new GUIContent("Secondary Albedo", "When a secondary albedo texture is set the albedo will be a blended mix of the two textures based on the blend value."); static GUIContent _metallicMapText = new GUIContent("Metallic", "Metallic (R) and Smoothness (A)"); static GUIContent _smoothnessText = new GUIContent("Smoothness", "Smoothness value"); @@ -143,19 +120,15 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { static GUIContent _depthText = new GUIContent("Write to Depth", "Write to Depth Buffer by clipping alpha."); static GUIContent _depthAlphaCutoffText = new GUIContent("Depth Alpha Cutoff", "Threshold for depth write alpha cutoff"); static GUIContent _shadowAlphaCutoffText = new GUIContent("Shadow Alpha Cutoff", "Threshold for shadow alpha cutoff"); - static GUIContent _receiveShadowsText = new GUIContent("Receive Shadows", "When enabled, other GameObjects can cast shadows onto this GameObject. 'Write to Depth' has to be enabled in Lightweight RP."); static GUIContent _fixedNormalText = new GUIContent("Fixed Normals", "If this is ticked instead of requiring mesh normals a Fixed Normal will be used instead (it's quicker and can result in better looking lighting effects on 2d objects)."); static GUIContent _fixedNormalDirectionText = new GUIContent("Fixed Normal Direction", "Should normally be (0,0,1) if in view-space or (0,0,-1) if in model-space."); static GUIContent _adjustBackfaceTangentText = new GUIContent("Adjust Back-face Tangents", "Tick only if you are going to rotate the sprite to face away from the camera, the tangents will be flipped when this is the case to make lighting correct."); - static GUIContent _sphericalHarmonicsText = new GUIContent("Light Probes & Ambient", "Enable to use spherical harmonics to aplpy ambient light and/or light probes. In vertex-lit mode this will be approximated from scenes ambient trilight settings."); + static GUIContent _sphericalHarmonicsText = new GUIContent("Spherical Harmonics", "Enable to use spherical harmonics to calculate ambient light / light probes. In vertex-lit mode this will be approximated from scenes ambient trilight settings."); static GUIContent _lightingModeText = new GUIContent("Lighting Mode", "Lighting Mode"); static GUIContent[] _lightingModeOptions = { new GUIContent("Vertex Lit"), new GUIContent("Pixel Lit"), - new GUIContent("Unlit"), - new GUIContent("Lit Lightweight"), - new GUIContent("Lit Universal"), - new GUIContent("Lit Universal2D") + new GUIContent("Unlit") }; static GUIContent _blendModeText = new GUIContent("Blend Mode", "Blend Mode"); static GUIContent[] _blendModeOptions = { @@ -167,13 +140,13 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { new GUIContent("Multiply"), new GUIContent("Multiply x2") }; - static GUIContent _rendererQueueText = new GUIContent("Render Queue Offset"); + static GUIContent _rendererQueueText = new GUIContent("Renderer Queue"); static GUIContent _cullingModeText = new GUIContent("Culling Mode"); static GUIContent[] _cullingModeOptions = { new GUIContent("Off"), new GUIContent("Front"), new GUIContent("Back") }; static GUIContent _pixelSnapText = new GUIContent("Pixel Snap"); //static GUIContent _customRenderTypetagsText = new GUIContent("Use Custom RenderType tags"); static GUIContent _fixedNormalSpaceText = new GUIContent("Fixed Normal Space"); - static GUIContent[] _fixedNormalSpaceOptions = { new GUIContent("View-Space"), new GUIContent("Model-Space"), new GUIContent("World-Space") }; + static GUIContent[] _fixedNormalSpaceOptions = { new GUIContent("View-Space"), new GUIContent("Model-Space") }; static GUIContent _rimLightingToggleText = new GUIContent("Rim Lighting", "Enable Rim Lighting."); static GUIContent _rimColorText = new GUIContent("Rim Color"); static GUIContent _rimPowerText = new GUIContent("Rim Power"); @@ -187,7 +160,6 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { static GUIContent _meshRequiresTangentsText = new GUIContent("Note: Material requires a mesh with tangents."); static GUIContent _meshRequiresNormalsText = new GUIContent("Note: Material requires a mesh with normals."); static GUIContent _meshRequiresNormalsAndTangentsText = new GUIContent("Note: Material requires a mesh with Normals and Tangents."); - static GUIContent[] _fixedDiffuseRampModeOptions = { new GUIContent("Hard"), new GUIContent("Soft"), new GUIContent("Old Hard"), new GUIContent("Old Soft") }; const string _primaryMapsText = "Main Maps"; const string _depthLabelText = "Depth"; @@ -206,11 +178,7 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { base.AssignNewShaderToMaterial(material, oldShader, newShader); //If not originally a sprite shader set default keywords - if (oldShader.name != kShaderVertexLit && oldShader.name != kShaderPixelLit && oldShader.name != kShaderUnlit && - oldShader.name != kShaderVertexLitOutline && oldShader.name != kShaderPixelLitOutline && oldShader.name != kShaderUnlitOutline && - oldShader.name != kShaderLitLW && - oldShader.name != kShaderLitURP && - oldShader.name != kShaderLitURP2D) { + if (oldShader.name != kShaderVertexLit && oldShader.name != kShaderPixelLit && oldShader.name != kShaderUnlit) { SetDefaultSpriteKeywords(material, newShader); } @@ -221,16 +189,13 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { #region Virtual Interface - protected override void FindProperties (MaterialProperty[] props) { - base.FindProperties(props); - + protected virtual void FindProperties (MaterialProperty[] props) { _mainTexture = FindProperty("_MainTex", props); - _maskTexture = FindProperty("_MaskTex", props, false); _color = FindProperty("_Color", props); _pixelSnap = FindProperty("PixelSnap", props); - _writeToDepth = FindProperty("_ZWrite", props, false); + _writeToDepth = FindProperty("_ZWrite", props); _depthAlphaCutoff = FindProperty("_Cutoff", props); _shadowAlphaCutoff = FindProperty("_ShadowAlphaCutoff", props); _renderQueue = FindProperty("_RenderQueue", props); @@ -322,16 +287,6 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { dataChanged |= RenderRimLightingProperties(); } - { - EditorGUILayout.Space(); - RenderStencilProperties(); - } - - { - EditorGUILayout.Space(); - RenderOutlineProperties(); - } - if (dataChanged) { MaterialChanged(_materialEditor); } @@ -369,18 +324,6 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { if (material.shader.name != kShaderUnlit) _materialEditor.SetShader(Shader.Find(kShaderUnlit), false); break; - case eLightMode.LitLightweight: - if (material.shader.name != kShaderLitLW) - _materialEditor.SetShader(Shader.Find(kShaderLitLW), false); - break; - case eLightMode.LitUniversal: - if (material.shader.name != kShaderLitURP) - _materialEditor.SetShader(Shader.Find(kShaderLitURP), false); - break; - case eLightMode.LitUniversal2D: - if (material.shader.name != kShaderLitURP2D) - _materialEditor.SetShader(Shader.Find(kShaderLitURP2D), false); - break; } } @@ -408,20 +351,15 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { dataChanged = true; } - - if (QualitySettings.activeColorSpace == ColorSpace.Linear && - !EditorGUI.showMixedValue && blendMode == eBlendMode.PreMultipliedAlpha) { - EditorGUILayout.HelpBox(MaterialChecks.kPMANotSupportedLinearMessage, MessageType.Error, true); - } } - EditorGUI.BeginDisabledGroup(true); - _materialEditor.RenderQueueField(); - EditorGUI.EndDisabledGroup(); + // GUILayout.Label(Styles.advancedText, EditorStyles.boldLabel); + // m_MaterialEditor.RenderQueueField(); + // m_MaterialEditor.EnableInstancingField(); EditorGUI.BeginChangeCheck(); EditorGUI.showMixedValue = _renderQueue.hasMixedValue; - int renderQueue = EditorGUILayout.IntField(_rendererQueueText, (int)_renderQueue.floatValue); + int renderQueue = EditorGUILayout.IntSlider(_rendererQueueText, (int)_renderQueue.floatValue, 0, 49); if (EditorGUI.EndChangeCheck()) { SetInt("_RenderQueue", renderQueue); dataChanged = true; @@ -455,10 +393,8 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { if (_bumpMap != null) _materialEditor.TexturePropertySingleLine(_normalMapText, _bumpMap, _bumpMap.textureValue != null ? _bumpScale : null); - if (_maskTexture != null) - _materialEditor.TexturePropertySingleLine(_maskText, _maskTexture); - - dataChanged |= RenderDiffuseRampProperties(); + if (_diffuseRamp != null) + _materialEditor.TexturePropertySingleLine(_diffuseRampText, _diffuseRamp); dataChanged |= EditorGUI.EndChangeCheck(); @@ -485,23 +421,18 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { EditorGUI.BeginChangeCheck(); - bool showDepthAlphaCutoff = true; - // e.g. Pixel Lit shader always has ZWrite enabled - if (_writeToDepth != null) { - bool mixedValue = _writeToDepth.hasMixedValue; - EditorGUI.showMixedValue = mixedValue; - bool writeTodepth = EditorGUILayout.Toggle(_depthText, _writeToDepth.floatValue != 0.0f); + bool mixedValue = _writeToDepth.hasMixedValue; + EditorGUI.showMixedValue = mixedValue; + bool writeTodepth = EditorGUILayout.Toggle(_depthText, _writeToDepth.floatValue != 0.0f); - if (EditorGUI.EndChangeCheck()) { - SetInt("_ZWrite", writeTodepth ? 1 : 0); - _depthAlphaCutoff.floatValue = writeTodepth ? 0.5f : 0.0f; - mixedValue = false; - dataChanged = true; - } - - showDepthAlphaCutoff = writeTodepth && !mixedValue && GetMaterialBlendMode((Material)_materialEditor.target) != eBlendMode.Opaque; + if (EditorGUI.EndChangeCheck()) { + SetInt("_ZWrite", writeTodepth ? 1 : 0); + _depthAlphaCutoff.floatValue = writeTodepth ? 0.5f : 0.0f; + mixedValue = false; + dataChanged = true; } - if (showDepthAlphaCutoff) { + + if (writeTodepth && !mixedValue && GetMaterialBlendMode((Material)_materialEditor.target) != eBlendMode.Opaque) { EditorGUI.BeginChangeCheck(); _materialEditor.RangeProperty(_depthAlphaCutoff, _depthAlphaCutoffText.text); dataChanged |= EditorGUI.EndChangeCheck(); @@ -528,7 +459,7 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { break; default: { - bool zWrite = HasZWriteEnabled(material); + bool zWrite = material.GetFloat("_ZWrite") > 0.0f; SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderType); } break; @@ -622,90 +553,13 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { return dataChanged; } - protected virtual bool RenderDiffuseRampProperties () { - bool dataChanged = false; - - eDiffuseRampMode rampMode = GetMaterialDiffuseRampMode((Material)_materialEditor.target); - bool mixedRampMode = false; - foreach (Material material in _materialEditor.targets) { - if (rampMode != GetMaterialDiffuseRampMode(material)) { - mixedRampMode = true; - break; - } - } - - EditorGUI.BeginChangeCheck(); - EditorGUI.showMixedValue = mixedRampMode; - EditorGUILayout.BeginHorizontal(); - - if (_diffuseRamp != null) - _materialEditor.TexturePropertySingleLine(_diffuseRampText, _diffuseRamp); - - if (EditorGUI.EndChangeCheck()) { - if (rampMode == eDiffuseRampMode.NoRampSpecified) - rampMode = eDiffuseRampMode.DefaultRampMode; - - SetDiffuseRampMode(_materialEditor, rampMode); - mixedRampMode = false; - dataChanged = true; - } - - if (_diffuseRamp != null && _diffuseRamp.textureValue != null) { - //Show drop down for ramp mode - EditorGUI.BeginChangeCheck(); - EditorGUI.showMixedValue = mixedRampMode; - rampMode = (eDiffuseRampMode)EditorGUILayout.Popup((int)rampMode, _fixedDiffuseRampModeOptions); - if (EditorGUI.EndChangeCheck()) { - SetDiffuseRampMode(_materialEditor, rampMode); - mixedRampMode = false; - dataChanged = true; - } - } - EditorGUILayout.EndHorizontal(); - - EditorGUI.showMixedValue = false; - - return dataChanged; - } - protected virtual bool RenderShadowsProperties () { - bool dataChanged = false; - EditorGUI.BeginChangeCheck(); _materialEditor.RangeProperty(_shadowAlphaCutoff, _shadowAlphaCutoffText.text); - dataChanged = EditorGUI.EndChangeCheck(); - bool areMixedShaders = false; - bool hasReceiveShadowsParameter = IsLWRPShader(_materialEditor, out areMixedShaders) || - IsURP3DShader(_materialEditor, out areMixedShaders); - - if (hasReceiveShadowsParameter) { - EditorGUI.BeginChangeCheck(); - bool mixedValue; - bool enableReceive = !IsKeywordEnabled(_materialEditor, "_RECEIVE_SHADOWS_OFF", out mixedValue); - EditorGUI.showMixedValue = mixedValue; - enableReceive = EditorGUILayout.Toggle(_receiveShadowsText, enableReceive); - - EditorGUI.showMixedValue = false; - - if (EditorGUI.EndChangeCheck()) { - SetKeyword(_materialEditor, "_RECEIVE_SHADOWS_OFF", !enableReceive); - dataChanged = true; - } - } - - return dataChanged; + return EditorGUI.EndChangeCheck(); } protected virtual bool RenderSphericalHarmonicsProperties () { - - bool areMixedShaders = false; - bool isLWRPShader = IsLWRPShader(_materialEditor, out areMixedShaders); - bool isURP3DShader = IsURP3DShader(_materialEditor, out areMixedShaders); - bool isURP2DShader = IsURP2DShader(_materialEditor, out areMixedShaders); - bool hasSHParameter = !(isLWRPShader || isURP3DShader || isURP2DShader); - if (!hasSHParameter) - return false; - EditorGUI.BeginChangeCheck(); bool mixedValue; bool enabled = IsKeywordEnabled(_materialEditor, "_SPHERICAL_HARMONICS", out mixedValue); @@ -722,13 +576,6 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { } protected virtual bool RenderFogProperties () { - - bool areMixedShaders = false; - bool isURP2DShader = IsURP2DShader(_materialEditor, out areMixedShaders); - - if (isURP2DShader && !areMixedShaders) - return false; - EditorGUI.BeginChangeCheck(); bool mixedValue; bool fog = IsKeywordEnabled(_materialEditor, "_FOG", out mixedValue); @@ -896,7 +743,6 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { SetKeyword(material, "_EMISSION", false); //Start with preMultiply alpha by default SetBlendMode(material, eBlendMode.PreMultipliedAlpha); - SetDiffuseRampMode(material, eDiffuseRampMode.DefaultRampMode); //Start with mesh normals by default SetNormalsMode(material, eNormalsMode.MeshNormals, false); if (_fixedNormal != null) @@ -909,15 +755,14 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { //Start with Culling disabled material.SetInt("_Cull", (int)eCulling.Off); //Start with Z writing disabled - if (material.HasProperty("_ZWrite")) - material.SetInt("_ZWrite", 0); + material.SetInt("_ZWrite", 0); } //Z write is on then static void SetRenderType (Material material, string renderType, bool useCustomRenderQueue) { //Want a check box to say if should use Sprite render queue (for custom writing depth and normals) - bool zWrite = HasZWriteEnabled(material); + bool zWrite = material.GetFloat("_ZWrite") > 0.0f; if (useCustomRenderQueue) { //If sprite has fixed normals then assign custom render type so we can write its correct normal with soft edges @@ -951,7 +796,7 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { eBlendMode blendMode = GetMaterialBlendMode(material); SetBlendMode(material, blendMode); - bool zWrite = HasZWriteEnabled(material); + bool zWrite = material.GetFloat("_ZWrite") > 0.0f; bool clipAlpha = zWrite && blendMode != eBlendMode.Opaque && material.GetFloat("_Cutoff") > 0.0f; SetKeyword(material, "_ALPHA_CLIP", clipAlpha); @@ -983,33 +828,6 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { m.DisableKeyword(keyword); } - static bool IsLWRPShader (MaterialEditor editor, out bool mixedValue) { - return IsShaderType(kShaderLitLW, editor, out mixedValue); - } - - static bool IsURP3DShader (MaterialEditor editor, out bool mixedValue) { - return IsShaderType(kShaderLitURP, editor, out mixedValue); - } - - static bool IsURP2DShader (MaterialEditor editor, out bool mixedValue) { - return IsShaderType(kShaderLitURP2D, editor, out mixedValue); - } - - static bool IsShaderType (string shaderType, MaterialEditor editor, out bool mixedValue) { - - mixedValue = false; - bool isAnyTargetTypeShader = false; - foreach (Material material in editor.targets) { - if (material.shader.name == shaderType) { - isAnyTargetTypeShader = true; - } - else if (isAnyTargetTypeShader) { - mixedValue = true; - } - } - return isAnyTargetTypeShader; - } - static bool IsKeywordEnabled (MaterialEditor editor, string keyword, out bool mixedValue) { bool keywordEnabled = ((Material)editor.target).IsKeywordEnabled(keyword); mixedValue = false; @@ -1025,24 +843,11 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { } static eLightMode GetMaterialLightMode (Material material) { - if (material.shader.name == kShaderPixelLit || - material.shader.name == kShaderPixelLitOutline) { + if (material.shader.name == kShaderPixelLit) { return eLightMode.PixelLit; - } - else if (material.shader.name == kShaderUnlit || - material.shader.name == kShaderUnlitOutline) { + } else if (material.shader.name == kShaderUnlit) { return eLightMode.Unlit; - } - else if (material.shader.name == kShaderLitLW) { - return eLightMode.LitLightweight; - } - else if (material.shader.name == kShaderLitURP) { - return eLightMode.LitUniversal; - } - else if (material.shader.name == kShaderLitURP2D) { - return eLightMode.LitUniversal2D; - } - else { // if (material.shader.name == kShaderVertexLit || kShaderVertexLitOutline) + } else { return eLightMode.VertexLit; } } @@ -1088,7 +893,7 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { { material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha); material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.One); - bool zWrite = HasZWriteEnabled(material); + bool zWrite = material.GetFloat("_ZWrite") > 0.0f; SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue); renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue; } @@ -1097,7 +902,7 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { { material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One); material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcColor); - bool zWrite = HasZWriteEnabled(material); + bool zWrite = material.GetFloat("_ZWrite") > 0.0f; SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue); renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue; } @@ -1106,7 +911,7 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { { material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.Zero); material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.SrcColor); - bool zWrite = HasZWriteEnabled(material); + bool zWrite = material.GetFloat("_ZWrite") > 0.0f; SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue); renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue; } @@ -1115,7 +920,7 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { { material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.DstColor); material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.SrcColor); - bool zWrite = HasZWriteEnabled(material); + bool zWrite = material.GetFloat("_ZWrite") > 0.0f; SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue); renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue; } @@ -1124,7 +929,7 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { { material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One); material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); - bool zWrite = HasZWriteEnabled(material); + bool zWrite = material.GetFloat("_ZWrite") > 0.0f; SetRenderType(material, zWrite ? "TransparentCutout" : "Transparent", useCustomRenderQueue); renderQueue = zWrite ? kAlphaTestQueue : kTransparentQueue; } @@ -1138,16 +943,15 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { static eNormalsMode GetMaterialNormalsMode (Material material) { if (material.IsKeywordEnabled("_FIXED_NORMALS_VIEWSPACE") || material.IsKeywordEnabled("_FIXED_NORMALS_VIEWSPACE_BACKFACE")) return eNormalsMode.FixedNormalsViewSpace; - if (material.IsKeywordEnabled("_FIXED_NORMALS_WORLDSPACE")) - return eNormalsMode.FixedNormalsWorldSpace; if (material.IsKeywordEnabled("_FIXED_NORMALS_MODELSPACE") || material.IsKeywordEnabled("_FIXED_NORMALS_MODELSPACE_BACKFACE")) return eNormalsMode.FixedNormalsModelSpace; return eNormalsMode.MeshNormals; } - static void SetNormalsMode (MaterialEditor materialEditor, eNormalsMode normalsMode, bool allowBackFaceRendering) { + SetNormalsMode((Material)materialEditor.target, normalsMode, allowBackFaceRendering); + foreach (Material material in materialEditor.targets) { SetNormalsMode(material, normalsMode, allowBackFaceRendering); } @@ -1156,7 +960,6 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { static void SetNormalsMode (Material material, eNormalsMode normalsMode, bool allowBackFaceRendering) { SetKeyword(material, "_FIXED_NORMALS_VIEWSPACE", normalsMode == eNormalsMode.FixedNormalsViewSpace && !allowBackFaceRendering); SetKeyword(material, "_FIXED_NORMALS_VIEWSPACE_BACKFACE", normalsMode == eNormalsMode.FixedNormalsViewSpace && allowBackFaceRendering); - SetKeyword(material, "_FIXED_NORMALS_WORLDSPACE", normalsMode == eNormalsMode.FixedNormalsWorldSpace); SetKeyword(material, "_FIXED_NORMALS_MODELSPACE", normalsMode == eNormalsMode.FixedNormalsModelSpace && !allowBackFaceRendering); SetKeyword(material, "_FIXED_NORMALS_MODELSPACE_BACKFACE", normalsMode == eNormalsMode.FixedNormalsModelSpace && allowBackFaceRendering); } @@ -1165,37 +968,5 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI { return material.IsKeywordEnabled("_FIXED_NORMALS_VIEWSPACE_BACKFACE") || material.IsKeywordEnabled("_FIXED_NORMALS_MODELSPACE_BACKFACE"); } - static eDiffuseRampMode GetMaterialDiffuseRampMode (Material material) { - if (material.IsKeywordEnabled("_FULLRANGE_HARD_RAMP")) - return eDiffuseRampMode.FullRangeHard; - if (material.IsKeywordEnabled("_FULLRANGE_SOFT_RAMP")) - return eDiffuseRampMode.FullRangeSoft; - if (material.IsKeywordEnabled("_OLD_HARD_RAMP")) - return eDiffuseRampMode.OldHard; - if (material.IsKeywordEnabled("_OLD_SOFT_RAMP")) - return eDiffuseRampMode.OldSoft; - - return eDiffuseRampMode.NoRampSpecified; - } - - static void SetDiffuseRampMode (MaterialEditor materialEditor, eDiffuseRampMode rampMode) { - foreach (Material material in materialEditor.targets) { - SetDiffuseRampMode(material, rampMode); - } - } - - static void SetDiffuseRampMode (Material material, eDiffuseRampMode rampMode) { - SetKeyword(material, "_FULLRANGE_HARD_RAMP", rampMode == eDiffuseRampMode.FullRangeHard); - SetKeyword(material, "_FULLRANGE_SOFT_RAMP", rampMode == eDiffuseRampMode.FullRangeSoft); - SetKeyword(material, "_OLD_HARD_RAMP", rampMode == eDiffuseRampMode.OldHard); - SetKeyword(material, "_OLD_SOFT_RAMP", rampMode == eDiffuseRampMode.OldSoft); - } - - static bool HasZWriteEnabled (Material material) { - if (material.HasProperty("_ZWrite")) { - return material.GetFloat("_ZWrite") > 0.0f; - } - else return true; // Pixel Lit shader always has _ZWrite enabled. - } #endregion } diff --git a/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineSpriteShaderGUI.cs.meta b/Assets/Spine/Editor/spine-unity/Modules/Shaders/Sprite/Editor/SpineSpriteShaderGUI.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineSpriteShaderGUI.cs.meta rename to Assets/Spine/Editor/spine-unity/Modules/Shaders/Sprite/Editor/SpineSpriteShaderGUI.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic.meta b/Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic.meta similarity index 67% rename from Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic.meta rename to Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic.meta index 230f17094..9e6f04cda 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic.meta +++ b/Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 6e8ed065898e65f4d9303492725fb912 +guid: 7a4120eda5e72634b8ea086a00778669 folderAsset: yes -timeCreated: 1573829873 +timeCreated: 1527569450 licenseType: Free DefaultImporter: userData: diff --git a/Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor.meta b/Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor.meta new file mode 100644 index 000000000..12c3774fd --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 78bba472871bc624f8930d51dea6dd3d +folderAsset: yes +timeCreated: 1455570938 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerGraphicInspector.cs b/Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor/BoneFollowerGraphicInspector.cs similarity index 79% rename from Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerGraphicInspector.cs rename to Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor/BoneFollowerGraphicInspector.cs index 1603385f6..6379b5dbb 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerGraphicInspector.cs +++ b/Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor/BoneFollowerGraphicInspector.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEngine; @@ -38,9 +38,8 @@ namespace Spine.Unity.Editor { [CustomEditor(typeof(BoneFollowerGraphic)), CanEditMultipleObjects] public class BoneFollowerGraphicInspector : Editor { - - SerializedProperty boneName, skeletonGraphic, followXYPosition, followZPosition, followBoneRotation, - followLocalScale, followSkeletonFlip, maintainedAxisOrientation; + + SerializedProperty boneName, skeletonGraphic, followZPosition, followBoneRotation, followLocalScale, followSkeletonFlip; BoneFollowerGraphic targetBoneFollower; bool needsReset; @@ -48,7 +47,7 @@ namespace Spine.Unity.Editor { [MenuItem ("CONTEXT/SkeletonGraphic/Add BoneFollower GameObject")] static void AddBoneFollowerGameObject (MenuCommand cmd) { var skeletonGraphic = cmd.context as SkeletonGraphic; - var go = EditorInstantiation.NewGameObject("BoneFollower", true, typeof(RectTransform)); + var go = SpineEditorUtilities.EditorInstantiation.NewGameObject("BoneFollower", typeof(RectTransform)); var t = go.transform; t.SetParent(skeletonGraphic.transform); t.localPosition = Vector3.zero; @@ -74,11 +73,9 @@ namespace Spine.Unity.Editor { skeletonGraphic = serializedObject.FindProperty("skeletonGraphic"); boneName = serializedObject.FindProperty("boneName"); followBoneRotation = serializedObject.FindProperty("followBoneRotation"); - followXYPosition = serializedObject.FindProperty("followXYPosition"); followZPosition = serializedObject.FindProperty("followZPosition"); followLocalScale = serializedObject.FindProperty("followLocalScale"); followSkeletonFlip = serializedObject.FindProperty("followSkeletonFlip"); - maintainedAxisOrientation = serializedObject.FindProperty("maintainedAxisOrientation"); targetBoneFollower = (BoneFollowerGraphic)target; if (targetBoneFollower.SkeletonGraphic != null) @@ -109,7 +106,7 @@ namespace Spine.Unity.Editor { } else { var targetBone = tbf.bone; if (targetBone == null) return; - + SpineHandles.DrawBoneWireframe(transform, targetBone, SpineHandles.TransformContraintColor, positionScale); Handles.Label(targetBone.GetWorldPosition(transform, positionScale), targetBone.Data.Name, SpineHandles.BoneNameStyle); } @@ -169,21 +166,15 @@ namespace Spine.Unity.Editor { needsReset |= EditorGUI.EndChangeCheck(); EditorGUILayout.PropertyField(followBoneRotation); - EditorGUILayout.PropertyField(followXYPosition); EditorGUILayout.PropertyField(followZPosition); EditorGUILayout.PropertyField(followLocalScale); EditorGUILayout.PropertyField(followSkeletonFlip); - if ((followSkeletonFlip.hasMultipleDifferentValues || followSkeletonFlip.boolValue == false) && - (followBoneRotation.hasMultipleDifferentValues || followBoneRotation.boolValue == true)) { - using (new SpineInspectorUtility.IndentScope()) - EditorGUILayout.PropertyField(maintainedAxisOrientation); - } //BoneFollowerInspector.RecommendRigidbodyButton(targetBoneFollower); } else { var boneFollowerSkeletonGraphic = targetBoneFollower.skeletonGraphic; if (boneFollowerSkeletonGraphic == null) { - EditorGUILayout.HelpBox("SkeletonGraphic is unassigned. Please assign a SkeletonRenderer (SkeletonAnimation or SkeletonMecanim).", MessageType.Warning); + EditorGUILayout.HelpBox("SkeletonGraphic is unassigned. Please assign a SkeletonRenderer (SkeletonAnimation or SkeletonAnimator).", MessageType.Warning); } else { boneFollowerSkeletonGraphic.Initialize(false); diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerGraphicInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor/BoneFollowerGraphicInspector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Components/BoneFollowerGraphicInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor/BoneFollowerGraphicInspector.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor/SkeletonGraphicInspector.cs b/Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor/SkeletonGraphicInspector.cs new file mode 100644 index 000000000..7bf82f760 --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor/SkeletonGraphicInspector.cs @@ -0,0 +1,229 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +using UnityEngine; +using UnityEditor; +using Spine; + +namespace Spine.Unity.Editor { + + [InitializeOnLoad] + [CustomEditor(typeof(SkeletonGraphic))] + [CanEditMultipleObjects] + public class SkeletonGraphicInspector : UnityEditor.Editor { + SerializedProperty material, color; + SerializedProperty skeletonDataAsset, initialSkinName; + SerializedProperty startingAnimation, startingLoop, timeScale, freeze, unscaledTime, tintBlack; + SerializedProperty initialFlipX, initialFlipY; + SerializedProperty meshGeneratorSettings; + SerializedProperty raycastTarget; + + SkeletonGraphic thisSkeletonGraphic; + + void OnEnable () { + var so = this.serializedObject; + thisSkeletonGraphic = target as SkeletonGraphic; + + // MaskableGraphic + material = so.FindProperty("m_Material"); + color = so.FindProperty("m_Color"); + raycastTarget = so.FindProperty("m_RaycastTarget"); + + // SkeletonRenderer + skeletonDataAsset = so.FindProperty("skeletonDataAsset"); + initialSkinName = so.FindProperty("initialSkinName"); + + initialFlipX = so.FindProperty("initialFlipX"); + initialFlipY = so.FindProperty("initialFlipY"); + + // SkeletonAnimation + startingAnimation = so.FindProperty("startingAnimation"); + startingLoop = so.FindProperty("startingLoop"); + timeScale = so.FindProperty("timeScale"); + unscaledTime = so.FindProperty("unscaledTime"); + freeze = so.FindProperty("freeze"); + + meshGeneratorSettings = so.FindProperty("meshGenerator").FindPropertyRelative("settings"); + meshGeneratorSettings.isExpanded = SkeletonRendererInspector.advancedFoldout; + } + + public override void OnInspectorGUI () { + EditorGUI.BeginChangeCheck(); + + EditorGUILayout.PropertyField(skeletonDataAsset); + EditorGUILayout.PropertyField(material); + EditorGUILayout.PropertyField(color); + + if (thisSkeletonGraphic.skeletonDataAsset == null) { + EditorGUILayout.HelpBox("You need to assign a SkeletonDataAsset first.", MessageType.Info); + serializedObject.ApplyModifiedProperties(); + serializedObject.Update(); + return; + } + using (new SpineInspectorUtility.BoxScope()) { + EditorGUILayout.PropertyField(meshGeneratorSettings, SpineInspectorUtility.TempContent("Advanced..."), includeChildren: true); + SkeletonRendererInspector.advancedFoldout = meshGeneratorSettings.isExpanded; + } + + EditorGUILayout.Space(); + EditorGUILayout.PropertyField(initialSkinName); + { + var rect = GUILayoutUtility.GetRect(EditorGUIUtility.currentViewWidth, EditorGUIUtility.singleLineHeight); + EditorGUI.PrefixLabel(rect, SpineInspectorUtility.TempContent("Initial Flip")); + rect.x += EditorGUIUtility.labelWidth; + rect.width = 30f; + SpineInspectorUtility.ToggleLeft(rect, initialFlipX, SpineInspectorUtility.TempContent("X", tooltip: "initialFlipX")); + rect.x += 35f; + SpineInspectorUtility.ToggleLeft(rect, initialFlipY, SpineInspectorUtility.TempContent("Y", tooltip: "initialFlipY")); + } + + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Animation", EditorStyles.boldLabel); + EditorGUILayout.PropertyField(startingAnimation); + EditorGUILayout.PropertyField(startingLoop); + EditorGUILayout.PropertyField(timeScale); + EditorGUILayout.PropertyField(unscaledTime, SpineInspectorUtility.TempContent(unscaledTime.displayName, tooltip: "If checked, this will use Time.unscaledDeltaTime to make this update independent of game Time.timeScale. Instance SkeletonGraphic.timeScale will still be applied.")); + EditorGUILayout.Space(); + EditorGUILayout.PropertyField(freeze); + EditorGUILayout.Space(); + EditorGUILayout.LabelField("UI", EditorStyles.boldLabel); + EditorGUILayout.PropertyField(raycastTarget); + + bool wasChanged = EditorGUI.EndChangeCheck(); + + if (wasChanged) + serializedObject.ApplyModifiedProperties(); + } + + #region Menus + [MenuItem("CONTEXT/SkeletonGraphic/Match RectTransform with Mesh Bounds")] + static void MatchRectTransformWithBounds (MenuCommand command) { + var skeletonGraphic = (SkeletonGraphic)command.context; + Mesh mesh = skeletonGraphic.GetLastMesh(); + if (mesh == null) { + Debug.Log("Mesh was not previously generated."); + return; + } + + if (mesh.vertexCount == 0) { + skeletonGraphic.rectTransform.sizeDelta = new Vector2(50f, 50f); + skeletonGraphic.rectTransform.pivot = new Vector2(0.5f, 0.5f); + return; + } + + mesh.RecalculateBounds(); + var bounds = mesh.bounds; + var size = bounds.size; + var center = bounds.center; + var p = new Vector2( + 0.5f - (center.x / size.x), + 0.5f - (center.y / size.y) + ); + + skeletonGraphic.rectTransform.sizeDelta = size; + skeletonGraphic.rectTransform.pivot = p; + } + + [MenuItem("GameObject/Spine/SkeletonGraphic (UnityUI)", false, 15)] + static public void SkeletonGraphicCreateMenuItem () { + var parentGameObject = Selection.activeObject as GameObject; + var parentTransform = parentGameObject == null ? null : parentGameObject.GetComponent(); + + if (parentTransform == null) + Debug.LogWarning("Your new SkeletonGraphic will not be visible until it is placed under a Canvas"); + + var gameObject = NewSkeletonGraphicGameObject("New SkeletonGraphic"); + gameObject.transform.SetParent(parentTransform, false); + EditorUtility.FocusProjectWindow(); + Selection.activeObject = gameObject; + EditorGUIUtility.PingObject(Selection.activeObject); + } + + // SpineEditorUtilities.InstantiateDelegate. Used by drag and drop. + public static Component SpawnSkeletonGraphicFromDrop (SkeletonDataAsset data) { + return InstantiateSkeletonGraphic(data); + } + + public static SkeletonGraphic InstantiateSkeletonGraphic (SkeletonDataAsset skeletonDataAsset, string skinName) { + return InstantiateSkeletonGraphic(skeletonDataAsset, skeletonDataAsset.GetSkeletonData(true).FindSkin(skinName)); + } + + public static SkeletonGraphic InstantiateSkeletonGraphic (SkeletonDataAsset skeletonDataAsset, Skin skin = null) { + string spineGameObjectName = string.Format("SkeletonGraphic ({0})", skeletonDataAsset.name.Replace("_SkeletonData", "")); + var go = NewSkeletonGraphicGameObject(spineGameObjectName); + var graphic = go.GetComponent(); + graphic.skeletonDataAsset = skeletonDataAsset; + + SkeletonData data = skeletonDataAsset.GetSkeletonData(true); + + if (data == null) { + for (int i = 0; i < skeletonDataAsset.atlasAssets.Length; i++) { + string reloadAtlasPath = AssetDatabase.GetAssetPath(skeletonDataAsset.atlasAssets[i]); + skeletonDataAsset.atlasAssets[i] = (AtlasAssetBase)AssetDatabase.LoadAssetAtPath(reloadAtlasPath, typeof(AtlasAssetBase)); + } + + data = skeletonDataAsset.GetSkeletonData(true); + } + + skin = skin ?? data.DefaultSkin ?? data.Skins.Items[0]; + graphic.MeshGenerator.settings.zSpacing = SpineEditorUtilities.Preferences.defaultZSpacing; + + graphic.startingLoop = SpineEditorUtilities.Preferences.defaultInstantiateLoop; + graphic.Initialize(false); + if (skin != null) graphic.Skeleton.SetSkin(skin); + graphic.initialSkinName = skin.Name; + graphic.Skeleton.UpdateWorldTransform(); + graphic.UpdateMesh(); + + return graphic; + } + + static GameObject NewSkeletonGraphicGameObject (string gameObjectName) { + var go = SpineEditorUtilities.EditorInstantiation.NewGameObject(gameObjectName, typeof(RectTransform), typeof(CanvasRenderer), typeof(SkeletonGraphic)); + var graphic = go.GetComponent(); + graphic.material = SkeletonGraphicInspector.DefaultSkeletonGraphicMaterial; + return go; + } + + public static Material DefaultSkeletonGraphicMaterial { + get { + var guids = AssetDatabase.FindAssets("SkeletonGraphicDefault t:material"); + if (guids.Length <= 0) return null; + + var firstAssetPath = AssetDatabase.GUIDToAssetPath(guids[0]); + if (string.IsNullOrEmpty(firstAssetPath)) return null; + + var firstMaterial = AssetDatabase.LoadAssetAtPath(firstAssetPath); + return firstMaterial; + } + } + + #endregion + } +} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicInspector.cs.meta b/Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor/SkeletonGraphicInspector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor/SkeletonGraphicInspector.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Modules/SkeletonRenderSeparator/Editor/SkeletonPartsRendererInspector.cs b/Assets/Spine/Editor/spine-unity/Modules/SkeletonRenderSeparator/Editor/SkeletonPartsRendererInspector.cs index 79d4d9e45..296039650 100644 --- a/Assets/Spine/Editor/spine-unity/Modules/SkeletonRenderSeparator/Editor/SkeletonPartsRendererInspector.cs +++ b/Assets/Spine/Editor/spine-unity/Modules/SkeletonRenderSeparator/Editor/SkeletonPartsRendererInspector.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,28 +15,28 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEngine; using UnityEditor; using Spine.Unity.Editor; -namespace Spine.Unity.Examples { +namespace Spine.Unity.Modules { [CustomEditor(typeof(SkeletonPartsRenderer))] public class SkeletonRenderPartInspector : UnityEditor.Editor { SpineInspectorUtility.SerializedSortingProperties sortingProperties; - void OnEnable () { + void OnEnable () { sortingProperties = new SpineInspectorUtility.SerializedSortingProperties(SpineInspectorUtility.GetRenderersSerializedObject(serializedObject)); } diff --git a/Assets/Spine/Editor/spine-unity/Modules/SkeletonRenderSeparator/Editor/SkeletonRenderSeparatorInspector.cs b/Assets/Spine/Editor/spine-unity/Modules/SkeletonRenderSeparator/Editor/SkeletonRenderSeparatorInspector.cs index 19712597c..49988a155 100644 --- a/Assets/Spine/Editor/spine-unity/Modules/SkeletonRenderSeparator/Editor/SkeletonRenderSeparatorInspector.cs +++ b/Assets/Spine/Editor/spine-unity/Modules/SkeletonRenderSeparator/Editor/SkeletonRenderSeparatorInspector.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,22 +15,18 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER -#define NEW_PREFAB_SYSTEM -#endif - using UnityEngine; using UnityEditor; @@ -39,8 +35,8 @@ using System.Collections.Generic; using Spine.Unity; using Spine.Unity.Editor; -namespace Spine.Unity.Examples { - +namespace Spine.Unity.Modules { + [CustomEditor(typeof(SkeletonRenderSeparator))] public class SkeletonRenderSeparatorInspector : UnityEditor.Editor { SkeletonRenderSeparator component; @@ -85,18 +81,7 @@ namespace Spine.Unity.Examples { // Restore mesh part for undo logic after undo of "Add Parts Renderer". // Triggers regeneration and assignment of the mesh filter's mesh. - - bool isMeshFilterAlwaysNull = false; - #if UNITY_EDITOR && NEW_PREFAB_SYSTEM - // Don't store mesh or material at the prefab, otherwise it will permanently reload - var prefabType = UnityEditor.PrefabUtility.GetPrefabAssetType(component); - if (UnityEditor.PrefabUtility.IsPartOfPrefabAsset(component) && - (prefabType == UnityEditor.PrefabAssetType.Regular || prefabType == UnityEditor.PrefabAssetType.Variant)) { - isMeshFilterAlwaysNull = true; - } - #endif - - if (!isMeshFilterAlwaysNull && component.GetComponent() && component.GetComponent().sharedMesh == null) { + if (component.GetComponent() && component.GetComponent().sharedMesh == null) { component.OnDisable(); component.OnEnable(); } @@ -145,7 +130,7 @@ namespace Spine.Unity.Examples { separatorNamesProp.isExpanded = true; } } - + if (separatorNamesProp != null) { if (skeletonRendererExpanded) { EditorGUI.indentLevel++; @@ -167,7 +152,7 @@ namespace Spine.Unity.Examples { if (!Application.isPlaying) slotsReapplyRequired = true; } - + totalParts = separatorCount + 1; var counterStyle = skeletonRendererExpanded ? EditorStyles.label : EditorStyles.miniLabel; @@ -197,14 +182,14 @@ namespace Spine.Unity.Examples { if (component.enabled && component.SkeletonRenderer != null && extraRenderersNeeded > 0) { EditorGUILayout.HelpBox(string.Format("Insufficient parts renderers. Some parts will not be rendered."), MessageType.Warning); string addMissingLabel = string.Format("Add the missing renderer{1} ({0}) ", extraRenderersNeeded, SpineInspectorUtility.PluralThenS(extraRenderersNeeded)); - if (GUILayout.Button(addMissingLabel, GUILayout.Height(30f))) { + if (GUILayout.Button(addMissingLabel, GUILayout.Height(40f))) { AddPartsRenderer(extraRenderersNeeded); DetectOrphanedPartsRenderers(component); partsRendererInitRequired = true; } } } - + if (partsRenderers_.isExpanded != partsRenderersExpanded) partsRenderersExpanded = partsRenderers_.isExpanded; if (partsRenderers_.isExpanded) { using (new EditorGUILayout.HorizontalScope()) { @@ -213,7 +198,7 @@ namespace Spine.Unity.Examples { if (GUILayout.Button("Clear Parts Renderers")) { // Do you really want to destroy all? Undo.RegisterCompleteObjectUndo(component, "Clear Parts Renderers"); - if (EditorUtility.DisplayDialog("Destroy Renderers", "Do you really want to destroy all the Parts Renderer GameObjects in the list?", "Destroy", "Cancel")) { + if (EditorUtility.DisplayDialog("Destroy Renderers", "Do you really want to destroy all the Parts Renderer GameObjects in the list?", "Destroy", "Cancel")) { foreach (var r in componentRenderers) { if (r != null) Undo.DestroyObjectImmediate(r.gameObject); diff --git a/Assets/Spine/Editor/spine-unity/Modules/SlotBlendModes/Editor/SlotBlendModesEditor.cs b/Assets/Spine/Editor/spine-unity/Modules/SlotBlendModes/Editor/SlotBlendModesEditor.cs index 889995202..2d0dfa4d8 100644 --- a/Assets/Spine/Editor/spine-unity/Modules/SlotBlendModes/Editor/SlotBlendModesEditor.cs +++ b/Assets/Spine/Editor/spine-unity/Modules/SlotBlendModes/Editor/SlotBlendModesEditor.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,29 +15,27 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEngine; using UnityEditor; -using Spine.Unity.Deprecated; -using System; +using Spine.Unity.Modules; namespace Spine.Unity.Editor { using Editor = UnityEditor.Editor; - [Obsolete("The spine-unity 3.7 runtime introduced SkeletonDataModifierAssets BlendModeMaterials which replaced SlotBlendModes. Will be removed in spine-unity 3.9.", false)] public class SlotBlendModesEditor : Editor { - + [MenuItem("CONTEXT/SkeletonRenderer/Add Slot Blend Modes Component")] static void AddSlotBlendModesComponent (MenuCommand command) { var skeletonRenderer = (SkeletonRenderer)command.context; diff --git a/Assets/Spine/Editor/spine-unity/Modules/Timeline.meta b/Assets/Spine/Editor/spine-unity/Modules/Timeline.meta new file mode 100644 index 000000000..6c6b7ad4c --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Modules/Timeline.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b7ef9595ebe8c204a8a4f251a55d4d22 +folderAsset: yes +timeCreated: 1527569508 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor.meta b/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor.meta new file mode 100644 index 000000000..2198595bc --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3cdbaf8cb2e511f4fa3b631af94fa18e +folderAsset: yes +timeCreated: 1527569538 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineAnimationStateDrawer.cs b/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineAnimationStateDrawer.cs new file mode 100644 index 000000000..7b8ce4453 --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineAnimationStateDrawer.cs @@ -0,0 +1,78 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +using UnityEditor; +using UnityEngine; +using Spine; +using Spine.Unity; +using Spine.Unity.Playables; + +//[CustomPropertyDrawer(typeof(SpineAnimationStateBehaviour))] +public class SpineAnimationStateDrawer : PropertyDrawer { + /* + public override float GetPropertyHeight (SerializedProperty property, GUIContent label) { + const int fieldCount = 8; + return fieldCount * EditorGUIUtility.singleLineHeight; + } + + public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) { + SerializedProperty skeletonDataAssetProp = property.FindPropertyRelative("skeletonDataAsset"); + SerializedProperty animationNameProp = property.FindPropertyRelative("animationName"); + SerializedProperty loopProp = property.FindPropertyRelative("loop"); + SerializedProperty eventProp = property.FindPropertyRelative("eventThreshold"); + SerializedProperty attachmentProp = property.FindPropertyRelative("attachmentThreshold"); + SerializedProperty drawOrderProp = property.FindPropertyRelative("drawOrderThreshold"); + + Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight); + EditorGUI.PropertyField(singleFieldRect, skeletonDataAssetProp); + + float lineHeightWithSpacing = EditorGUIUtility.singleLineHeight + 2f; + + singleFieldRect.y += lineHeightWithSpacing; + EditorGUI.PropertyField(singleFieldRect, animationNameProp); + + singleFieldRect.y += lineHeightWithSpacing; + EditorGUI.PropertyField(singleFieldRect, loopProp); + + singleFieldRect.y += lineHeightWithSpacing * 0.5f; + + singleFieldRect.y += lineHeightWithSpacing; + EditorGUI.LabelField(singleFieldRect, "Mixing Settings", EditorStyles.boldLabel); + + singleFieldRect.y += lineHeightWithSpacing; + EditorGUI.PropertyField(singleFieldRect, eventProp); + + singleFieldRect.y += lineHeightWithSpacing; + EditorGUI.PropertyField(singleFieldRect, attachmentProp); + + singleFieldRect.y += lineHeightWithSpacing; + EditorGUI.PropertyField(singleFieldRect, drawOrderProp); + } + */ +} diff --git a/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineAnimationStateDrawer.cs.meta b/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineAnimationStateDrawer.cs.meta new file mode 100644 index 000000000..fddb862c1 --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineAnimationStateDrawer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: cba97e3d11d6d4d428fcfe1a7be16db0 +timeCreated: 1510816616 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineSkeletonFlipDrawer.cs b/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineSkeletonFlipDrawer.cs new file mode 100644 index 000000000..398a8b213 --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineSkeletonFlipDrawer.cs @@ -0,0 +1,56 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED) +using UnityEditor; +using UnityEngine; +using UnityEngine.Playables; + +[CustomPropertyDrawer(typeof(SpineSkeletonFlipBehaviour))] +public class SpineSkeletonFlipDrawer : PropertyDrawer +{ + public override float GetPropertyHeight (SerializedProperty property, GUIContent label) + { + int fieldCount = 1; + return fieldCount * EditorGUIUtility.singleLineHeight; + } + + public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) + { + SerializedProperty flipXProp = property.FindPropertyRelative("flipX"); + SerializedProperty flipYProp = property.FindPropertyRelative("flipY"); + + Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight); + EditorGUI.PropertyField(singleFieldRect, flipXProp); + + singleFieldRect.y += EditorGUIUtility.singleLineHeight; + EditorGUI.PropertyField(singleFieldRect, flipYProp); + } +} +#endif \ No newline at end of file diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/BuildSettings.cs.meta b/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineSkeletonFlipDrawer.cs.meta similarity index 76% rename from Assets/Spine/Editor/spine-unity/Editor/Utility/BuildSettings.cs.meta rename to Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineSkeletonFlipDrawer.cs.meta index 871001340..d7949d202 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/BuildSettings.cs.meta +++ b/Assets/Spine/Editor/spine-unity/Modules/Timeline/Editor/SpineSkeletonFlipDrawer.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 80767dcb23931c645ad70c88670ddeb6 -timeCreated: 1563313275 +guid: b8a0a5d3de45a5e48ae96aa414860d3c +timeCreated: 1500876411 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/Spine/Editor/spine-unity/SkeletonUtility.meta b/Assets/Spine/Editor/spine-unity/SkeletonUtility.meta new file mode 100644 index 000000000..66e5d621e --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/SkeletonUtility.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 88e9a484884f9cb498c122a17ea0b4e5 +folderAsset: yes +timeCreated: 1527569561 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor.meta b/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor.meta new file mode 100644 index 000000000..386e1e90b --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: a751a9d1e3e26d64d997b66a781df8e9 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityBoneInspector.cs b/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityBoneInspector.cs new file mode 100644 index 000000000..9877985fa --- /dev/null +++ b/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityBoneInspector.cs @@ -0,0 +1,374 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +// Contributed by: Mitch Thompson + +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; +using Spine; + +namespace Spine.Unity.Editor { + using Icons = SpineEditorUtilities.Icons; + + [CustomEditor(typeof(SkeletonUtilityBone)), CanEditMultipleObjects] + public class SkeletonUtilityBoneInspector : UnityEditor.Editor { + SerializedProperty mode, boneName, zPosition, position, rotation, scale, overrideAlpha, parentReference; + + //multi selected flags + bool containsFollows, containsOverrides, multiObject; + + //single selected helpers + SkeletonUtilityBone utilityBone; + SkeletonUtility skeletonUtility; + bool canCreateHingeChain = false; + + Dictionary> boundingBoxTable = new Dictionary>(); + + void OnEnable () { + mode = this.serializedObject.FindProperty("mode"); + boneName = this.serializedObject.FindProperty("boneName"); + zPosition = this.serializedObject.FindProperty("zPosition"); + position = this.serializedObject.FindProperty("position"); + rotation = this.serializedObject.FindProperty("rotation"); + scale = this.serializedObject.FindProperty("scale"); + overrideAlpha = this.serializedObject.FindProperty("overrideAlpha"); + parentReference = this.serializedObject.FindProperty("parentReference"); + EvaluateFlags(); + + if (!utilityBone.valid && skeletonUtility != null && skeletonUtility.skeletonRenderer != null) + skeletonUtility.skeletonRenderer.Initialize(false); + + canCreateHingeChain = CanCreateHingeChain(); + boundingBoxTable.Clear(); + + if (multiObject) return; + if (utilityBone.bone == null) return; + + var skeleton = utilityBone.bone.Skeleton; + int slotCount = skeleton.Slots.Count; + Skin skin = skeleton.Skin; + if (skeleton.Skin == null) + skin = skeleton.Data.DefaultSkin; + + for(int i = 0; i < slotCount; i++){ + Slot slot = skeletonUtility.skeletonRenderer.skeleton.Slots.Items[i]; + if (slot.Bone == utilityBone.bone) { + var slotAttachments = new List(); + skin.FindAttachmentsForSlot(skeleton.FindSlotIndex(slot.Data.Name), slotAttachments); + var boundingBoxes = new List(); + foreach (var att in slotAttachments) { + var boundingBoxAttachment = att as BoundingBoxAttachment; + if (boundingBoxAttachment != null) + boundingBoxes.Add(boundingBoxAttachment); + } + + if (boundingBoxes.Count > 0) + boundingBoxTable.Add(slot, boundingBoxes); + } + } + + } + + void EvaluateFlags () { + utilityBone = (SkeletonUtilityBone)target; + skeletonUtility = utilityBone.hierarchy; + + if (Selection.objects.Length == 1) { + containsFollows = utilityBone.mode == SkeletonUtilityBone.Mode.Follow; + containsOverrides = utilityBone.mode == SkeletonUtilityBone.Mode.Override; + } else { + int boneCount = 0; + foreach (Object o in Selection.objects) { + var go = o as GameObject; + if (go != null) { + SkeletonUtilityBone sub = go.GetComponent(); + if (sub != null) { + boneCount++; + containsFollows |= (sub.mode == SkeletonUtilityBone.Mode.Follow); + containsOverrides |= (sub.mode == SkeletonUtilityBone.Mode.Override); + } + } + } + + multiObject |= (boneCount > 1); + } + } + + public override void OnInspectorGUI () { + serializedObject.Update(); + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(mode); + if (EditorGUI.EndChangeCheck()) { + containsOverrides = mode.enumValueIndex == 1; + containsFollows = mode.enumValueIndex == 0; + } + + using (new EditorGUI.DisabledGroupScope(multiObject)) { + string str = boneName.stringValue; + if (str == "") + str = ""; + if (multiObject) + str = ""; + + using (new GUILayout.HorizontalScope()) { + EditorGUILayout.PrefixLabel("Bone"); + if (GUILayout.Button(str, EditorStyles.popup)) { + BoneSelectorContextMenu(str, ((SkeletonUtilityBone)target).hierarchy.skeletonRenderer.skeleton.Bones, "", TargetBoneSelected); + } + } + } + + EditorGUILayout.PropertyField(zPosition); + EditorGUILayout.PropertyField(position); + EditorGUILayout.PropertyField(rotation); + EditorGUILayout.PropertyField(scale); + + using (new EditorGUI.DisabledGroupScope(containsFollows)) { + EditorGUILayout.PropertyField(overrideAlpha); + EditorGUILayout.PropertyField(parentReference); + } + + EditorGUILayout.Space(); + + using (new GUILayout.HorizontalScope()) { + EditorGUILayout.Space(); + using (new EditorGUI.DisabledGroupScope(multiObject || !utilityBone.valid || utilityBone.bone == null || utilityBone.bone.Children.Count == 0)) { + if (GUILayout.Button(SpineInspectorUtility.TempContent("Add Child Bone", Icons.bone), GUILayout.MinWidth(120), GUILayout.Height(24))) + BoneSelectorContextMenu("", utilityBone.bone.Children, "", SpawnChildBoneSelected); + } + using (new EditorGUI.DisabledGroupScope(multiObject || !utilityBone.valid || utilityBone.bone == null || containsOverrides)) { + if (GUILayout.Button(SpineInspectorUtility.TempContent("Add Override", Icons.poseBones), GUILayout.MinWidth(120), GUILayout.Height(24))) + SpawnOverride(); + } + EditorGUILayout.Space(); + } + EditorGUILayout.Space(); + using (new GUILayout.HorizontalScope()) { + EditorGUILayout.Space(); + using (new EditorGUI.DisabledGroupScope(multiObject || !utilityBone.valid || !canCreateHingeChain)) { + if (GUILayout.Button(SpineInspectorUtility.TempContent("Create 3D Hinge Chain", Icons.hingeChain), GUILayout.MinWidth(120), GUILayout.Height(24))) + CreateHingeChain(); + if (GUILayout.Button(SpineInspectorUtility.TempContent("Create 2D Hinge Chain", Icons.hingeChain), GUILayout.MinWidth(120), GUILayout.Height(24))) + CreateHingeChain2D(); + } + EditorGUILayout.Space(); + } + + using (new EditorGUI.DisabledGroupScope(multiObject || boundingBoxTable.Count == 0)) { + EditorGUILayout.LabelField(SpineInspectorUtility.TempContent("Bounding Boxes", Icons.boundingBox), EditorStyles.boldLabel); + + foreach (var entry in boundingBoxTable){ + Slot slot = entry.Key; + var boundingBoxes = entry.Value; + + EditorGUI.indentLevel++; + EditorGUILayout.LabelField(slot.Data.Name); + EditorGUI.indentLevel++; + { + foreach (var box in boundingBoxes) { + using (new GUILayout.HorizontalScope()) { + GUILayout.Space(30); + string buttonLabel = box.IsWeighted() ? box.Name + " (!)" : box.Name; + if (GUILayout.Button(buttonLabel, GUILayout.Width(200))) { + utilityBone.bone.Skeleton.UpdateWorldTransform(); + var bbTransform = utilityBone.transform.Find("[BoundingBox]" + box.Name); // Use FindChild in older versions of Unity. + if (bbTransform != null) { + var originalCollider = bbTransform.GetComponent(); + if (originalCollider != null) + SkeletonUtility.SetColliderPointsLocal(originalCollider, slot, box); + else + SkeletonUtility.AddBoundingBoxAsComponent(box, slot, bbTransform.gameObject); + } else { + var newPolygonCollider = SkeletonUtility.AddBoundingBoxGameObject(null, box, slot, utilityBone.transform); + bbTransform = newPolygonCollider.transform; + } + EditorGUIUtility.PingObject(bbTransform); + } + } + + } + } + EditorGUI.indentLevel--; + EditorGUI.indentLevel--; + } + } + + BoneFollowerInspector.RecommendRigidbodyButton(utilityBone); + + serializedObject.ApplyModifiedProperties(); + } + + static void BoneSelectorContextMenu (string current, ExposedList bones, string topValue, GenericMenu.MenuFunction2 callback) { + var menu = new GenericMenu(); + + if (topValue != "") + menu.AddItem(new GUIContent(topValue), current == topValue, callback, null); + + for (int i = 0; i < bones.Count; i++) + menu.AddItem(new GUIContent(bones.Items[i].Data.Name), bones.Items[i].Data.Name == current, callback, bones.Items[i]); + + menu.ShowAsContext(); + } + + void TargetBoneSelected (object obj) { + if (obj == null) { + boneName.stringValue = ""; + serializedObject.ApplyModifiedProperties(); + } else { + var bone = (Bone)obj; + boneName.stringValue = bone.Data.Name; + serializedObject.ApplyModifiedProperties(); + utilityBone.Reset(); + } + } + + void SpawnChildBoneSelected (object obj) { + if (obj == null) { + // Add recursively + foreach (var bone in utilityBone.bone.Children) { + GameObject go = skeletonUtility.SpawnBoneRecursively(bone, utilityBone.transform, utilityBone.mode, utilityBone.position, utilityBone.rotation, utilityBone.scale); + SkeletonUtilityBone[] newUtilityBones = go.GetComponentsInChildren(); + foreach (SkeletonUtilityBone utilBone in newUtilityBones) + SkeletonUtilityInspector.AttachIcon(utilBone); + } + } else { + var bone = (Bone)obj; + GameObject go = skeletonUtility.SpawnBone(bone, utilityBone.transform, utilityBone.mode, utilityBone.position, utilityBone.rotation, utilityBone.scale); + SkeletonUtilityInspector.AttachIcon(go.GetComponent()); + Selection.activeGameObject = go; + EditorGUIUtility.PingObject(go); + } + } + + void SpawnOverride () { + GameObject go = skeletonUtility.SpawnBone(utilityBone.bone, utilityBone.transform.parent, SkeletonUtilityBone.Mode.Override, utilityBone.position, utilityBone.rotation, utilityBone.scale); + go.name = go.name + " [Override]"; + SkeletonUtilityInspector.AttachIcon(go.GetComponent()); + Selection.activeGameObject = go; + EditorGUIUtility.PingObject(go); + } + + bool CanCreateHingeChain () { + if (utilityBone == null) + return false; + if (utilityBone.GetComponent() != null || utilityBone.GetComponent() != null) + return false; + if (utilityBone.bone != null && utilityBone.bone.Children.Count == 0) + return false; + + var rigidbodies = utilityBone.GetComponentsInChildren(); + var rigidbodies2D = utilityBone.GetComponentsInChildren(); + return rigidbodies.Length <= 0 && rigidbodies2D.Length <= 0; + } + + void CreateHingeChain2D () { + var utilBoneArr = utilityBone.GetComponentsInChildren(); + + foreach (var utilBone in utilBoneArr) { + if (utilBone.GetComponent() == null) { + if (utilBone.bone.Data.Length == 0) { + var sphere = utilBone.gameObject.AddComponent(); + sphere.radius = 0.1f; + } else { + float length = utilBone.bone.Data.Length; + var box = utilBone.gameObject.AddComponent(); + box.size = new Vector3(length, length / 3f, 0.2f); + box.offset = new Vector3(length / 2f, 0, 0); + } + } + + utilBone.gameObject.AddComponent(); + } + + utilityBone.GetComponent().isKinematic = true; + + foreach (var utilBone in utilBoneArr) { + if (utilBone == utilityBone) + continue; + + utilBone.mode = SkeletonUtilityBone.Mode.Override; + + var joint = utilBone.gameObject.AddComponent(); + joint.connectedBody = utilBone.transform.parent.GetComponent(); + joint.useLimits = true; + joint.limits = new JointAngleLimits2D { + min = -20, + max = 20 + }; + utilBone.GetComponent().mass = utilBone.transform.parent.GetComponent().mass * 0.75f; + } + } + + void CreateHingeChain () { + var utilBoneArr = utilityBone.GetComponentsInChildren(); + + foreach (var utilBone in utilBoneArr) { + AttachRigidbody(utilBone); + } + + utilityBone.GetComponent().isKinematic = true; + + foreach (var utilBone in utilBoneArr) { + if (utilBone == utilityBone) + continue; + + utilBone.mode = SkeletonUtilityBone.Mode.Override; + + HingeJoint joint = utilBone.gameObject.AddComponent(); + joint.axis = Vector3.forward; + joint.connectedBody = utilBone.transform.parent.GetComponent(); + joint.useLimits = true; + joint.limits = new JointLimits { + min = -20, + max = 20 + }; + utilBone.GetComponent().mass = utilBone.transform.parent.GetComponent().mass * 0.75f; + } + } + + static void AttachRigidbody (SkeletonUtilityBone utilBone) { + if (utilBone.GetComponent() == null) { + if (utilBone.bone.Data.Length == 0) { + SphereCollider sphere = utilBone.gameObject.AddComponent(); + sphere.radius = 0.1f; + } else { + float length = utilBone.bone.Data.Length; + BoxCollider box = utilBone.gameObject.AddComponent(); + box.size = new Vector3(length, length / 3f, 0.2f); + box.center = new Vector3(length / 2f, 0, 0); + } + } + + utilBone.gameObject.AddComponent(); + } + } + +} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityBoneInspector.cs.meta b/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityBoneInspector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityBoneInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityBoneInspector.cs.meta diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityInspector.cs b/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs similarity index 64% rename from Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityInspector.cs rename to Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs index d20f00fbb..ace520684 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityInspector.cs +++ b/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -47,9 +47,8 @@ namespace Spine.Unity.Editor { SkeletonUtility skeletonUtility; Skeleton skeleton; SkeletonRenderer skeletonRenderer; - SkeletonGraphic skeletonGraphic; - -#if !NEW_PREFAB_SYSTEM + + #if !NEW_PREFAB_SYSTEM bool isPrefab; #endif @@ -57,32 +56,23 @@ namespace Spine.Unity.Editor { void OnEnable () { skeletonUtility = (SkeletonUtility)target; - skeletonRenderer = skeletonUtility.skeletonRenderer; - skeletonGraphic = skeletonUtility.skeletonGraphic; - skeleton = skeletonUtility.Skeleton; + skeletonRenderer = skeletonUtility.GetComponent(); + skeleton = skeletonRenderer.Skeleton; if (skeleton == null) { - if (skeletonRenderer != null) { - skeletonRenderer.Initialize(false); - skeletonRenderer.LateUpdate(); - } - else if (skeletonGraphic != null) { - skeletonGraphic.Initialize(false); - skeletonGraphic.LateUpdate(); - } - skeleton = skeletonUtility.Skeleton; + skeletonRenderer.Initialize(false); + skeletonRenderer.LateUpdate(); + skeleton = skeletonRenderer.skeleton; } - if ((skeletonRenderer != null && !skeletonRenderer.valid) || - (skeletonGraphic != null && !skeletonGraphic.IsValid)) return; + if (!skeletonRenderer.valid) return; #if !NEW_PREFAB_SYSTEM isPrefab |= PrefabUtility.GetPrefabType(this.target) == PrefabType.Prefab; #endif } - + public override void OnInspectorGUI () { - #if !NEW_PREFAB_SYSTEM if (isPrefab) { GUILayout.Label(new GUIContent("Cannot edit Prefabs", Icons.warning)); @@ -90,22 +80,12 @@ namespace Spine.Unity.Editor { } #endif - serializedObject.Update(); - - if ((skeletonRenderer != null && !skeletonRenderer.valid) || - (skeletonGraphic != null && !skeletonGraphic.IsValid)) { + if (!skeletonRenderer.valid) { GUILayout.Label(new GUIContent("Spine Component invalid. Check Skeleton Data Asset.", Icons.warning)); - return; + return; } EditorGUILayout.PropertyField(serializedObject.FindProperty("boneRoot"), SpineInspectorUtility.TempContent("Skeleton Root")); - EditorGUILayout.PropertyField(serializedObject.FindProperty("flipBy180DegreeRotation"), SpineInspectorUtility.TempContent("Flip by Rotation", null, - "If true, Skeleton.ScaleX and Skeleton.ScaleY are followed " + - "by 180 degree rotation. If false, negative Transform scale is used. " + - "Note that using negative scale is consistent with previous behaviour (hence the default), " + - "however causes serious problems with rigidbodies and physics. Therefore, it is recommended to " + - "enable this parameter where possible. When creating hinge chains for a chain of skeleton bones " + - "via SkeletonUtilityBone, it is mandatory to have this parameter enabled.")); bool hasRootBone = skeletonUtility.boneRoot != null; @@ -124,8 +104,6 @@ namespace Spine.Unity.Editor { skeletonUtility.boneRoot = null; } } - - serializedObject.ApplyModifiedProperties(); } void SpawnHierarchyContextMenu () { @@ -141,7 +119,7 @@ namespace Spine.Unity.Editor { } public static void AttachIcon (SkeletonUtilityBone boneComponent) { - Skeleton skeleton = boneComponent.hierarchy.Skeleton; + Skeleton skeleton = boneComponent.hierarchy.skeletonRenderer.skeleton; Texture2D icon = boneComponent.bone.Data.Length == 0 ? Icons.nullBone : Icons.boneNib; foreach (IkConstraint c in skeleton.IkConstraints) @@ -165,25 +143,21 @@ namespace Spine.Unity.Editor { } void SpawnFollowHierarchy () { - Undo.RegisterCompleteObjectUndo(skeletonUtility, "Spawn Hierarchy"); Selection.activeGameObject = skeletonUtility.SpawnHierarchy(SkeletonUtilityBone.Mode.Follow, true, true, true); AttachIconsToChildren(skeletonUtility.boneRoot); } void SpawnFollowHierarchyRootOnly () { - Undo.RegisterCompleteObjectUndo(skeletonUtility, "Spawn Root"); Selection.activeGameObject = skeletonUtility.SpawnRoot(SkeletonUtilityBone.Mode.Follow, true, true, true); AttachIconsToChildren(skeletonUtility.boneRoot); } void SpawnOverrideHierarchy () { - Undo.RegisterCompleteObjectUndo(skeletonUtility, "Spawn Hierarchy"); Selection.activeGameObject = skeletonUtility.SpawnHierarchy(SkeletonUtilityBone.Mode.Override, true, true, true); AttachIconsToChildren(skeletonUtility.boneRoot); } void SpawnOverrideHierarchyRootOnly () { - Undo.RegisterCompleteObjectUndo(skeletonUtility, "Spawn Root"); Selection.activeGameObject = skeletonUtility.SpawnRoot(SkeletonUtilityBone.Mode.Override, true, true, true); AttachIconsToChildren(skeletonUtility.boneRoot); } diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityInspector.cs.meta b/Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs.meta similarity index 100% rename from Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonUtilityInspector.cs.meta rename to Assets/Spine/Editor/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs.meta diff --git a/Assets/Spine/Runtime/spine-csharp/Animation.cs b/Assets/Spine/Runtime/spine-csharp/Animation.cs index 70c1b33ee..31904e9d4 100644 --- a/Assets/Spine/Runtime/spine-csharp/Animation.cs +++ b/Assets/Spine/Runtime/spine-csharp/Animation.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -37,19 +37,11 @@ namespace Spine { public class Animation { internal String name; internal ExposedList timelines; - internal HashSet timelineIds; internal float duration; public Animation (string name, ExposedList timelines, float duration) { if (name == null) throw new ArgumentNullException("name", "name cannot be null."); if (timelines == null) throw new ArgumentNullException("timelines", "timelines cannot be null."); - // Note: avoiding reallocations by adding all hash set entries at - // once (EnsureCapacity() is only available in newer .Net versions). - int[] propertyIDs = new int[timelines.Count]; - for (int i = 0; i < timelines.Count; ++i) { - propertyIDs[i] = timelines.Items[i].PropertyId; - } - this.timelineIds = new HashSet(propertyIDs); this.name = name; this.timelines = timelines; this.duration = duration; @@ -60,14 +52,9 @@ namespace Spine { /// The duration of the animation in seconds, which is the highest time of all keys in the timeline. public float Duration { get { return duration; } set { duration = value; } } - /// The animation's name, which is unique across all animations in the skeleton. + /// The animation's name, which is unique within the skeleton. public string Name { get { return name; } } - /// Whether the timeline with the property id is contained in this animation. - public bool HasTimeline (int id) { - return timelineIds.Contains(id); - } - /// Applies all the animation's timelines to the specified skeleton. /// public void Apply (Skeleton skeleton, float lastTime, float time, bool loop, ExposedList events, float alpha, MixBlend blend, @@ -147,7 +134,7 @@ namespace Spine { /// apply animations on top of each other (layered). /// Controls how mixing is applied when alpha < 1. /// Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions, - /// such as or , and other such as {@link ScaleTimeline}. + /// such as or . void Apply (Skeleton skeleton, float lastTime, float time, ExposedList events, float alpha, MixBlend blend, MixDirection direction); /// Uniquely encodes both the type of this timeline and the skeleton property that it affects. int PropertyId { get; } @@ -349,7 +336,7 @@ namespace Spine { override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList firedEvents, float alpha, MixBlend blend, MixDirection direction) { Bone bone = skeleton.bones.Items[boneIndex]; - if (!bone.active) return; + float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. switch (blend) { @@ -439,7 +426,7 @@ namespace Spine { /// The time in seconds, x, and y values for each key frame. public float[] Frames { get { return frames; } set { frames = value; } } - + /// Sets the time in seconds, x, and y values for the specified key frame. public void SetFrame (int frameIndex, float time, float x, float y) { frameIndex *= ENTRIES; @@ -451,7 +438,7 @@ namespace Spine { override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList firedEvents, float alpha, MixBlend blend, MixDirection direction) { Bone bone = skeleton.bones.Items[boneIndex]; - if (!bone.active) return; + float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. switch (blend) { @@ -506,15 +493,15 @@ namespace Spine { public ScaleTimeline (int frameCount) : base(frameCount) { } - + override public int PropertyId { get { return ((int)TimelineType.Scale << 24) + boneIndex; } } - + override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList firedEvents, float alpha, MixBlend blend, MixDirection direction) { Bone bone = skeleton.bones.Items[boneIndex]; - if (!bone.active) return; + float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. switch (blend) { @@ -611,7 +598,7 @@ namespace Spine { public ShearTimeline (int frameCount) : base(frameCount) { } - + override public int PropertyId { get { return ((int)TimelineType.Shear << 24) + boneIndex; } } @@ -619,7 +606,6 @@ namespace Spine { override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList firedEvents, float alpha, MixBlend blend, MixDirection direction) { Bone bone = skeleton.bones.Items[boneIndex]; - if (!bone.active) return; float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. switch (blend) { @@ -713,7 +699,6 @@ namespace Spine { override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList firedEvents, float alpha, MixBlend blend, MixDirection direction) { Slot slot = skeleton.slots.Items[slotIndex]; - if (!slot.bone.active) return; float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. var slotData = slot.data; @@ -729,7 +714,6 @@ namespace Spine { slot.g += (slotData.g - slot.g) * alpha; slot.b += (slotData.b - slot.b) * alpha; slot.a += (slotData.a - slot.a) * alpha; - slot.ClampColor(); return; } return; @@ -763,7 +747,6 @@ namespace Spine { slot.g = g; slot.b = b; slot.a = a; - slot.ClampColor(); } else { float br, bg, bb, ba; if (blend == MixBlend.Setup) { @@ -781,7 +764,6 @@ namespace Spine { slot.g = bg + ((g - bg) * alpha); slot.b = bb + ((b - bb) * alpha); slot.a = ba + ((a - ba) * alpha); - slot.ClampColor(); } } } @@ -834,7 +816,6 @@ namespace Spine { override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList firedEvents, float alpha, MixBlend blend, MixDirection direction) { Slot slot = skeleton.slots.Items[slotIndex]; - if (!slot.bone.active) return; float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. var slotData = slot.data; @@ -846,22 +827,18 @@ namespace Spine { slot.g = slotData.g; slot.b = slotData.b; slot.a = slotData.a; - slot.ClampColor(); slot.r2 = slotData.r2; slot.g2 = slotData.g2; slot.b2 = slotData.b2; - slot.ClampSecondColor(); return; case MixBlend.First: slot.r += (slot.r - slotData.r) * alpha; slot.g += (slot.g - slotData.g) * alpha; slot.b += (slot.b - slotData.b) * alpha; slot.a += (slot.a - slotData.a) * alpha; - slot.ClampColor(); slot.r2 += (slot.r2 - slotData.r2) * alpha; slot.g2 += (slot.g2 - slotData.g2) * alpha; slot.b2 += (slot.b2 - slotData.b2) * alpha; - slot.ClampSecondColor(); return; } return; @@ -904,11 +881,9 @@ namespace Spine { slot.g = g; slot.b = b; slot.a = a; - slot.ClampColor(); slot.r2 = r2; slot.g2 = g2; slot.b2 = b2; - slot.ClampSecondColor(); } else { float br, bg, bb, ba, br2, bg2, bb2; if (blend == MixBlend.Setup) { @@ -932,11 +907,9 @@ namespace Spine { slot.g = bg + ((g - bg) * alpha); slot.b = bb + ((b - bb) * alpha); slot.a = ba + ((a - ba) * alpha); - slot.ClampColor(); slot.r2 = br2 + ((r2 - br2) * alpha); slot.g2 = bg2 + ((g2 - bg2) * alpha); slot.b2 = bb2 + ((b2 - bb2) * alpha); - slot.ClampSecondColor(); } } @@ -976,7 +949,7 @@ namespace Spine { /// The attachment name for each key frame. May contain null values to clear the attachment. public string[] AttachmentNames { get { return attachmentNames; } set { attachmentNames = value; } } - + /// Sets the time in seconds and the attachment name for the specified key frame. public void SetFrame (int frameIndex, float time, String attachmentName) { frames[frameIndex] = time; @@ -985,16 +958,20 @@ namespace Spine { public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList firedEvents, float alpha, MixBlend blend, MixDirection direction) { + string attachmentName; Slot slot = skeleton.slots.Items[slotIndex]; - if (!slot.bone.active) return; - if (direction == MixDirection.Out) { - if (blend == MixBlend.Setup) SetAttachment(skeleton, slot, slot.data.attachmentName); + if (direction == MixDirection.Out && blend == MixBlend.Setup) { + attachmentName = slot.data.attachmentName; + slot.Attachment = attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName); return; } float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. - if (blend == MixBlend.Setup || blend == MixBlend.First) SetAttachment(skeleton, slot, slot.data.attachmentName); + if (blend == MixBlend.Setup || blend == MixBlend.First) { + attachmentName = slot.data.attachmentName; + slot.Attachment = attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName); + } return; } @@ -1004,15 +981,12 @@ namespace Spine { else frameIndex = Animation.BinarySearch(frames, time) - 1; - SetAttachment(skeleton, slot, attachmentNames[frameIndex]); - } - - private void SetAttachment (Skeleton skeleton, Slot slot, string attachmentName) { + attachmentName = attachmentNames[frameIndex]; slot.Attachment = attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName); } } - /// Changes a slot's to deform a . + /// Changes a slot's to deform a . public class DeformTimeline : CurveTimeline, ISlotTimeline { internal int slotIndex; internal VertexAttachment attachment; @@ -1041,13 +1015,13 @@ namespace Spine { } /// The attachment that will be deformed. public VertexAttachment Attachment { get { return attachment; } set { attachment = value; } } - + /// The time in seconds for each key frame. public float[] Frames { get { return frames; } set { frames = value; } } /// The vertices for each key frame. public float[][] Vertices { get { return frameVertices; } set { frameVertices = value; } } - + /// Sets the time in seconds and the vertices for the specified key frame. /// Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. @@ -1059,45 +1033,44 @@ namespace Spine { override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList firedEvents, float alpha, MixBlend blend, MixDirection direction) { Slot slot = skeleton.slots.Items[slotIndex]; - if (!slot.bone.active) return; VertexAttachment vertexAttachment = slot.attachment as VertexAttachment; - if (vertexAttachment == null || vertexAttachment.DeformAttachment != attachment) return; + if (vertexAttachment == null || !vertexAttachment.ApplyDeform(attachment)) return; - var deformArray = slot.Deform; - if (deformArray.Count == 0) blend = MixBlend.Setup; + var verticesArray = slot.attachmentVertices; + if (verticesArray.Count == 0) blend = MixBlend.Setup; float[][] frameVertices = this.frameVertices; int vertexCount = frameVertices[0].Length; float[] frames = this.frames; - float[] deform; + float[] vertices; if (time < frames[0]) { // Time is before first frame. - + switch (blend) { case MixBlend.Setup: - deformArray.Clear(); + verticesArray.Clear(); return; - case MixBlend.First: + case MixBlend.Replace: if (alpha == 1) { - deformArray.Clear(); + verticesArray.Clear(); return; } - // deformArray.SetSize(vertexCount) // Ensure size and preemptively set count. - if (deformArray.Capacity < vertexCount) deformArray.Capacity = vertexCount; - deformArray.Count = vertexCount; - deform = deformArray.Items; + // verticesArray.SetSize(vertexCount) // Ensure size and preemptively set count. + if (verticesArray.Capacity < vertexCount) verticesArray.Capacity = vertexCount; + verticesArray.Count = vertexCount; + vertices = verticesArray.Items; if (vertexAttachment.bones == null) { // Unweighted vertex positions. float[] setupVertices = vertexAttachment.vertices; for (int i = 0; i < vertexCount; i++) - deform[i] += (setupVertices[i] - deform[i]) * alpha; + vertices[i] += (setupVertices[i] - vertices[i]) * alpha; } else { // Weighted deform offsets. alpha = 1 - alpha; for (int i = 0; i < vertexCount; i++) - deform[i] *= alpha; + vertices[i] *= alpha; } return; default: @@ -1106,10 +1079,10 @@ namespace Spine { } - // deformArray.SetSize(vertexCount) // Ensure size and preemptively set count. - if (deformArray.Capacity < vertexCount) deformArray.Capacity = vertexCount; - deformArray.Count = vertexCount; - deform = deformArray.Items; + // verticesArray.SetSize(vertexCount) // Ensure size and preemptively set count. + if (verticesArray.Capacity < vertexCount) verticesArray.Capacity = vertexCount; + verticesArray.Count = vertexCount; + vertices = verticesArray.Items; if (time >= frames[frames.Length - 1]) { // Time is after last frame. @@ -1120,15 +1093,15 @@ namespace Spine { // Unweighted vertex positions, no alpha. float[] setupVertices = vertexAttachment.vertices; for (int i = 0; i < vertexCount; i++) - deform[i] += lastVertices[i] - setupVertices[i]; + vertices[i] += lastVertices[i] - setupVertices[i]; } else { // Weighted deform offsets, no alpha. for (int i = 0; i < vertexCount; i++) - deform[i] += lastVertices[i]; + vertices[i] += lastVertices[i]; } } else { // Vertex positions or deform offsets, no alpha. - Array.Copy(lastVertices, 0, deform, 0, vertexCount); + Array.Copy(lastVertices, 0, vertices, 0, vertexCount); } } else { switch (blend) { @@ -1138,12 +1111,12 @@ namespace Spine { float[] setupVertices = vertexAttachment.vertices; for (int i = 0; i < vertexCount; i++) { float setup = setupVertices[i]; - deform[i] = setup + (lastVertices[i] - setup) * alpha; + vertices[i] = setup + (lastVertices[i] - setup) * alpha; } } else { // Weighted deform offsets, with alpha. for (int i = 0; i < vertexCount; i++) - deform[i] = lastVertices[i] * alpha; + vertices[i] = lastVertices[i] * alpha; } break; } @@ -1151,18 +1124,18 @@ namespace Spine { case MixBlend.Replace: // Vertex positions or deform offsets, with alpha. for (int i = 0; i < vertexCount; i++) - deform[i] += (lastVertices[i] - deform[i]) * alpha; + vertices[i] += (lastVertices[i] - vertices[i]) * alpha; break; case MixBlend.Add: if (vertexAttachment.bones == null) { // Unweighted vertex positions, no alpha. float[] setupVertices = vertexAttachment.vertices; for (int i = 0; i < vertexCount; i++) - deform[i] += (lastVertices[i] - setupVertices[i]) * alpha; + vertices[i] += (lastVertices[i] - setupVertices[i]) * alpha; } else { // Weighted deform offsets, alpha. for (int i = 0; i < vertexCount; i++) - deform[i] += lastVertices[i] * alpha; + vertices[i] += lastVertices[i] * alpha; } break; } @@ -1184,20 +1157,20 @@ namespace Spine { float[] setupVertices = vertexAttachment.vertices; for (int i = 0; i < vertexCount; i++) { float prev = prevVertices[i]; - deform[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i]; + vertices[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i]; } } else { // Weighted deform offsets, no alpha. for (int i = 0; i < vertexCount; i++) { float prev = prevVertices[i]; - deform[i] += prev + (nextVertices[i] - prev) * percent; + vertices[i] += prev + (nextVertices[i] - prev) * percent; } } } else { // Vertex positions or deform offsets, no alpha. for (int i = 0; i < vertexCount; i++) { float prev = prevVertices[i]; - deform[i] = prev + (nextVertices[i] - prev) * percent; + vertices[i] = prev + (nextVertices[i] - prev) * percent; } } } else { @@ -1208,13 +1181,13 @@ namespace Spine { float[] setupVertices = vertexAttachment.vertices; for (int i = 0; i < vertexCount; i++) { float prev = prevVertices[i], setup = setupVertices[i]; - deform[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha; + vertices[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha; } } else { // Weighted deform offsets, with alpha. for (int i = 0; i < vertexCount; i++) { float prev = prevVertices[i]; - deform[i] = (prev + (nextVertices[i] - prev) * percent) * alpha; + vertices[i] = (prev + (nextVertices[i] - prev) * percent) * alpha; } } break; @@ -1224,7 +1197,7 @@ namespace Spine { // Vertex positions or deform offsets, with alpha. for (int i = 0; i < vertexCount; i++) { float prev = prevVertices[i]; - deform[i] += (prev + (nextVertices[i] - prev) * percent - deform[i]) * alpha; + vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha; } break; } @@ -1234,13 +1207,13 @@ namespace Spine { float[] setupVertices = vertexAttachment.vertices; for (int i = 0; i < vertexCount; i++) { float prev = prevVertices[i]; - deform[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha; + vertices[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha; } } else { // Weighted deform offsets, with alpha. for (int i = 0; i < vertexCount; i++) { float prev = prevVertices[i]; - deform[i] += (prev + (nextVertices[i] - prev) * percent) * alpha; + vertices[i] += (prev + (nextVertices[i] - prev) * percent) * alpha; } } break; @@ -1272,7 +1245,7 @@ namespace Spine { /// The event for each key frame. public Event[] Events { get { return events; } set { events = value; } } - + /// Sets the time in seconds and the event for the specified key frame. public void SetFrame (int frameIndex, Event e) { frames[frameIndex] = e.Time; @@ -1345,8 +1318,8 @@ namespace Spine { MixDirection direction) { ExposedList drawOrder = skeleton.drawOrder; ExposedList slots = skeleton.slots; - if (direction == MixDirection.Out) { - if (blend == MixBlend.Setup) Array.Copy(slots.Items, 0, drawOrder.Items, 0, slots.Count); + if (direction == MixDirection.Out && blend == MixBlend.Setup) { + Array.Copy(slots.Items, 0, drawOrder.Items, 0, slots.Count); return; } @@ -1361,7 +1334,7 @@ namespace Spine { frame = frames.Length - 1; else frame = Animation.BinarySearch(frames, time) - 1; - + int[] drawOrderToSetupIndex = drawOrders[frame]; if (drawOrderToSetupIndex == null) { Array.Copy(slots.Items, 0, drawOrder.Items, 0, slots.Count); @@ -1374,22 +1347,21 @@ namespace Spine { } } - /// Changes an IK constraint's , , - /// , , and . + /// Changes an IK constraint's , , + /// , and . public class IkConstraintTimeline : CurveTimeline { - public const int ENTRIES = 6; - private const int PREV_TIME = -6, PREV_MIX = -5, PREV_SOFTNESS = -4, PREV_BEND_DIRECTION = -3, PREV_COMPRESS = -2, - PREV_STRETCH = -1; - private const int MIX = 1, SOFTNESS = 2, BEND_DIRECTION = 3, COMPRESS = 4, STRETCH = 5; + public const int ENTRIES = 5; + private const int PREV_TIME = -5, PREV_MIX = -4, PREV_BEND_DIRECTION = -3, PREV_COMPRESS = -2, PREV_STRETCH = -1; + private const int MIX = 1, BEND_DIRECTION = 2, COMPRESS = 3, STRETCH = 4; internal int ikConstraintIndex; - internal float[] frames; // time, mix, softness, bendDirection, compress, stretch, ... + internal float[] frames; // time, mix, bendDirection, compress, stretch, ... public IkConstraintTimeline (int frameCount) : base(frameCount) { frames = new float[frameCount * ENTRIES]; } - + override public int PropertyId { get { return ((int)TimelineType.IkConstraint << 24) + ikConstraintIndex; } } @@ -1405,16 +1377,14 @@ namespace Spine { } } - /// The time in seconds, mix, softness, bend direction, compress, and stretch for each key frame. + /// The time in seconds, mix, bend direction, compress, and stretch for each key frame. public float[] Frames { get { return frames; } set { frames = value; } } - /// Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. - public void SetFrame (int frameIndex, float time, float mix, float softness, int bendDirection, bool compress, - bool stretch) { + /// Sets the time in seconds, mix, bend direction, compress, and stretch for the specified key frame. + public void SetFrame (int frameIndex, float time, float mix, int bendDirection, bool compress, bool stretch) { frameIndex *= ENTRIES; frames[frameIndex] = time; frames[frameIndex + MIX] = mix; - frames[frameIndex + SOFTNESS] = softness; frames[frameIndex + BEND_DIRECTION] = bendDirection; frames[frameIndex + COMPRESS] = compress ? 1 : 0; frames[frameIndex + STRETCH] = stretch ? 1 : 0; @@ -1423,20 +1393,17 @@ namespace Spine { override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList firedEvents, float alpha, MixBlend blend, MixDirection direction) { IkConstraint constraint = skeleton.ikConstraints.Items[ikConstraintIndex]; - if (!constraint.active) return; float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. switch (blend) { case MixBlend.Setup: constraint.mix = constraint.data.mix; - constraint.softness = constraint.data.softness; constraint.bendDirection = constraint.data.bendDirection; constraint.compress = constraint.data.compress; constraint.stretch = constraint.data.stretch; return; case MixBlend.First: constraint.mix += (constraint.data.mix - constraint.mix) * alpha; - constraint.softness += (constraint.data.softness - constraint.softness) * alpha; constraint.bendDirection = constraint.data.bendDirection; constraint.compress = constraint.data.compress; constraint.stretch = constraint.data.stretch; @@ -1448,8 +1415,6 @@ namespace Spine { if (time >= frames[frames.Length - ENTRIES]) { // Time is after last frame. if (blend == MixBlend.Setup) { constraint.mix = constraint.data.mix + (frames[frames.Length + PREV_MIX] - constraint.data.mix) * alpha; - constraint.softness = constraint.data.softness - + (frames[frames.Length + PREV_SOFTNESS] - constraint.data.softness) * alpha; if (direction == MixDirection.Out) { constraint.bendDirection = constraint.data.bendDirection; constraint.compress = constraint.data.compress; @@ -1461,7 +1426,6 @@ namespace Spine { } } else { constraint.mix += (frames[frames.Length + PREV_MIX] - constraint.mix) * alpha; - constraint.softness += (frames[frames.Length + PREV_SOFTNESS] - constraint.softness) * alpha; if (direction == MixDirection.In) { constraint.bendDirection = (int)frames[frames.Length + PREV_BEND_DIRECTION]; constraint.compress = frames[frames.Length + PREV_COMPRESS] != 0; @@ -1474,14 +1438,11 @@ namespace Spine { // Interpolate between the previous frame and the current frame. int frame = Animation.BinarySearch(frames, time, ENTRIES); float mix = frames[frame + PREV_MIX]; - float softness = frames[frame + PREV_SOFTNESS]; float frameTime = frames[frame]; float percent = GetCurvePercent(frame / ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PREV_TIME] - frameTime)); if (blend == MixBlend.Setup) { constraint.mix = constraint.data.mix + (mix + (frames[frame + MIX] - mix) * percent - constraint.data.mix) * alpha; - constraint.softness = constraint.data.softness - + (softness + (frames[frame + SOFTNESS] - softness) * percent - constraint.data.softness) * alpha; if (direction == MixDirection.Out) { constraint.bendDirection = constraint.data.bendDirection; constraint.compress = constraint.data.compress; @@ -1493,7 +1454,6 @@ namespace Spine { } } else { constraint.mix += (mix + (frames[frame + MIX] - mix) * percent - constraint.mix) * alpha; - constraint.softness += (softness + (frames[frame + SOFTNESS] - softness) * percent - constraint.softness) * alpha; if (direction == MixDirection.In) { constraint.bendDirection = (int)frames[frame + PREV_BEND_DIRECTION]; constraint.compress = frames[frame + PREV_COMPRESS] != 0; @@ -1548,7 +1508,6 @@ namespace Spine { override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList firedEvents, float alpha, MixBlend blend, MixDirection direction) { TransformConstraint constraint = skeleton.transformConstraints.Items[transformConstraintIndex]; - if (!constraint.active) return; float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. TransformConstraintData data = constraint.data; @@ -1649,7 +1608,6 @@ namespace Spine { override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList firedEvents, float alpha, MixBlend blend, MixDirection direction) { PathConstraint constraint = skeleton.pathConstraints.Items[pathConstraintIndex]; - if (!constraint.active) return; float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. switch (blend) { @@ -1696,7 +1654,6 @@ namespace Spine { override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList events, float alpha, MixBlend blend, MixDirection direction) { PathConstraint constraint = skeleton.pathConstraints.Items[pathConstraintIndex]; - if (!constraint.active) return; float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. switch (blend) { @@ -1774,7 +1731,6 @@ namespace Spine { override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList firedEvents, float alpha, MixBlend blend, MixDirection direction) { PathConstraint constraint = skeleton.pathConstraints.Items[pathConstraintIndex]; - if (!constraint.active) return; float[] frames = this.frames; if (time < frames[0]) { // Time is before first frame. switch (blend) { diff --git a/Assets/Spine/Runtime/spine-csharp/AnimationState.cs b/Assets/Spine/Runtime/spine-csharp/AnimationState.cs index 2ded456e1..5d72d3193 100644 --- a/Assets/Spine/Runtime/spine-csharp/AnimationState.cs +++ b/Assets/Spine/Runtime/spine-csharp/AnimationState.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -49,18 +49,12 @@ namespace Spine { /// 2) The next track entry applied after this one does not have a timeline to set this property. /// Result: Mix from the setup pose to the timeline pose. internal const int First = 1; - /// 1) A previously applied timeline has set this property.
- /// 2) The next track entry to be applied does have a timeline to set this property.
- /// 3) The next track entry after that one does not have a timeline to set this property.
- /// Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids "dipping" when crossfading - /// animations that key the same property. A subsequent timeline will set this property using a mix. - internal const int HoldSubsequent = 2; /// 1) This is the first timeline to set this property. /// 2) The next track entry to be applied does have a timeline to set this property. /// 3) The next track entry after that one does not have a timeline to set this property. /// Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids "dipping" when crossfading animations /// that key the same property. A subsequent timeline will set this property using a mix. - internal const int HoldFirst = 3; + internal const int Hold = 2; /// 1) This is the first timeline to set this property. /// 2) The next track entry to be applied does have a timeline to set this property. /// 3) The next track entry after that one does have a timeline to set this property. @@ -69,16 +63,15 @@ namespace Spine { /// 2 track entries in a row have a timeline that sets the same property. /// Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid /// "dipping" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A - /// (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap to the mixed - /// out position. - internal const int HoldMix = 4; - - internal const int Setup = 1, Current = 2; + /// (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into + /// place. + internal const int HoldMix = 3; protected AnimationStateData data; private readonly ExposedList tracks = new ExposedList(); private readonly ExposedList events = new ExposedList(); - // difference to libgdx reference: delegates are used for event callbacks instead of 'final SnapshotArray listeners'. + + // difference to libgdx reference: delegates are used for event callbacks instead of 'Array listeners'. internal void OnStart (TrackEntry entry) { if (Start != null) Start(entry); } internal void OnInterrupt (TrackEntry entry) { if (Interrupt != null) Interrupt(entry); } internal void OnEnd (TrackEntry entry) { if (End != null) End(entry); } @@ -86,40 +79,20 @@ namespace Spine { internal void OnComplete (TrackEntry entry) { if (Complete != null) Complete(entry); } internal void OnEvent (TrackEntry entry, Event e) { if (Event != null) Event(entry, e); } - public delegate void TrackEntryDelegate (TrackEntry trackEntry); + public delegate void TrackEntryDelegate(TrackEntry trackEntry); public event TrackEntryDelegate Start, Interrupt, End, Dispose, Complete; - public delegate void TrackEntryEventDelegate (TrackEntry trackEntry, Event e); + public delegate void TrackEntryEventDelegate(TrackEntry trackEntry, Event e); public event TrackEntryEventDelegate Event; - public void AssignEventSubscribersFrom (AnimationState src) { - Event = src.Event; - Start = src.Start; - Interrupt = src.Interrupt; - End = src.End; - Dispose = src.Dispose; - Complete = src.Complete; - } - - public void AddEventSubscribersFrom (AnimationState src) { - Event += src.Event; - Start += src.Start; - Interrupt += src.Interrupt; - End += src.End; - Dispose += src.Dispose; - Complete += src.Complete; - } - - // end of difference private readonly EventQueue queue; // Initialized by constructor. private readonly HashSet propertyIDs = new HashSet(); private bool animationsChanged; private float timeScale = 1; - private int unkeyedState; private readonly Pool trackEntryPool = new Pool(); - public AnimationState (AnimationStateData data) { + public AnimationState(AnimationStateData data) { if (data == null) throw new ArgumentNullException("data", "data cannot be null."); this.data = data; this.queue = new EventQueue( @@ -157,7 +130,7 @@ namespace Spine { float nextTime = current.trackLast - next.delay; if (nextTime >= 0) { next.delay = 0; - next.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; + next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; current.trackTime += currentDelta; SetCurrent(i, next, true); while (next.mixingFrom != null) { @@ -218,8 +191,8 @@ namespace Spine { } /// - /// Poses the skeleton using the track entry animations. The animation state is not changed, so can be applied to multiple - /// skeletons to pose them identically. + /// Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the + /// animation state can be applied to multiple skeletons to pose them identically. /// True if any animations were applied. public bool Apply (Skeleton skeleton) { if (skeleton == null) throw new ArgumentNullException("skeleton", "skeleton cannot be null."); @@ -249,18 +222,13 @@ namespace Spine { var timelines = current.animation.timelines; var timelinesItems = timelines.Items; if ((i == 0 && mix == 1) || blend == MixBlend.Add) { - for (int ii = 0; ii < timelineCount; ii++) { - var timeline = timelinesItems[ii]; - if (timeline is AttachmentTimeline) - ApplyAttachmentTimeline((AttachmentTimeline)timeline, skeleton, animationTime, blend, true); - else - timeline.Apply(skeleton, animationLast, animationTime, events, mix, blend, MixDirection.In); - } + for (int ii = 0; ii < timelineCount; ii++) + timelinesItems[ii].Apply(skeleton, animationLast, animationTime, events, mix, blend, MixDirection.In); } else { var timelineMode = current.timelineMode.Items; - bool firstFrame = current.timelinesRotation.Count != timelineCount << 1; - if (firstFrame) current.timelinesRotation.Resize(timelines.Count << 1); + bool firstFrame = current.timelinesRotation.Count == 0; + if (firstFrame) current.timelinesRotation.EnsureCapacity(timelines.Count << 1); var timelinesRotation = current.timelinesRotation.Items; for (int ii = 0; ii < timelineCount; ii++) { @@ -268,10 +236,8 @@ namespace Spine { MixBlend timelineBlend = timelineMode[ii] == AnimationState.Subsequent ? blend : MixBlend.Setup; var rotateTimeline = timeline as RotateTimeline; if (rotateTimeline != null) - ApplyRotateTimeline(rotateTimeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, - ii << 1, firstFrame); - else if (timeline is AttachmentTimeline) - ApplyAttachmentTimeline((AttachmentTimeline)timeline, skeleton, animationTime, blend, true); + ApplyRotateTimeline(rotateTimeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, + firstFrame); else timeline.Apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, MixDirection.In); } @@ -282,57 +248,6 @@ namespace Spine { current.nextTrackLast = current.trackTime; } - // Set slots attachments to the setup pose, if needed. This occurs if an animation that is mixing out sets attachments so - // subsequent timelines see any deform, but the subsequent timelines don't set an attachment (eg they are also mixing out or - // the time is before the first key). - int setupState = unkeyedState + Setup; - var slots = skeleton.slots.Items; - for (int i = 0, n = skeleton.slots.Count; i < n; i++) { - Slot slot = (Slot)slots[i]; - if (slot.attachmentState == setupState) { - string attachmentName = slot.data.attachmentName; - slot.Attachment = (attachmentName == null ? null : skeleton.GetAttachment(slot.data.index, attachmentName)); - } - } - unkeyedState += 2; // Increasing after each use avoids the need to reset attachmentState for every slot. - - queue.Drain(); - return applied; - } - - /// Version of only applying EventTimelines for lightweight off-screen updates. - // Note: This method is not part of the libgdx reference implementation. - public bool ApplyEventTimelinesOnly (Skeleton skeleton) { - if (skeleton == null) throw new ArgumentNullException("skeleton", "skeleton cannot be null."); - - var events = this.events; - bool applied = false; - var tracksItems = tracks.Items; - for (int i = 0, n = tracks.Count; i < n; i++) { - TrackEntry current = tracksItems[i]; - if (current == null || current.delay > 0) continue; - applied = true; - - // Apply mixing from entries first. - if (current.mixingFrom != null) - ApplyMixingFromEventTimelinesOnly(current, skeleton); - - // Apply current entry. - float animationLast = current.animationLast, animationTime = current.AnimationTime; - int timelineCount = current.animation.timelines.Count; - var timelines = current.animation.timelines; - var timelinesItems = timelines.Items; - for (int ii = 0; ii < timelineCount; ii++) { - Timeline timeline = timelinesItems[ii]; - if (timeline is EventTimeline) - timeline.Apply(skeleton, animationLast, animationTime, events, 1.0f, MixBlend.Setup, MixDirection.In); - } - QueueEvents(current, animationTime); - events.Clear(false); - current.nextAnimationLast = animationTime; - current.nextTrackLast = current.trackTime; - } - queue.Drain(); return applied; } @@ -366,7 +281,7 @@ namespace Spine { var timelineMode = from.timelineMode.Items; var timelineHoldMix = from.timelineHoldMix.Items; - bool firstFrame = from.timelinesRotation.Count != timelineCount << 1; + bool firstFrame = from.timelinesRotation.Count == 0; if (firstFrame) from.timelinesRotation.Resize(timelines.Count << 1); // from.timelinesRotation.setSize var timelinesRotation = from.timelinesRotation.Items; @@ -378,6 +293,7 @@ namespace Spine { float alpha; switch (timelineMode[i]) { case AnimationState.Subsequent: + if (!attachments && timeline is AttachmentTimeline) continue; if (!drawOrder && timeline is DrawOrderTimeline) continue; timelineBlend = blend; alpha = alphaMix; @@ -386,30 +302,33 @@ namespace Spine { timelineBlend = MixBlend.Setup; alpha = alphaMix; break; - case AnimationState.HoldSubsequent: - timelineBlend = blend; - alpha = alphaHold; - break; - case AnimationState.HoldFirst: + case AnimationState.Hold: timelineBlend = MixBlend.Setup; alpha = alphaHold; break; - default: // HoldMix + default: timelineBlend = MixBlend.Setup; TrackEntry holdMix = timelineHoldMix[i]; alpha = alphaHold * Math.Max(0, 1 - holdMix.mixTime / holdMix.mixDuration); break; } from.totalAlpha += alpha; + var rotateTimeline = timeline as RotateTimeline; if (rotateTimeline != null) { - ApplyRotateTimeline(rotateTimeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, - i << 1, firstFrame); - } else if (timeline is AttachmentTimeline) { - ApplyAttachmentTimeline((AttachmentTimeline)timeline, skeleton, animationTime, timelineBlend, attachments); + ApplyRotateTimeline(rotateTimeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, + firstFrame); } else { - if (drawOrder && timeline is DrawOrderTimeline && timelineBlend == MixBlend.Setup) - direction = MixDirection.In; + if (timelineBlend == MixBlend.Setup) { + if (timeline is AttachmentTimeline) { + if (attachments) direction = MixDirection.In; + } else if (timeline is DrawOrderTimeline) { + if (drawOrder) { + direction = MixDirection.In; + } + } + } + timeline.Apply(skeleton, animationLast, animationTime, eventBuffer, alpha, timelineBlend, direction); } } @@ -423,93 +342,18 @@ namespace Spine { return mix; } - /// Version of only applying EventTimelines for lightweight off-screen updates. - // Note: This method is not part of the libgdx reference implementation. - private float ApplyMixingFromEventTimelinesOnly (TrackEntry to, Skeleton skeleton) { - TrackEntry from = to.mixingFrom; - if (from.mixingFrom != null) ApplyMixingFromEventTimelinesOnly(from, skeleton); - - float mix; - if (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes. - mix = 1; - } - else { - mix = to.mixTime / to.mixDuration; - if (mix > 1) mix = 1; - } - - var eventBuffer = mix < from.eventThreshold ? this.events : null; - if (eventBuffer == null) - return mix; - - float animationLast = from.animationLast, animationTime = from.AnimationTime; - var timelines = from.animation.timelines; - int timelineCount = timelines.Count; - var timelinesItems = timelines.Items; - for (int i = 0; i < timelineCount; i++) { - var timeline = timelinesItems[i]; - if (timeline is EventTimeline) - timeline.Apply(skeleton, animationLast, animationTime, eventBuffer, 0, MixBlend.Setup, MixDirection.Out); - } - - if (to.mixDuration > 0) QueueEvents(from, animationTime); - this.events.Clear(false); - from.nextAnimationLast = animationTime; - from.nextTrackLast = from.trackTime; - - return mix; - } - - /// Applies the attachment timeline and sets . - /// False when: 1) the attachment timeline is mixing out, 2) mix < attachmentThreshold, and 3) the timeline - /// is not the last timeline to set the slot's attachment. In that case the timeline is applied only so subsequent - /// timelines see any deform. - private void ApplyAttachmentTimeline (AttachmentTimeline timeline, Skeleton skeleton, float time, MixBlend blend, - bool attachments) { - - Slot slot = skeleton.slots.Items[timeline.slotIndex]; - if (!slot.bone.active) return; - - float[] frames = timeline.frames; - if (time < frames[0]) { // Time is before first frame. - if (blend == MixBlend.Setup || blend == MixBlend.First) - SetAttachment(skeleton, slot, slot.data.attachmentName, attachments); - } - else { - int frameIndex; - if (time >= frames[frames.Length - 1]) // Time is after last frame. - frameIndex = frames.Length - 1; - else - frameIndex = Animation.BinarySearch(frames, time) - 1; - SetAttachment(skeleton, slot, timeline.attachmentNames[frameIndex], attachments); - } - - // If an attachment wasn't set (ie before the first frame or attachments is false), set the setup attachment later. - if (slot.attachmentState <= unkeyedState) slot.attachmentState = unkeyedState + Setup; - } - - private void SetAttachment (Skeleton skeleton, Slot slot, String attachmentName, bool attachments) { - slot.Attachment = attachmentName == null ? null : skeleton.GetAttachment(slot.data.index, attachmentName); - if (attachments) slot.attachmentState = unkeyedState + Current; - } - - /// - /// Applies the rotate timeline, mixing with the current pose while keeping the same rotation direction chosen as the shortest - /// the first time the mixing was applied. - static private void ApplyRotateTimeline (RotateTimeline timeline, Skeleton skeleton, float time, float alpha, MixBlend blend, + static private void ApplyRotateTimeline (RotateTimeline rotateTimeline, Skeleton skeleton, float time, float alpha, MixBlend blend, float[] timelinesRotation, int i, bool firstFrame) { if (firstFrame) timelinesRotation[i] = 0; if (alpha == 1) { - timeline.Apply(skeleton, 0, time, null, 1, blend, MixDirection.In); + rotateTimeline.Apply(skeleton, 0, time, null, 1, blend, MixDirection.In); return; } - Bone bone = skeleton.bones.Items[timeline.boneIndex]; - if (!bone.active) return; - - float[] frames = timeline.frames; + Bone bone = skeleton.bones.Items[rotateTimeline.boneIndex]; + float[] frames = rotateTimeline.frames; float r1, r2; if (time < frames[0]) { // Time is before first frame. switch (blend) { @@ -532,7 +376,7 @@ namespace Spine { int frame = Animation.BinarySearch(frames, time, RotateTimeline.ENTRIES); float prevRotation = frames[frame + RotateTimeline.PREV_ROTATION]; float frameTime = frames[frame]; - float percent = timeline.GetCurvePercent((frame >> 1) - 1, + float percent = rotateTimeline.GetCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime)); r2 = frames[frame + RotateTimeline.ROTATION] - prevRotation; @@ -871,24 +715,25 @@ namespace Spine { private void AnimationsChanged () { animationsChanged = false; - // Process in the order that animations are applied. propertyIDs.Clear(); var tracksItems = tracks.Items; for (int i = 0, n = tracks.Count; i < n; i++) { TrackEntry entry = tracksItems[i]; if (entry == null) continue; - while (entry.mixingFrom != null) // Move to last entry, then iterate in reverse. + // Move to last entry, then iterate in reverse (the order animations are applied). + while (entry.mixingFrom != null) entry = entry.mixingFrom; do { - if (entry.mixingTo == null || entry.mixBlend != MixBlend.Add) ComputeHold(entry); + if (entry.mixingTo == null || entry.mixBlend != MixBlend.Add) SetTimelineModes(entry); entry = entry.mixingTo; } while (entry != null); + } } - private void ComputeHold (TrackEntry entry) { + private void SetTimelineModes (TrackEntry entry) { TrackEntry to = entry.mixingTo; var timelines = entry.animation.timelines.Items; int timelinesCount = entry.animation.timelines.Count; @@ -898,24 +743,23 @@ namespace Spine { var propertyIDs = this.propertyIDs; if (to != null && to.holdPrevious) { - for (int i = 0; i < timelinesCount; i++) - timelineMode[i] = propertyIDs.Add(timelines[i].PropertyId) ? AnimationState.HoldFirst : AnimationState.HoldSubsequent; - + for (int i = 0; i < timelinesCount; i++) { + propertyIDs.Add(timelines[i].PropertyId); + timelineMode[i] = AnimationState.Hold; + } return; } // outer: for (int i = 0; i < timelinesCount; i++) { - Timeline timeline = timelines[i]; - int id = timeline.PropertyId; + int id = timelines[i].PropertyId; if (!propertyIDs.Add(id)) timelineMode[i] = AnimationState.Subsequent; - else if (to == null || timeline is AttachmentTimeline || timeline is DrawOrderTimeline - || timeline is EventTimeline || !to.animation.HasTimeline(id)) { + else if (to == null || !HasTimeline(to, id)) timelineMode[i] = AnimationState.First; - } else { + else { for (TrackEntry next = to.mixingTo; next != null; next = next.mixingTo) { - if (next.animation.HasTimeline(id)) continue; + if (HasTimeline(next, id)) continue; if (next.mixDuration > 0) { timelineMode[i] = AnimationState.HoldMix; timelineHoldMix[i] = next; @@ -923,12 +767,19 @@ namespace Spine { } break; } - timelineMode[i] = AnimationState.HoldFirst; + timelineMode[i] = AnimationState.Hold; } continue_outer: {} } } + static bool HasTimeline (TrackEntry entry, int id) { + var timelines = entry.animation.timelines.Items; + for (int i = 0, n = entry.animation.timelines.Count; i < n; i++) + if (timelines[i].PropertyId == id) return true; + return false; + } + /// The track entry for the animation currently playing on the track, or null if no animation is currently playing. public TrackEntry GetCurrent (int trackIndex) { if (trackIndex >= tracks.Count) return null; diff --git a/Assets/Spine/Runtime/spine-csharp/AnimationStateData.cs b/Assets/Spine/Runtime/spine-csharp/AnimationStateData.cs index 6cda146fa..84dcb320f 100644 --- a/Assets/Spine/Runtime/spine-csharp/AnimationStateData.cs +++ b/Assets/Spine/Runtime/spine-csharp/AnimationStateData.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -59,7 +59,7 @@ namespace Spine { SetMix(from, to, duration); } - /// Sets a mix duration when changing from the specified animation to the other. + /// Sets a mix duration when changing from the specified animation to the other. /// See TrackEntry.MixDuration. public void SetMix (Animation from, Animation to, float duration) { if (from == null) throw new ArgumentNullException("from", "from cannot be null."); @@ -70,7 +70,7 @@ namespace Spine { } /// - /// The mix duration to use when changing from the specified animation to the other, + /// The mix duration to use when changing from the specified animation to the other, /// or the DefaultMix if no mix duration has been set. /// public float GetMix (Animation from, Animation to) { diff --git a/Assets/Spine/Runtime/spine-csharp/Atlas.cs b/Assets/Spine/Runtime/spine-csharp/Atlas.cs index aeaf1050a..0bb0f4d95 100644 --- a/Assets/Spine/Runtime/spine-csharp/Atlas.cs +++ b/Assets/Spine/Runtime/spine-csharp/Atlas.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if (UNITY_5 || UNITY_5_3_OR_NEWER || UNITY_WSA || UNITY_WP8 || UNITY_WP8_1) @@ -58,9 +58,6 @@ namespace Spine { } #endregion - public List Regions { get { return regions; } } - public List Pages { get { return pages; } } - #if !(IS_UNITY) #if WINDOWS_STOREAPP private async Task ReadFile(string path, TextureLoader textureLoader) { @@ -156,14 +153,7 @@ namespace Spine { region.name = line; region.page = page; - string rotateValue = ReadValue(reader); - if (rotateValue == "true") - region.degrees = 90; - else if (rotateValue == "false") - region.degrees = 0; - else - region.degrees = int.Parse(rotateValue); - region.rotate = region.degrees == 90; + region.rotate = Boolean.Parse(ReadValue(reader)); ReadTuple(reader, tuple); int x = int.Parse(tuple[0], CultureInfo.InvariantCulture); @@ -314,7 +304,6 @@ namespace Spine { public int originalWidth, originalHeight; public int index; public bool rotate; - public int degrees; public int[] splits; public int[] pads; diff --git a/Assets/Spine/Runtime/spine-csharp/Attachments/AtlasAttachmentLoader.cs b/Assets/Spine/Runtime/spine-csharp/Attachments/AtlasAttachmentLoader.cs index 52b405988..77cac6869 100644 --- a/Assets/Spine/Runtime/spine-csharp/Attachments/AtlasAttachmentLoader.cs +++ b/Assets/Spine/Runtime/spine-csharp/Attachments/AtlasAttachmentLoader.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -68,7 +68,6 @@ namespace Spine { attachment.RegionU2 = region.u2; attachment.RegionV2 = region.v2; attachment.RegionRotate = region.rotate; - attachment.RegionDegrees = region.degrees; attachment.regionOffsetX = region.offsetX; attachment.regionOffsetY = region.offsetY; attachment.regionWidth = region.width; @@ -76,7 +75,7 @@ namespace Spine { attachment.regionOriginalWidth = region.originalWidth; attachment.regionOriginalHeight = region.originalHeight; return attachment; - } + } public BoundingBoxAttachment NewBoundingBoxAttachment (Skin skin, string name) { return new BoundingBoxAttachment(name); diff --git a/Assets/Spine/Runtime/spine-csharp/Attachments/Attachment.cs b/Assets/Spine/Runtime/spine-csharp/Attachments/Attachment.cs index 80918bc69..78e264aae 100644 --- a/Assets/Spine/Runtime/spine-csharp/Attachments/Attachment.cs +++ b/Assets/Spine/Runtime/spine-csharp/Attachments/Attachment.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -41,9 +41,6 @@ namespace Spine { override public string ToString () { return Name; } - - ///Returns a copy of the attachment. - public abstract Attachment Copy (); } public interface IHasRendererObject { diff --git a/Assets/Spine/Runtime/spine-csharp/Attachments/AttachmentLoader.cs b/Assets/Spine/Runtime/spine-csharp/Attachments/AttachmentLoader.cs index 962376b66..2f2eb9cdd 100644 --- a/Assets/Spine/Runtime/spine-csharp/Attachments/AttachmentLoader.cs +++ b/Assets/Spine/Runtime/spine-csharp/Attachments/AttachmentLoader.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ namespace Spine { diff --git a/Assets/Spine/Runtime/spine-csharp/Attachments/AttachmentType.cs b/Assets/Spine/Runtime/spine-csharp/Attachments/AttachmentType.cs index 09000e52f..b9c2cd6c7 100644 --- a/Assets/Spine/Runtime/spine-csharp/Attachments/AttachmentType.cs +++ b/Assets/Spine/Runtime/spine-csharp/Attachments/AttachmentType.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ namespace Spine { diff --git a/Assets/Spine/Runtime/spine-csharp/Attachments/BoundingBoxAttachment.cs b/Assets/Spine/Runtime/spine-csharp/Attachments/BoundingBoxAttachment.cs index f9b736922..1afccfa4c 100644 --- a/Assets/Spine/Runtime/spine-csharp/Attachments/BoundingBoxAttachment.cs +++ b/Assets/Spine/Runtime/spine-csharp/Attachments/BoundingBoxAttachment.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -35,11 +35,5 @@ namespace Spine { public BoundingBoxAttachment (string name) : base(name) { } - - public override Attachment Copy () { - BoundingBoxAttachment copy = new BoundingBoxAttachment(this.Name); - CopyTo(copy); - return copy; - } } } diff --git a/Assets/Spine/Runtime/spine-csharp/Attachments/ClippingAttachment.cs b/Assets/Spine/Runtime/spine-csharp/Attachments/ClippingAttachment.cs index b0aa8db61..f106ba4e8 100644 --- a/Assets/Spine/Runtime/spine-csharp/Attachments/ClippingAttachment.cs +++ b/Assets/Spine/Runtime/spine-csharp/Attachments/ClippingAttachment.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,34 +15,27 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; namespace Spine { - public class ClippingAttachment : VertexAttachment { - internal SlotData endSlot; + public class ClippingAttachment : VertexAttachment { + internal SlotData endSlot; - public SlotData EndSlot { get { return endSlot; } set { endSlot = value; } } + public SlotData EndSlot { get { return endSlot; } set { endSlot = value; } } - public ClippingAttachment(string name) : base(name) { - } - - public override Attachment Copy () { - ClippingAttachment copy = new ClippingAttachment(this.Name); - CopyTo(copy); - copy.endSlot = endSlot; - return copy; - } - } + public ClippingAttachment(string name) : base(name) { + } + } } diff --git a/Assets/Spine/Runtime/spine-csharp/Attachments/MeshAttachment.cs b/Assets/Spine/Runtime/spine-csharp/Attachments/MeshAttachment.cs index fad2ee1de..528e859ad 100644 --- a/Assets/Spine/Runtime/spine-csharp/Attachments/MeshAttachment.cs +++ b/Assets/Spine/Runtime/spine-csharp/Attachments/MeshAttachment.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -38,6 +38,7 @@ namespace Spine { internal int[] triangles; internal float r = 1, g = 1, b = 1, a = 1; internal int hulllength; + internal bool inheritDeform; public int HullLength { get { return hulllength; } set { hulllength = value; } } public float[] RegionUVs { get { return regionUVs; } set { regionUVs = value; } } @@ -57,7 +58,6 @@ namespace Spine { public float RegionU2 { get; set; } public float RegionV2 { get; set; } public bool RegionRotate { get; set; } - public int RegionDegrees { get; set; } public float RegionOffsetX { get { return regionOffsetX; } set { regionOffsetX = value; } } public float RegionOffsetY { get { return regionOffsetY; } set { regionOffsetY = value; } } // Pixels stripped from the bottom left, unrotated. public float RegionWidth { get { return regionWidth; } set { regionWidth = value; } } @@ -65,6 +65,8 @@ namespace Spine { public float RegionOriginalWidth { get { return regionOriginalWidth; } set { regionOriginalWidth = value; } } public float RegionOriginalHeight { get { return regionOriginalHeight; } set { regionOriginalHeight = value; } } // Unrotated, unstripped size. + public bool InheritDeform { get { return inheritDeform; } set { inheritDeform = value; } } + public MeshAttachment ParentMesh { get { return parentMesh; } set { @@ -96,51 +98,26 @@ namespace Spine { float[] regionUVs = this.regionUVs; if (this.uvs == null || this.uvs.Length != regionUVs.Length) this.uvs = new float[regionUVs.Length]; float[] uvs = this.uvs; - float u = RegionU, v = RegionV, width = 0, height = 0; - if (RegionDegrees == 90) { + if (RegionRotate) { float textureHeight = this.regionWidth / (RegionV2 - RegionV); float textureWidth = this.regionHeight / (RegionU2 - RegionU); - u -= (RegionOriginalHeight - RegionOffsetY - RegionHeight) / textureWidth; - v -= (RegionOriginalWidth - RegionOffsetX - RegionWidth) / textureHeight; - width = RegionOriginalHeight / textureWidth; - height = RegionOriginalWidth / textureHeight; + float u = RegionU - (RegionOriginalHeight - RegionOffsetY - RegionHeight) / textureWidth; + float v = RegionV - (RegionOriginalWidth - RegionOffsetX - RegionWidth) / textureHeight; + float width = RegionOriginalHeight / textureWidth; + float height = RegionOriginalWidth / textureHeight; for (int i = 0, n = uvs.Length; i < n; i += 2) { uvs[i] = u + regionUVs[i + 1] * width; - uvs[i + 1] = v + (1 - regionUVs[i]) * height; - } - } else if (RegionDegrees == 180) { - float textureWidth = this.regionWidth / (RegionU2 - RegionU); - float textureHeight = this.regionHeight / (RegionV2 - RegionV); - u -= (RegionOriginalWidth - RegionOffsetX - RegionWidth) / textureWidth; - v -= RegionOffsetY / textureHeight; - width = RegionOriginalWidth / textureWidth; - height = RegionOriginalHeight / textureHeight; - - for (int i = 0, n = uvs.Length; i < n; i += 2) { - uvs[i] = u + (1 - regionUVs[i]) * width; - uvs[i + 1] = v + (1 - regionUVs[i + 1]) * height; - } - } else if (RegionDegrees == 270) { - float textureWidth = this.regionWidth / (RegionU2 - RegionU); - float textureHeight = this.regionHeight / (RegionV2 - RegionV); - u -= RegionOffsetY / textureWidth; - v -= RegionOffsetX / textureHeight; - width = RegionOriginalHeight / textureWidth; - height = RegionOriginalWidth / textureHeight; - - for (int i = 0, n = uvs.Length; iReturns a new mesh with this mesh set as the . - public MeshAttachment NewLinkedMesh () { - MeshAttachment mesh = new MeshAttachment(Name); - mesh.RendererObject = RendererObject; - mesh.regionOffsetX = regionOffsetX; - mesh.regionOffsetY = regionOffsetY; - mesh.regionWidth = regionWidth; - mesh.regionHeight = regionHeight; - mesh.regionOriginalWidth = regionOriginalWidth; - mesh.regionOriginalHeight = regionOriginalHeight; - mesh.RegionDegrees = RegionDegrees; - mesh.RegionRotate = RegionRotate; - mesh.RegionU = RegionU; - mesh.RegionV = RegionV; - mesh.RegionU2 = RegionU2; - mesh.RegionV2 = RegionV2; - - mesh.Path = Path; - mesh.r = r; - mesh.g = g; - mesh.b = b; - mesh.a = a; - - mesh.deformAttachment = deformAttachment; - mesh.ParentMesh = parentMesh != null ? parentMesh : this; - mesh.UpdateUVs(); - return mesh; + override public bool ApplyDeform (VertexAttachment sourceAttachment) { + return this == sourceAttachment || (inheritDeform && parentMesh == sourceAttachment); } } } diff --git a/Assets/Spine/Runtime/spine-csharp/Attachments/PathAttachment.cs b/Assets/Spine/Runtime/spine-csharp/Attachments/PathAttachment.cs index 375379d5e..94d59f9ef 100644 --- a/Assets/Spine/Runtime/spine-csharp/Attachments/PathAttachment.cs +++ b/Assets/Spine/Runtime/spine-csharp/Attachments/PathAttachment.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -42,16 +42,6 @@ namespace Spine { public PathAttachment (String name) : base(name) { - } - - public override Attachment Copy () { - PathAttachment copy = new PathAttachment(this.Name); - CopyTo(copy); - copy.lengths = new float[lengths.Length]; - Array.Copy(lengths, 0, copy.lengths, 0, lengths.Length); - copy.closed = closed; - copy.constantSpeed = constantSpeed; - return copy; - } + } } } diff --git a/Assets/Spine/Runtime/spine-csharp/Attachments/PointAttachment.cs b/Assets/Spine/Runtime/spine-csharp/Attachments/PointAttachment.cs index be4668ec6..4d001c11c 100644 --- a/Assets/Spine/Runtime/spine-csharp/Attachments/PointAttachment.cs +++ b/Assets/Spine/Runtime/spine-csharp/Attachments/PointAttachment.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ namespace Spine { @@ -55,13 +55,5 @@ namespace Spine { float iy = cos * bone.c + sin * bone.d; return MathUtils.Atan2(iy, ix) * MathUtils.RadDeg; } - - public override Attachment Copy () { - PointAttachment copy = new PointAttachment(this.Name); - copy.x = x; - copy.y = y; - copy.rotation = rotation; - return copy; - } } } diff --git a/Assets/Spine/Runtime/spine-csharp/Attachments/RegionAttachment.cs b/Assets/Spine/Runtime/spine-csharp/Attachments/RegionAttachment.cs index 460f9b8f3..c10bbe846 100644 --- a/Assets/Spine/Runtime/spine-csharp/Attachments/RegionAttachment.cs +++ b/Assets/Spine/Runtime/spine-csharp/Attachments/RegionAttachment.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -178,31 +178,5 @@ namespace Spine { worldVertices[offset + 1] = offsetX * c + offsetY * d + bwy; //offset += stride; } - - public override Attachment Copy () { - RegionAttachment copy = new RegionAttachment(this.Name); - copy.RendererObject = RendererObject; - copy.regionOffsetX = regionOffsetX; - copy.regionOffsetY = regionOffsetY; - copy.regionWidth = regionWidth; - copy.regionHeight = regionHeight; - copy.regionOriginalWidth = regionOriginalWidth; - copy.regionOriginalHeight = regionOriginalHeight; - copy.Path = Path; - copy.x = x; - copy.y = y; - copy.scaleX = scaleX; - copy.scaleY = scaleY; - copy.rotation = rotation; - copy.width = width; - copy.height = height; - Array.Copy(uvs, 0, copy.uvs, 0, 8); - Array.Copy(offset, 0, copy.offset, 0, 8); - copy.r = r; - copy.g = g; - copy.b = b; - copy.a = a; - return copy; - } } } diff --git a/Assets/Spine/Runtime/spine-csharp/Attachments/VertexAttachment.cs b/Assets/Spine/Runtime/spine-csharp/Attachments/VertexAttachment.cs index 2c534def1..7f501237e 100644 --- a/Assets/Spine/Runtime/spine-csharp/Attachments/VertexAttachment.cs +++ b/Assets/Spine/Runtime/spine-csharp/Attachments/VertexAttachment.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,24 +15,23 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; namespace Spine { - /// >An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's - /// . - public abstract class VertexAttachment : Attachment { + /// >An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's vertices. + public class VertexAttachment : Attachment { static int nextID = 0; static readonly Object nextIdLock = new Object(); @@ -40,21 +39,16 @@ namespace Spine { internal int[] bones; internal float[] vertices; internal int worldVerticesLength; - internal VertexAttachment deformAttachment; /// Gets a unique ID for this attachment. public int Id { get { return id; } } public int[] Bones { get { return bones; } set { bones = value; } } public float[] Vertices { get { return vertices; } set { vertices = value; } } public int WorldVerticesLength { get { return worldVerticesLength; } set { worldVerticesLength = value; } } - ///Deform keys for the deform attachment are also applied to this attachment. - /// May be null if no deform keys should be applied. - public VertexAttachment DeformAttachment { get { return deformAttachment; } set { deformAttachment = value; } } public VertexAttachment (string name) : base(name) { - deformAttachment = this; lock (VertexAttachment.nextIdLock) { id = (VertexAttachment.nextID++ & 65535) << 11; } @@ -64,13 +58,7 @@ namespace Spine { ComputeWorldVertices(slot, 0, worldVerticesLength, worldVertices, 0); } - /// - /// Transforms the attachment's local to world coordinates. If the slot's is - /// not empty, it is used to deform the vertices. - /// - /// See World transforms in the Spine - /// Runtimes Guide. - /// + /// Transforms local vertices to world coordinates. /// The index of the first value to transform. Each vertex has 2 values, x and y. /// The number of world vertex values to output. Must be less than or equal to - start. /// The output world vertices. Must have a length greater than or equal to + . @@ -79,7 +67,7 @@ namespace Spine { public void ComputeWorldVertices (Slot slot, int start, int count, float[] worldVertices, int offset, int stride = 2) { count = offset + (count >> 1) * stride; Skeleton skeleton = slot.bone.skeleton; - var deformArray = slot.deform; + var deformArray = slot.attachmentVertices; float[] vertices = this.vertices; int[] bones = this.bones; if (bones == null) { @@ -133,24 +121,9 @@ namespace Spine { } } - ///Does not copy id (generated) or name (set on construction). - internal void CopyTo (VertexAttachment attachment) { - if (bones != null) { - attachment.bones = new int[bones.Length]; - Array.Copy(bones, 0, attachment.bones, 0, bones.Length); - } - else - attachment.bones = null; - - if (vertices != null) { - attachment.vertices = new float[vertices.Length]; - Array.Copy(vertices, 0, attachment.vertices, 0, vertices.Length); - } - else - attachment.vertices = null; - - attachment.worldVerticesLength = worldVerticesLength; - attachment.deformAttachment = deformAttachment; - } + /// Returns true if a deform originally applied to the specified attachment should be applied to this attachment. + virtual public bool ApplyDeform (VertexAttachment sourceAttachment) { + return this == sourceAttachment; + } } } diff --git a/Assets/Spine/Runtime/spine-csharp/BlendMode.cs b/Assets/Spine/Runtime/spine-csharp/BlendMode.cs index 037540330..c74e55b57 100644 --- a/Assets/Spine/Runtime/spine-csharp/BlendMode.cs +++ b/Assets/Spine/Runtime/spine-csharp/BlendMode.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ namespace Spine { diff --git a/Assets/Spine/Runtime/spine-csharp/Bone.cs b/Assets/Spine/Runtime/spine-csharp/Bone.cs index 5031e24c3..6fb30cf2b 100644 --- a/Assets/Spine/Runtime/spine-csharp/Bone.cs +++ b/Assets/Spine/Runtime/spine-csharp/Bone.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -52,15 +52,12 @@ namespace Spine { internal float a, b, worldX; internal float c, d, worldY; - internal bool sorted, active; + internal bool sorted; public BoneData Data { get { return data; } } public Skeleton Skeleton { get { return skeleton; } } public Bone Parent { get { return parent; } } public ExposedList Children { get { return children; } } - /// Returns false when the bone has not been computed because is true and the - /// active skin does not contain this bone. - public bool Active { get { return active; } } /// The local X translation. public float X { get { return x; } set { x = value; } } /// The local Y translation. @@ -150,7 +147,7 @@ namespace Spine { Bone parent = this.parent; if (parent == null) { // Root bone. - float rotationY = rotation + 90 + shearY, sx = skeleton.ScaleX, sy = skeleton.ScaleY; + float rotationY = rotation + 90 + shearY, sx = skeleton.scaleX, sy = skeleton.scaleY; a = MathUtils.CosDeg(rotation + shearX) * scaleX * sx; b = MathUtils.CosDeg(rotationY) * scaleY * sx; c = MathUtils.SinDeg(rotation + shearX) * scaleX * sy; @@ -189,8 +186,6 @@ namespace Spine { float s = pa * pa + pc * pc, prx; if (s > 0.0001f) { s = Math.Abs(pa * pd - pb * pc) / s; - pa /= skeleton.ScaleX; - pc /= skeleton.ScaleY; pb = pc * s; pd = pa * s; prx = MathUtils.Atan2(pc, pa) * MathUtils.RadDeg; @@ -214,15 +209,15 @@ namespace Spine { case TransformMode.NoScale: case TransformMode.NoScaleOrReflection: { float cos = MathUtils.CosDeg(rotation), sin = MathUtils.SinDeg(rotation); - float za = (pa * cos + pb * sin) / skeleton.ScaleX; - float zc = (pc * cos + pd * sin) / skeleton.ScaleY; + float za = (pa * cos + pb * sin) / skeleton.scaleX; + float zc = (pc * cos + pd * sin) / skeleton.scaleY; float s = (float)Math.Sqrt(za * za + zc * zc); if (s > 0.00001f) s = 1 / s; za *= s; zc *= s; s = (float)Math.Sqrt(za * za + zc * zc); if (data.transformMode == TransformMode.NoScale - && (pa * pd - pb * pc < 0) != (skeleton.ScaleX < 0 != skeleton.ScaleY < 0)) s = -s; + && (pa * pd - pb * pc < 0) != (skeleton.scaleX < 0 != skeleton.scaleY < 0)) s = -s; float r = MathUtils.PI / 2 + MathUtils.Atan2(zc, za); float zb = MathUtils.Cos(r) * s; @@ -239,10 +234,10 @@ namespace Spine { } } - a *= skeleton.ScaleX; - b *= skeleton.ScaleX; - c *= skeleton.ScaleY; - d *= skeleton.ScaleY; + a *= skeleton.scaleX; + b *= skeleton.scaleX; + c *= skeleton.scaleY; + d *= skeleton.scaleY; } public void SetToSetupPose () { @@ -259,7 +254,7 @@ namespace Spine { /// /// Computes the individual applied transform values from the world transform. This can be useful to perform processing using /// the applied transform after the world transform has been modified directly (eg, by a constraint).. - /// + /// /// Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. /// internal void UpdateAppliedTransform () { @@ -303,7 +298,7 @@ namespace Spine { } } - public void WorldToLocal (float worldX, float worldY, out float localX, out float localY) { + public void WorldToLocal (float worldX, float worldY, out float localX, out float localY) { float a = this.a, b = this.b, c = this.c, d = this.d; float invDet = 1 / (a * d - b * c); float x = worldX - this.worldX, y = worldY - this.worldY; diff --git a/Assets/Spine/Runtime/spine-csharp/BoneData.cs b/Assets/Spine/Runtime/spine-csharp/BoneData.cs index 4cb4664ce..40eef4ac1 100644 --- a/Assets/Spine/Runtime/spine-csharp/BoneData.cs +++ b/Assets/Spine/Runtime/spine-csharp/BoneData.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -37,12 +37,11 @@ namespace Spine { internal float length; internal float x, y, rotation, scaleX = 1, scaleY = 1, shearX, shearY; internal TransformMode transformMode = TransformMode.Normal; - internal bool skinRequired; /// The index of the bone in Skeleton.Bones public int Index { get { return index; } } - /// The name of the bone, which is unique across all bones in the skeleton. + /// The name of the bone, which is unique within the skeleton. public string Name { get { return name; } } /// May be null. @@ -74,11 +73,6 @@ namespace Spine { /// The transform mode for how parent world transforms affect this bone. public TransformMode TransformMode { get { return transformMode; } set { transformMode = value; } } - ///When true, only updates this bone if the contains this - /// bone. - /// - public bool SkinRequired { get { return skinRequired; } set { skinRequired = value; } } - /// May be null. public BoneData (int index, string name, BoneData parent) { if (index < 0) throw new ArgumentException("index must be >= 0", "index"); diff --git a/Assets/Spine/Runtime/spine-csharp/Collections.meta b/Assets/Spine/Runtime/spine-csharp/Collections.meta deleted file mode 100644 index 86d3d73a9..000000000 --- a/Assets/Spine/Runtime/spine-csharp/Collections.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: b41ddd57048a62b41951dbbfd453ab98 -folderAsset: yes -timeCreated: 1565181882 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-csharp/Collections/OrderedDictionary.cs b/Assets/Spine/Runtime/spine-csharp/Collections/OrderedDictionary.cs deleted file mode 100644 index 6af4cc4ab..000000000 --- a/Assets/Spine/Runtime/spine-csharp/Collections/OrderedDictionary.cs +++ /dev/null @@ -1,633 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -/****************************************************************************** - * Thanks to Travis Parks - * https://github.com/jehugaleahsa/truncon.collections.OrderedDictionary - *****************************************************************************/ - -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Linq; - -namespace Spine.Collections -{ - /// - /// Represents a dictionary that tracks the order that items were added. - /// - /// The type of the dictionary keys. - /// The type of the dictionary values. - /// - /// This dictionary makes it possible to get the index of a key and a key based on an index. - /// It can be costly to find the index of a key because it must be searched for linearly. - /// It can be costly to insert a key/value pair because other key's indexes must be adjusted. - /// It can be costly to remove a key/value pair because other keys' indexes must be adjusted. - /// - [DebuggerDisplay("Count = {Count}")] - [DebuggerTypeProxy(typeof(OrderedDictionaryDebugView<,>))] - public sealed class OrderedDictionary : IDictionary, IList> - { - private readonly Dictionary dictionary; - private readonly List keys; - private readonly List values; - private int version; - - private const string CollectionModifiedMessage = "Collection was modified; enumeration operation may not execute."; - private const string EditReadOnlyListMessage = "An attempt was made to edit a read-only list."; - private const string IndexOutOfRangeMessage = "The index is negative or outside the bounds of the collection."; - - /// - /// Initializes a new instance of an OrderedDictionary. - /// - public OrderedDictionary () - : this(0, null) { - } - - /// - /// Initializes a new instance of an OrderedDictionary. - /// - /// The initial capacity of the dictionary. - /// The capacity is less than zero. - public OrderedDictionary (int capacity) - : this(capacity, null) { - } - - /// - /// Initializes a new instance of an OrderedDictionary. - /// - /// The equality comparer to use to compare keys. - public OrderedDictionary (IEqualityComparer comparer) - : this(0, comparer) { - } - - /// - /// Initializes a new instance of an OrderedDictionary. - /// - /// The initial capacity of the dictionary. - /// The equality comparer to use to compare keys. - public OrderedDictionary (int capacity, IEqualityComparer comparer) { - dictionary = new Dictionary(capacity, comparer ?? EqualityComparer.Default); - keys = new List(capacity); - values = new List(capacity); - } - - /// - /// Gets the equality comparer used to compare keys. - /// - public IEqualityComparer Comparer { - get { - return dictionary.Comparer; - } - } - - /// - /// Adds the given key/value pair to the dictionary. - /// - /// The key to add to the dictionary. - /// The value to associated with the key. - /// The given key already exists in the dictionary. - /// The key is null. - public void Add (TKey key, TValue value) { - dictionary.Add(key, values.Count); - keys.Add(key); - values.Add(value); - ++version; - } - - /// - /// Inserts the given key/value pair at the specified index. - /// - /// The index to insert the key/value pair. - /// The key to insert. - /// The value to insert. - /// The given key already exists in the dictionary. - /// The key is null. - /// The index is negative -or- larger than the size of the dictionary. - public void Insert (int index, TKey key, TValue value) { - if (index < 0 || index > values.Count) { - throw new ArgumentOutOfRangeException("index", index, IndexOutOfRangeMessage); - } - dictionary.Add(key, index); - for (int keyIndex = index; keyIndex != keys.Count; ++keyIndex) { - var otherKey = keys[keyIndex]; - dictionary[otherKey] += 1; - } - keys.Insert(index, key); - values.Insert(index, value); - ++version; - } - - /// - /// Determines whether the given key exists in the dictionary. - /// - /// The key to look for. - /// True if the key exists in the dictionary; otherwise, false. - /// The key is null. - public bool ContainsKey (TKey key) { - return dictionary.ContainsKey(key); - } - - /// - /// Gets the key at the given index. - /// - /// The index of the key to get. - /// The key at the given index. - /// The index is negative -or- larger than the number of keys. - public TKey GetKey (int index) { - return keys[index]; - } - - /// - /// Gets the index of the given key. - /// - /// The key to get the index of. - /// The index of the key in the dictionary -or- -1 if the key is not found. - /// The operation runs in O(n). - public int IndexOf (TKey key) { - int index; - if (dictionary.TryGetValue(key, out index)) { - return index; - } - return -1; - } - - /// - /// Gets the keys in the dictionary in the order they were added. - /// - public KeyCollection Keys { - get { - return new KeyCollection(this.dictionary); - } - } - - /// - /// Removes the key/value pair with the given key from the dictionary. - /// - /// The key of the pair to remove. - /// True if the key was found and the pair removed; otherwise, false. - /// The key is null. - public bool Remove (TKey key) { - int index; - if (dictionary.TryGetValue(key, out index)) { - RemoveAt(index); - return true; - } - return false; - } - - /// - /// Removes the key/value pair at the given index. - /// - /// The index of the key/value pair to remove. - /// The index is negative -or- larger than the size of the dictionary. - public void RemoveAt (int index) { - var key = keys[index]; - for (int keyIndex = index + 1; keyIndex < keys.Count; ++keyIndex) { - var otherKey = keys[keyIndex]; - dictionary[otherKey] -= 1; - } - dictionary.Remove(key); - keys.RemoveAt(index); - values.RemoveAt(index); - ++version; - } - - /// - /// Tries to get the value associated with the given key. If the key is not found, - /// default(TValue) value is stored in the value. - /// - /// The key to get the value for. - /// The value used to hold the results. - /// True if the key was found; otherwise, false. - /// The key is null. - public bool TryGetValue (TKey key, out TValue value) { - int index; - if (dictionary.TryGetValue(key, out index)) { - value = values[index]; - return true; - } - value = default(TValue); - return false; - } - - /// - /// Gets the values in the dictionary. - /// - public ValueCollection Values { - get { - return new ValueCollection(values); - } - } - - /// - /// Gets or sets the value at the given index. - /// - /// The index of the value to get. - /// The value at the given index. - /// The index is negative -or- beyond the length of the dictionary. - public TValue this[int index] { - get { - return values[index]; - } - - set { - values[index] = value; - } - } - - /// - /// Gets or sets the value associated with the given key. - /// - /// The key to get the associated value by or to associate with the value. - /// The value associated with the given key. - /// The key is null. - /// The key is not in the dictionary. - public TValue this[TKey key] { - get { - return values[dictionary[key]]; - } - set { - int index; - if (dictionary.TryGetValue(key, out index)) { - keys[index] = key; - values[index] = value; - } - else { - Add(key, value); - } - } - } - - /// - /// Removes all key/value pairs from the dictionary. - /// - public void Clear () { - dictionary.Clear(); - keys.Clear(); - values.Clear(); - ++version; - } - - /// - /// Gets the number of key/value pairs in the dictionary. - /// - public int Count { - get { - return dictionary.Count; - } - } - - /// - /// Gets the key/value pairs in the dictionary in the order they were added. - /// - /// An enumerator over the key/value pairs in the dictionary. - public IEnumerator> GetEnumerator () { - int startVersion = version; - for (int index = 0; index != keys.Count; ++index) { - var key = keys[index]; - var value = values[index]; - yield return new KeyValuePair(key, value); - if (version != startVersion) { - throw new InvalidOperationException(CollectionModifiedMessage); - } - } - } - - int IList>.IndexOf (KeyValuePair item) { - int index; - if (dictionary.TryGetValue(item.Key, out index) && Equals(values[index], item.Value)) { - return index; - } - return -1; - } - - void IList>.Insert (int index, KeyValuePair item) { - Insert(index, item.Key, item.Value); - } - - KeyValuePair IList>.this[int index] { - get { - TKey key = keys[index]; - TValue value = values[index]; - return new KeyValuePair(key, value); - } - set { - TKey key = keys[index]; - if (dictionary.Comparer.Equals(key, value.Key)) { - dictionary[value.Key] = index; - } - else { - dictionary.Add(value.Key, index); // will throw if key already exists - dictionary.Remove(key); - } - keys[index] = value.Key; - values[index] = value.Value; - } - } - - ICollection IDictionary.Keys { - get { - return Keys; - } - } - - ICollection IDictionary.Values { - get { - return Values; - } - } - - void ICollection>.Add (KeyValuePair item) { - Add(item.Key, item.Value); - } - - bool ICollection>.Contains (KeyValuePair item) { - int index; - if (dictionary.TryGetValue(item.Key, out index) && Equals(values[index], item.Value)) { - return true; - } - return false; - } - - void ICollection>.CopyTo (KeyValuePair[] array, int arrayIndex) { - if (array == null) { - throw new ArgumentNullException("array"); - } - if (arrayIndex < 0) { - throw new ArgumentOutOfRangeException("arrayIndex", arrayIndex, IndexOutOfRangeMessage); - } - for (int index = 0; index != keys.Count && arrayIndex < array.Length; ++index, ++arrayIndex) { - var key = keys[index]; - var value = values[index]; - array[arrayIndex] = new KeyValuePair(key, value); - } - } - - bool ICollection>.IsReadOnly { - get { - return false; - } - } - - bool ICollection>.Remove (KeyValuePair item) { - ICollection> self = this; - if (self.Contains(item)) { - return Remove(item.Key); - } - return false; - } - - IEnumerator IEnumerable.GetEnumerator () { - return GetEnumerator(); - } - - /// - /// Wraps the keys in an OrderDictionary. - /// - public sealed class KeyCollection : ICollection - { - private readonly Dictionary dictionary; - - /// - /// Initializes a new instance of a KeyCollection. - /// - /// The OrderedDictionary whose keys to wrap. - /// The dictionary is null. - internal KeyCollection (Dictionary dictionary) { - this.dictionary = dictionary; - } - - /// - /// Copies the keys from the OrderedDictionary to the given array, starting at the given index. - /// - /// The array to copy the keys to. - /// The index into the array to start copying the keys. - /// The array is null. - /// The arrayIndex is negative. - /// The array, starting at the given index, is not large enough to contain all the keys. - public void CopyTo (TKey[] array, int arrayIndex) { - dictionary.Keys.CopyTo(array, arrayIndex); - } - - /// - /// Gets the number of keys in the OrderedDictionary. - /// - public int Count { - get { - return dictionary.Count; - } - } - - /// - /// Gets an enumerator over the keys in the OrderedDictionary. - /// - /// The enumerator. - public IEnumerator GetEnumerator () { - return dictionary.Keys.GetEnumerator(); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - bool ICollection.Contains (TKey item) { - return dictionary.ContainsKey(item); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - void ICollection.Add (TKey item) { - throw new NotSupportedException(EditReadOnlyListMessage); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - void ICollection.Clear () { - throw new NotSupportedException(EditReadOnlyListMessage); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - bool ICollection.IsReadOnly { - get { - return true; - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - bool ICollection.Remove (TKey item) { - throw new NotSupportedException(EditReadOnlyListMessage); - } - - IEnumerator IEnumerable.GetEnumerator () { - return GetEnumerator(); - } - } - - /// - /// Wraps the keys in an OrderDictionary. - /// - public sealed class ValueCollection : ICollection - { - private readonly List values; - - /// - /// Initializes a new instance of a ValueCollection. - /// - /// The OrderedDictionary whose keys to wrap. - /// The dictionary is null. - internal ValueCollection (List values) { - this.values = values; - } - - /// - /// Copies the values from the OrderedDictionary to the given array, starting at the given index. - /// - /// The array to copy the values to. - /// The index into the array to start copying the values. - /// The array is null. - /// The arrayIndex is negative. - /// The array, starting at the given index, is not large enough to contain all the values. - public void CopyTo (TValue[] array, int arrayIndex) { - values.CopyTo(array, arrayIndex); - } - - /// - /// Gets the number of values in the OrderedDictionary. - /// - public int Count { - get { - return values.Count; - } - } - - /// - /// Gets an enumerator over the values in the OrderedDictionary. - /// - /// The enumerator. - public IEnumerator GetEnumerator () { - return values.GetEnumerator(); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - bool ICollection.Contains (TValue item) { - return values.Contains(item); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - void ICollection.Add (TValue item) { - throw new NotSupportedException(EditReadOnlyListMessage); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - void ICollection.Clear () { - throw new NotSupportedException(EditReadOnlyListMessage); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - bool ICollection.IsReadOnly { - get { - return true; - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - bool ICollection.Remove (TValue item) { - throw new NotSupportedException(EditReadOnlyListMessage); - } - - IEnumerator IEnumerable.GetEnumerator () { - return GetEnumerator(); - } - } - } - - internal class OrderedDictionaryDebugView - { - private readonly OrderedDictionary dictionary; - - public OrderedDictionaryDebugView (OrderedDictionary dictionary) { - this.dictionary = dictionary; - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public KeyValuePair[] Items { - get { - return dictionary.ToArray(); - } - } - } - - /// - /// Provides extensions methods for constructing instances of . - /// - public static class CollectionExtensions - { - #region ToOrderedDictionary - - /// - /// Creates a new OrderedDictionary from the given collection, using the key selector to extract the key. - /// - /// The type of the items in the collection. - /// The type of the key. - /// The items to created the OrderedDictionary from. - /// A delegate that can extract a key from an item in the collection. - /// An OrderedDictionary mapping the extracted keys to their values. - public static OrderedDictionary ToOrderedDictionary (this IEnumerable source, Func keySelector) { - return ToOrderedDictionary(source, keySelector, null); - } - - /// - /// Creates a new OrderedDictionary from the given collection, using the key selector to extract the key. - /// The key comparer is passed to the OrderedDictionary for comparing the extracted keys. - /// - /// The type of the items in the collection. - /// The type of the key. - /// The items to created the OrderedDictionary from. - /// A delegate that can extract a key from an item in the collection. - /// The key equality comparer to use to compare keys in the dictionary. - /// An OrderedDictionary mapping the extracted keys to their values. - public static OrderedDictionary ToOrderedDictionary ( - this IEnumerable source, - Func keySelector, - IEqualityComparer comparer) { - if (source == null) { - throw new ArgumentNullException("source"); - } - if (keySelector == null) { - throw new ArgumentNullException("keySelector"); - } - var dictionary = new OrderedDictionary(comparer); - foreach (TSource item in source) { - TKey key = keySelector(item); - dictionary.Add(key, item); - } - return dictionary; - } - - #endregion - } -} diff --git a/Assets/Spine/Runtime/spine-csharp/Collections/OrderedDictionary.cs.meta b/Assets/Spine/Runtime/spine-csharp/Collections/OrderedDictionary.cs.meta deleted file mode 100644 index 97e097a66..000000000 --- a/Assets/Spine/Runtime/spine-csharp/Collections/OrderedDictionary.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ca4b738078ed756469d5d97bcca93e6f -timeCreated: 1636570216 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-csharp/ConstraintData.cs b/Assets/Spine/Runtime/spine-csharp/ConstraintData.cs deleted file mode 100644 index d4f950322..000000000 --- a/Assets/Spine/Runtime/spine-csharp/ConstraintData.cs +++ /dev/null @@ -1,62 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using System; -using System.Collections.Generic; - -namespace Spine -{ - /// The base class for all constraint datas. - public abstract class ConstraintData { - internal readonly string name; - internal int order; - internal bool skinRequired; - - public ConstraintData (string name) { - if (name == null) throw new ArgumentNullException("name", "name cannot be null."); - this.name = name; - } - - /// The constraint's name, which is unique across all constraints in the skeleton of the same type. - public string Name { get { return name; } } - - ///The ordinal of this constraint for the order a skeleton's constraints will be applied by - /// . - public int Order { get { return order; } set { order = value; } } - - ///When true, only updates this constraint if the contains - /// this constraint. - /// - public bool SkinRequired { get { return skinRequired; } set { skinRequired = value; } } - - override public string ToString () { - return name; - } - } -} diff --git a/Assets/Spine/Runtime/spine-csharp/ConstraintData.cs.meta b/Assets/Spine/Runtime/spine-csharp/ConstraintData.cs.meta deleted file mode 100644 index 961c6fdba..000000000 --- a/Assets/Spine/Runtime/spine-csharp/ConstraintData.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 55d3827079aca3a4687535c3ede7ec5f -timeCreated: 1636570216 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-csharp/Event.cs b/Assets/Spine/Runtime/spine-csharp/Event.cs index 72c3b70d2..226c4cb2e 100644 --- a/Assets/Spine/Runtime/spine-csharp/Event.cs +++ b/Assets/Spine/Runtime/spine-csharp/Event.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -38,7 +38,7 @@ namespace Spine { internal float floatValue; internal string stringValue; internal float volume; - internal float balance; + internal float balance; public EventData Data { get { return data; } } /// The animation time this event was keyed. diff --git a/Assets/Spine/Runtime/spine-csharp/EventData.cs b/Assets/Spine/Runtime/spine-csharp/EventData.cs index 39094f411..26bca7efc 100644 --- a/Assets/Spine/Runtime/spine-csharp/EventData.cs +++ b/Assets/Spine/Runtime/spine-csharp/EventData.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -34,7 +34,7 @@ namespace Spine { public class EventData { internal string name; - /// The name of the event, which is unique across all events in the skeleton. + /// The name of the event, which is unique within the skeleton. public string Name { get { return name; } } public int Int { get; set; } public float Float { get; set; } diff --git a/Assets/Spine/Runtime/spine-csharp/ExposedList.cs b/Assets/Spine/Runtime/spine-csharp/ExposedList.cs index 7d0b69711..7a0d8f62b 100644 --- a/Assets/Spine/Runtime/spine-csharp/ExposedList.cs +++ b/Assets/Spine/Runtime/spine-csharp/ExposedList.cs @@ -17,10 +17,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -141,23 +141,6 @@ namespace Spine { } } - // Additional overload provided because ExposedList only implements IEnumerable, - // leading to sub-optimal behavior: It grows multiple times as it assumes not - // to know the final size ahead of insertion. - public void AddRange (ExposedList list) { - CheckCollection(list); - - int collectionCount = list.Count; - if (collectionCount == 0) - return; - - GrowIfNeeded(collectionCount); - list.CopyTo(Items, Count); - Count += collectionCount; - - version++; - } - public void AddRange (IEnumerable collection) { CheckCollection(collection); @@ -483,7 +466,7 @@ namespace Spine { public T Pop () { if (Count == 0) throw new InvalidOperationException("List is empty. Nothing to pop."); - + int i = Count - 1; T item = Items[i]; Items[i] = default(T); diff --git a/Assets/Spine/Runtime/spine-csharp/IConstraint.cs b/Assets/Spine/Runtime/spine-csharp/IConstraint.cs new file mode 100644 index 000000000..8f17c0439 --- /dev/null +++ b/Assets/Spine/Runtime/spine-csharp/IConstraint.cs @@ -0,0 +1,39 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +namespace Spine { + + /// The interface for all constraints. + public interface IConstraint : IUpdatable { + /// The ordinal for the order a skeleton's constraints will be applied. + int Order { get; } + + } + +} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/DataReloadHandler.cs.meta b/Assets/Spine/Runtime/spine-csharp/IConstraint.cs.meta similarity index 76% rename from Assets/Spine/Editor/spine-unity/Editor/Utility/DataReloadHandler.cs.meta rename to Assets/Spine/Runtime/spine-csharp/IConstraint.cs.meta index 21bfdf21d..84d18969d 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/DataReloadHandler.cs.meta +++ b/Assets/Spine/Runtime/spine-csharp/IConstraint.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: d8a1a76014a68634a8ede50af6db1cae -timeCreated: 1563310382 +guid: 1193bcbef8900304db4c4ae8c750f617 +timeCreated: 1474766505 licenseType: Free MonoImporter: serializedVersion: 2 diff --git a/Assets/Spine/Runtime/spine-csharp/IUpdatable.cs b/Assets/Spine/Runtime/spine-csharp/IUpdatable.cs index aa380adff..3c2e6021a 100644 --- a/Assets/Spine/Runtime/spine-csharp/IUpdatable.cs +++ b/Assets/Spine/Runtime/spine-csharp/IUpdatable.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,28 +15,20 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ namespace Spine { - - ///The interface for items updated by . public interface IUpdatable { void Update (); - - ///Returns false when this item has not been updated because a skin is required and the active - /// skin does not contain this item. - /// - /// - bool Active { get; } } } diff --git a/Assets/Spine/Runtime/spine-csharp/IkConstraint.cs b/Assets/Spine/Runtime/spine-csharp/IkConstraint.cs index 1d88c4a63..8b5ba1a36 100644 --- a/Assets/Spine/Runtime/spine-csharp/IkConstraint.cs +++ b/Assets/Spine/Runtime/spine-csharp/IkConstraint.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -37,22 +37,19 @@ namespace Spine { /// /// See IK constraints in the Spine User Guide. /// - public class IkConstraint : IUpdatable { + public class IkConstraint : IConstraint { internal IkConstraintData data; internal ExposedList bones = new ExposedList(); internal Bone target; internal int bendDirection; internal bool compress, stretch; - internal float mix = 1, softness; - - internal bool active; + internal float mix = 1; public IkConstraint (IkConstraintData data, Skeleton skeleton) { if (data == null) throw new ArgumentNullException("data", "data cannot be null."); if (skeleton == null) throw new ArgumentNullException("skeleton", "skeleton cannot be null."); this.data = data; mix = data.mix; - softness = data.softness; bendDirection = data.bendDirection; compress = data.compress; stretch = data.stretch; @@ -73,7 +70,6 @@ namespace Spine { bones.Add(skeleton.Bones.Items[bone.data.index]); target = skeleton.Bones.Items[constraint.target.data.index]; mix = constraint.mix; - softness = constraint.softness; bendDirection = constraint.bendDirection; compress = constraint.compress; stretch = constraint.stretch; @@ -92,11 +88,16 @@ namespace Spine { Apply(bones.Items[0], target.worldX, target.worldY, compress, stretch, data.uniform, mix); break; case 2: - Apply(bones.Items[0], bones.Items[1], target.worldX, target.worldY, bendDirection, stretch, softness, mix); + Apply(bones.Items[0], bones.Items[1], target.worldX, target.worldY, bendDirection, stretch, mix); break; } } + + public int Order { + get { return data.order; } + } + /// The bones that will be modified by this IK constraint. public ExposedList Bones { get { return bones; } @@ -114,12 +115,6 @@ namespace Spine { set { mix = value; } } - ///For two bone IK, the distance from the maximum reach of the bones that rotation will slow. - public float Softness { - get { return softness; } - set { softness = value; } - } - /// Controls the bend direction of the IK bones, either 1 or -1. public int BendDirection { get { return bendDirection; } @@ -141,10 +136,6 @@ namespace Spine { set { stretch = value; } } - public bool Active { - get { return active; } - } - /// The IK constraint's setup pose data. public IkConstraintData Data { get { return data; } @@ -159,53 +150,17 @@ namespace Spine { float alpha) { if (!bone.appliedValid) bone.UpdateAppliedTransform(); Bone p = bone.parent; - - float pa = p.a, pb = p.b, pc = p.c, pd = p.d; - float rotationIK = -bone.ashearX - bone.arotation; - float tx = 0, ty = 0; - - switch(bone.data.transformMode) { - case TransformMode.OnlyTranslation: - tx = targetX - bone.worldX; - ty = targetY - bone.worldY; - break; - case TransformMode.NoRotationOrReflection: { - float s = Math.Abs(pa * pd - pb * pc) / (pa * pa + pc * pc); - float sa = pa / bone.skeleton.ScaleX; - float sc = pc / bone.skeleton.ScaleY; - pb = -sc * s * bone.skeleton.ScaleX; - pd = sa * s * bone.skeleton.ScaleY; - rotationIK += (float)Math.Atan2(pc, pa) * MathUtils.RadDeg; - goto default; // Fall through. - } - default: { - float x = targetX - p.worldX, y = targetY - p.worldY; - float d = pa * pd - pb * pc; - tx = (x * pd - y * pb) / d - bone.ax; - ty = (y * pa - x * pc) / d - bone.ay; - break; - } - } - - rotationIK += (float)Math.Atan2(ty, tx) * MathUtils.RadDeg; + float id = 1 / (p.a * p.d - p.b * p.c); + float x = targetX - p.worldX, y = targetY - p.worldY; + float tx = (x * p.d - y * p.b) * id - bone.ax, ty = (y * p.a - x * p.c) * id - bone.ay; + float rotationIK = (float)Math.Atan2(ty, tx) * MathUtils.RadDeg - bone.ashearX - bone.arotation; if (bone.ascaleX < 0) rotationIK += 180; if (rotationIK > 180) rotationIK -= 360; else if (rotationIK < -180) // rotationIK += 360; - float sx = bone.ascaleX, sy = bone.ascaleY; if (compress || stretch) { - switch (bone.data.transformMode) { - case TransformMode.NoScale: - tx = targetX - bone.worldX; - ty = targetY - bone.worldY; - break; - case TransformMode.NoScaleOrReflection: - tx = targetX - bone.worldX; - ty = targetY - bone.worldY; - break; - } float b = bone.data.length * sx, dd = (float)Math.Sqrt(tx * tx + ty * ty); if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001f) { float s = (dd / b - 1) * alpha + 1; @@ -218,8 +173,7 @@ namespace Spine { /// Applies 2 bone IK. The target is specified in the world coordinate system. /// A direct descendant of the parent bone. - static public void Apply (Bone parent, Bone child, float targetX, float targetY, int bendDir, bool stretch, float softness, - float alpha) { + static public void Apply (Bone parent, Bone child, float targetX, float targetY, int bendDir, bool stretch, float alpha) { if (alpha == 0) { child.UpdateWorldTransform(); return; @@ -261,29 +215,12 @@ namespace Spine { b = pp.b; c = pp.c; d = pp.d; - float id = 1 / (a * d - b * c), x = cwx - pp.worldX, y = cwy - pp.worldY; + float id = 1 / (a * d - b * c), x = targetX - pp.worldX, y = targetY - pp.worldY; + float tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty; + x = cwx - pp.worldX; + y = cwy - pp.worldY; float dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; float l1 = (float)Math.Sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2; - if (l1 < 0.0001f) { - Apply(parent, targetX, targetY, false, stretch, false, alpha); - child.UpdateWorldTransform(cx, cy, 0, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); - return; - } - x = targetX - pp.worldX; - y = targetY - pp.worldY; - float tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py; - float dd = tx * tx + ty * ty; - if (softness != 0) { - softness *= psx * (csx + 1) / 2; - float td = (float)Math.Sqrt(dd), sd = td - l1 - l2 * psx + softness; - if (sd > 0) { - float p = Math.Min(1, sd / (softness * 2)) - 1; - p = (sd - softness * (1 - p * p)) / td; - tx -= p * tx; - ty -= p * ty; - dd = tx * tx + ty * ty; - } - } if (u) { l2 *= psx; float cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); @@ -291,7 +228,7 @@ namespace Spine { cos = -1; else if (cos > 1) { cos = 1; - if (stretch) sx *= ((float)Math.Sqrt(dd) / (l1 + l2) - 1) * alpha + 1; + if (stretch && l1 + l2 > 0.0001f) sx *= ((float)Math.Sqrt(dd) / (l1 + l2) - 1) * alpha + 1; } a2 = (float)Math.Acos(cos) * bendDir; a = l1 + l2 * cos; diff --git a/Assets/Spine/Runtime/spine-csharp/IkConstraintData.cs b/Assets/Spine/Runtime/spine-csharp/IkConstraintData.cs index bc6a1c76f..5a4f7fca7 100644 --- a/Assets/Spine/Runtime/spine-csharp/IkConstraintData.cs +++ b/Assets/Spine/Runtime/spine-csharp/IkConstraintData.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -32,18 +32,27 @@ using System.Collections.Generic; namespace Spine { /// Stores the setup pose for an IkConstraint. - public class IkConstraintData : ConstraintData { - internal ExposedList bones = new ExposedList(); + public class IkConstraintData { + internal string name; + internal int order; + internal List bones = new List(); internal BoneData target; internal int bendDirection = 1; internal bool compress, stretch, uniform; - internal float mix = 1, softness; + internal float mix = 1; - public IkConstraintData (string name) : base(name) { + /// The IK constraint's name, which is unique within the skeleton. + public string Name { + get { return name; } + } + + public int Order { + get { return order; } + set { order = value; } } /// The bones that are constrained by this IK Constraint. - public ExposedList Bones { + public List Bones { get { return bones; } } @@ -60,12 +69,6 @@ namespace Spine { set { mix = value; } } - ///For two bone IK, the distance from the maximum reach of the bones that rotation will slow. - public float Softness { - get { return softness; } - set { softness = value; } - } - /// Controls the bend direction of the IK bones, either 1 or -1. public int BendDirection { get { return bendDirection; } @@ -73,7 +76,7 @@ namespace Spine { } /// - /// When true, and only a single bone is being constrained, + /// When true, and only a single bone is being constrained, /// if the target is too close, the bone is scaled to reach it. public bool Compress { get { return compress; } @@ -81,7 +84,7 @@ namespace Spine { } /// - /// When true, if the target is out of range, the parent bone is scaled on the X axis to reach it. + /// When true, if the target is out of range, the parent bone is scaled on the X axis to reach it. /// If the bone has local nonuniform scale, stretching is not applied. public bool Stretch { get { return stretch; } @@ -89,11 +92,20 @@ namespace Spine { } /// - /// When true, only a single bone is being constrained and Compress or Stretch is used, + /// When true, only a single bone is being constrained and Compress or Stretch is used, /// the bone is scaled both on the X and Y axes. public bool Uniform { get { return uniform; } set { uniform = value; } } + + public IkConstraintData (string name) { + if (name == null) throw new ArgumentNullException("name", "name cannot be null."); + this.name = name; + } + + override public string ToString () { + return name; + } } } diff --git a/Assets/Spine/Runtime/spine-csharp/Json.cs b/Assets/Spine/Runtime/spine-csharp/Json.cs index aa790f422..667a56694 100644 --- a/Assets/Spine/Runtime/spine-csharp/Json.cs +++ b/Assets/Spine/Runtime/spine-csharp/Json.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -45,17 +45,19 @@ namespace Spine { } /** - * Copyright (c) 2016 Adriano Tinoco d'Oliveira Rezende * + * Copyright (c) 2016 Adriano Tinoco d'Oliveira Rezende + * * Based on the JSON parser by Patrick van Bergen * http://techblog.procurios.nl/k/news/view/14605/14863/how-do-i-write-my-own-parser-(for-json).html * * Changes made: + * + * - Optimized parser speed (deserialize roughly near 3x faster than original) + * - Added support to handle lexer/parser error messages with line numbers + * - Added more fine grained control over type conversions during the parsing + * - Refactory API (Separate Lexer code from Parser code and the Encoder from Decoder) * - * - Optimized parser speed (deserialize roughly near 3x faster than original) - * - Added support to handle lexer/parser error messages with line numbers - * - Added more fine grained control over type conversions during the parsing - * - Refactory API (Separate Lexer code from Parser code and the Encoder from Decoder) * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without restriction, @@ -69,6 +71,7 @@ namespace Spine { * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * */ namespace SharpJson { @@ -129,19 +132,19 @@ namespace SharpJson { int idx = 0; StringBuilder builder = null; - + SkipWhiteSpaces(); - + // " char c = json[index++]; - + bool failed = false; bool complete = false; - + while (!complete && !failed) { if (index == json.Length) break; - + c = json[index++]; if (c == '"') { complete = true; @@ -149,9 +152,9 @@ namespace SharpJson } else if (c == '\\') { if (index == json.Length) break; - + c = json[index++]; - + switch (c) { case '"': stringBuffer[idx++] = '"'; @@ -181,10 +184,10 @@ namespace SharpJson int remainingLength = json.Length - index; if (remainingLength >= 4) { var hex = new string(json, index, 4); - + // XXX: handle UTF stringBuffer[idx++] = (char) Convert.ToInt32(hex, 16); - + // skip 4 chars index += 4; } else { @@ -195,38 +198,38 @@ namespace SharpJson } else { stringBuffer[idx++] = c; } - + if (idx >= stringBuffer.Length) { if (builder == null) builder = new StringBuilder(); - + builder.Append(stringBuffer, 0, idx); idx = 0; } } - + if (!complete) { success = false; return null; } - + if (builder != null) return builder.ToString (); else return new string (stringBuffer, 0, idx); } - + string GetNumberString() { SkipWhiteSpaces(); int lastIndex = GetLastIndexOfNumber(index); int charLength = (lastIndex - index) + 1; - + var result = new string (json, index, charLength); - + index = lastIndex + 1; - + return result; } @@ -234,10 +237,10 @@ namespace SharpJson { float number; var str = GetNumberString (); - + if (!float.TryParse (str, NumberStyles.Float, CultureInfo.InvariantCulture, out number)) return 0; - + return number; } @@ -245,25 +248,25 @@ namespace SharpJson { double number; var str = GetNumberString (); - + if (!double.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out number)) return 0; - + return number; } - + int GetLastIndexOfNumber(int index) { int lastIndex; - + for (lastIndex = index; lastIndex < json.Length; lastIndex++) { char ch = json[lastIndex]; - + if ((ch < '0' || ch > '9') && ch != '+' && ch != '-' && ch != '.' && ch != 'e' && ch != 'E') break; } - + return lastIndex - 1; } @@ -298,9 +301,9 @@ namespace SharpJson { if (index == json.Length) return Token.None; - + char c = json[index++]; - + switch (c) { case '{': return Token.CurlyOpen; @@ -323,9 +326,9 @@ namespace SharpJson } index--; - + int remainingLength = json.Length - index; - + // false if (remainingLength >= 5) { if (json[index] == 'f' && @@ -337,7 +340,7 @@ namespace SharpJson return Token.False; } } - + // true if (remainingLength >= 4) { if (json[index] == 't' && @@ -348,7 +351,7 @@ namespace SharpJson return Token.True; } } - + // null if (remainingLength >= 4) { if (json[index] == 'n' && @@ -434,25 +437,25 @@ namespace SharpJson TriggerError("Invalid token; expected ':'"); return null; } - + // value object value = ParseValue(); if (errorMessage != null) return null; - + table[name] = value; break; } } - + //return null; // Unreachable code } IList ParseArray() { var array = new List(); - + // [ lexer.NextToken(); @@ -479,7 +482,7 @@ namespace SharpJson break; } } - + //return null; // Unreachable code } diff --git a/Assets/Spine/Runtime/spine-csharp/MathUtils.cs b/Assets/Spine/Runtime/spine-csharp/MathUtils.cs index ad10ec217..5ff19d3af 100644 --- a/Assets/Spine/Runtime/spine-csharp/MathUtils.cs +++ b/Assets/Spine/Runtime/spine-csharp/MathUtils.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,20 +15,18 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -//#define USE_FAST_SIN_COS_ATAN2_APPROXIMATIONS - using System; namespace Spine { @@ -38,9 +36,6 @@ namespace Spine { public const float RadDeg = 180f / PI; public const float DegRad = PI / 180; - static Random random = new Random(); - - #if USE_FAST_SIN_COS_ATAN2_APPROXIMATIONS const int SIN_BITS = 14; // 16KB. Adjust for accuracy. const int SIN_MASK = ~(-1 << SIN_BITS); const int SIN_COUNT = SIN_MASK + 1; @@ -50,6 +45,8 @@ namespace Spine { const float DegToIndex = SIN_COUNT / DegFull; static float[] sin = new float[SIN_COUNT]; + static Random random = new Random(); + static MathUtils () { for (int i = 0; i < SIN_COUNT; i++) sin[i] = (float)Math.Sin((i + 0.5f) / SIN_COUNT * RadFull); @@ -57,22 +54,22 @@ namespace Spine { sin[(int)(i * DegToIndex) & SIN_MASK] = (float)Math.Sin(i * DegRad); } - /// Returns the sine of a given angle in radians from a lookup table. + /// Returns the sine in radians from a lookup table. static public float Sin (float radians) { return sin[(int)(radians * RadToIndex) & SIN_MASK]; } - /// Returns the cosine of a given angle in radians from a lookup table. + /// Returns the cosine in radians from a lookup table. static public float Cos (float radians) { return sin[(int)((radians + PI / 2) * RadToIndex) & SIN_MASK]; } - - /// Returns the sine of a given angle in degrees from a lookup table. + + /// Returns the sine in radians from a lookup table. static public float SinDeg (float degrees) { return sin[(int)(degrees * DegToIndex) & SIN_MASK]; } - - /// Returns the cosine of a given angle in degrees from a lookup table. + + /// Returns the cosine in radians from a lookup table. static public float CosDeg (float degrees) { return sin[(int)((degrees + 90) * DegToIndex) & SIN_MASK]; } @@ -94,32 +91,7 @@ namespace Spine { atan = PI / 2 - z / (z * z + 0.28f); return y < 0f ? atan - PI : atan; } - #else - /// Returns the sine of a given angle in radians. - static public float Sin (float radians) { - return (float)Math.Sin(radians); - } - /// Returns the cosine of a given angle in radians. - static public float Cos (float radians) { - return (float)Math.Cos(radians); - } - - /// Returns the sine of a given angle in degrees. - static public float SinDeg (float degrees) { - return (float)Math.Sin(degrees * DegRad); - } - - /// Returns the cosine of a given angle in degrees. - static public float CosDeg (float degrees) { - return (float)Math.Cos(degrees * DegRad); - } - - /// Returns the atan2 using Math.Atan2. - static public float Atan2 (float y, float x) { - return (float)Math.Atan2(y, x); - } - #endif static public float Clamp (float value, float min, float max) { if (value < min) return min; if (value > max) return max; diff --git a/Assets/Spine/Runtime/spine-csharp/PathConstraint.cs b/Assets/Spine/Runtime/spine-csharp/PathConstraint.cs index c8fef419e..74bd08a2c 100644 --- a/Assets/Spine/Runtime/spine-csharp/PathConstraint.cs +++ b/Assets/Spine/Runtime/spine-csharp/PathConstraint.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -38,7 +38,7 @@ namespace Spine { /// /// See Path constraints in the Spine User Guide. /// - public class PathConstraint : IUpdatable { + public class PathConstraint : IConstraint { const int NONE = -1, BEFORE = -2, AFTER = -3; const float Epsilon = 0.00001f; @@ -47,8 +47,6 @@ namespace Spine { internal Slot target; internal float position, spacing, rotateMix, translateMix; - internal bool active; - internal ExposedList spaces = new ExposedList(), positions = new ExposedList(); internal ExposedList world = new ExposedList(), curves = new ExposedList(), lengths = new ExposedList(); internal float[] segments = new float[10]; @@ -86,7 +84,7 @@ namespace Spine { public void Apply () { Update(); } - + public void Update () { PathAttachment attachment = target.Attachment as PathAttachment; if (attachment == null) return; @@ -447,7 +445,8 @@ namespace Spine { output[o + 2] = (float)Math.Atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); } } - + + public int Order { get { return data.order; } } /// The position along the path. public float Position { get { return position; } set { position = value; } } /// The spacing between bones. @@ -460,8 +459,11 @@ namespace Spine { public ExposedList Bones { get { return bones; } } /// The slot whose path attachment will be used to constrained the bones. public Slot Target { get { return target; } set { target = value; } } - public bool Active { get { return active; } } /// The path constraint's setup pose data. public PathConstraintData Data { get { return data; } } + + override public string ToString () { + return data.name; + } } } diff --git a/Assets/Spine/Runtime/spine-csharp/PathConstraintData.cs b/Assets/Spine/Runtime/spine-csharp/PathConstraintData.cs index fa6e71fd9..924c99a06 100644 --- a/Assets/Spine/Runtime/spine-csharp/PathConstraintData.cs +++ b/Assets/Spine/Runtime/spine-csharp/PathConstraintData.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,22 +15,24 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; namespace Spine { - public class PathConstraintData : ConstraintData { + public class PathConstraintData { + internal string name; + internal int order; internal ExposedList bones = new ExposedList(); internal SlotData target; internal PositionMode positionMode; @@ -39,11 +41,10 @@ namespace Spine { internal float offsetRotation; internal float position, spacing, rotateMix, translateMix; - public PathConstraintData (string name) : base(name) { - } - + public string Name { get { return name; } } + public int Order { get { return order; } set { order = value; } } public ExposedList Bones { get { return bones; } } - public SlotData Target { get { return target; } set { target = value; } } + public SlotData Target { get { return target; } set { target = value; } } public PositionMode PositionMode { get { return positionMode; } set { positionMode = value; } } public SpacingMode SpacingMode { get { return spacingMode; } set { spacingMode = value; } } public RotateMode RotateMode { get { return rotateMode; } set { rotateMode = value; } } @@ -52,10 +53,19 @@ namespace Spine { public float Spacing { get { return spacing; } set { spacing = value; } } public float RotateMix { get { return rotateMix; } set { rotateMix = value; } } public float TranslateMix { get { return translateMix; } set { translateMix = value; } } - } + public PathConstraintData (String name) { + if (name == null) throw new ArgumentNullException("name", "name cannot be null."); + this.name = name; + } + + public override string ToString () { + return name; + } + } + public enum PositionMode { - Fixed, Percent + Fixed, Percent } public enum SpacingMode { diff --git a/Assets/Spine/Runtime/spine-csharp/Skeleton.cs b/Assets/Spine/Runtime/spine-csharp/Skeleton.cs index 1bd501723..8e0491b03 100644 --- a/Assets/Spine/Runtime/spine-csharp/Skeleton.cs +++ b/Assets/Spine/Runtime/spine-csharp/Skeleton.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -44,7 +44,7 @@ namespace Spine { internal Skin skin; internal float r = 1, g = 1, b = 1, a = 1; internal float time; - private float scaleX = 1, scaleY = 1; + internal float scaleX = 1, scaleY = 1; internal float x, y; public SkeletonData Data { get { return data; } } @@ -55,7 +55,7 @@ namespace Spine { public ExposedList IkConstraints { get { return ikConstraints; } } public ExposedList PathConstraints { get { return pathConstraints; } } public ExposedList TransformConstraints { get { return transformConstraints; } } - public Skin Skin { get { return skin; } set { SetSkin(value); } } + public Skin Skin { get { return skin; } set { skin = value; } } public float R { get { return r; } set { r = value; } } public float G { get { return g; } set { g = value; } } public float B { get { return b; } set { b = value; } } @@ -64,7 +64,7 @@ namespace Spine { public float X { get { return x; } set { x = value; } } public float Y { get { return y; } set { y = value; } } public float ScaleX { get { return scaleX; } set { scaleX = value; } } - public float ScaleY { get { return scaleY * (Bone.yDown ? -1 : 1); } set { scaleY = value; } } + public float ScaleY { get { return scaleY; } set { scaleY = value; } } [Obsolete("Use ScaleX instead. FlipX is when ScaleX is negative.")] public bool FlipX { get { return scaleX < 0; } set { scaleX = value ? -1f : 1f; } } @@ -84,7 +84,7 @@ namespace Spine { foreach (BoneData boneData in data.bones) { Bone bone; if (boneData.parent == null) { - bone = new Bone(boneData, this, null); + bone = new Bone(boneData, this, null); } else { Bone parent = bones.Items[boneData.parent.index]; bone = new Bone(boneData, this, parent); @@ -118,36 +118,21 @@ namespace Spine { UpdateWorldTransform(); } - /// Caches information about bones and constraints. Must be called if the is modified or if bones, constraints, or - /// constraints, or weighted path attachments are added or removed. + /// Caches information about bones and constraints. Must be called if bones, constraints or weighted path attachments are added + /// or removed. public void UpdateCache () { var updateCache = this.updateCache; updateCache.Clear(); this.updateCacheReset.Clear(); - int boneCount = this.bones.Items.Length; var bones = this.bones; - for (int i = 0; i < boneCount; i++) { - Bone bone = bones.Items[i]; - bone.sorted = bone.data.skinRequired; - bone.active = !bone.sorted; - } - if (skin != null) { - Object[] skinBones = skin.bones.Items; - for (int i = 0, n = skin.bones.Count; i < n; i++) { - Bone bone = (Bone)bones.Items[((BoneData)skinBones[i]).index]; - do { - bone.sorted = false; - bone.active = true; - bone = bone.parent; - } while (bone != null); - } - } + for (int i = 0, n = bones.Count; i < n; i++) + bones.Items[i].sorted = false; - int ikCount = this.ikConstraints.Count, transformCount = this.transformConstraints.Count, pathCount = this.pathConstraints.Count; var ikConstraints = this.ikConstraints; var transformConstraints = this.transformConstraints; var pathConstraints = this.pathConstraints; + int ikCount = ikConstraints.Count, transformCount = transformConstraints.Count, pathCount = pathConstraints.Count; int constraintCount = ikCount + transformCount + pathCount; //outer: for (int i = 0; i < constraintCount; i++) { @@ -175,15 +160,11 @@ namespace Spine { continue_outer: {} } - for (int i = 0; i < boneCount; i++) + for (int i = 0, n = bones.Count; i < n; i++) SortBone(bones.Items[i]); } private void SortIkConstraint (IkConstraint constraint) { - constraint.active = constraint.target.active - && (!constraint.data.skinRequired || (skin != null && skin.constraints.Contains(constraint.data))); - if (!constraint.active) return; - Bone target = constraint.target; SortBone(target); @@ -204,16 +185,14 @@ namespace Spine { } private void SortPathConstraint (PathConstraint constraint) { - constraint.active = constraint.target.bone.active - && (!constraint.data.skinRequired || (skin != null && skin.constraints.Contains(constraint.data))); - if (!constraint.active) return; - Slot slot = constraint.target; int slotIndex = slot.data.index; Bone slotBone = slot.bone; if (skin != null) SortPathConstraintAttachment(skin, slotIndex, slotBone); if (data.defaultSkin != null && data.defaultSkin != skin) SortPathConstraintAttachment(data.defaultSkin, slotIndex, slotBone); + for (int ii = 0, nn = data.skins.Count; ii < nn; ii++) + SortPathConstraintAttachment(data.skins.Items[ii], slotIndex, slotBone); Attachment attachment = slot.attachment; if (attachment is PathAttachment) SortPathConstraintAttachment(attachment, slotBone); @@ -232,10 +211,6 @@ namespace Spine { } private void SortTransformConstraint (TransformConstraint constraint) { - constraint.active = constraint.target.active - && (!constraint.data.skinRequired || (skin != null && skin.constraints.Contains(constraint.data))); - if (!constraint.active) return; - SortBone(constraint.target); var constrained = constraint.bones; @@ -260,10 +235,8 @@ namespace Spine { } private void SortPathConstraintAttachment (Skin skin, int slotIndex, Bone slotBone) { - foreach (var entryObj in skin.Attachments.Keys) { - var entry = (Skin.SkinEntry)entryObj; - if (entry.SlotIndex == slotIndex) SortPathConstraintAttachment(entry.Attachment, slotBone); - } + foreach (var entry in skin.Attachments) + if (entry.Key.slotIndex == slotIndex) SortPathConstraintAttachment(entry.Value, slotBone); } private void SortPathConstraintAttachment (Attachment attachment, Bone slotBone) { @@ -294,7 +267,6 @@ namespace Spine { var bonesItems = bones.Items; for (int i = 0, n = bones.Count; i < n; i++) { Bone bone = bonesItems[i]; - if (!bone.active) continue; if (bone.sorted) SortReset(bone.children); bone.sorted = false; } @@ -321,8 +293,7 @@ namespace Spine { } /// - /// Temporarily sets the root bone as a child of the specified bone, then updates the world transform for each bone and applies - /// all constraints. + /// Updates the world transform for each bone and applies all constraints. The root bone will be temporarily parented to the specified bone. /// public void UpdateWorldTransform (Bone parent) { // This partial update avoids computing the world transform for constrained bones when 1) the bone is not updated @@ -342,7 +313,8 @@ namespace Spine { bone.appliedValid = true; } - // Apply the parent bone transform to the root bone. The root bone always inherits scale, rotation and reflection. + // Apply the parent bone transform to the root bone. The root bone + // always inherits scale, rotation and reflection. Bone rootBone = this.RootBone; float pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; rootBone.worldX = pa * x + pb * y + parent.worldX; @@ -384,7 +356,6 @@ namespace Spine { for (int i = 0, n = ikConstraints.Count; i < n; i++) { IkConstraint constraint = ikConstraintsItems[i]; constraint.mix = constraint.data.mix; - constraint.softness = constraint.data.softness; constraint.bendDirection = constraint.data.bendDirection; constraint.compress = constraint.data.compress; constraint.stretch = constraint.data.stretch; @@ -474,20 +445,15 @@ namespace Spine { } /// - /// Sets the skin used to look up attachments before looking in the . If the - /// skin is changed, is called. - /// - /// Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. - /// If there was no old skin, each slot's setup mode attachment is attached from the new skin. - /// - /// After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling - /// . - /// Also, often is called before the next time the + /// Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. + /// If there was no old skin, each slot's setup mode attachment is attached from the new skin. + /// After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling + /// . + /// Also, often is called before the next time the /// skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin. /// /// May be null. public void SetSkin (Skin newSkin) { - if (newSkin == skin) return; if (newSkin != null) { if (skin != null) newSkin.AttachAll(this, skin); @@ -504,7 +470,6 @@ namespace Spine { } } skin = newSkin; - UpdateCache(); } /// Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment name. @@ -525,7 +490,7 @@ namespace Spine { } /// A convenience method to set an attachment by finding the slot with FindSlot, finding the attachment with GetAttachment, then setting the slot's slot.Attachment. - /// May be null to clear the slot's attachment. + /// May be null. public void SetAttachment (string slotName, string attachmentName) { if (slotName == null) throw new ArgumentNullException("slotName", "slotName cannot be null."); ExposedList slots = this.slots; @@ -543,7 +508,7 @@ namespace Spine { } throw new Exception("Slot not found: " + slotName); } - + /// May be null. public IkConstraint FindIkConstraint (string constraintName) { if (constraintName == null) throw new ArgumentNullException("constraintName", "constraintName cannot be null."); @@ -561,7 +526,7 @@ namespace Spine { ExposedList transformConstraints = this.transformConstraints; for (int i = 0, n = transformConstraints.Count; i < n; i++) { TransformConstraint transformConstraint = transformConstraints.Items[i]; - if (transformConstraint.data.Name == constraintName) return transformConstraint; + if (transformConstraint.data.name == constraintName) return transformConstraint; } return null; } @@ -572,7 +537,7 @@ namespace Spine { ExposedList pathConstraints = this.pathConstraints; for (int i = 0, n = pathConstraints.Count; i < n; i++) { PathConstraint constraint = pathConstraints.Items[i]; - if (constraint.data.Name.Equals(constraintName)) return constraint; + if (constraint.data.name.Equals(constraintName)) return constraint; } return null; } @@ -592,9 +557,8 @@ namespace Spine { temp = temp ?? new float[8]; var drawOrderItems = this.drawOrder.Items; float minX = int.MaxValue, minY = int.MaxValue, maxX = int.MinValue, maxY = int.MinValue; - for (int i = 0, n = drawOrderItems.Length; i < n; i++) { + for (int i = 0, n = this.drawOrder.Count; i < n; i++) { Slot slot = drawOrderItems[i]; - if (!slot.bone.active) continue; int verticesLength = 0; float[] vertices = null; Attachment attachment = slot.attachment; diff --git a/Assets/Spine/Runtime/spine-csharp/SkeletonBinary.cs b/Assets/Spine/Runtime/spine-csharp/SkeletonBinary.cs index 810c22b72..6b3dac21d 100644 --- a/Assets/Spine/Runtime/spine-csharp/SkeletonBinary.cs +++ b/Assets/Spine/Runtime/spine-csharp/SkeletonBinary.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if (UNITY_5 || UNITY_5_3_OR_NEWER || UNITY_WSA || UNITY_WP8 || UNITY_WP8_1) @@ -62,6 +62,7 @@ namespace Spine { public float Scale { get; set; } private AttachmentLoader attachmentLoader; + private byte[] buffer = new byte[32]; private List linkedMeshes = new List(); public SkeletonBinary (params Atlas[] atlasArray) @@ -73,7 +74,7 @@ namespace Spine { this.attachmentLoader = attachmentLoader; Scale = 1; } - + #if !ISUNITY && WINDOWS_STOREAPP private async Task ReadFile(string path) { var folder = Windows.ApplicationModel.Package.Current.InstalledLocation; @@ -110,85 +111,83 @@ namespace Spine { }; /// Returns the version string of binary skeleton data. - public static string GetVersionString (Stream file) { - if (file == null) throw new ArgumentNullException("file"); + public static string GetVersionString (Stream input) { + if (input == null) throw new ArgumentNullException("input"); - SkeletonInput input = new SkeletonInput(file); - return input.GetVersionString(); + try { + // Hash. + int byteCount = ReadVarint(input, true); + if (byteCount > 1) input.Position += byteCount - 1; + + // Version. + byteCount = ReadVarint(input, true); + if (byteCount > 1) { + byteCount--; + var buffer = new byte[byteCount]; + ReadFully(input, buffer, 0, byteCount); + return System.Text.Encoding.UTF8.GetString(buffer, 0, byteCount); + } + + throw new ArgumentException("Stream does not contain a valid binary Skeleton Data.", "input"); + } catch (Exception e) { + throw new ArgumentException("Stream does not contain a valid binary Skeleton Data.\n" + e, "input"); + } } - public SkeletonData ReadSkeletonData (Stream file) { - if (file == null) throw new ArgumentNullException("file"); + public SkeletonData ReadSkeletonData (Stream input) { + if (input == null) throw new ArgumentNullException("input"); float scale = Scale; var skeletonData = new SkeletonData(); - SkeletonInput input = new SkeletonInput(file); - - skeletonData.hash = input.ReadString(); + skeletonData.hash = ReadString(input); if (skeletonData.hash.Length == 0) skeletonData.hash = null; - skeletonData.version = input.ReadString(); + skeletonData.version = ReadString(input); if (skeletonData.version.Length == 0) skeletonData.version = null; - if ("3.8.75" == skeletonData.version) - throw new Exception("Unsupported skeleton data, please export with a newer version of Spine."); - skeletonData.x = input.ReadFloat(); - skeletonData.y = input.ReadFloat(); - skeletonData.width = input.ReadFloat(); - skeletonData.height = input.ReadFloat(); + skeletonData.width = ReadFloat(input); + skeletonData.height = ReadFloat(input); - bool nonessential = input.ReadBoolean(); + bool nonessential = ReadBoolean(input); if (nonessential) { - skeletonData.fps = input.ReadFloat(); + skeletonData.fps = ReadFloat(input); - skeletonData.imagesPath = input.ReadString(); + skeletonData.imagesPath = ReadString(input); if (string.IsNullOrEmpty(skeletonData.imagesPath)) skeletonData.imagesPath = null; - skeletonData.audioPath = input.ReadString(); + skeletonData.audioPath = ReadString(input); if (string.IsNullOrEmpty(skeletonData.audioPath)) skeletonData.audioPath = null; } - int n; - Object[] o; - - // Strings. - input.strings = new ExposedList(n = input.ReadInt(true)); - o = input.strings.Resize(n).Items; - for (int i = 0; i < n; i++) - o[i] = input.ReadString(); - // Bones. - o = skeletonData.bones.Resize(n = input.ReadInt(true)).Items; - for (int i = 0; i < n; i++) { - String name = input.ReadString(); - BoneData parent = i == 0 ? null : skeletonData.bones.Items[input.ReadInt(true)]; + for (int i = 0, n = ReadVarint(input, true); i < n; i++) { + String name = ReadString(input); + BoneData parent = i == 0 ? null : skeletonData.bones.Items[ReadVarint(input, true)]; BoneData data = new BoneData(i, name, parent); - data.rotation = input.ReadFloat(); - data.x = input.ReadFloat() * scale; - data.y = input.ReadFloat() * scale; - data.scaleX = input.ReadFloat(); - data.scaleY = input.ReadFloat(); - data.shearX = input.ReadFloat(); - data.shearY = input.ReadFloat(); - data.length = input.ReadFloat() * scale; - data.transformMode = TransformModeValues[input.ReadInt(true)]; - data.skinRequired = input.ReadBoolean(); - if (nonessential) input.ReadInt(); // Skip bone color. - o[i] = data; + data.rotation = ReadFloat(input); + data.x = ReadFloat(input) * scale; + data.y = ReadFloat(input) * scale; + data.scaleX = ReadFloat(input); + data.scaleY = ReadFloat(input); + data.shearX = ReadFloat(input); + data.shearY = ReadFloat(input); + data.length = ReadFloat(input) * scale; + data.transformMode = TransformModeValues[ReadVarint(input, true)]; + if (nonessential) ReadInt(input); // Skip bone color. + skeletonData.bones.Add(data); } // Slots. - o = skeletonData.slots.Resize(n = input.ReadInt(true)).Items; - for (int i = 0; i < n; i++) { - String slotName = input.ReadString(); - BoneData boneData = skeletonData.bones.Items[input.ReadInt(true)]; + for (int i = 0, n = ReadVarint(input, true); i < n; i++) { + String slotName = ReadString(input); + BoneData boneData = skeletonData.bones.Items[ReadVarint(input, true)]; SlotData slotData = new SlotData(i, slotName, boneData); - int color = input.ReadInt(); + int color = ReadInt(input); slotData.r = ((color & 0xff000000) >> 24) / 255f; slotData.g = ((color & 0x00ff0000) >> 16) / 255f; slotData.b = ((color & 0x0000ff00) >> 8) / 255f; slotData.a = ((color & 0x000000ff)) / 255f; - int darkColor = input.ReadInt(); // 0x00rrggbb + int darkColor = ReadInt(input); // 0x00rrggbb if (darkColor != -1) { slotData.hasSecondColor = true; slotData.r2 = ((darkColor & 0x00ff0000) >> 16) / 255f; @@ -196,187 +195,154 @@ namespace Spine { slotData.b2 = ((darkColor & 0x000000ff)) / 255f; } - slotData.attachmentName = input.ReadStringRef(); - slotData.blendMode = (BlendMode)input.ReadInt(true); - o[i] = slotData; + slotData.attachmentName = ReadString(input); + slotData.blendMode = (BlendMode)ReadVarint(input, true); + skeletonData.slots.Add(slotData); } // IK constraints. - o = skeletonData.ikConstraints.Resize(n = input.ReadInt(true)).Items; - for (int i = 0, nn; i < n; i++) { - IkConstraintData data = new IkConstraintData(input.ReadString()); - data.order = input.ReadInt(true); - data.skinRequired = input.ReadBoolean(); - Object[] bones = data.bones.Resize(nn = input.ReadInt(true)).Items; - for (int ii = 0; ii < nn; ii++) - bones[ii] = skeletonData.bones.Items[input.ReadInt(true)]; - data.target = skeletonData.bones.Items[input.ReadInt(true)]; - data.mix = input.ReadFloat(); - data.softness = input.ReadFloat() * scale; - data.bendDirection = input.ReadSByte(); - data.compress = input.ReadBoolean(); - data.stretch = input.ReadBoolean(); - data.uniform = input.ReadBoolean(); - o[i] = data; + for (int i = 0, n = ReadVarint(input, true); i < n; i++) { + IkConstraintData data = new IkConstraintData(ReadString(input)); + data.order = ReadVarint(input, true); + for (int ii = 0, nn = ReadVarint(input, true); ii < nn; ii++) + data.bones.Add(skeletonData.bones.Items[ReadVarint(input, true)]); + data.target = skeletonData.bones.Items[ReadVarint(input, true)]; + data.mix = ReadFloat(input); + data.bendDirection = ReadSByte(input); + data.compress = ReadBoolean(input); + data.stretch = ReadBoolean(input); + data.uniform = ReadBoolean(input); + skeletonData.ikConstraints.Add(data); } // Transform constraints. - o = skeletonData.transformConstraints.Resize(n = input.ReadInt(true)).Items; - for (int i = 0, nn; i < n; i++) { - TransformConstraintData data = new TransformConstraintData(input.ReadString()); - data.order = input.ReadInt(true); - data.skinRequired = input.ReadBoolean(); - Object[] bones = data.bones.Resize(nn = input.ReadInt(true)).Items; - for (int ii = 0; ii < nn; ii++) - bones[ii] = skeletonData.bones.Items[input.ReadInt(true)]; - data.target = skeletonData.bones.Items[input.ReadInt(true)]; - data.local = input.ReadBoolean(); - data.relative = input.ReadBoolean(); - data.offsetRotation = input.ReadFloat(); - data.offsetX = input.ReadFloat() * scale; - data.offsetY = input.ReadFloat() * scale; - data.offsetScaleX = input.ReadFloat(); - data.offsetScaleY = input.ReadFloat(); - data.offsetShearY = input.ReadFloat(); - data.rotateMix = input.ReadFloat(); - data.translateMix = input.ReadFloat(); - data.scaleMix = input.ReadFloat(); - data.shearMix = input.ReadFloat(); - o[i] = data; + for (int i = 0, n = ReadVarint(input, true); i < n; i++) { + TransformConstraintData data = new TransformConstraintData(ReadString(input)); + data.order = ReadVarint(input, true); + for (int ii = 0, nn = ReadVarint(input, true); ii < nn; ii++) + data.bones.Add(skeletonData.bones.Items[ReadVarint(input, true)]); + data.target = skeletonData.bones.Items[ReadVarint(input, true)]; + data.local = ReadBoolean(input); + data.relative = ReadBoolean(input); + data.offsetRotation = ReadFloat(input); + data.offsetX = ReadFloat(input) * scale; + data.offsetY = ReadFloat(input) * scale; + data.offsetScaleX = ReadFloat(input); + data.offsetScaleY = ReadFloat(input); + data.offsetShearY = ReadFloat(input); + data.rotateMix = ReadFloat(input); + data.translateMix = ReadFloat(input); + data.scaleMix = ReadFloat(input); + data.shearMix = ReadFloat(input); + skeletonData.transformConstraints.Add(data); } // Path constraints - o = skeletonData.pathConstraints.Resize(n = input.ReadInt(true)).Items; - for (int i = 0, nn; i < n; i++) { - PathConstraintData data = new PathConstraintData(input.ReadString()); - data.order = input.ReadInt(true); - data.skinRequired = input.ReadBoolean(); - Object[] bones = data.bones.Resize(nn = input.ReadInt(true)).Items; - for (int ii = 0; ii < nn; ii++) - bones[ii] = skeletonData.bones.Items[input.ReadInt(true)]; - data.target = skeletonData.slots.Items[input.ReadInt(true)]; - data.positionMode = (PositionMode)Enum.GetValues(typeof(PositionMode)).GetValue(input.ReadInt(true)); - data.spacingMode = (SpacingMode)Enum.GetValues(typeof(SpacingMode)).GetValue(input.ReadInt(true)); - data.rotateMode = (RotateMode)Enum.GetValues(typeof(RotateMode)).GetValue(input.ReadInt(true)); - data.offsetRotation = input.ReadFloat(); - data.position = input.ReadFloat(); + for (int i = 0, n = ReadVarint(input, true); i < n; i++) { + PathConstraintData data = new PathConstraintData(ReadString(input)); + data.order = ReadVarint(input, true); + for (int ii = 0, nn = ReadVarint(input, true); ii < nn; ii++) + data.bones.Add(skeletonData.bones.Items[ReadVarint(input, true)]); + data.target = skeletonData.slots.Items[ReadVarint(input, true)]; + data.positionMode = (PositionMode)Enum.GetValues(typeof(PositionMode)).GetValue(ReadVarint(input, true)); + data.spacingMode = (SpacingMode)Enum.GetValues(typeof(SpacingMode)).GetValue(ReadVarint(input, true)); + data.rotateMode = (RotateMode)Enum.GetValues(typeof(RotateMode)).GetValue(ReadVarint(input, true)); + data.offsetRotation = ReadFloat(input); + data.position = ReadFloat(input); if (data.positionMode == PositionMode.Fixed) data.position *= scale; - data.spacing = input.ReadFloat(); + data.spacing = ReadFloat(input); if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) data.spacing *= scale; - data.rotateMix = input.ReadFloat(); - data.translateMix = input.ReadFloat(); - o[i] = data; + data.rotateMix = ReadFloat(input); + data.translateMix = ReadFloat(input); + skeletonData.pathConstraints.Add(data); } // Default skin. - Skin defaultSkin = ReadSkin(input, skeletonData, true, nonessential); + Skin defaultSkin = ReadSkin(input, skeletonData, "default", nonessential); if (defaultSkin != null) { skeletonData.defaultSkin = defaultSkin; skeletonData.skins.Add(defaultSkin); } // Skins. - { - int i = skeletonData.skins.Count; - o = skeletonData.skins.Resize(n = i + input.ReadInt(true)).Items; - for (; i < n; i++) - o[i] = ReadSkin(input, skeletonData, false, nonessential); - } + for (int i = 0, n = ReadVarint(input, true); i < n; i++) + skeletonData.skins.Add(ReadSkin(input, skeletonData, ReadString(input), nonessential)); // Linked meshes. - n = linkedMeshes.Count; - for (int i = 0; i < n; i++) { + for (int i = 0, n = linkedMeshes.Count; i < n; i++) { SkeletonJson.LinkedMesh linkedMesh = linkedMeshes[i]; Skin skin = linkedMesh.skin == null ? skeletonData.DefaultSkin : skeletonData.FindSkin(linkedMesh.skin); if (skin == null) throw new Exception("Skin not found: " + linkedMesh.skin); Attachment parent = skin.GetAttachment(linkedMesh.slotIndex, linkedMesh.parent); if (parent == null) throw new Exception("Parent mesh not found: " + linkedMesh.parent); - linkedMesh.mesh.DeformAttachment = linkedMesh.inheritDeform ? (VertexAttachment)parent : linkedMesh.mesh; linkedMesh.mesh.ParentMesh = (MeshAttachment)parent; linkedMesh.mesh.UpdateUVs(); } linkedMeshes.Clear(); // Events. - o = skeletonData.events.Resize(n = input.ReadInt(true)).Items; - for (int i = 0; i < n; i++) { - EventData data = new EventData(input.ReadStringRef()); - data.Int = input.ReadInt(false); - data.Float = input.ReadFloat(); - data.String = input.ReadString(); - data.AudioPath = input.ReadString(); + for (int i = 0, n = ReadVarint(input, true); i < n; i++) { + EventData data = new EventData(ReadString(input)); + data.Int = ReadVarint(input, false); + data.Float = ReadFloat(input); + data.String = ReadString(input); + data.AudioPath = ReadString(input); if (data.AudioPath != null) { - data.Volume = input.ReadFloat(); - data.Balance = input.ReadFloat(); + data.Volume = ReadFloat(input); + data.Balance = ReadFloat(input); } - o[i] = data; + skeletonData.events.Add(data); } // Animations. - o = skeletonData.animations.Resize(n = input.ReadInt(true)).Items; - for (int i = 0; i < n; i++) - o[i] = ReadAnimation(input.ReadString(), input, skeletonData); + for (int i = 0, n = ReadVarint(input, true); i < n; i++) + ReadAnimation(ReadString(input), input, skeletonData); + skeletonData.bones.TrimExcess(); + skeletonData.slots.TrimExcess(); + skeletonData.skins.TrimExcess(); + skeletonData.events.TrimExcess(); + skeletonData.animations.TrimExcess(); + skeletonData.ikConstraints.TrimExcess(); + skeletonData.pathConstraints.TrimExcess(); return skeletonData; } /// May be null. - private Skin ReadSkin (SkeletonInput input, SkeletonData skeletonData, bool defaultSkin, bool nonessential) { - - Skin skin; - int slotCount; - - if (defaultSkin) { - slotCount = input.ReadInt(true); - if (slotCount == 0) return null; - skin = new Skin("default"); - } else { - skin = new Skin(input.ReadStringRef()); - Object[] bones = skin.bones.Resize(input.ReadInt(true)).Items; - for (int i = 0, n = skin.bones.Count; i < n; i++) - bones[i] = skeletonData.bones.Items[input.ReadInt(true)]; - - for (int i = 0, n = input.ReadInt(true); i < n; i++) - skin.constraints.Add(skeletonData.ikConstraints.Items[input.ReadInt(true)]); - for (int i = 0, n = input.ReadInt(true); i < n; i++) - skin.constraints.Add(skeletonData.transformConstraints.Items[input.ReadInt(true)]); - for (int i = 0, n = input.ReadInt(true); i < n; i++) - skin.constraints.Add(skeletonData.pathConstraints.Items[input.ReadInt(true)]); - skin.constraints.TrimExcess(); - slotCount = input.ReadInt(true); - } + private Skin ReadSkin (Stream input, SkeletonData skeletonData, String skinName, bool nonessential) { + int slotCount = ReadVarint(input, true); + if (slotCount == 0) return null; + Skin skin = new Skin(skinName); for (int i = 0; i < slotCount; i++) { - int slotIndex = input.ReadInt(true); - for (int ii = 0, nn = input.ReadInt(true); ii < nn; ii++) { - String name = input.ReadStringRef(); + int slotIndex = ReadVarint(input, true); + for (int ii = 0, nn = ReadVarint(input, true); ii < nn; ii++) { + String name = ReadString(input); Attachment attachment = ReadAttachment(input, skeletonData, skin, slotIndex, name, nonessential); - if (attachment != null) skin.SetAttachment(slotIndex, name, attachment); + if (attachment != null) skin.AddAttachment(slotIndex, name, attachment); } } return skin; } - private Attachment ReadAttachment (SkeletonInput input, SkeletonData skeletonData, Skin skin, int slotIndex, - String attachmentName, bool nonessential) { - + private Attachment ReadAttachment (Stream input, SkeletonData skeletonData, Skin skin, int slotIndex, String attachmentName, bool nonessential) { float scale = Scale; - String name = input.ReadStringRef(); + String name = ReadString(input); if (name == null) name = attachmentName; AttachmentType type = (AttachmentType)input.ReadByte(); switch (type) { case AttachmentType.Region: { - String path = input.ReadStringRef(); - float rotation = input.ReadFloat(); - float x = input.ReadFloat(); - float y = input.ReadFloat(); - float scaleX = input.ReadFloat(); - float scaleY = input.ReadFloat(); - float width = input.ReadFloat(); - float height = input.ReadFloat(); - int color = input.ReadInt(); + String path = ReadString(input); + float rotation = ReadFloat(input); + float x = ReadFloat(input); + float y = ReadFloat(input); + float scaleX = ReadFloat(input); + float scaleY = ReadFloat(input); + float width = ReadFloat(input); + float height = ReadFloat(input); + int color = ReadInt(input); if (path == null) path = name; RegionAttachment region = attachmentLoader.NewRegionAttachment(skin, name, path); @@ -397,32 +363,31 @@ namespace Spine { return region; } case AttachmentType.Boundingbox: { - int vertexCount = input.ReadInt(true); + int vertexCount = ReadVarint(input, true); Vertices vertices = ReadVertices(input, vertexCount); - if (nonessential) input.ReadInt(); //int color = nonessential ? input.ReadInt() : 0; // Avoid unused local warning. - + if (nonessential) ReadInt(input); //int color = nonessential ? ReadInt(input) : 0; // Avoid unused local warning. + BoundingBoxAttachment box = attachmentLoader.NewBoundingBoxAttachment(skin, name); if (box == null) return null; box.worldVerticesLength = vertexCount << 1; box.vertices = vertices.vertices; - box.bones = vertices.bones; - // skipped porting: if (nonessential) Color.rgba8888ToColor(box.getColor(), color); + box.bones = vertices.bones; return box; } case AttachmentType.Mesh: { - String path = input.ReadStringRef(); - int color = input.ReadInt(); - int vertexCount = input.ReadInt(true); + String path = ReadString(input); + int color = ReadInt(input); + int vertexCount = ReadVarint(input, true); float[] uvs = ReadFloatArray(input, vertexCount << 1, 1); int[] triangles = ReadShortArray(input); Vertices vertices = ReadVertices(input, vertexCount); - int hullLength = input.ReadInt(true); + int hullLength = ReadVarint(input, true); int[] edges = null; float width = 0, height = 0; if (nonessential) { edges = ReadShortArray(input); - width = input.ReadFloat(); - height = input.ReadFloat(); + width = ReadFloat(input); + height = ReadFloat(input); } if (path == null) path = name; @@ -448,15 +413,15 @@ namespace Spine { return mesh; } case AttachmentType.Linkedmesh: { - String path = input.ReadStringRef(); - int color = input.ReadInt(); - String skinName = input.ReadStringRef(); - String parent = input.ReadStringRef(); - bool inheritDeform = input.ReadBoolean(); + String path = ReadString(input); + int color = ReadInt(input); + String skinName = ReadString(input); + String parent = ReadString(input); + bool inheritDeform = ReadBoolean(input); float width = 0, height = 0; if (nonessential) { - width = input.ReadFloat(); - height = input.ReadFloat(); + width = ReadFloat(input); + height = ReadFloat(input); } if (path == null) path = name; @@ -467,22 +432,23 @@ namespace Spine { mesh.g = ((color & 0x00ff0000) >> 16) / 255f; mesh.b = ((color & 0x0000ff00) >> 8) / 255f; mesh.a = ((color & 0x000000ff)) / 255f; + mesh.inheritDeform = inheritDeform; if (nonessential) { mesh.Width = width * scale; mesh.Height = height * scale; } - linkedMeshes.Add(new SkeletonJson.LinkedMesh(mesh, skinName, slotIndex, parent, inheritDeform)); + linkedMeshes.Add(new SkeletonJson.LinkedMesh(mesh, skinName, slotIndex, parent)); return mesh; } case AttachmentType.Path: { - bool closed = input.ReadBoolean(); - bool constantSpeed = input.ReadBoolean(); - int vertexCount = input.ReadInt(true); + bool closed = ReadBoolean(input); + bool constantSpeed = ReadBoolean(input); + int vertexCount = ReadVarint(input, true); Vertices vertices = ReadVertices(input, vertexCount); float[] lengths = new float[vertexCount / 3]; for (int i = 0, n = lengths.Length; i < n; i++) - lengths[i] = input.ReadFloat() * scale; - if (nonessential) input.ReadInt(); //int color = nonessential ? input.ReadInt() : 0; + lengths[i] = ReadFloat(input) * scale; + if (nonessential) ReadInt(input); //int color = nonessential ? ReadInt(input) : 0; PathAttachment path = attachmentLoader.NewPathAttachment(skin, name); if (path == null) return null; @@ -492,28 +458,27 @@ namespace Spine { path.vertices = vertices.vertices; path.bones = vertices.bones; path.lengths = lengths; - // skipped porting: if (nonessential) Color.rgba8888ToColor(path.getColor(), color); - return path; + return path; } case AttachmentType.Point: { - float rotation = input.ReadFloat(); - float x = input.ReadFloat(); - float y = input.ReadFloat(); - if (nonessential) input.ReadInt(); //int color = nonessential ? input.ReadInt() : 0; + float rotation = ReadFloat(input); + float x = ReadFloat(input); + float y = ReadFloat(input); + if (nonessential) ReadInt(input); //int color = nonessential ? ReadInt(input) : 0; PointAttachment point = attachmentLoader.NewPointAttachment(skin, name); if (point == null) return null; point.x = x * scale; point.y = y * scale; point.rotation = rotation; - // skipped porting: if (nonessential) point.color = color; + //if (nonessential) point.color = color; return point; } case AttachmentType.Clipping: { - int endSlotIndex = input.ReadInt(true); - int vertexCount = input.ReadInt(true); + int endSlotIndex = ReadVarint(input, true); + int vertexCount = ReadVarint(input, true); Vertices vertices = ReadVertices(input, vertexCount); - if (nonessential) input.ReadInt(); + if (nonessential) ReadInt(input); ClippingAttachment clip = attachmentLoader.NewClippingAttachment(skin, name); if (clip == null) return null; @@ -521,31 +486,30 @@ namespace Spine { clip.worldVerticesLength = vertexCount << 1; clip.vertices = vertices.vertices; clip.bones = vertices.bones; - // skipped porting: if (nonessential) Color.rgba8888ToColor(clip.getColor(), color); return clip; } } return null; } - private Vertices ReadVertices (SkeletonInput input, int vertexCount) { + private Vertices ReadVertices (Stream input, int vertexCount) { float scale = Scale; int verticesLength = vertexCount << 1; Vertices vertices = new Vertices(); - if(!input.ReadBoolean()) { + if(!ReadBoolean(input)) { vertices.vertices = ReadFloatArray(input, verticesLength, scale); return vertices; } var weights = new ExposedList(verticesLength * 3 * 3); var bonesArray = new ExposedList(verticesLength * 3); for (int i = 0; i < vertexCount; i++) { - int boneCount = input.ReadInt(true); + int boneCount = ReadVarint(input, true); bonesArray.Add(boneCount); for (int ii = 0; ii < boneCount; ii++) { - bonesArray.Add(input.ReadInt(true)); - weights.Add(input.ReadFloat() * scale); - weights.Add(input.ReadFloat() * scale); - weights.Add(input.ReadFloat()); + bonesArray.Add(ReadVarint(input, true)); + weights.Add(ReadFloat(input) * scale); + weights.Add(ReadFloat(input) * scale); + weights.Add(ReadFloat(input)); } } @@ -554,43 +518,43 @@ namespace Spine { return vertices; } - private float[] ReadFloatArray (SkeletonInput input, int n, float scale) { + private float[] ReadFloatArray (Stream input, int n, float scale) { float[] array = new float[n]; if (scale == 1) { for (int i = 0; i < n; i++) - array[i] = input.ReadFloat(); + array[i] = ReadFloat(input); } else { for (int i = 0; i < n; i++) - array[i] = input.ReadFloat() * scale; + array[i] = ReadFloat(input) * scale; } return array; } - private int[] ReadShortArray (SkeletonInput input) { - int n = input.ReadInt(true); + private int[] ReadShortArray (Stream input) { + int n = ReadVarint(input, true); int[] array = new int[n]; - for (int i = 0; i < n; i++) + for (int i = 0; i < n; i++) array[i] = (input.ReadByte() << 8) | input.ReadByte(); return array; } - private Animation ReadAnimation (String name, SkeletonInput input, SkeletonData skeletonData) { - var timelines = new ExposedList(32); + private void ReadAnimation (String name, Stream input, SkeletonData skeletonData) { + var timelines = new ExposedList(); float scale = Scale; float duration = 0; // Slot timelines. - for (int i = 0, n = input.ReadInt(true); i < n; i++) { - int slotIndex = input.ReadInt(true); - for (int ii = 0, nn = input.ReadInt(true); ii < nn; ii++) { + for (int i = 0, n = ReadVarint(input, true); i < n; i++) { + int slotIndex = ReadVarint(input, true); + for (int ii = 0, nn = ReadVarint(input, true); ii < nn; ii++) { int timelineType = input.ReadByte(); - int frameCount = input.ReadInt(true); + int frameCount = ReadVarint(input, true); switch (timelineType) { case SLOT_ATTACHMENT: { AttachmentTimeline timeline = new AttachmentTimeline(frameCount); timeline.slotIndex = slotIndex; for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) - timeline.SetFrame(frameIndex, input.ReadFloat(), input.ReadStringRef()); + timeline.SetFrame(frameIndex, ReadFloat(input), ReadString(input)); timelines.Add(timeline); duration = Math.Max(duration, timeline.frames[frameCount - 1]); break; @@ -599,8 +563,8 @@ namespace Spine { ColorTimeline timeline = new ColorTimeline(frameCount); timeline.slotIndex = slotIndex; for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) { - float time = input.ReadFloat(); - int color = input.ReadInt(); + float time = ReadFloat(input); + int color = ReadInt(input); float r = ((color & 0xff000000) >> 24) / 255f; float g = ((color & 0x00ff0000) >> 16) / 255f; float b = ((color & 0x0000ff00) >> 8) / 255f; @@ -609,20 +573,20 @@ namespace Spine { if (frameIndex < frameCount - 1) ReadCurve(input, frameIndex, timeline); } timelines.Add(timeline); - duration = Math.Max(duration, timeline.frames[(frameCount - 1) * ColorTimeline.ENTRIES]); + duration = Math.Max(duration, timeline.frames[(timeline.FrameCount - 1) * ColorTimeline.ENTRIES]); break; } case SLOT_TWO_COLOR: { TwoColorTimeline timeline = new TwoColorTimeline(frameCount); timeline.slotIndex = slotIndex; for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) { - float time = input.ReadFloat(); - int color = input.ReadInt(); + float time = ReadFloat(input); + int color = ReadInt(input); float r = ((color & 0xff000000) >> 24) / 255f; float g = ((color & 0x00ff0000) >> 16) / 255f; float b = ((color & 0x0000ff00) >> 8) / 255f; float a = ((color & 0x000000ff)) / 255f; - int color2 = input.ReadInt(); // 0x00rrggbb + int color2 = ReadInt(input); // 0x00rrggbb float r2 = ((color2 & 0x00ff0000) >> 16) / 255f; float g2 = ((color2 & 0x0000ff00) >> 8) / 255f; float b2 = ((color2 & 0x000000ff)) / 255f; @@ -631,7 +595,7 @@ namespace Spine { if (frameIndex < frameCount - 1) ReadCurve(input, frameIndex, timeline); } timelines.Add(timeline); - duration = Math.Max(duration, timeline.frames[(frameCount - 1) * TwoColorTimeline.ENTRIES]); + duration = Math.Max(duration, timeline.frames[(timeline.FrameCount - 1) * TwoColorTimeline.ENTRIES]); break; } } @@ -639,17 +603,17 @@ namespace Spine { } // Bone timelines. - for (int i = 0, n = input.ReadInt(true); i < n; i++) { - int boneIndex = input.ReadInt(true); - for (int ii = 0, nn = input.ReadInt(true); ii < nn; ii++) { + for (int i = 0, n = ReadVarint(input, true); i < n; i++) { + int boneIndex = ReadVarint(input, true); + for (int ii = 0, nn = ReadVarint(input, true); ii < nn; ii++) { int timelineType = input.ReadByte(); - int frameCount = input.ReadInt(true); + int frameCount = ReadVarint(input, true); switch (timelineType) { case BONE_ROTATE: { RotateTimeline timeline = new RotateTimeline(frameCount); timeline.boneIndex = boneIndex; for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) { - timeline.SetFrame(frameIndex, input.ReadFloat(), input.ReadFloat()); + timeline.SetFrame(frameIndex, ReadFloat(input), ReadFloat(input)); if (frameIndex < frameCount - 1) ReadCurve(input, frameIndex, timeline); } timelines.Add(timeline); @@ -671,8 +635,8 @@ namespace Spine { } timeline.boneIndex = boneIndex; for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) { - timeline.SetFrame(frameIndex, input.ReadFloat(), input.ReadFloat() * timelineScale, - input.ReadFloat() * timelineScale); + timeline.SetFrame(frameIndex, ReadFloat(input), ReadFloat(input) * timelineScale, ReadFloat(input) + * timelineScale); if (frameIndex < frameCount - 1) ReadCurve(input, frameIndex, timeline); } timelines.Add(timeline); @@ -683,16 +647,15 @@ namespace Spine { } } - // IK constraint timelines. - for (int i = 0, n = input.ReadInt(true); i < n; i++) { - int index = input.ReadInt(true); - int frameCount = input.ReadInt(true); + // IK timelines. + for (int i = 0, n = ReadVarint(input, true); i < n; i++) { + int index = ReadVarint(input, true); + int frameCount = ReadVarint(input, true); IkConstraintTimeline timeline = new IkConstraintTimeline(frameCount) { ikConstraintIndex = index }; for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) { - timeline.SetFrame(frameIndex, input.ReadFloat(), input.ReadFloat(), input.ReadFloat() * scale, input.ReadSByte(), input.ReadBoolean(), - input.ReadBoolean()); + timeline.SetFrame(frameIndex, ReadFloat(input), ReadFloat(input), ReadSByte(input), ReadBoolean(input), ReadBoolean(input)); if (frameIndex < frameCount - 1) ReadCurve(input, frameIndex, timeline); } timelines.Add(timeline); @@ -700,14 +663,13 @@ namespace Spine { } // Transform constraint timelines. - for (int i = 0, n = input.ReadInt(true); i < n; i++) { - int index = input.ReadInt(true); - int frameCount = input.ReadInt(true); + for (int i = 0, n = ReadVarint(input, true); i < n; i++) { + int index = ReadVarint(input, true); + int frameCount = ReadVarint(input, true); TransformConstraintTimeline timeline = new TransformConstraintTimeline(frameCount); timeline.transformConstraintIndex = index; for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) { - timeline.SetFrame(frameIndex, input.ReadFloat(), input.ReadFloat(), input.ReadFloat(), input.ReadFloat(), - input.ReadFloat()); + timeline.SetFrame(frameIndex, ReadFloat(input), ReadFloat(input), ReadFloat(input), ReadFloat(input), ReadFloat(input)); if (frameIndex < frameCount - 1) ReadCurve(input, frameIndex, timeline); } timelines.Add(timeline); @@ -715,12 +677,12 @@ namespace Spine { } // Path constraint timelines. - for (int i = 0, n = input.ReadInt(true); i < n; i++) { - int index = input.ReadInt(true); + for (int i = 0, n = ReadVarint(input, true); i < n; i++) { + int index = ReadVarint(input, true); PathConstraintData data = skeletonData.pathConstraints.Items[index]; - for (int ii = 0, nn = input.ReadInt(true); ii < nn; ii++) { - int timelineType = input.ReadSByte(); - int frameCount = input.ReadInt(true); + for (int ii = 0, nn = ReadVarint(input, true); ii < nn; ii++) { + int timelineType = ReadSByte(input); + int frameCount = ReadVarint(input, true); switch(timelineType) { case PATH_POSITION: case PATH_SPACING: { @@ -728,14 +690,14 @@ namespace Spine { float timelineScale = 1; if (timelineType == PATH_SPACING) { timeline = new PathConstraintSpacingTimeline(frameCount); - if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) timelineScale = scale; + if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) timelineScale = scale; } else { timeline = new PathConstraintPositionTimeline(frameCount); if (data.positionMode == PositionMode.Fixed) timelineScale = scale; } timeline.pathConstraintIndex = index; - for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) { - timeline.SetFrame(frameIndex, input.ReadFloat(), input.ReadFloat() * timelineScale); + for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) { + timeline.SetFrame(frameIndex, ReadFloat(input), ReadFloat(input) * timelineScale); if (frameIndex < frameCount - 1) ReadCurve(input, frameIndex, timeline); } timelines.Add(timeline); @@ -746,7 +708,7 @@ namespace Spine { PathConstraintMixTimeline timeline = new PathConstraintMixTimeline(frameCount); timeline.pathConstraintIndex = index; for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) { - timeline.SetFrame(frameIndex, input.ReadFloat(), input.ReadFloat(), input.ReadFloat()); + timeline.SetFrame(frameIndex, ReadFloat(input), ReadFloat(input), ReadFloat(input)); if (frameIndex < frameCount - 1) ReadCurve(input, frameIndex, timeline); } timelines.Add(timeline); @@ -758,37 +720,37 @@ namespace Spine { } // Deform timelines. - for (int i = 0, n = input.ReadInt(true); i < n; i++) { - Skin skin = skeletonData.skins.Items[input.ReadInt(true)]; - for (int ii = 0, nn = input.ReadInt(true); ii < nn; ii++) { - int slotIndex = input.ReadInt(true); - for (int iii = 0, nnn = input.ReadInt(true); iii < nnn; iii++) { - VertexAttachment attachment = (VertexAttachment)skin.GetAttachment(slotIndex, input.ReadStringRef()); + for (int i = 0, n = ReadVarint(input, true); i < n; i++) { + Skin skin = skeletonData.skins.Items[ReadVarint(input, true)]; + for (int ii = 0, nn = ReadVarint(input, true); ii < nn; ii++) { + int slotIndex = ReadVarint(input, true); + for (int iii = 0, nnn = ReadVarint(input, true); iii < nnn; iii++) { + VertexAttachment attachment = (VertexAttachment)skin.GetAttachment(slotIndex, ReadString(input)); bool weighted = attachment.bones != null; float[] vertices = attachment.vertices; int deformLength = weighted ? vertices.Length / 3 * 2 : vertices.Length; - int frameCount = input.ReadInt(true); + int frameCount = ReadVarint(input, true); DeformTimeline timeline = new DeformTimeline(frameCount); timeline.slotIndex = slotIndex; timeline.attachment = attachment; for (int frameIndex = 0; frameIndex < frameCount; frameIndex++) { - float time = input.ReadFloat(); + float time = ReadFloat(input); float[] deform; - int end = input.ReadInt(true); + int end = ReadVarint(input, true); if (end == 0) deform = weighted ? new float[deformLength] : vertices; else { deform = new float[deformLength]; - int start = input.ReadInt(true); + int start = ReadVarint(input, true); end += start; if (scale == 1) { for (int v = start; v < end; v++) - deform[v] = input.ReadFloat(); + deform[v] = ReadFloat(input); } else { for (int v = start; v < end; v++) - deform[v] = input.ReadFloat() * scale; + deform[v] = ReadFloat(input) * scale; } if (!weighted) { for (int v = 0, vn = deform.Length; v < vn; v++) @@ -798,7 +760,7 @@ namespace Spine { timeline.SetFrame(frameIndex, time, deform); if (frameIndex < frameCount - 1) ReadCurve(input, frameIndex, timeline); - } + } timelines.Add(timeline); duration = Math.Max(duration, timeline.frames[frameCount - 1]); } @@ -806,25 +768,25 @@ namespace Spine { } // Draw order timeline. - int drawOrderCount = input.ReadInt(true); + int drawOrderCount = ReadVarint(input, true); if (drawOrderCount > 0) { DrawOrderTimeline timeline = new DrawOrderTimeline(drawOrderCount); int slotCount = skeletonData.slots.Count; for (int i = 0; i < drawOrderCount; i++) { - float time = input.ReadFloat(); - int offsetCount = input.ReadInt(true); + float time = ReadFloat(input); + int offsetCount = ReadVarint(input, true); int[] drawOrder = new int[slotCount]; for (int ii = slotCount - 1; ii >= 0; ii--) drawOrder[ii] = -1; int[] unchanged = new int[slotCount - offsetCount]; int originalIndex = 0, unchangedIndex = 0; for (int ii = 0; ii < offsetCount; ii++) { - int slotIndex = input.ReadInt(true); + int slotIndex = ReadVarint(input, true); // Collect unchanged items. while (originalIndex != slotIndex) unchanged[unchangedIndex++] = originalIndex++; // Set changed items. - drawOrder[originalIndex + input.ReadInt(true)] = originalIndex++; + drawOrder[originalIndex + ReadVarint(input, true)] = originalIndex++; } // Collect remaining unchanged items. while (originalIndex < slotCount) @@ -839,20 +801,20 @@ namespace Spine { } // Event timeline. - int eventCount = input.ReadInt(true); + int eventCount = ReadVarint(input, true); if (eventCount > 0) { EventTimeline timeline = new EventTimeline(eventCount); for (int i = 0; i < eventCount; i++) { - float time = input.ReadFloat(); - EventData eventData = skeletonData.events.Items[input.ReadInt(true)]; + float time = ReadFloat(input); + EventData eventData = skeletonData.events.Items[ReadVarint(input, true)]; Event e = new Event(time, eventData) { - Int = input.ReadInt(false), - Float = input.ReadFloat(), - String = input.ReadBoolean() ? input.ReadString() : eventData.String + Int = ReadVarint(input, false), + Float = ReadFloat(input), + String = ReadBoolean(input) ? ReadString(input) : eventData.String }; if (e.data.AudioPath != null) { - e.volume = input.ReadFloat(); - e.balance = input.ReadFloat(); + e.volume = ReadFloat(input); + e.balance = ReadFloat(input); } timeline.SetFrame(i, e); } @@ -861,137 +823,88 @@ namespace Spine { } timelines.TrimExcess(); - return new Animation(name, timelines, duration); + skeletonData.animations.Add(new Animation(name, timelines, duration)); } - private void ReadCurve (SkeletonInput input, int frameIndex, CurveTimeline timeline) { + private void ReadCurve (Stream input, int frameIndex, CurveTimeline timeline) { switch (input.ReadByte()) { case CURVE_STEPPED: timeline.SetStepped(frameIndex); break; case CURVE_BEZIER: - timeline.SetCurve(frameIndex, input.ReadFloat(), input.ReadFloat(), input.ReadFloat(), input.ReadFloat()); + timeline.SetCurve(frameIndex, ReadFloat(input), ReadFloat(input), ReadFloat(input), ReadFloat(input)); break; } } - internal class Vertices - { + private static sbyte ReadSByte (Stream input) { + int value = input.ReadByte(); + if (value == -1) throw new EndOfStreamException(); + return (sbyte)value; + } + + private static bool ReadBoolean (Stream input) { + return input.ReadByte() != 0; + } + + private float ReadFloat (Stream input) { + buffer[3] = (byte)input.ReadByte(); + buffer[2] = (byte)input.ReadByte(); + buffer[1] = (byte)input.ReadByte(); + buffer[0] = (byte)input.ReadByte(); + return BitConverter.ToSingle(buffer, 0); + } + + private static int ReadInt (Stream input) { + return (input.ReadByte() << 24) + (input.ReadByte() << 16) + (input.ReadByte() << 8) + input.ReadByte(); + } + + private static int ReadVarint (Stream input, bool optimizePositive) { + int b = input.ReadByte(); + int result = b & 0x7F; + if ((b & 0x80) != 0) { + b = input.ReadByte(); + result |= (b & 0x7F) << 7; + if ((b & 0x80) != 0) { + b = input.ReadByte(); + result |= (b & 0x7F) << 14; + if ((b & 0x80) != 0) { + b = input.ReadByte(); + result |= (b & 0x7F) << 21; + if ((b & 0x80) != 0) result |= (input.ReadByte() & 0x7F) << 28; + } + } + } + return optimizePositive ? result : ((result >> 1) ^ -(result & 1)); + } + + private string ReadString (Stream input) { + int byteCount = ReadVarint(input, true); + switch (byteCount) { + case 0: + return null; + case 1: + return ""; + } + byteCount--; + byte[] buffer = this.buffer; + if (buffer.Length < byteCount) buffer = new byte[byteCount]; + ReadFully(input, buffer, 0, byteCount); + return System.Text.Encoding.UTF8.GetString(buffer, 0, byteCount); + } + + private static void ReadFully (Stream input, byte[] buffer, int offset, int length) { + while (length > 0) { + int count = input.Read(buffer, offset, length); + if (count <= 0) throw new EndOfStreamException(); + offset += count; + length -= count; + } + } + + internal class Vertices { public int[] bones; public float[] vertices; } - - internal class SkeletonInput { - private byte[] chars = new byte[32]; - private byte[] bytesBigEndian = new byte[4]; - internal ExposedList strings; - Stream input; - - public SkeletonInput (Stream input) { - this.input = input; - } - - public byte ReadByte () { - return (byte)input.ReadByte(); - } - - public sbyte ReadSByte () { - int value = input.ReadByte(); - if (value == -1) throw new EndOfStreamException(); - return (sbyte)value; - } - - public bool ReadBoolean () { - return input.ReadByte() != 0; - } - - public float ReadFloat () { - input.Read(bytesBigEndian, 0, 4); - chars[3] = bytesBigEndian[0]; - chars[2] = bytesBigEndian[1]; - chars[1] = bytesBigEndian[2]; - chars[0] = bytesBigEndian[3]; - return BitConverter.ToSingle(chars, 0); - } - - public int ReadInt () { - input.Read(bytesBigEndian, 0, 4); - return (bytesBigEndian[0] << 24) - + (bytesBigEndian[1] << 16) - + (bytesBigEndian[2] << 8) - + bytesBigEndian[3]; - } - - public int ReadInt (bool optimizePositive) { - int b = input.ReadByte(); - int result = b & 0x7F; - if ((b & 0x80) != 0) { - b = input.ReadByte(); - result |= (b & 0x7F) << 7; - if ((b & 0x80) != 0) { - b = input.ReadByte(); - result |= (b & 0x7F) << 14; - if ((b & 0x80) != 0) { - b = input.ReadByte(); - result |= (b & 0x7F) << 21; - if ((b & 0x80) != 0) result |= (input.ReadByte() & 0x7F) << 28; - } - } - } - return optimizePositive ? result : ((result >> 1) ^ -(result & 1)); - } - - public string ReadString () { - int byteCount = ReadInt(true); - switch (byteCount) { - case 0: - return null; - case 1: - return ""; - } - byteCount--; - byte[] buffer = this.chars; - if (buffer.Length < byteCount) buffer = new byte[byteCount]; - ReadFully(buffer, 0, byteCount); - return System.Text.Encoding.UTF8.GetString(buffer, 0, byteCount); - } - - ///May be null. - public String ReadStringRef () { - int index = ReadInt(true); - return index == 0 ? null : strings.Items[index - 1]; - } - - public void ReadFully (byte[] buffer, int offset, int length) { - while (length > 0) { - int count = input.Read(buffer, offset, length); - if (count <= 0) throw new EndOfStreamException(); - offset += count; - length -= count; - } - } - - /// Returns the version string of binary skeleton data. - public string GetVersionString () { - try { - // Hash. - int byteCount = ReadInt(true); - if (byteCount > 1) input.Position += byteCount - 1; - - // Version. - byteCount = ReadInt(true); - if (byteCount > 1) { - byteCount--; - var buffer = new byte[byteCount]; - ReadFully(buffer, 0, byteCount); - return System.Text.Encoding.UTF8.GetString(buffer, 0, byteCount); - } - - throw new ArgumentException("Stream does not contain a valid binary Skeleton Data.", "input"); - } catch (Exception e) { - throw new ArgumentException("Stream does not contain a valid binary Skeleton Data.\n" + e, "input"); - } - } - } } } diff --git a/Assets/Spine/Runtime/spine-csharp/SkeletonBounds.cs b/Assets/Spine/Runtime/spine-csharp/SkeletonBounds.cs index fe247364f..ecab399b2 100644 --- a/Assets/Spine/Runtime/spine-csharp/SkeletonBounds.cs +++ b/Assets/Spine/Runtime/spine-csharp/SkeletonBounds.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -74,7 +74,6 @@ namespace Spine { for (int i = 0; i < slotCount; i++) { Slot slot = slots.Items[i]; - if (!slot.bone.active) continue; BoundingBoxAttachment boundingBox = slot.attachment as BoundingBoxAttachment; if (boundingBox == null) continue; boundingBoxes.Add(boundingBox); diff --git a/Assets/Spine/Runtime/spine-csharp/SkeletonClipping.cs b/Assets/Spine/Runtime/spine-csharp/SkeletonClipping.cs index 40b6036a6..4e3b83b01 100644 --- a/Assets/Spine/Runtime/spine-csharp/SkeletonClipping.cs +++ b/Assets/Spine/Runtime/spine-csharp/SkeletonClipping.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; diff --git a/Assets/Spine/Runtime/spine-csharp/SkeletonData.cs b/Assets/Spine/Runtime/spine-csharp/SkeletonData.cs index 05ec27229..57417da47 100644 --- a/Assets/Spine/Runtime/spine-csharp/SkeletonData.cs +++ b/Assets/Spine/Runtime/spine-csharp/SkeletonData.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,22 +15,22 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; namespace Spine { - + /// Stores the setup pose and all of the stateless data for a skeleton. public class SkeletonData { internal string name; @@ -43,7 +43,7 @@ namespace Spine { internal ExposedList ikConstraints = new ExposedList(); internal ExposedList transformConstraints = new ExposedList(); internal ExposedList pathConstraints = new ExposedList(); - internal float x , y, width, height; + internal float width, height; internal string version, hash; // Nonessential. @@ -73,8 +73,6 @@ namespace Spine { public ExposedList TransformConstraints { get { return transformConstraints; } set { transformConstraints = value; } } public ExposedList PathConstraints { get { return pathConstraints; } set { pathConstraints = value; } } - public float X { get { return x; } set { x = value; } } - public float Y { get { return y; } set { y = value; } } public float Width { get { return width; } set { width = value; } } public float Height { get { return height; } set { height = value; } } /// The Spine version used to export this data, or null. @@ -83,7 +81,7 @@ namespace Spine { /// The path to the images directory as defined in Spine. Available only when nonessential data was exported. May be null public string ImagesPath { get { return imagesPath; } set { imagesPath = value; } } - + /// The path to the audio directory defined in Spine. Available only when nonessential data was exported. May be null. public string AudioPath { get { return audioPath; } set { audioPath = value; } } diff --git a/Assets/Spine/Runtime/spine-csharp/SkeletonJson.cs b/Assets/Spine/Runtime/spine-csharp/SkeletonJson.cs index de7f2367e..b2cf6d23d 100644 --- a/Assets/Spine/Runtime/spine-csharp/SkeletonJson.cs +++ b/Assets/Spine/Runtime/spine-csharp/SkeletonJson.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if (UNITY_5 || UNITY_5_3_OR_NEWER || UNITY_WSA || UNITY_WP8 || UNITY_WP8_1) @@ -99,42 +99,35 @@ namespace Spine { var skeletonMap = (Dictionary)root["skeleton"]; skeletonData.hash = (string)skeletonMap["hash"]; skeletonData.version = (string)skeletonMap["spine"]; - if ("3.8.75" == skeletonData.version) - throw new Exception("Unsupported skeleton data, please export with a newer version of Spine."); - skeletonData.x = GetFloat(skeletonMap, "x", 0); - skeletonData.y = GetFloat(skeletonMap, "y", 0); skeletonData.width = GetFloat(skeletonMap, "width", 0); skeletonData.height = GetFloat(skeletonMap, "height", 0); - skeletonData.fps = GetFloat(skeletonMap, "fps", 30); + skeletonData.fps = GetFloat(skeletonMap, "fps", 0); skeletonData.imagesPath = GetString(skeletonMap, "images", null); skeletonData.audioPath = GetString(skeletonMap, "audio", null); } // Bones. - if (root.ContainsKey("bones")) { - foreach (Dictionary boneMap in (List)root["bones"]) { - BoneData parent = null; - if (boneMap.ContainsKey("parent")) { - parent = skeletonData.FindBone((string)boneMap["parent"]); - if (parent == null) - throw new Exception("Parent bone not found: " + boneMap["parent"]); - } - var data = new BoneData(skeletonData.Bones.Count, (string)boneMap["name"], parent); - data.length = GetFloat(boneMap, "length", 0) * scale; - data.x = GetFloat(boneMap, "x", 0) * scale; - data.y = GetFloat(boneMap, "y", 0) * scale; - data.rotation = GetFloat(boneMap, "rotation", 0); - data.scaleX = GetFloat(boneMap, "scaleX", 1); - data.scaleY = GetFloat(boneMap, "scaleY", 1); - data.shearX = GetFloat(boneMap, "shearX", 0); - data.shearY = GetFloat(boneMap, "shearY", 0); - - string tm = GetString(boneMap, "transform", TransformMode.Normal.ToString()); - data.transformMode = (TransformMode)Enum.Parse(typeof(TransformMode), tm, true); - data.skinRequired = GetBoolean(boneMap, "skin", false); - - skeletonData.bones.Add(data); + foreach (Dictionary boneMap in (List)root["bones"]) { + BoneData parent = null; + if (boneMap.ContainsKey("parent")) { + parent = skeletonData.FindBone((string)boneMap["parent"]); + if (parent == null) + throw new Exception("Parent bone not found: " + boneMap["parent"]); } + var data = new BoneData(skeletonData.Bones.Count, (string)boneMap["name"], parent); + data.length = GetFloat(boneMap, "length", 0) * scale; + data.x = GetFloat(boneMap, "x", 0) * scale; + data.y = GetFloat(boneMap, "y", 0) * scale; + data.rotation = GetFloat(boneMap, "rotation", 0); + data.scaleX = GetFloat(boneMap, "scaleX", 1); + data.scaleY = GetFloat(boneMap, "scaleY", 1); + data.shearX = GetFloat(boneMap, "shearX", 0); + data.shearY = GetFloat(boneMap, "shearY", 0); + + string tm = GetString(boneMap, "transform", TransformMode.Normal.ToString()); + data.transformMode = (TransformMode)Enum.Parse(typeof(TransformMode), tm, true); + + skeletonData.bones.Add(data); } // Slots. @@ -161,7 +154,7 @@ namespace Spine { data.b2 = ToColor(color2, 2, 6); data.hasSecondColor = true; } - + data.attachmentName = GetString(slotMap, "attachment", null); if (slotMap.ContainsKey("blend")) data.blendMode = (BlendMode)Enum.Parse(typeof(BlendMode), (string)slotMap["blend"], true); @@ -176,21 +169,17 @@ namespace Spine { foreach (Dictionary constraintMap in (List)root["ik"]) { IkConstraintData data = new IkConstraintData((string)constraintMap["name"]); data.order = GetInt(constraintMap, "order", 0); - data.skinRequired = GetBoolean(constraintMap,"skin", false); - if (constraintMap.ContainsKey("bones")) { - foreach (string boneName in (List)constraintMap["bones"]) { - BoneData bone = skeletonData.FindBone(boneName); - if (bone == null) throw new Exception("IK bone not found: " + boneName); - data.bones.Add(bone); - } + foreach (string boneName in (List)constraintMap["bones"]) { + BoneData bone = skeletonData.FindBone(boneName); + if (bone == null) throw new Exception("IK constraint bone not found: " + boneName); + data.bones.Add(bone); } string targetName = (string)constraintMap["target"]; data.target = skeletonData.FindBone(targetName); - if (data.target == null) throw new Exception("IK target bone not found: " + targetName); + if (data.target == null) throw new Exception("Target bone not found: " + targetName); data.mix = GetFloat(constraintMap, "mix", 1); - data.softness = GetFloat(constraintMap, "softness", 0) * scale; data.bendDirection = GetBoolean(constraintMap, "bendPositive", true) ? 1 : -1; data.compress = GetBoolean(constraintMap, "compress", false); data.stretch = GetBoolean(constraintMap, "stretch", false); @@ -205,19 +194,16 @@ namespace Spine { foreach (Dictionary constraintMap in (List)root["transform"]) { TransformConstraintData data = new TransformConstraintData((string)constraintMap["name"]); data.order = GetInt(constraintMap, "order", 0); - data.skinRequired = GetBoolean(constraintMap,"skin", false); - if (constraintMap.ContainsKey("bones")) { - foreach (string boneName in (List)constraintMap["bones"]) { - BoneData bone = skeletonData.FindBone(boneName); - if (bone == null) throw new Exception("Transform constraint bone not found: " + boneName); - data.bones.Add(bone); - } + foreach (string boneName in (List)constraintMap["bones"]) { + BoneData bone = skeletonData.FindBone(boneName); + if (bone == null) throw new Exception("Transform constraint bone not found: " + boneName); + data.bones.Add(bone); } string targetName = (string)constraintMap["target"]; data.target = skeletonData.FindBone(targetName); - if (data.target == null) throw new Exception("Transform constraint target bone not found: " + targetName); + if (data.target == null) throw new Exception("Target bone not found: " + targetName); data.local = GetBoolean(constraintMap, "local", false); data.relative = GetBoolean(constraintMap, "relative", false); @@ -243,19 +229,16 @@ namespace Spine { foreach (Dictionary constraintMap in (List)root["path"]) { PathConstraintData data = new PathConstraintData((string)constraintMap["name"]); data.order = GetInt(constraintMap, "order", 0); - data.skinRequired = GetBoolean(constraintMap,"skin", false); - if (constraintMap.ContainsKey("bones")) { - foreach (string boneName in (List)constraintMap["bones"]) { - BoneData bone = skeletonData.FindBone(boneName); - if (bone == null) throw new Exception("Path bone not found: " + boneName); - data.bones.Add(bone); - } + foreach (string boneName in (List)constraintMap["bones"]) { + BoneData bone = skeletonData.FindBone(boneName); + if (bone == null) throw new Exception("Path bone not found: " + boneName); + data.bones.Add(bone); } string targetName = (string)constraintMap["target"]; data.target = skeletonData.FindSlot(targetName); - if (data.target == null) throw new Exception("Path target slot not found: " + targetName); + if (data.target == null) throw new Exception("Target slot not found: " + targetName); data.positionMode = (PositionMode)Enum.Parse(typeof(PositionMode), GetString(constraintMap, "positionMode", "percent"), true); data.spacingMode = (SpacingMode)Enum.Parse(typeof(SpacingMode), GetString(constraintMap, "spacingMode", "length"), true); @@ -274,48 +257,18 @@ namespace Spine { // Skins. if (root.ContainsKey("skins")) { - foreach (Dictionary skinMap in (List)root["skins"]) { - Skin skin = new Skin((string)skinMap["name"]); - if (skinMap.ContainsKey("bones")) { - foreach (string entryName in (List)skinMap["bones"]) { - BoneData bone = skeletonData.FindBone(entryName); - if (bone == null) throw new Exception("Skin bone not found: " + entryName); - skin.bones.Add(bone); - } - } - if (skinMap.ContainsKey("ik")) { - foreach (string entryName in (List)skinMap["ik"]) { - IkConstraintData constraint = skeletonData.FindIkConstraint(entryName); - if (constraint == null) throw new Exception("Skin IK constraint not found: " + entryName); - skin.constraints.Add(constraint); - } - } - if (skinMap.ContainsKey("transform")) { - foreach (string entryName in (List)skinMap["transform"]) { - TransformConstraintData constraint = skeletonData.FindTransformConstraint(entryName); - if (constraint == null) throw new Exception("Skin transform constraint not found: " + entryName); - skin.constraints.Add(constraint); - } - } - if (skinMap.ContainsKey("path")) { - foreach (string entryName in (List)skinMap["path"]) { - PathConstraintData constraint = skeletonData.FindPathConstraint(entryName); - if (constraint == null) throw new Exception("Skin path constraint not found: " + entryName); - skin.constraints.Add(constraint); - } - } - if (skinMap.ContainsKey("attachments")) { - foreach (KeyValuePair slotEntry in (Dictionary)skinMap["attachments"]) { - int slotIndex = skeletonData.FindSlotIndex(slotEntry.Key); - foreach (KeyValuePair entry in ((Dictionary)slotEntry.Value)) { - try { - Attachment attachment = ReadAttachment((Dictionary)entry.Value, skin, slotIndex, entry.Key, skeletonData); - if (attachment != null) skin.SetAttachment(slotIndex, entry.Key, attachment); - } catch (Exception e) { - throw new Exception("Error reading attachment: " + entry.Key + ", skin: " + skin, e); - } + foreach (KeyValuePair skinMap in (Dictionary)root["skins"]) { + var skin = new Skin(skinMap.Key); + foreach (KeyValuePair slotEntry in (Dictionary)skinMap.Value) { + int slotIndex = skeletonData.FindSlotIndex(slotEntry.Key); + foreach (KeyValuePair entry in ((Dictionary)slotEntry.Value)) { + try { + Attachment attachment = ReadAttachment((Dictionary)entry.Value, skin, slotIndex, entry.Key, skeletonData); + if (attachment != null) skin.AddAttachment(slotIndex, entry.Key, attachment); + } catch (Exception e) { + throw new Exception("Error reading attachment: " + entry.Key + ", skin: " + skin, e); } - } + } } skeletonData.skins.Add(skin); if (skin.name == "default") skeletonData.defaultSkin = skin; @@ -329,7 +282,6 @@ namespace Spine { if (skin == null) throw new Exception("Slot not found: " + linkedMesh.skin); Attachment parent = skin.GetAttachment(linkedMesh.slotIndex, linkedMesh.parent); if (parent == null) throw new Exception("Parent mesh not found: " + linkedMesh.parent); - linkedMesh.mesh.DeformAttachment = linkedMesh.inheritDeform ? (VertexAttachment)parent : linkedMesh.mesh; linkedMesh.mesh.ParentMesh = (MeshAttachment)parent; linkedMesh.mesh.UpdateUVs(); } @@ -360,7 +312,7 @@ namespace Spine { } catch (Exception e) { throw new Exception("Error reading animation: " + entry.Key, e); } - } + } } skeletonData.bones.TrimExcess(); @@ -377,6 +329,9 @@ namespace Spine { name = GetString(map, "name", name); var typeName = GetString(map, "type", "region"); + if (typeName == "skinnedmesh") typeName = "weightedmesh"; + if (typeName == "weightedmesh") typeName = "mesh"; + if (typeName == "weightedlinkedmesh") typeName = "linkedmesh"; var type = (AttachmentType)Enum.Parse(typeof(AttachmentType), typeName, true); string path = GetString(map, "path", name); @@ -428,7 +383,8 @@ namespace Spine { string parent = GetString(map, "parent", null); if (parent != null) { - linkedMeshes.Add(new LinkedMesh(mesh, GetString(map, "skin", null), slotIndex, parent, GetBoolean(map, "deform", true))); + mesh.InheritDeform = GetBoolean(map, "deform", true); + linkedMeshes.Add(new LinkedMesh(mesh, GetString(map, "skin", null), slotIndex, parent)); return mesh; } @@ -536,7 +492,7 @@ namespace Spine { int frameIndex = 0; foreach (Dictionary valueMap in values) { - float time = GetFloat(valueMap, "time", 0); + float time = (float)valueMap["time"]; timeline.SetFrame(frameIndex++, time, (string)valueMap["name"]); } timelines.Add(timeline); @@ -548,7 +504,7 @@ namespace Spine { int frameIndex = 0; foreach (Dictionary valueMap in values) { - float time = GetFloat(valueMap, "time", 0); + float time = (float)valueMap["time"]; string c = (string)valueMap["color"]; timeline.SetFrame(frameIndex, time, ToColor(c, 0), ToColor(c, 1), ToColor(c, 2), ToColor(c, 3)); ReadCurve(valueMap, timeline, frameIndex); @@ -563,7 +519,7 @@ namespace Spine { int frameIndex = 0; foreach (Dictionary valueMap in values) { - float time = GetFloat(valueMap, "time", 0); + float time = (float)valueMap["time"]; string light = (string)valueMap["light"]; string dark = (string)valueMap["dark"]; timeline.SetFrame(frameIndex, time, ToColor(light, 0), ToColor(light, 1), ToColor(light, 2), ToColor(light, 3), @@ -596,7 +552,7 @@ namespace Spine { int frameIndex = 0; foreach (Dictionary valueMap in values) { - timeline.SetFrame(frameIndex, GetFloat(valueMap, "time", 0), GetFloat(valueMap, "angle", 0)); + timeline.SetFrame(frameIndex, (float)valueMap["time"], (float)valueMap["angle"]); ReadCurve(valueMap, timeline, frameIndex); frameIndex++; } @@ -605,11 +561,9 @@ namespace Spine { } else if (timelineName == "translate" || timelineName == "scale" || timelineName == "shear") { TranslateTimeline timeline; - float timelineScale = 1, defaultValue = 0; - if (timelineName == "scale") { + float timelineScale = 1; + if (timelineName == "scale") timeline = new ScaleTimeline(values.Count); - defaultValue = 1; - } else if (timelineName == "shear") timeline = new ShearTimeline(values.Count); else { @@ -620,9 +574,9 @@ namespace Spine { int frameIndex = 0; foreach (Dictionary valueMap in values) { - float time = GetFloat(valueMap, "time", 0); - float x = GetFloat(valueMap, "x", defaultValue); - float y = GetFloat(valueMap, "y", defaultValue); + float time = (float)valueMap["time"]; + float x = GetFloat(valueMap, "x", 0); + float y = GetFloat(valueMap, "y", 0); timeline.SetFrame(frameIndex, time, x * timelineScale, y * timelineScale); ReadCurve(valueMap, timeline, frameIndex); frameIndex++; @@ -645,9 +599,14 @@ namespace Spine { timeline.ikConstraintIndex = skeletonData.ikConstraints.IndexOf(constraint); int frameIndex = 0; foreach (Dictionary valueMap in values) { - timeline.SetFrame(frameIndex, GetFloat(valueMap, "time", 0), GetFloat(valueMap, "mix", 1), - GetFloat(valueMap, "softness", 0) * scale, GetBoolean(valueMap, "bendPositive", true) ? 1 : -1, - GetBoolean(valueMap, "compress", false), GetBoolean(valueMap, "stretch", false)); + timeline.SetFrame( + frameIndex, + (float)valueMap["time"], + GetFloat(valueMap, "mix", 1), + GetBoolean(valueMap, "bendPositive", true) ? 1 : -1, + GetBoolean(valueMap, "compress", true), + GetBoolean(valueMap, "stretch", false) + ); ReadCurve(valueMap, timeline, frameIndex); frameIndex++; } @@ -665,8 +624,12 @@ namespace Spine { timeline.transformConstraintIndex = skeletonData.transformConstraints.IndexOf(constraint); int frameIndex = 0; foreach (Dictionary valueMap in values) { - timeline.SetFrame(frameIndex, GetFloat(valueMap, "time", 0), GetFloat(valueMap, "rotateMix", 1), - GetFloat(valueMap, "translateMix", 1), GetFloat(valueMap, "scaleMix", 1), GetFloat(valueMap, "shearMix", 1)); + float time = (float)valueMap["time"]; + float rotateMix = GetFloat(valueMap, "rotateMix", 1); + float translateMix = GetFloat(valueMap, "translateMix", 1); + float scaleMix = GetFloat(valueMap, "scaleMix", 1); + float shearMix = GetFloat(valueMap, "shearMix", 1); + timeline.SetFrame(frameIndex, time, rotateMix, translateMix, scaleMix, shearMix); ReadCurve(valueMap, timeline, frameIndex); frameIndex++; } @@ -676,8 +639,8 @@ namespace Spine { } // Path constraint timelines. - if (map.ContainsKey("path")) { - foreach (KeyValuePair constraintMap in (Dictionary)map["path"]) { + if (map.ContainsKey("paths")) { + foreach (KeyValuePair constraintMap in (Dictionary)map["paths"]) { int index = skeletonData.FindPathConstraintIndex(constraintMap.Key); if (index == -1) throw new Exception("Path constraint not found: " + constraintMap.Key); PathConstraintData data = skeletonData.pathConstraints.Items[index]; @@ -699,7 +662,7 @@ namespace Spine { timeline.pathConstraintIndex = index; int frameIndex = 0; foreach (Dictionary valueMap in values) { - timeline.SetFrame(frameIndex, GetFloat(valueMap, "time", 0), GetFloat(valueMap, timelineName, 0) * timelineScale); + timeline.SetFrame(frameIndex, (float)valueMap["time"], GetFloat(valueMap, timelineName, 0) * timelineScale); ReadCurve(valueMap, timeline, frameIndex); frameIndex++; } @@ -711,8 +674,7 @@ namespace Spine { timeline.pathConstraintIndex = index; int frameIndex = 0; foreach (Dictionary valueMap in values) { - timeline.SetFrame(frameIndex, GetFloat(valueMap, "time", 0), GetFloat(valueMap, "rotateMix", 1), - GetFloat(valueMap, "translateMix", 1)); + timeline.SetFrame(frameIndex, (float)valueMap["time"], GetFloat(valueMap, "rotateMix", 1), GetFloat(valueMap, "translateMix", 1)); ReadCurve(valueMap, timeline, frameIndex); frameIndex++; } @@ -741,7 +703,7 @@ namespace Spine { var timeline = new DeformTimeline(values.Count); timeline.slotIndex = slotIndex; timeline.attachment = attachment; - + int frameIndex = 0; foreach (Dictionary valueMap in values) { float[] deform; @@ -763,7 +725,7 @@ namespace Spine { } } - timeline.SetFrame(frameIndex, GetFloat(valueMap, "time", 0), deform); + timeline.SetFrame(frameIndex, (float)valueMap["time"], deform); ReadCurve(valueMap, timeline, frameIndex); frameIndex++; } @@ -806,7 +768,7 @@ namespace Spine { for (int i = slotCount - 1; i >= 0; i--) if (drawOrder[i] == -1) drawOrder[i] = unchanged[--unchangedIndex]; } - timeline.SetFrame(frameIndex++, GetFloat(drawOrderMap, "time", 0), drawOrder); + timeline.SetFrame(frameIndex++, (float)drawOrderMap["time"], drawOrder); } timelines.Add(timeline); duration = Math.Max(duration, timeline.frames[timeline.FrameCount - 1]); @@ -820,7 +782,7 @@ namespace Spine { foreach (Dictionary eventMap in eventsMap) { EventData eventData = skeletonData.FindEvent((string)eventMap["name"]); if (eventData == null) throw new Exception("Event not found: " + eventMap["name"]); - var e = new Event(GetFloat(eventMap, "time", 0), eventData) { + var e = new Event((float)eventMap["time"], eventData) { intValue = GetInt(eventMap, "int", eventData.Int), floatValue = GetFloat(eventMap, "float", eventData.Float), stringValue = GetString(eventMap, "string", eventData.String) @@ -843,24 +805,25 @@ namespace Spine { if (!valueMap.ContainsKey("curve")) return; Object curveObject = valueMap["curve"]; - if (curveObject is string) + if (curveObject.Equals("stepped")) timeline.SetStepped(frameIndex); - else - timeline.SetCurve(frameIndex, (float)curveObject, GetFloat(valueMap, "c2", 0), GetFloat(valueMap, "c3", 1), GetFloat(valueMap, "c4", 1)); + else { + var curve = curveObject as List; + if (curve != null) + timeline.SetCurve(frameIndex, (float)curve[0], (float)curve[1], (float)curve[2], (float)curve[3]); + } } internal class LinkedMesh { internal string parent, skin; internal int slotIndex; internal MeshAttachment mesh; - internal bool inheritDeform; - public LinkedMesh (MeshAttachment mesh, string skin, int slotIndex, string parent, bool inheritDeform) { + public LinkedMesh (MeshAttachment mesh, string skin, int slotIndex, string parent) { this.mesh = mesh; this.skin = skin; this.slotIndex = slotIndex; this.parent = parent; - this.inheritDeform = inheritDeform; } } diff --git a/Assets/Spine/Runtime/spine-csharp/Skin.cs b/Assets/Spine/Runtime/spine-csharp/Skin.cs index de26ad1b8..cf8680c4a 100644 --- a/Assets/Spine/Runtime/spine-csharp/Skin.cs +++ b/Assets/Spine/Runtime/spine-csharp/Skin.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,114 +15,75 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; -using System.Collections; using System.Collections.Generic; -using Spine.Collections; namespace Spine { /// Stores attachments by slot index and attachment name. - /// See SkeletonData , Skeleton , and + /// See SkeletonData , Skeleton , and /// Runtime skins in the Spine Runtimes Guide. /// public class Skin { internal string name; - private OrderedDictionary attachments = new OrderedDictionary(SkinEntryComparer.Instance); - internal readonly ExposedList bones = new ExposedList(); - internal readonly ExposedList constraints = new ExposedList(); + private Dictionary attachments = + new Dictionary(AttachmentKeyTupleComparer.Instance); public string Name { get { return name; } } - public OrderedDictionary Attachments { get { return attachments; } } - public ExposedList Bones { get { return bones; } } - public ExposedList Constraints { get { return constraints; } } + public Dictionary Attachments { get { return attachments; } } public Skin (string name) { if (name == null) throw new ArgumentNullException("name", "name cannot be null."); this.name = name; } - /// Adds an attachment to the skin for the specified slot index and name. - /// If the name already exists for the slot, the previous value is replaced. - public void SetAttachment (int slotIndex, string name, Attachment attachment) { + /// Adds an attachment to the skin for the specified slot index and name. If the name already exists for the slot, the previous value is replaced. + public void AddAttachment (int slotIndex, string name, Attachment attachment) { if (attachment == null) throw new ArgumentNullException("attachment", "attachment cannot be null."); - if (slotIndex < 0) throw new ArgumentNullException("slotIndex", "slotIndex must be >= 0."); - attachments[new SkinEntry(slotIndex, name, attachment)] = attachment; - } - - ///Adds all attachments, bones, and constraints from the specified skin to this skin. - public void AddSkin (Skin skin) { - foreach (BoneData data in skin.bones) - if (!bones.Contains(data)) bones.Add(data); - - foreach (ConstraintData data in skin.constraints) - if (!constraints.Contains(data)) constraints.Add(data); - - foreach (SkinEntry entry in skin.attachments.Keys) - SetAttachment(entry.SlotIndex, entry.Name, entry.Attachment); - } - - ///Adds all attachments from the specified skin to this skin. Attachments are deep copied. - public void CopySkin (Skin skin) { - foreach (BoneData data in skin.bones) - if (!bones.Contains(data)) bones.Add(data); - - foreach (ConstraintData data in skin.constraints) - if (!constraints.Contains(data)) constraints.Add(data); - - foreach (SkinEntry entry in skin.attachments.Keys) { - if (entry.Attachment is MeshAttachment) - SetAttachment(entry.SlotIndex, entry.Name, - entry.Attachment != null ? ((MeshAttachment)entry.Attachment).NewLinkedMesh() : null); - else - SetAttachment(entry.SlotIndex, entry.Name, entry.Attachment != null ? entry.Attachment.Copy() : null); - } + attachments[new AttachmentKeyTuple(slotIndex, name)] = attachment; } /// Returns the attachment for the specified slot index and name, or null. /// May be null. public Attachment GetAttachment (int slotIndex, string name) { - var lookup = new SkinEntry(slotIndex, name, null); - Attachment attachment = null; - bool containsKey = attachments.TryGetValue(lookup, out attachment); - return containsKey ? attachment : null; + Attachment attachment; + attachments.TryGetValue(new AttachmentKeyTuple(slotIndex, name), out attachment); + return attachment; } /// Removes the attachment in the skin for the specified slot index and name, if any. public void RemoveAttachment (int slotIndex, string name) { if (slotIndex < 0) throw new ArgumentOutOfRangeException("slotIndex", "slotIndex must be >= 0"); - var lookup = new SkinEntry(slotIndex, name, null); - attachments.Remove(lookup); + attachments.Remove(new AttachmentKeyTuple(slotIndex, name)); } - ///Returns all attachments contained in this skin. - public ICollection GetAttachments () { - return this.attachments.Keys; - } - - /// Returns all attachments in this skin for the specified slot index. + /// Finds the skin keys for a given slot. The results are added to the passed List(names). /// The target slotIndex. To find the slot index, use or - public void GetAttachments (int slotIndex, List attachments) { - foreach (SkinEntry entry in this.attachments.Keys) - if (entry.SlotIndex == slotIndex) attachments.Add(entry); + /// Found skin key names will be added to this list. + public void FindNamesForSlot (int slotIndex, List names) { + if (names == null) throw new ArgumentNullException("names", "names cannot be null."); + foreach (AttachmentKeyTuple key in attachments.Keys) + if (key.slotIndex == slotIndex) names.Add(key.name); } - ///Clears all attachments, bones, and constraints. - public void Clear () { - attachments.Clear(); - bones.Clear(); - constraints.Clear(); + /// Finds the attachments for a given slot. The results are added to the passed List(Attachment). + /// The target slotIndex. To find the slot index, use or + /// Found Attachments will be added to this list. + public void FindAttachmentsForSlot (int slotIndex, List attachments) { + if (attachments == null) throw new ArgumentNullException("attachments", "attachments cannot be null."); + foreach (KeyValuePair entry in this.attachments) + if (entry.Key.slotIndex == slotIndex) attachments.Add(entry.Value); } override public string ToString () { @@ -131,62 +92,38 @@ namespace Spine { /// Attach all attachments from this skin if the corresponding attachment from the old skin is currently attached. internal void AttachAll (Skeleton skeleton, Skin oldSkin) { - foreach (SkinEntry entry in oldSkin.attachments.Keys) { - int slotIndex = entry.SlotIndex; + foreach (KeyValuePair entry in oldSkin.attachments) { + int slotIndex = entry.Key.slotIndex; Slot slot = skeleton.slots.Items[slotIndex]; - if (slot.Attachment == entry.Attachment) { - Attachment attachment = GetAttachment(slotIndex, entry.Name); + if (slot.Attachment == entry.Value) { + Attachment attachment = GetAttachment(slotIndex, entry.Key.name); if (attachment != null) slot.Attachment = attachment; } } } - /// Stores an entry in the skin consisting of the slot index, name, and attachment. - public struct SkinEntry { - private readonly int slotIndex; - private readonly string name; - private readonly Attachment attachment; - internal readonly int hashCode; + public struct AttachmentKeyTuple { + public readonly int slotIndex; + public readonly string name; + internal readonly int nameHashCode; - public SkinEntry (int slotIndex, string name, Attachment attachment) { + public AttachmentKeyTuple (int slotIndex, string name) { this.slotIndex = slotIndex; this.name = name; - this.attachment = attachment; - this.hashCode = this.name.GetHashCode() + this.slotIndex * 37; - } - - public int SlotIndex { - get { - return slotIndex; - } - } - - /// The name the attachment is associated with, equivalent to the skin placeholder name in the Spine editor. - public String Name { - get { - return name; - } - } - - public Attachment Attachment { - get { - return attachment; - } + nameHashCode = this.name.GetHashCode(); } } - // Avoids boxing in the dictionary and is necessary to omit entry.attachment in the comparison. - class SkinEntryComparer : IEqualityComparer { - internal static readonly SkinEntryComparer Instance = new SkinEntryComparer(); + // Avoids boxing in the dictionary. + class AttachmentKeyTupleComparer : IEqualityComparer { + internal static readonly AttachmentKeyTupleComparer Instance = new AttachmentKeyTupleComparer(); - bool IEqualityComparer.Equals (SkinEntry e1, SkinEntry e2) { - if (e1.SlotIndex != e2.SlotIndex) return false; - if (!string.Equals(e1.Name, e2.Name, StringComparison.Ordinal)) return false; - return true; + bool IEqualityComparer.Equals (AttachmentKeyTuple o1, AttachmentKeyTuple o2) { + return o1.slotIndex == o2.slotIndex && o1.nameHashCode == o2.nameHashCode && string.Equals(o1.name, o2.name, StringComparison.Ordinal); } - int IEqualityComparer.GetHashCode (SkinEntry e) { - return e.Name.GetHashCode() + e.SlotIndex * 37; + int IEqualityComparer.GetHashCode (AttachmentKeyTuple o) { + return o.slotIndex; } } } diff --git a/Assets/Spine/Runtime/spine-csharp/Slot.cs b/Assets/Spine/Runtime/spine-csharp/Slot.cs index c7e45a886..9d5284622 100644 --- a/Assets/Spine/Runtime/spine-csharp/Slot.cs +++ b/Assets/Spine/Runtime/spine-csharp/Slot.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -44,8 +44,7 @@ namespace Spine { internal bool hasSecondColor; internal Attachment attachment; internal float attachmentTime; - internal ExposedList deform = new ExposedList(); - internal int attachmentState; + internal ExposedList attachmentVertices = new ExposedList(); public Slot (SlotData data, Bone bone) { if (data == null) throw new ArgumentNullException("data", "data cannot be null."); @@ -84,7 +83,6 @@ namespace Spine { attachment = slot.attachment; attachmentTime = slot.attachmentTime; - deform.AddRange(slot.deform); } /// The slot's setup pose data. @@ -106,13 +104,6 @@ namespace Spine { /// color tinting. public float A { get { return a; } set { a = value; } } - public void ClampColor() { - r = MathUtils.Clamp(r, 0, 1); - g = MathUtils.Clamp(g, 0, 1); - b = MathUtils.Clamp(b, 0, 1); - a = MathUtils.Clamp(a, 0, 1); - } - /// The dark color used to tint the slot's attachment for two color tinting, ignored if two color tinting is not used. /// public float R2 { get { return r2; } set { r2 = value; } } @@ -125,24 +116,18 @@ namespace Spine { /// Whether R2 G2 B2 are used to tint the slot's attachment for two color tinting. False if two color tinting is not used. public bool HasSecondColor { get { return data.hasSecondColor; } set { data.hasSecondColor = value; } } - public void ClampSecondColor () { - r2 = MathUtils.Clamp(r2, 0, 1); - g2 = MathUtils.Clamp(g2, 0, 1); - b2 = MathUtils.Clamp(b2, 0, 1); - } - public Attachment Attachment { /// The current attachment for the slot, or null if the slot has no attachment. get { return attachment; } /// /// Sets the slot's attachment and, if the attachment changed, resets and clears - /// . + /// . /// May be null. set { if (attachment == value) return; attachment = value; attachmentTime = bone.skeleton.time; - deform.Clear(false); + attachmentVertices.Clear(false); } } @@ -157,13 +142,13 @@ namespace Spine { /// weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions. /// /// See and . - public ExposedList Deform { + public ExposedList AttachmentVertices { get { - return deform; + return attachmentVertices; } set { - if (deform == null) throw new ArgumentNullException("deform", "deform cannot be null."); - deform = value; + if (attachmentVertices == null) throw new ArgumentNullException("attachmentVertices", "attachmentVertices cannot be null."); + attachmentVertices = value; } } diff --git a/Assets/Spine/Runtime/spine-csharp/SlotData.cs b/Assets/Spine/Runtime/spine-csharp/SlotData.cs index a51b2949e..4819fefd2 100644 --- a/Assets/Spine/Runtime/spine-csharp/SlotData.cs +++ b/Assets/Spine/Runtime/spine-csharp/SlotData.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -40,11 +40,8 @@ namespace Spine { internal string attachmentName; internal BlendMode blendMode; - /// The index of the slot in . public int Index { get { return index; } } - /// The name of the slot, which is unique across all slots in the skeleton. public string Name { get { return name; } } - /// The bone this slot belongs to. public BoneData BoneData { get { return boneData; } } public float R { get { return r; } set { r = value; } } public float G { get { return g; } set { g = value; } } @@ -56,9 +53,8 @@ namespace Spine { public float B2 { get { return b2; } set { b2 = value; } } public bool HasSecondColor { get { return hasSecondColor; } set { hasSecondColor = value; } } - /// The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. + /// May be null. public String AttachmentName { get { return attachmentName; } set { attachmentName = value; } } - /// The blend mode for drawing the slot's attachment. public BlendMode BlendMode { get { return blendMode; } set { blendMode = value; } } public SlotData (int index, String name, BoneData boneData) { diff --git a/Assets/Spine/Runtime/spine-csharp/TransformConstraint.cs b/Assets/Spine/Runtime/spine-csharp/TransformConstraint.cs index 25761029c..a2d7d184f 100644 --- a/Assets/Spine/Runtime/spine-csharp/TransformConstraint.cs +++ b/Assets/Spine/Runtime/spine-csharp/TransformConstraint.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -37,14 +37,12 @@ namespace Spine { /// /// See Transform constraints in the Spine User Guide. /// - public class TransformConstraint : IUpdatable { + public class TransformConstraint : IConstraint { internal TransformConstraintData data; internal ExposedList bones; internal Bone target; internal float rotateMix, translateMix, scaleMix, shearMix; - internal bool active; - public TransformConstraint (TransformConstraintData data, Skeleton skeleton) { if (data == null) throw new ArgumentNullException("data", "data cannot be null."); if (skeleton == null) throw new ArgumentNullException("skeleton", "skeleton cannot be null."); @@ -290,6 +288,7 @@ namespace Spine { } } + public int Order { get { return data.order; } } /// The bones that will be modified by this transform constraint. public ExposedList Bones { get { return bones; } } /// The target bone whose world transform will be copied to the constrained bones. @@ -302,7 +301,6 @@ namespace Spine { public float ScaleMix { get { return scaleMix; } set { scaleMix = value; } } /// A percentage (0-1) that controls the mix between the constrained and unconstrained scales. public float ShearMix { get { return shearMix; } set { shearMix = value; } } - public bool Active { get { return active; } } /// The transform constraint's setup pose data. public TransformConstraintData Data { get { return data; } } diff --git a/Assets/Spine/Runtime/spine-csharp/TransformConstraintData.cs b/Assets/Spine/Runtime/spine-csharp/TransformConstraintData.cs index f3da4d6a0..1adc43dc4 100644 --- a/Assets/Spine/Runtime/spine-csharp/TransformConstraintData.cs +++ b/Assets/Spine/Runtime/spine-csharp/TransformConstraintData.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,28 +15,32 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; namespace Spine { - public class TransformConstraintData : ConstraintData { + public class TransformConstraintData { + internal string name; + internal int order; internal ExposedList bones = new ExposedList(); internal BoneData target; internal float rotateMix, translateMix, scaleMix, shearMix; internal float offsetRotation, offsetX, offsetY, offsetScaleX, offsetScaleY, offsetShearY; internal bool relative, local; + public string Name { get { return name; } } + public int Order { get { return order; } set { order = value; } } public ExposedList Bones { get { return bones; } } public BoneData Target { get { return target; } set { target = value; } } public float RotateMix { get { return rotateMix; } set { rotateMix = value; } } @@ -54,7 +58,13 @@ namespace Spine { public bool Relative { get { return relative; } set { relative = value; } } public bool Local { get { return local; } set { local = value; } } - public TransformConstraintData (string name) : base(name) { + public TransformConstraintData (string name) { + if (name == null) throw new ArgumentNullException("name", "name cannot be null."); + this.name = name; + } + + override public string ToString () { + return name; } } } diff --git a/Assets/Spine/Runtime/spine-csharp/Triangulator.cs b/Assets/Spine/Runtime/spine-csharp/Triangulator.cs index f0cc8dc5b..4591bc639 100644 --- a/Assets/Spine/Runtime/spine-csharp/Triangulator.cs +++ b/Assets/Spine/Runtime/spine-csharp/Triangulator.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -126,13 +126,13 @@ namespace Spine { var convexPolygons = this.convexPolygons; for (int i = 0, n = convexPolygons.Count; i < n; i++) { polygonPool.Free(convexPolygons.Items[i]); - } + } convexPolygons.Clear(); var convexPolygonsIndices = this.convexPolygonsIndices; for (int i = 0, n = convexPolygonsIndices.Count; i < n; i++) { polygonIndicesPool.Free(convexPolygonsIndices.Items[i]); - } + } convexPolygonsIndices.Clear(); var polygonIndices = polygonIndicesPool.Obtain(); @@ -173,7 +173,7 @@ namespace Spine { } else { polygonPool.Free(polygon); polygonIndicesPool.Free(polygonIndices); - } + } polygon = polygonPool.Obtain(); polygon.Clear(); polygon.Add(x1); diff --git a/Assets/Spine/Runtime/spine-unity.asmdef b/Assets/Spine/Runtime/spine-unity.txt similarity index 100% rename from Assets/Spine/Runtime/spine-unity.asmdef rename to Assets/Spine/Runtime/spine-unity.txt diff --git a/Assets/Spine/Runtime/spine-unity.asmdef.meta b/Assets/Spine/Runtime/spine-unity.txt.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity.asmdef.meta rename to Assets/Spine/Runtime/spine-unity.txt.meta diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/AnimationReferenceAsset.cs b/Assets/Spine/Runtime/spine-unity/Asset Types/AnimationReferenceAsset.cs index 494ce23e3..c5bf54614 100644 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/AnimationReferenceAsset.cs +++ b/Assets/Spine/Runtime/spine-unity/Asset Types/AnimationReferenceAsset.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #define AUTOINIT_SPINEREFERENCE @@ -52,13 +52,13 @@ namespace Spine.Unity { return animation; } } - + public void Initialize () { if (skeletonDataAsset == null) return; this.animation = skeletonDataAsset.GetSkeletonData(AnimationReferenceAsset.QuietSkeletonData).FindAnimation(animationName); if (this.animation == null) Debug.LogWarningFormat("Animation '{0}' not found in SkeletonData : {1}.", animationName, skeletonDataAsset.name); } - + public static implicit operator Animation (AnimationReferenceAsset asset) { return asset.Animation; } diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/AtlasAssetBase.cs b/Assets/Spine/Runtime/spine-unity/Asset Types/AtlasAssetBase.cs index a987b54fc..f5942e952 100644 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/AtlasAssetBase.cs +++ b/Assets/Spine/Runtime/spine-unity/Asset Types/AtlasAssetBase.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System.Collections; diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/BlendModeMaterials.cs b/Assets/Spine/Runtime/spine-unity/Asset Types/BlendModeMaterials.cs deleted file mode 100644 index 4ddcf1b5c..000000000 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/BlendModeMaterials.cs +++ /dev/null @@ -1,144 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using System; -using System.Collections.Generic; -using System.IO; -using UnityEngine; -using Spine; - -namespace Spine.Unity { - [System.Serializable] - public class BlendModeMaterials { - - [System.Serializable] - public class ReplacementMaterial { - public string pageName; - public Material material; - } - - [SerializeField, HideInInspector] protected bool requiresBlendModeMaterials = false; - public bool applyAdditiveMaterial = false; - - public List additiveMaterials = new List(); - public List multiplyMaterials = new List(); - public List screenMaterials = new List(); - - public bool RequiresBlendModeMaterials { get { return requiresBlendModeMaterials; } set { requiresBlendModeMaterials = value; } } - - #if UNITY_EDITOR - public void TransferSettingsFrom (BlendModeMaterialsAsset modifierAsset) { - applyAdditiveMaterial = modifierAsset.applyAdditiveMaterial; - } - - public bool UpdateBlendmodeMaterialsRequiredState (SkeletonData skeletonData) { - requiresBlendModeMaterials = false; - - if (skeletonData == null) throw new ArgumentNullException("skeletonData"); - - var skinEntries = new List(); - var slotsItems = skeletonData.Slots.Items; - for (int slotIndex = 0, slotCount = skeletonData.Slots.Count; slotIndex < slotCount; slotIndex++) { - var slot = slotsItems[slotIndex]; - if (slot.blendMode == BlendMode.Normal) continue; - if (!applyAdditiveMaterial && slot.blendMode == BlendMode.Additive) continue; - - skinEntries.Clear(); - foreach (var skin in skeletonData.Skins) - skin.GetAttachments(slotIndex, skinEntries); - - foreach (var entry in skinEntries) { - if (entry.Attachment is IHasRendererObject) { - requiresBlendModeMaterials = true; - return true; - } - } - } - return false; - } - #endif - public void ApplyMaterials (SkeletonData skeletonData) { - if (skeletonData == null) throw new ArgumentNullException("skeletonData"); - if (!requiresBlendModeMaterials) - return; - - var skinEntries = new List(); - var slotsItems = skeletonData.Slots.Items; - for (int slotIndex = 0, slotCount = skeletonData.Slots.Count; slotIndex < slotCount; slotIndex++) { - var slot = slotsItems[slotIndex]; - if (slot.blendMode == BlendMode.Normal) continue; - if (!applyAdditiveMaterial && slot.blendMode == BlendMode.Additive) continue; - - List replacementMaterials = null; - switch (slot.blendMode) { - case BlendMode.Multiply: - replacementMaterials = multiplyMaterials; - break; - case BlendMode.Screen: - replacementMaterials = screenMaterials; - break; - case BlendMode.Additive: - replacementMaterials = additiveMaterials; - break; - } - if (replacementMaterials == null) - continue; - - skinEntries.Clear(); - foreach (var skin in skeletonData.Skins) - skin.GetAttachments(slotIndex, skinEntries); - - foreach (var entry in skinEntries) { - var renderableAttachment = entry.Attachment as IHasRendererObject; - if (renderableAttachment != null) { - renderableAttachment.RendererObject = CloneAtlasRegionWithMaterial( - (AtlasRegion)renderableAttachment.RendererObject, replacementMaterials); - } - } - } - } - - protected AtlasRegion CloneAtlasRegionWithMaterial (AtlasRegion originalRegion, List replacementMaterials) { - var newRegion = originalRegion.Clone(); - Material material = null; - foreach (var replacement in replacementMaterials) { - if (replacement.pageName == originalRegion.page.name) { - material = replacement.material; - break; - } - } - - AtlasPage originalPage = originalRegion.page; - var newPage = originalPage.Clone(); - newPage.rendererObject = material; - newRegion.page = newPage; - return newRegion; - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/BlendModeMaterials.cs.meta b/Assets/Spine/Runtime/spine-unity/Asset Types/BlendModeMaterials.cs.meta deleted file mode 100644 index 8c1222e4a..000000000 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/BlendModeMaterials.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d03ca55657e89b949a4c07bc9207beac -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/BlendModeMaterialsAsset.cs b/Assets/Spine/Runtime/spine-unity/Asset Types/BlendModeMaterialsAsset.cs similarity index 75% rename from Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/BlendModeMaterialsAsset.cs rename to Assets/Spine/Runtime/spine-unity/Asset Types/BlendModeMaterialsAsset.cs index 3f649324b..51b641e5f 100644 --- a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/BlendModeMaterialsAsset.cs +++ b/Assets/Spine/Runtime/spine-unity/Asset Types/BlendModeMaterialsAsset.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -42,7 +42,7 @@ namespace Spine.Unity { public Material screenMaterialTemplate; public Material additiveMaterialTemplate; - public bool applyAdditiveMaterial = true; + public bool applyAdditiveMaterial; public override void Apply (SkeletonData skeletonData) { ApplyMaterials(skeletonData, multiplyMaterialTemplate, screenMaterialTemplate, additiveMaterialTemplate, applyAdditiveMaterial); @@ -52,16 +52,16 @@ namespace Spine.Unity { if (skeletonData == null) throw new ArgumentNullException("skeletonData"); using (var materialCache = new AtlasMaterialCache()) { - var entryBuffer = new List(); + var attachmentBuffer = new List(); var slotsItems = skeletonData.Slots.Items; - for (int slotIndex = 0, slotCount = skeletonData.Slots.Count; slotIndex < slotCount; slotIndex++) { - var slot = slotsItems[slotIndex]; + for (int i = 0, slotCount = skeletonData.Slots.Count; i < slotCount; i++) { + var slot = slotsItems[i]; if (slot.blendMode == BlendMode.Normal) continue; if (!includeAdditiveSlots && slot.blendMode == BlendMode.Additive) continue; - entryBuffer.Clear(); + attachmentBuffer.Clear(); foreach (var skin in skeletonData.Skins) - skin.GetAttachments(slotIndex, entryBuffer); + skin.FindAttachmentsForSlot(i, attachmentBuffer); Material templateMaterial = null; switch (slot.blendMode) { @@ -77,8 +77,8 @@ namespace Spine.Unity { } if (templateMaterial == null) continue; - foreach (var entry in entryBuffer) { - var renderableAttachment = entry.Attachment as IHasRendererObject; + foreach (var attachment in attachmentBuffer) { + var renderableAttachment = attachment as IHasRendererObject; if (renderableAttachment != null) { renderableAttachment.RendererObject = materialCache.CloneAtlasRegionWithMaterial((AtlasRegion)renderableAttachment.RendererObject, templateMaterial); } @@ -123,7 +123,7 @@ namespace Spine.Unity { cache.Clear(); } } - + } } diff --git a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/BlendModeMaterialsAsset.cs.meta b/Assets/Spine/Runtime/spine-unity/Asset Types/BlendModeMaterialsAsset.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/BlendModeMaterialsAsset.cs.meta rename to Assets/Spine/Runtime/spine-unity/Asset Types/BlendModeMaterialsAsset.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/EventDataReferenceAsset.cs b/Assets/Spine/Runtime/spine-unity/Asset Types/EventDataReferenceAsset.cs index 38e41dfed..0e7cc130b 100644 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/EventDataReferenceAsset.cs +++ b/Assets/Spine/Runtime/spine-unity/Asset Types/EventDataReferenceAsset.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #define AUTOINIT_SPINEREFERENCE diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/RegionlessAttachmentLoader.cs b/Assets/Spine/Runtime/spine-unity/Asset Types/RegionlessAttachmentLoader.cs index 37e7eaa2e..23555e676 100644 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/RegionlessAttachmentLoader.cs +++ b/Assets/Spine/Runtime/spine-unity/Asset Types/RegionlessAttachmentLoader.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataAsset.cs b/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataAsset.cs index 746d2a4a3..f88c223c3 100644 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataAsset.cs +++ b/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataAsset.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -32,7 +32,7 @@ using System.Collections.Generic; using System.IO; using UnityEngine; -using CompatibilityProblemInfo = Spine.Unity.SkeletonDataCompatibility.CompatibilityProblemInfo; +using Spine; namespace Spine.Unity { @@ -49,9 +49,6 @@ namespace Spine.Unity { #endif public TextAsset skeletonJSON; - public bool isUpgradingBlendModeMaterials = false; - public BlendModeMaterials blendModeMaterials = new BlendModeMaterials(); - [Tooltip("Use SkeletonDataModifierAssets to apply changes to the SkeletonData after being loaded, such as apply blend mode Materials to Attachments under slots with special blend modes.")] public List skeletonDataModifiers = new List(); @@ -119,24 +116,24 @@ namespace Spine.Unity { } // Disabled to support attachmentless/skinless SkeletonData. - // if (atlasAssets == null) { - // atlasAssets = new AtlasAsset[0]; - // if (!quiet) - // Debug.LogError("Atlas not set for SkeletonData asset: " + name, this); - // Clear(); - // return null; - // } - // #if !SPINE_TK2D - // if (atlasAssets.Length == 0) { - // Clear(); - // return null; - // } - // #else - // if (atlasAssets.Length == 0 && spriteCollection == null) { - // Clear(); - // return null; - // } - // #endif +// if (atlasAssets == null) { +// atlasAssets = new AtlasAsset[0]; +// if (!quiet) +// Debug.LogError("Atlas not set for SkeletonData asset: " + name, this); +// Clear(); +// return null; +// } +// #if !SPINE_TK2D +// if (atlasAssets.Length == 0) { +// Clear(); +// return null; +// } +// #else +// if (atlasAssets.Length == 0 && spriteCollection == null) { +// Clear(); +// return null; +// } +// #endif if (skeletonData != null) return skeletonData; @@ -163,48 +160,27 @@ namespace Spine.Unity { } #endif - bool hasBinaryExtension = skeletonJSON.name.ToLower().Contains(".skel"); - SkeletonData loadedSkeletonData = null; + bool isBinary = skeletonJSON.name.ToLower().Contains(".skel"); + SkeletonData loadedSkeletonData; try { - if (hasBinaryExtension) + if (isBinary) loadedSkeletonData = SkeletonDataAsset.ReadSkeletonData(skeletonJSON.bytes, attachmentLoader, skeletonDataScale); else loadedSkeletonData = SkeletonDataAsset.ReadSkeletonData(skeletonJSON.text, attachmentLoader, skeletonDataScale); + } catch (Exception ex) { if (!quiet) - Debug.LogError("Error reading skeleton JSON file for SkeletonData asset: " + name + "\n" + ex.Message + "\n" + ex.StackTrace, skeletonJSON); - } - - #if UNITY_EDITOR - if (loadedSkeletonData == null && !quiet && skeletonJSON != null) { - string problemDescription = null; - bool isSpineSkeletonData; - SkeletonDataCompatibility.VersionInfo fileVersion = SkeletonDataCompatibility.GetVersionInfo(skeletonJSON, out isSpineSkeletonData, ref problemDescription); - if (problemDescription != null) { - if (!quiet) - Debug.LogError(problemDescription, skeletonJSON); - return null; - } - CompatibilityProblemInfo compatibilityProblemInfo = SkeletonDataCompatibility.GetCompatibilityProblemInfo(fileVersion); - if (compatibilityProblemInfo != null) { - SkeletonDataCompatibility.DisplayCompatibilityProblem(compatibilityProblemInfo.DescriptionString(), skeletonJSON); - return null; - } - } - #endif - if (loadedSkeletonData == null) + Debug.LogError("Error reading skeleton JSON file for SkeletonData asset: " + name + "\n" + ex.Message + "\n" + ex.StackTrace, this); return null; + } + if (skeletonDataModifiers != null) { - foreach (var modifier in skeletonDataModifiers) { - if (modifier != null && !(isUpgradingBlendModeMaterials && modifier is BlendModeMaterialsAsset)) { - modifier.Apply(loadedSkeletonData); - } + foreach (var m in skeletonDataModifiers) { + if (m != null) m.Apply(loadedSkeletonData); } } - if (!isUpgradingBlendModeMaterials) - blendModeMaterials.ApplyMaterials(loadedSkeletonData); this.InitializeWithData(loadedSkeletonData); @@ -257,6 +233,7 @@ namespace Spine.Unity { }; return json.ReadSkeletonData(input); } + } } diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs b/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs deleted file mode 100644 index 2be8e6cda..000000000 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs +++ /dev/null @@ -1,215 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using System.Collections.Generic; -using System.IO; -using UnityEngine; -using System; -#if UNITY_EDITOR -using System.Globalization; -using System.Text.RegularExpressions; -#endif - -namespace Spine.Unity { - - public static class SkeletonDataCompatibility { - - #if UNITY_EDITOR - static readonly int[][] compatibleBinaryVersions = { new[] { 3, 8, 0 } }; - static readonly int[][] compatibleJsonVersions = { new[] { 3, 8, 0 } }; - - static bool wasVersionDialogShown = false; - static readonly Regex jsonVersionRegex = new Regex(@"""spine""\s*:\s*""([^""]+)""", RegexOptions.CultureInvariant); - #endif - - public enum SourceType { - Json, - Binary - } - - [System.Serializable] - public class VersionInfo { - public string rawVersion = null; - public int[] version = null; - public SourceType sourceType; - } - - [System.Serializable] - public class CompatibilityProblemInfo { - public VersionInfo actualVersion; - public int[][] compatibleVersions; - public string explicitProblemDescription = null; - - public string DescriptionString () { - if (!string.IsNullOrEmpty(explicitProblemDescription)) - return explicitProblemDescription; - - string compatibleVersionString = ""; - string optionalOr = null; - foreach (int[] version in compatibleVersions) { - compatibleVersionString += string.Format("{0}{1}.{2}", optionalOr, version[0], version[1]); - optionalOr = " or "; - } - return string.Format("Skeleton data could not be loaded. Data version: {0}. Required version: {1}.\nPlease re-export skeleton data with Spine {1} or change runtime to version {2}.{3}.", - actualVersion.rawVersion, compatibleVersionString, actualVersion.version[0], actualVersion.version[1]); - } - } - - #if UNITY_EDITOR - public static VersionInfo GetVersionInfo (TextAsset asset, out bool isSpineSkeletonData, ref string problemDescription) { - isSpineSkeletonData = false; - if (asset == null) - return null; - - VersionInfo fileVersion = new VersionInfo(); - bool hasBinaryExtension = asset.name.Contains(".skel"); - fileVersion.sourceType = hasBinaryExtension ? SourceType.Binary : SourceType.Json; - - bool isJsonFileByContent = IsJsonFile(asset); - if (hasBinaryExtension == isJsonFileByContent) { - if (hasBinaryExtension) { - problemDescription = string.Format("Failed to read '{0}'. Extension is '.skel.bytes' but content looks like a '.json' file.\n" - + "Did you choose the wrong extension upon export?\n", asset.name); - } - else { - problemDescription = string.Format("Failed to read '{0}'. Extension is '.json' but content looks like binary 'skel.bytes' file.\n" - + "Did you choose the wrong extension upon export?\n", asset.name); - } - isSpineSkeletonData = false; - return null; - } - - if (fileVersion.sourceType == SourceType.Binary) { - try { - using (var memStream = new MemoryStream(asset.bytes)) { - fileVersion.rawVersion = SkeletonBinary.GetVersionString(memStream); - } - } - catch (System.Exception e) { - problemDescription = string.Format("Failed to read '{0}'. It is likely not a binary Spine SkeletonData file.\n{1}", asset.name, e); - isSpineSkeletonData = false; - return null; - } - } - else { - Match match = jsonVersionRegex.Match(asset.text); - if (match != null) { - fileVersion.rawVersion = match.Groups[1].Value; - } - else { - object obj = Json.Deserialize(new StringReader(asset.text)); - if (obj == null) { - problemDescription = string.Format("'{0}' is not valid JSON.", asset.name); - isSpineSkeletonData = false; - return null; - } - - var root = obj as Dictionary; - if (root == null) { - problemDescription = string.Format("'{0}' is not compatible JSON. Parser returned an incorrect type while parsing version info.", asset.name); - isSpineSkeletonData = false; - return null; - } - - if (root.ContainsKey("skeleton")) { - var skeletonInfo = (Dictionary)root["skeleton"]; - object jv; - skeletonInfo.TryGetValue("spine", out jv); - fileVersion.rawVersion = jv as string; - } - } - } - - if (string.IsNullOrEmpty(fileVersion.rawVersion)) { - // very likely not a Spine skeleton json file at all. Could be another valid json file, don't report errors. - isSpineSkeletonData = false; - return null; - } - - var versionSplit = fileVersion.rawVersion.Split('.'); - try { - fileVersion.version = new[]{ int.Parse(versionSplit[0], CultureInfo.InvariantCulture), - int.Parse(versionSplit[1], CultureInfo.InvariantCulture) }; - } - catch (System.Exception e) { - problemDescription = string.Format("Failed to read version info at skeleton '{0}'. It is likely not a valid Spine SkeletonData file.\n{1}", asset.name, e); - isSpineSkeletonData = false; - return null; - } - isSpineSkeletonData = true; - return fileVersion; - } - - public static bool IsJsonFile (TextAsset file) { - byte[] content = file.bytes; - const int maxCharsToCheck = 256; - int numCharsToCheck = Math.Min(content.Length, maxCharsToCheck); - int i = 0; - if (content.Length >= 3 && content[0] == 0xEF && content[1] == 0xBB && content[2] == 0xBF) // skip potential BOM - i = 3; - for (; i < numCharsToCheck; ++i) { - char c = (char)content[i]; - if (char.IsWhiteSpace(c)) - continue; - return c == '{'; - } - return true; - } - - public static CompatibilityProblemInfo GetCompatibilityProblemInfo (VersionInfo fileVersion) { - if (fileVersion == null) { - return null; // it's most likely not a Spine skeleton file, e.g. another json file. don't report problems. - } - - CompatibilityProblemInfo info = new CompatibilityProblemInfo(); - info.actualVersion = fileVersion; - info.compatibleVersions = (fileVersion.sourceType == SourceType.Binary) ? compatibleBinaryVersions - : compatibleJsonVersions; - - foreach (var compatibleVersion in info.compatibleVersions) { - bool majorMatch = fileVersion.version[0] == compatibleVersion[0]; - bool minorMatch = fileVersion.version[1] == compatibleVersion[1]; - if (majorMatch && minorMatch) { - return null; // is compatible, thus no problem info returned - } - } - return info; - } - - public static void DisplayCompatibilityProblem (string descriptionString, TextAsset spineJson) { - if (!wasVersionDialogShown) { - wasVersionDialogShown = true; - UnityEditor.EditorUtility.DisplayDialog("Version mismatch!", descriptionString, "OK"); - } - Debug.LogError(string.Format("Error importing skeleton '{0}': {1}", - spineJson.name, descriptionString), spineJson); - } - #endif // UNITY_EDITOR - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs.meta b/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs.meta deleted file mode 100644 index 1df7111a1..000000000 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataCompatibility.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4224df6e20549f0449154531ae080201 -timeCreated: 1567002861 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataModifierAsset.cs b/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataModifierAsset.cs index 34fef4fa9..ccc82f43b 100644 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataModifierAsset.cs +++ b/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataModifierAsset.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System.Collections; diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/SpineAtlasAsset.cs b/Assets/Spine/Runtime/spine-unity/Asset Types/SpineAtlasAsset.cs index 55aba23d8..38e36d21c 100644 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/SpineAtlasAsset.cs +++ b/Assets/Spine/Runtime/spine-unity/Asset Types/SpineAtlasAsset.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System; @@ -46,7 +46,7 @@ namespace Spine.Unity { public override IEnumerable Materials { get { return materials; } } public override int MaterialCount { get { return materials == null ? 0 : materials.Length; } } public override Material PrimaryMaterial { get { return materials[0]; } } - + #region Runtime Instantiation /// /// Creates a runtime AtlasAsset diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/SpineSpriteAtlasAsset.cs b/Assets/Spine/Runtime/spine-unity/Asset Types/SpineSpriteAtlasAsset.cs deleted file mode 100644 index 12b1a7005..000000000 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/SpineSpriteAtlasAsset.cs +++ /dev/null @@ -1,397 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#if UNITY_2018_2_OR_NEWER -#define EXPOSES_SPRITE_ATLAS_UTILITIES -#endif - -using System; -using System.Collections.Generic; -using System.IO; -using UnityEngine; -using Spine; -using UnityEngine.U2D; - -#if UNITY_EDITOR -using UnityEditor; -using System.Reflection; -#endif - -namespace Spine.Unity { - /// Loads and stores a Spine atlas and list of materials. - [CreateAssetMenu(fileName = "New Spine SpriteAtlas Asset", menuName = "Spine/Spine SpriteAtlas Asset")] - public class SpineSpriteAtlasAsset : AtlasAssetBase { - public SpriteAtlas spriteAtlasFile; - public Material[] materials; - protected Atlas atlas; - public bool updateRegionsInPlayMode; - - [System.Serializable] - protected class SavedRegionInfo { - public float x, y, width, height; - public SpritePackingRotation packingRotation; - } - [SerializeField] protected SavedRegionInfo[] savedRegions; - - public override bool IsLoaded { get { return this.atlas != null; } } - - public override IEnumerable Materials { get { return materials; } } - public override int MaterialCount { get { return materials == null ? 0 : materials.Length; } } - public override Material PrimaryMaterial { get { return materials[0]; } } - - #if UNITY_EDITOR - static MethodInfo GetPackedSpritesMethod, GetPreviewTexturesMethod; - #if !EXPOSES_SPRITE_ATLAS_UTILITIES - static MethodInfo PackAtlasesMethod; - #endif - #endif - - #region Runtime Instantiation - /// - /// Creates a runtime AtlasAsset - public static SpineSpriteAtlasAsset CreateRuntimeInstance (SpriteAtlas spriteAtlasFile, Material[] materials, bool initialize) { - SpineSpriteAtlasAsset atlasAsset = ScriptableObject.CreateInstance(); - atlasAsset.Reset(); - atlasAsset.spriteAtlasFile = spriteAtlasFile; - atlasAsset.materials = materials; - - if (initialize) - atlasAsset.GetAtlas(); - - return atlasAsset; - } - #endregion - - void Reset () { - Clear(); - } - - public override void Clear () { - atlas = null; - } - - /// The atlas or null if it could not be loaded. - public override Atlas GetAtlas () { - if (spriteAtlasFile == null) { - Debug.LogError("SpriteAtlas file not set for SpineSpriteAtlasAsset: " + name, this); - Clear(); - return null; - } - - if (materials == null || materials.Length == 0) { - Debug.LogError("Materials not set for SpineSpriteAtlasAsset: " + name, this); - Clear(); - return null; - } - - if (atlas != null) return atlas; - - try { - atlas = LoadAtlas(spriteAtlasFile); - return atlas; - } catch (Exception ex) { - Debug.LogError("Error analyzing SpriteAtlas for SpineSpriteAtlasAsset: " + name + "\n" + ex.Message + "\n" + ex.StackTrace, this); - return null; - } - } - - protected void AssignRegionsFromSavedRegions (Sprite[] sprites, Atlas usedAtlas) { - - if (savedRegions == null || savedRegions.Length != sprites.Length) - return; - - int i = 0; - foreach (var region in usedAtlas) { - var savedRegion = savedRegions[i]; - var page = region.page; - - region.degrees = savedRegion.packingRotation == SpritePackingRotation.None ? 0 : 90; - region.rotate = region.degrees != 0; - - float x = savedRegion.x; - float y = savedRegion.y; - float width = savedRegion.width; - float height = savedRegion.height; - - region.u = x / (float)page.width; - region.v = y / (float)page.height; - if (region.rotate) { - region.u2 = (x + height) / (float)page.width; - region.v2 = (y + width) / (float)page.height; - } - else { - region.u2 = (x + width) / (float)page.width; - region.v2 = (y + height) / (float)page.height; - } - region.x = (int)x; - region.y = (int)y; - region.width = Math.Abs((int)width); - region.height = Math.Abs((int)height); - - // flip upside down - var temp = region.v; - region.v = region.v2; - region.v2 = temp; - - region.originalWidth = (int)width; - region.originalHeight = (int)height; - - // note: currently sprite pivot offsets are ignored. - // var sprite = sprites[i]; - region.offsetX = 0;//sprite.pivot.x; - region.offsetY = 0;//sprite.pivot.y; - - ++i; - } - } - - private Atlas LoadAtlas (UnityEngine.U2D.SpriteAtlas spriteAtlas) { - - List pages = new List(); - List regions = new List(); - - Sprite[] sprites = new UnityEngine.Sprite[spriteAtlas.spriteCount]; - spriteAtlas.GetSprites(sprites); - if (sprites.Length == 0) - return new Atlas(pages, regions); - - Texture2D texture = null; - #if UNITY_EDITOR - if (!Application.isPlaying) - texture = AccessPackedTextureEditor(spriteAtlas); - else - #endif - texture = AccessPackedTexture(sprites); - - Material material = materials[0]; - #if !UNITY_EDITOR - material.mainTexture = texture; - #endif - - Spine.AtlasPage page = new AtlasPage(); - page.name = spriteAtlas.name; - page.width = texture.width; - page.height = texture.height; - page.format = Spine.Format.RGBA8888; - - page.minFilter = TextureFilter.Linear; - page.magFilter = TextureFilter.Linear; - page.uWrap = TextureWrap.ClampToEdge; - page.vWrap = TextureWrap.ClampToEdge; - page.rendererObject = material; - pages.Add(page); - - sprites = AccessPackedSprites(spriteAtlas); - - int i = 0; - for ( ; i < sprites.Length; ++i) { - var sprite = sprites[i]; - AtlasRegion region = new AtlasRegion(); - region.name = sprite.name.Replace("(Clone)", ""); - region.page = page; - region.degrees = sprite.packingRotation == SpritePackingRotation.None ? 0 : 90; - region.rotate = region.degrees != 0; - - region.u2 = 1; - region.v2 = 1; - region.width = page.width; - region.height = page.height; - region.originalWidth = page.width; - region.originalHeight = page.height; - - region.index = i; - regions.Add(region); - } - - var atlas = new Atlas(pages, regions); - AssignRegionsFromSavedRegions(sprites, atlas); - - return atlas; - } - -#if UNITY_EDITOR - public static void UpdateByStartingEditorPlayMode () { - EditorApplication.isPlaying = true; - } - - public static bool AnySpriteAtlasNeedsRegionsLoaded () { - string[] guids = UnityEditor.AssetDatabase.FindAssets("t:SpineSpriteAtlasAsset"); - foreach (var guid in guids) { - string path = UnityEditor.AssetDatabase.GUIDToAssetPath(guid); - if (!string.IsNullOrEmpty(path)) { - var atlasAsset = UnityEditor.AssetDatabase.LoadAssetAtPath(path); - if (atlasAsset) { - if (atlasAsset.RegionsNeedLoading) - return true; - } - } - } - return false; - } - - public static void UpdateWhenEditorPlayModeStarted () { - if (!EditorApplication.isPlaying) - return; - - EditorApplication.update -= UpdateWhenEditorPlayModeStarted; - string[] guids = UnityEditor.AssetDatabase.FindAssets("t:SpineSpriteAtlasAsset"); - if (guids.Length == 0) - return; - - Debug.Log("Updating SpineSpriteAtlasAssets"); - foreach (var guid in guids) { - string path = UnityEditor.AssetDatabase.GUIDToAssetPath(guid); - if (!string.IsNullOrEmpty(path)) { - var atlasAsset = UnityEditor.AssetDatabase.LoadAssetAtPath(path); - if (atlasAsset) { - atlasAsset.atlas = atlasAsset.LoadAtlas(atlasAsset.spriteAtlasFile); - atlasAsset.LoadRegionsInEditorPlayMode(); - Debug.Log(string.Format("Updated regions of '{0}'", atlasAsset.name), atlasAsset); - } - } - } - - EditorApplication.isPlaying = false; - } - - public bool RegionsNeedLoading { - get { return savedRegions == null || savedRegions.Length == 0 || updateRegionsInPlayMode; } - } - - public void LoadRegionsInEditorPlayMode () { - - Sprite[] sprites = null; - System.Type T = Type.GetType("UnityEditor.U2D.SpriteAtlasExtensions,UnityEditor"); - var method = T.GetMethod("GetPackedSprites", BindingFlags.NonPublic | BindingFlags.Static); - if (method != null) { - object retval = method.Invoke(null, new object[] { spriteAtlasFile }); - var spritesArray = retval as Sprite[]; - if (spritesArray != null && spritesArray.Length > 0) { - sprites = spritesArray; - } - } - if (sprites == null) { - sprites = new UnityEngine.Sprite[spriteAtlasFile.spriteCount]; - spriteAtlasFile.GetSprites(sprites); - } - if (sprites.Length == 0) { - Debug.LogWarning(string.Format("SpriteAtlas '{0}' contains no sprites. Please make sure all assigned images are set to import type 'Sprite'.", spriteAtlasFile.name), spriteAtlasFile); - return; - } - else if (sprites[0].packingMode == SpritePackingMode.Tight) { - Debug.LogError(string.Format("SpriteAtlas '{0}': Tight packing is not supported. Please disable 'Tight Packing' in the SpriteAtlas Inspector.", spriteAtlasFile.name), spriteAtlasFile); - return; - } - - if (savedRegions == null || savedRegions.Length != sprites.Length) - savedRegions = new SavedRegionInfo[sprites.Length]; - - int i = 0; - foreach (var region in atlas) { - var sprite = sprites[i]; - var rect = sprite.textureRect; - float x = rect.min.x; - float y = rect.min.y; - float width = rect.width; - float height = rect.height; - - var savedRegion = new SavedRegionInfo(); - savedRegion.x = x; - savedRegion.y = y; - savedRegion.width = width; - savedRegion.height = height; - savedRegion.packingRotation = sprite.packingRotation; - savedRegions[i] = savedRegion; - - ++i; - } - updateRegionsInPlayMode = false; - AssignRegionsFromSavedRegions(sprites, atlas); - EditorUtility.SetDirty(this); - AssetDatabase.SaveAssets(); - } - - public static Texture2D AccessPackedTextureEditor (SpriteAtlas spriteAtlas) { - #if EXPOSES_SPRITE_ATLAS_UTILITIES - UnityEditor.U2D.SpriteAtlasUtility.PackAtlases(new SpriteAtlas[] { spriteAtlas }, EditorUserBuildSettings.activeBuildTarget); - #else - /*if (PackAtlasesMethod == null) { - System.Type T = Type.GetType("UnityEditor.U2D.SpriteAtlasUtility,UnityEditor"); - PackAtlasesMethod = T.GetMethod("PackAtlases", BindingFlags.NonPublic | BindingFlags.Static); - } - if (PackAtlasesMethod != null) { - PackAtlasesMethod.Invoke(null, new object[] { new SpriteAtlas[] { spriteAtlas }, EditorUserBuildSettings.activeBuildTarget }); - }*/ - #endif - if (GetPreviewTexturesMethod == null) { - System.Type T = Type.GetType("UnityEditor.U2D.SpriteAtlasExtensions,UnityEditor"); - GetPreviewTexturesMethod = T.GetMethod("GetPreviewTextures", BindingFlags.NonPublic | BindingFlags.Static); - } - if (GetPreviewTexturesMethod != null) { - object retval = GetPreviewTexturesMethod.Invoke(null, new object[] { spriteAtlas }); - var textures = retval as Texture2D[]; - if (textures.Length > 0) - return textures[0]; - } - return null; - } -#endif - public static Texture2D AccessPackedTexture (Sprite[] sprites) { - return sprites[0].texture; - } - - - public static Sprite[] AccessPackedSprites (UnityEngine.U2D.SpriteAtlas spriteAtlas) { - Sprite[] sprites = null; -#if UNITY_EDITOR - if (!Application.isPlaying) { - - if (GetPackedSpritesMethod == null) { - System.Type T = Type.GetType("UnityEditor.U2D.SpriteAtlasExtensions,UnityEditor"); - GetPackedSpritesMethod = T.GetMethod("GetPackedSprites", BindingFlags.NonPublic | BindingFlags.Static); - } - if (GetPackedSpritesMethod != null) { - object retval = GetPackedSpritesMethod.Invoke(null, new object[] { spriteAtlas }); - var spritesArray = retval as Sprite[]; - if (spritesArray != null && spritesArray.Length > 0) { - sprites = spritesArray; - } - } - } -#endif - if (sprites == null) { - sprites = new UnityEngine.Sprite[spriteAtlas.spriteCount]; - spriteAtlas.GetSprites(sprites); - if (sprites.Length == 0) - return null; - } - return sprites; - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Asset Types/SpineSpriteAtlasAsset.cs.meta b/Assets/Spine/Runtime/spine-unity/Asset Types/SpineSpriteAtlasAsset.cs.meta deleted file mode 100644 index e61e24e07..000000000 --- a/Assets/Spine/Runtime/spine-unity/Asset Types/SpineSpriteAtlasAsset.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ce59897dd7e6cbc4690a05ebaf975dff -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Components/Following/BoneFollower.cs b/Assets/Spine/Runtime/spine-unity/Components/BoneFollower.cs similarity index 66% rename from Assets/Spine/Runtime/spine-unity/Components/Following/BoneFollower.cs rename to Assets/Spine/Runtime/spine-unity/Components/BoneFollower.cs index cb75c432c..6abd4ea24 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/Following/BoneFollower.cs +++ b/Assets/Spine/Runtime/spine-unity/Components/BoneFollower.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -43,7 +43,6 @@ namespace Spine.Unity { [ExecuteInEditMode] #endif [AddComponentMenu("Spine/BoneFollower")] - [HelpURL("http://esotericsoftware.com/spine-unity#BoneFollower")] public class BoneFollower : MonoBehaviour { #region Inspector @@ -58,9 +57,8 @@ namespace Spine.Unity { /// If a bone isn't set in code, boneName is used to find the bone at the beginning. For runtime switching by name, use SetBoneByName. You can also set the BoneFollower.bone field directly. [SpineBone(dataField: "skeletonRenderer")] - public string boneName; + [SerializeField] public string boneName; - public bool followXYPosition = true; public bool followZPosition = true; public bool followBoneRotation = true; @@ -70,16 +68,6 @@ namespace Spine.Unity { [Tooltip("Follows the target bone's local scale. BoneFollower cannot inherit world/skewed scale because of UnityEngine.Transform property limitations.")] public bool followLocalScale = false; - public enum AxisOrientation { - XAxis = 1, - YAxis - } - [Tooltip("Applies when 'Follow Skeleton Flip' is disabled but 'Follow Bone Rotation' is enabled." - + " When flipping the skeleton by scaling its Transform, this follower's rotation is adjusted" - + " instead of its scale to follow the bone orientation. When one of the axes is flipped, " - + " only one axis can be followed, either the X or the Y axis, which is selected here.")] - public AxisOrientation maintainedAxisOrientation = AxisOrientation.XAxis; - [UnityEngine.Serialization.FormerlySerializedAs("resetOnAwake")] public bool initializeOnAwake = true; #endregion @@ -152,12 +140,9 @@ namespace Spine.Unity { } Transform thisTransform = this.transform; - float additionalFlipScale = 1; if (skeletonTransformIsParent) { // Recommended setup: Use local transform properties if Spine GameObject is the immediate parent - thisTransform.localPosition = new Vector3(followXYPosition ? bone.worldX : thisTransform.localPosition.x, - followXYPosition ? bone.worldY : thisTransform.localPosition.y, - followZPosition ? 0f : thisTransform.localPosition.z); + thisTransform.localPosition = new Vector3(bone.worldX, bone.worldY, followZPosition ? 0f : thisTransform.localPosition.z); if (followBoneRotation) { float halfRotation = Mathf.Atan2(bone.c, bone.a) * 0.5f; if (followLocalScale && bone.scaleX < 0) // Negate rotation from negative scaleX. Don't use negative determinant. local scaleY doesn't factor into used rotation. @@ -172,44 +157,27 @@ namespace Spine.Unity { // For special cases: Use transform world properties if transform relationship is complicated Vector3 targetWorldPosition = skeletonTransform.TransformPoint(new Vector3(bone.worldX, bone.worldY, 0f)); if (!followZPosition) targetWorldPosition.z = thisTransform.position.z; - if (!followXYPosition) { - targetWorldPosition.x = thisTransform.position.x; - targetWorldPosition.y = thisTransform.position.y; + + float boneWorldRotation = bone.WorldRotationX; + + Transform transformParent = thisTransform.parent; + if (transformParent != null) { + Matrix4x4 m = transformParent.localToWorldMatrix; + if (m.m00 * m.m11 - m.m01 * m.m10 < 0) // Determinant2D is negative + boneWorldRotation = -boneWorldRotation; } - Vector3 skeletonLossyScale = skeletonTransform.lossyScale; - Transform transformParent = thisTransform.parent; - Vector3 parentLossyScale = transformParent != null ? transformParent.lossyScale : Vector3.one; if (followBoneRotation) { - float boneWorldRotation = bone.WorldRotationX; - - if ((skeletonLossyScale.x * skeletonLossyScale.y) < 0) - boneWorldRotation = -boneWorldRotation; - - if (followSkeletonFlip || maintainedAxisOrientation == AxisOrientation.XAxis) { - if ((skeletonLossyScale.x * parentLossyScale.x < 0)) - boneWorldRotation += 180f; - } - else { - if ((skeletonLossyScale.y * parentLossyScale.y < 0)) - boneWorldRotation += 180f; - } - Vector3 worldRotation = skeletonTransform.rotation.eulerAngles; if (followLocalScale && bone.scaleX < 0) boneWorldRotation += 180f; thisTransform.SetPositionAndRotation(targetWorldPosition, Quaternion.Euler(worldRotation.x, worldRotation.y, worldRotation.z + boneWorldRotation)); } else { thisTransform.position = targetWorldPosition; } - - additionalFlipScale = Mathf.Sign(skeletonLossyScale.x * parentLossyScale.x - * skeletonLossyScale.y * parentLossyScale.y); } Vector3 localScale = followLocalScale ? new Vector3(bone.scaleX, bone.scaleY, 1f) : new Vector3(1f, 1f, 1f); - if (followSkeletonFlip) - localScale.y *= Mathf.Sign(bone.skeleton.ScaleX * bone.skeleton.ScaleY) * additionalFlipScale; - + if (followSkeletonFlip) localScale.y *= Mathf.Sign(bone.skeleton.scaleX * bone.skeleton.scaleY); thisTransform.localScale = localScale; } } diff --git a/Assets/Spine/Runtime/spine-unity/Components/Following/BoneFollower.cs.meta b/Assets/Spine/Runtime/spine-unity/Components/BoneFollower.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/Following/BoneFollower.cs.meta rename to Assets/Spine/Runtime/spine-unity/Components/BoneFollower.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Components/Following.meta b/Assets/Spine/Runtime/spine-unity/Components/Following.meta deleted file mode 100644 index 39fdc6c39..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/Following.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: b0fd98019ca00c74f929c6d1f7ee3544 -folderAsset: yes -timeCreated: 1563290418 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollowerGraphic.cs b/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollowerGraphic.cs deleted file mode 100644 index 674a0fb04..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollowerGraphic.cs +++ /dev/null @@ -1,257 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER -#define NEW_PREFAB_SYSTEM -#endif - -using UnityEngine; -using System.Collections.Generic; - -namespace Spine.Unity { - - #if NEW_PREFAB_SYSTEM - [ExecuteAlways] - #else - [ExecuteInEditMode] - #endif - [HelpURL("http://esotericsoftware.com/spine-unity#BoundingBoxFollowerGraphic")] - public class BoundingBoxFollowerGraphic : MonoBehaviour { - internal static bool DebugMessages = true; - - #region Inspector - public SkeletonGraphic skeletonGraphic; - [SpineSlot(dataField: "skeletonGraphic", containsBoundingBoxes: true)] - public string slotName; - public bool isTrigger; - public bool clearStateOnDisable = true; - #endregion - - Slot slot; - BoundingBoxAttachment currentAttachment; - string currentAttachmentName; - PolygonCollider2D currentCollider; - - public readonly Dictionary colliderTable = new Dictionary(); - public readonly Dictionary nameTable = new Dictionary(); - - public Slot Slot { get { return slot; } } - public BoundingBoxAttachment CurrentAttachment { get { return currentAttachment; } } - public string CurrentAttachmentName { get { return currentAttachmentName; } } - public PolygonCollider2D CurrentCollider { get { return currentCollider; } } - public bool IsTrigger { get { return isTrigger; } } - - void Start () { - Initialize(); - } - - void OnEnable () { - if (skeletonGraphic != null) { - skeletonGraphic.OnRebuild -= HandleRebuild; - skeletonGraphic.OnRebuild += HandleRebuild; - } - - Initialize(); - } - - void HandleRebuild (SkeletonGraphic sr) { - //if (BoundingBoxFollowerGraphic.DebugMessages) Debug.Log("Skeleton was rebuilt. Repopulating BoundingBoxFollowerGraphic."); - Initialize(); - } - - /// - /// Initialize and instantiate the BoundingBoxFollowerGraphic colliders. This is method checks if the BoundingBoxFollowerGraphic has already been initialized for the skeleton instance and slotName and prevents overwriting unless it detects a new setup. - public void Initialize (bool overwrite = false) { - if (skeletonGraphic == null) - return; - - skeletonGraphic.Initialize(false); - - if (string.IsNullOrEmpty(slotName)) - return; - - // Don't reinitialize if the setup did not change. - if (!overwrite - && - colliderTable.Count > 0 && slot != null // Slot is set and colliders already populated. - && - skeletonGraphic.Skeleton == slot.Skeleton // Skeleton object did not change. - && - slotName == slot.data.name // Slot object did not change. - ) - return; - - slot = null; - currentAttachment = null; - currentAttachmentName = null; - currentCollider = null; - colliderTable.Clear(); - nameTable.Clear(); - - var skeleton = skeletonGraphic.Skeleton; - if (skeleton == null) - return; - slot = skeleton.FindSlot(slotName); - int slotIndex = skeleton.FindSlotIndex(slotName); - - if (slot == null) { - if (BoundingBoxFollowerGraphic.DebugMessages) - Debug.LogWarning(string.Format("Slot '{0}' not found for BoundingBoxFollowerGraphic on '{1}'. (Previous colliders were disposed.)", slotName, this.gameObject.name)); - return; - } - - int requiredCollidersCount = 0; - var colliders = GetComponents(); - if (this.gameObject.activeInHierarchy) { - var canvas = skeletonGraphic.canvas; - if (canvas == null) canvas = skeletonGraphic.GetComponentInParent(); - float scale = canvas != null ? canvas.referencePixelsPerUnit : 100.0f; - - foreach (var skin in skeleton.Data.Skins) - AddCollidersForSkin(skin, slotIndex, colliders, scale, ref requiredCollidersCount); - - if (skeleton.skin != null) - AddCollidersForSkin(skeleton.skin, slotIndex, colliders, scale, ref requiredCollidersCount); - } - DisposeExcessCollidersAfter(requiredCollidersCount); - - if (BoundingBoxFollowerGraphic.DebugMessages) { - bool valid = colliderTable.Count != 0; - if (!valid) { - if (this.gameObject.activeInHierarchy) - Debug.LogWarning("Bounding Box Follower not valid! Slot [" + slotName + "] does not contain any Bounding Box Attachments!"); - else - Debug.LogWarning("Bounding Box Follower tried to rebuild as a prefab."); - } - } - } - - void AddCollidersForSkin (Skin skin, int slotIndex, PolygonCollider2D[] previousColliders, float scale, ref int collidersCount) { - if (skin == null) return; - var skinEntries = new List(); - skin.GetAttachments(slotIndex, skinEntries); - - foreach (var entry in skinEntries) { - var attachment = skin.GetAttachment(slotIndex, entry.Name); - var boundingBoxAttachment = attachment as BoundingBoxAttachment; - - if (BoundingBoxFollowerGraphic.DebugMessages && attachment != null && boundingBoxAttachment == null) - Debug.Log("BoundingBoxFollowerGraphic tried to follow a slot that contains non-boundingbox attachments: " + slotName); - - if (boundingBoxAttachment != null) { - if (!colliderTable.ContainsKey(boundingBoxAttachment)) { - var bbCollider = collidersCount < previousColliders.Length ? - previousColliders[collidersCount] : gameObject.AddComponent(); - ++collidersCount; - SkeletonUtility.SetColliderPointsLocal(bbCollider, slot, boundingBoxAttachment, scale); - bbCollider.isTrigger = isTrigger; - bbCollider.enabled = false; - bbCollider.hideFlags = HideFlags.NotEditable; - bbCollider.isTrigger = IsTrigger; - colliderTable.Add(boundingBoxAttachment, bbCollider); - nameTable.Add(boundingBoxAttachment, entry.Name); - } - } - } - } - - void OnDisable () { - if (clearStateOnDisable) - ClearState(); - - if (skeletonGraphic != null) - skeletonGraphic.OnRebuild -= HandleRebuild; - } - - public void ClearState () { - if (colliderTable != null) - foreach (var col in colliderTable.Values) - col.enabled = false; - - currentAttachment = null; - currentAttachmentName = null; - currentCollider = null; - } - - void DisposeExcessCollidersAfter (int requiredCount) { - var colliders = GetComponents(); - if (colliders.Length == 0) return; - - for (int i = requiredCount; i < colliders.Length; ++i) { - var collider = colliders[i]; - if (collider != null) { -#if UNITY_EDITOR - if (Application.isEditor && !Application.isPlaying) - DestroyImmediate(collider); - else -#endif - Destroy(collider); - } - } - } - - void LateUpdate () { - if (slot != null && slot.Attachment != currentAttachment) - MatchAttachment(slot.Attachment); - } - - /// Sets the current collider to match attachment. - /// If the attachment is not a bounding box, it will be treated as null. - void MatchAttachment (Attachment attachment) { - var bbAttachment = attachment as BoundingBoxAttachment; - - if (BoundingBoxFollowerGraphic.DebugMessages && attachment != null && bbAttachment == null) - Debug.LogWarning("BoundingBoxFollowerGraphic tried to match a non-boundingbox attachment. It will treat it as null."); - - if (currentCollider != null) - currentCollider.enabled = false; - - if (bbAttachment == null) { - currentCollider = null; - currentAttachment = null; - currentAttachmentName = null; - } else { - PolygonCollider2D foundCollider; - colliderTable.TryGetValue(bbAttachment, out foundCollider); - if (foundCollider != null) { - currentCollider = foundCollider; - currentCollider.enabled = true; - currentAttachment = bbAttachment; - currentAttachmentName = nameTable[bbAttachment]; - } else { - currentCollider = null; - currentAttachment = bbAttachment; - currentAttachmentName = null; - if (BoundingBoxFollowerGraphic.DebugMessages) Debug.LogFormat("Collider for BoundingBoxAttachment named '{0}' was not initialized. It is possibly from a new skin. currentAttachmentName will be null. You may need to call BoundingBoxFollowerGraphic.Initialize(overwrite: true);", bbAttachment.Name); - } - } - } - } - -} diff --git a/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollowerGraphic.cs.meta b/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollowerGraphic.cs.meta deleted file mode 100644 index 05dc86256..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollowerGraphic.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 1c0bf7b497af9f74280040d96cdf88da -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Components/Following/PointFollower.cs b/Assets/Spine/Runtime/spine-unity/Components/PointFollower.cs similarity index 81% rename from Assets/Spine/Runtime/spine-unity/Components/Following/PointFollower.cs rename to Assets/Spine/Runtime/spine-unity/Components/PointFollower.cs index 25aa203ff..1808c4773 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/Following/PointFollower.cs +++ b/Assets/Spine/Runtime/spine-unity/Components/PointFollower.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -41,10 +41,9 @@ namespace Spine.Unity { [ExecuteInEditMode] #endif [AddComponentMenu("Spine/Point Follower")] - [HelpURL("http://esotericsoftware.com/spine-unity#PointFollower")] public class PointFollower : MonoBehaviour, IHasSkeletonRenderer, IHasSkeletonComponent { - public SkeletonRenderer skeletonRenderer; + [SerializeField] public SkeletonRenderer skeletonRenderer; public SkeletonRenderer SkeletonRenderer { get { return this.skeletonRenderer; } } public ISkeletonComponent SkeletonComponent { get { return skeletonRenderer as ISkeletonComponent; } } @@ -70,7 +69,7 @@ namespace Spine.Unity { if (!valid) return; - UpdateReferences(); + UpdateReferences(); #if UNITY_EDITOR if (Application.isEditor) LateUpdate(); @@ -101,11 +100,6 @@ namespace Spine.Unity { } } - void OnDestroy () { - if (skeletonRenderer != null) - skeletonRenderer.OnRebuild -= HandleRebuildRenderer; - } - public void LateUpdate () { #if UNITY_EDITOR if (!Application.isPlaying) skeletonTransformIsParent = Transform.ReferenceEquals(skeletonTransform, transform.parent); @@ -156,7 +150,7 @@ namespace Spine.Unity { if (followSkeletonFlip) { Vector3 localScale = thisTransform.localScale; - localScale.y = Mathf.Abs(localScale.y) * Mathf.Sign(bone.skeleton.ScaleX * bone.skeleton.ScaleY); + localScale.y = Mathf.Abs(localScale.y) * Mathf.Sign(bone.skeleton.scaleX * bone.skeleton.scaleY); thisTransform.localScale = localScale; } } diff --git a/Assets/Spine/Runtime/spine-unity/Components/Following/PointFollower.cs.meta b/Assets/Spine/Runtime/spine-unity/Components/PointFollower.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/Following/PointFollower.cs.meta rename to Assets/Spine/Runtime/spine-unity/Components/PointFollower.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonMecanimRootMotion.cs b/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonMecanimRootMotion.cs deleted file mode 100644 index 4a90bdb00..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonMecanimRootMotion.cs +++ /dev/null @@ -1,121 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; -using System.Collections.Generic; -using Spine.Unity.AnimationTools; - -namespace Spine.Unity { - - /// - /// Add this component to a SkeletonMecanim GameObject - /// to turn motion of a selected root bone into Transform or RigidBody motion. - /// Local bone translation movement is used as motion. - /// All top-level bones of the skeleton are moved to compensate the root - /// motion bone location, keeping the distance relationship between bones intact. - /// - /// - /// Only compatible with SkeletonMecanim. - /// For SkeletonAnimation or SkeletonGraphic please use - /// SkeletonRootMotion instead. - /// - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonMecanimRootMotion")] - public class SkeletonMecanimRootMotion : SkeletonRootMotionBase { - #region Inspector - const int DefaultMecanimLayerFlags = -1; - public int mecanimLayerFlags = DefaultMecanimLayerFlags; - #endregion - - protected Vector2 movementDelta; - - SkeletonMecanim skeletonMecanim; - public SkeletonMecanim SkeletonMecanim { - get { - return skeletonMecanim ? skeletonMecanim : skeletonMecanim = GetComponent(); - } - } - - public override Vector2 GetRemainingRootMotion (int layerIndex) { - var pair = skeletonMecanim.Translator.GetActiveAnimationAndTime(layerIndex); - var animation = pair.Key; - var time = pair.Value; - if (animation == null) - return Vector2.zero; - - float start = time; - float end = animation.duration; - return GetAnimationRootMotion(start, end, animation); - } - - public override RootMotionInfo GetRootMotionInfo (int layerIndex) { - var pair = skeletonMecanim.Translator.GetActiveAnimationAndTime(layerIndex); - var animation = pair.Key; - var time = pair.Value; - if (animation == null) - return new RootMotionInfo(); - return GetAnimationRootMotionInfo(animation, time); - } - - protected override void Reset () { - base.Reset(); - mecanimLayerFlags = DefaultMecanimLayerFlags; - } - - protected override void Start () { - base.Start(); - skeletonMecanim = GetComponent(); - if (skeletonMecanim) { - skeletonMecanim.Translator.OnClipApplied -= OnClipApplied; - skeletonMecanim.Translator.OnClipApplied += OnClipApplied; - } - } - - void OnClipApplied(Spine.Animation animation, int layerIndex, float weight, - float time, float lastTime, bool playsBackward) { - - if (((mecanimLayerFlags & 1< - /// Add this component to a SkeletonAnimation or SkeletonGraphic GameObject - /// to turn motion of a selected root bone into Transform or RigidBody motion. - /// Local bone translation movement is used as motion. - /// All top-level bones of the skeleton are moved to compensate the root - /// motion bone location, keeping the distance relationship between bones intact. - /// - /// - /// Only compatible with SkeletonAnimation (or other components that implement - /// ISkeletonComponent, ISkeletonAnimation and IAnimationStateComponent). - /// For SkeletonMecanim please use - /// SkeletonMecanimRootMotion instead. - /// - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonRootMotion")] - public class SkeletonRootMotion : SkeletonRootMotionBase { - #region Inspector - const int DefaultAnimationTrackFlags = -1; - public int animationTrackFlags = DefaultAnimationTrackFlags; - #endregion - - AnimationState animationState; - Canvas canvas; - - public override Vector2 GetRemainingRootMotion (int trackIndex) { - TrackEntry track = animationState.GetCurrent(trackIndex); - if (track == null) - return Vector2.zero; - - var animation = track.Animation; - float start = track.AnimationTime; - float end = animation.duration; - return GetAnimationRootMotion(start, end, animation); - } - - public override RootMotionInfo GetRootMotionInfo (int trackIndex) { - TrackEntry track = animationState.GetCurrent(trackIndex); - if (track == null) - return new RootMotionInfo(); - - var animation = track.Animation; - float time = track.AnimationTime; - return GetAnimationRootMotionInfo(track.Animation, time); - } - - protected override float AdditionalScale { - get { - return canvas ? canvas.referencePixelsPerUnit: 1.0f; - } - } - - protected override void Reset () { - base.Reset(); - animationTrackFlags = DefaultAnimationTrackFlags; - } - - protected override void Start () { - base.Start(); - var animstateComponent = skeletonComponent as IAnimationStateComponent; - this.animationState = (animstateComponent != null) ? animstateComponent.AnimationState : null; - - if (this.GetComponent() != null) { - canvas = this.GetComponentInParent(); - } - } - - protected override Vector2 CalculateAnimationsMovementDelta () { - Vector2 localDelta = Vector2.zero; - int trackCount = animationState.Tracks.Count; - - for (int trackIndex = 0; trackIndex < trackCount; ++trackIndex) { - // note: animationTrackFlags != -1 below covers trackIndex >= 32, - // with -1 corresponding to entry "everything" of the dropdown list. - if (animationTrackFlags != -1 && (animationTrackFlags & 1 << trackIndex) == 0) - continue; - - TrackEntry track = animationState.GetCurrent(trackIndex); - TrackEntry next = null; - while (track != null) { - var animation = track.Animation; - float start = track.animationLast; - float end = track.AnimationTime; - var currentDelta = GetAnimationRootMotion(start, end, animation); - if (currentDelta != Vector2.zero) { - ApplyMixAlphaToDelta(ref currentDelta, next, track); - localDelta += currentDelta; - } - - // Traverse mixingFrom chain. - next = track; - track = track.mixingFrom; - } - } - return localDelta; - } - - void ApplyMixAlphaToDelta (ref Vector2 currentDelta, TrackEntry next, TrackEntry track) { - // Apply mix alpha to the delta position (based on AnimationState.cs). - float mix; - if (next != null) { - if (next.mixDuration == 0) { // Single frame mix to undo mixingFrom changes. - mix = 1; - } - else { - mix = next.mixTime / next.mixDuration; - if (mix > 1) mix = 1; - } - float mixAndAlpha = track.alpha * next.interruptAlpha * (1 - mix); - currentDelta *= mixAndAlpha; - } - else { - if (track.mixDuration == 0) { - mix = 1; - } - else { - mix = track.alpha * (track.mixTime / track.mixDuration); - if (mix > 1) mix = 1; - } - currentDelta *= mix; - } - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotion.cs.meta b/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotion.cs.meta deleted file mode 100644 index bef9e2e4f..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotion.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f21c9538588898a45a3da22bf4779ab3 -timeCreated: 1591121072 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotionBase.cs b/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotionBase.cs deleted file mode 100644 index a6222fb23..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotionBase.cs +++ /dev/null @@ -1,322 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; -using System.Collections.Generic; -using Spine.Unity.AnimationTools; -using System; - -namespace Spine.Unity { - - /// - /// Base class for skeleton root motion components. - /// - abstract public class SkeletonRootMotionBase : MonoBehaviour { - - #region Inspector - [SpineBone] - [SerializeField] - protected string rootMotionBoneName = "root"; - public bool transformPositionX = true; - public bool transformPositionY = true; - - public float rootMotionScaleX = 1; - public float rootMotionScaleY = 1; - /// Skeleton space X translation per skeleton space Y translation root motion. - public float rootMotionTranslateXPerY = 0; - /// Skeleton space Y translation per skeleton space X translation root motion. - public float rootMotionTranslateYPerX = 0; - - [Header("Optional")] - public Rigidbody2D rigidBody2D; - public Rigidbody rigidBody; - - public bool UsesRigidbody { - get { return rigidBody != null || rigidBody2D != null; } - } - #endregion - - protected ISkeletonComponent skeletonComponent; - protected Bone rootMotionBone; - protected int rootMotionBoneIndex; - protected List topLevelBones = new List(); - protected Vector2 initialOffset = Vector2.zero; - protected Vector2 tempSkeletonDisplacement; - protected Vector2 rigidbodyDisplacement; - - protected virtual void Reset () { - FindRigidbodyComponent(); - } - - protected virtual void Start () { - skeletonComponent = GetComponent(); - GatherTopLevelBones(); - SetRootMotionBone(rootMotionBoneName); - if (rootMotionBone != null) - initialOffset = new Vector2(rootMotionBone.x, rootMotionBone.y); - - var skeletonAnimation = skeletonComponent as ISkeletonAnimation; - if (skeletonAnimation != null) { - skeletonAnimation.UpdateLocal -= HandleUpdateLocal; - skeletonAnimation.UpdateLocal += HandleUpdateLocal; - } - } - - protected virtual void FixedUpdate () { - if (!this.isActiveAndEnabled) - return; // Root motion is only applied when component is enabled. - - if (rigidBody2D != null) { - rigidBody2D.MovePosition(new Vector2(transform.position.x, transform.position.y) - + rigidbodyDisplacement); - } - if (rigidBody != null) { - rigidBody.MovePosition(transform.position - + new Vector3(rigidbodyDisplacement.x, rigidbodyDisplacement.y, 0)); - } - Vector2 parentBoneScale; - GetScaleAffectingRootMotion(out parentBoneScale); - ClearEffectiveBoneOffsets(parentBoneScale); - rigidbodyDisplacement = Vector2.zero; - tempSkeletonDisplacement = Vector2.zero; - } - - protected virtual void OnDisable () { - rigidbodyDisplacement = Vector2.zero; - tempSkeletonDisplacement = Vector2.zero; - } - - protected void FindRigidbodyComponent () { - rigidBody2D = this.GetComponent(); - if (!rigidBody2D) - rigidBody = this.GetComponent(); - - if (!rigidBody2D && !rigidBody) { - rigidBody2D = this.GetComponentInParent(); - if (!rigidBody2D) - rigidBody = this.GetComponentInParent(); - } - } - - protected virtual float AdditionalScale { get { return 1.0f; } } - abstract protected Vector2 CalculateAnimationsMovementDelta (); - abstract public Vector2 GetRemainingRootMotion (int trackIndex = 0); - - public struct RootMotionInfo { - public Vector2 start; - public Vector2 current; - public Vector2 mid; - public Vector2 end; - public bool timeIsPastMid; - }; - abstract public RootMotionInfo GetRootMotionInfo (int trackIndex = 0); - - public void SetRootMotionBone (string name) { - var skeleton = skeletonComponent.Skeleton; - int index = skeleton.FindBoneIndex(name); - if (index >= 0) { - this.rootMotionBoneIndex = index; - this.rootMotionBone = skeleton.bones.Items[index]; - } - else { - Debug.Log("Bone named \"" + name + "\" could not be found."); - this.rootMotionBoneIndex = 0; - this.rootMotionBone = skeleton.RootBone; - } - } - - public void AdjustRootMotionToDistance (Vector2 distanceToTarget, int trackIndex = 0, bool adjustX = true, bool adjustY = true, - float minX = 0, float maxX = float.MaxValue, float minY = 0, float maxY = float.MaxValue, - bool allowXTranslation = false, bool allowYTranslation = false) { - - Vector2 distanceToTargetSkeletonSpace = (Vector2)transform.InverseTransformVector(distanceToTarget); - Vector2 scaleAffectingRootMotion = GetScaleAffectingRootMotion(); - if (UsesRigidbody) - distanceToTargetSkeletonSpace -= tempSkeletonDisplacement; - - Vector2 remainingRootMotionSkeletonSpace = GetRemainingRootMotion(trackIndex); - remainingRootMotionSkeletonSpace.Scale(scaleAffectingRootMotion); - if (remainingRootMotionSkeletonSpace.x == 0) - remainingRootMotionSkeletonSpace.x = 0.0001f; - if (remainingRootMotionSkeletonSpace.y == 0) - remainingRootMotionSkeletonSpace.y = 0.0001f; - - if (adjustX) - rootMotionScaleX = Math.Min(maxX, Math.Max(minX, distanceToTargetSkeletonSpace.x / remainingRootMotionSkeletonSpace.x)); - if (adjustY) - rootMotionScaleY = Math.Min(maxY, Math.Max(minY, distanceToTargetSkeletonSpace.y / remainingRootMotionSkeletonSpace.y)); - - if (allowXTranslation) - rootMotionTranslateXPerY = (distanceToTargetSkeletonSpace.x - remainingRootMotionSkeletonSpace.x * rootMotionScaleX) / remainingRootMotionSkeletonSpace.y; - if (allowYTranslation) - rootMotionTranslateYPerX = (distanceToTargetSkeletonSpace.y - remainingRootMotionSkeletonSpace.y * rootMotionScaleY) / remainingRootMotionSkeletonSpace.x; - } - - public Vector2 GetAnimationRootMotion (Animation animation) { - return GetAnimationRootMotion(0, animation.duration, animation); - } - - public Vector2 GetAnimationRootMotion (float startTime, float endTime, - Animation animation) { - - var timeline = animation.FindTranslateTimelineForBone(rootMotionBoneIndex); - if (timeline != null) { - return GetTimelineMovementDelta(startTime, endTime, timeline, animation); - } - return Vector2.zero; - } - - public RootMotionInfo GetAnimationRootMotionInfo (Animation animation, float currentTime) { - RootMotionInfo rootMotion = new RootMotionInfo(); - var timeline = animation.FindTranslateTimelineForBone(rootMotionBoneIndex); - if (timeline != null) { - float duration = animation.duration; - float mid = duration * 0.5f; - rootMotion.start = timeline.Evaluate(0); - rootMotion.current = timeline.Evaluate(currentTime); - rootMotion.mid = timeline.Evaluate(mid); - rootMotion.end = timeline.Evaluate(duration); - rootMotion.timeIsPastMid = currentTime > mid; - } - return rootMotion; - } - - Vector2 GetTimelineMovementDelta (float startTime, float endTime, - TranslateTimeline timeline, Animation animation) { - - Vector2 currentDelta; - if (startTime > endTime) // Looped - currentDelta = (timeline.Evaluate(animation.duration) - timeline.Evaluate(startTime)) - + (timeline.Evaluate(endTime) - timeline.Evaluate(0)); - else if (startTime != endTime) // Non-looped - currentDelta = timeline.Evaluate(endTime) - timeline.Evaluate(startTime); - else - currentDelta = Vector2.zero; - return currentDelta; - } - - void GatherTopLevelBones () { - topLevelBones.Clear(); - var skeleton = skeletonComponent.Skeleton; - foreach (var bone in skeleton.Bones) { - if (bone.Parent == null) - topLevelBones.Add(bone); - } - } - - void HandleUpdateLocal (ISkeletonAnimation animatedSkeletonComponent) { - if (!this.isActiveAndEnabled) - return; // Root motion is only applied when component is enabled. - - var boneLocalDelta = CalculateAnimationsMovementDelta(); - Vector2 parentBoneScale; - Vector2 skeletonDelta = GetSkeletonSpaceMovementDelta(boneLocalDelta, out parentBoneScale); - ApplyRootMotion(skeletonDelta, parentBoneScale); - } - - void ApplyRootMotion (Vector2 skeletonDelta, Vector2 parentBoneScale) { - // Apply root motion to Transform or RigidBody; - if (UsesRigidbody) { - rigidbodyDisplacement += (Vector2)transform.TransformVector(skeletonDelta); - - // Accumulated displacement is applied on the next Physics update in FixedUpdate. - // Until the next Physics update, tempBoneDisplacement is offsetting bone locations - // to prevent stutter which would otherwise occur if we don't move every Update. - tempSkeletonDisplacement += skeletonDelta; - SetEffectiveBoneOffsetsTo(tempSkeletonDisplacement, parentBoneScale); - } - else { - transform.position += transform.TransformVector(skeletonDelta); - ClearEffectiveBoneOffsets(parentBoneScale); - } - } - - Vector2 GetScaleAffectingRootMotion () { - Vector2 parentBoneScale; - return GetScaleAffectingRootMotion(out parentBoneScale); - } - - Vector2 GetScaleAffectingRootMotion (out Vector2 parentBoneScale) { - var skeleton = skeletonComponent.Skeleton; - Vector2 totalScale = Vector2.one; - totalScale.x *= skeleton.ScaleX; - totalScale.y *= skeleton.ScaleY; - - parentBoneScale = Vector2.one; - Bone scaleBone = rootMotionBone; - while ((scaleBone = scaleBone.parent) != null) { - parentBoneScale.x *= scaleBone.ScaleX; - parentBoneScale.y *= scaleBone.ScaleY; - } - totalScale = Vector2.Scale(totalScale, parentBoneScale); - totalScale *= AdditionalScale; - return totalScale; - } - - Vector2 GetSkeletonSpaceMovementDelta (Vector2 boneLocalDelta, out Vector2 parentBoneScale) { - Vector2 skeletonDelta = boneLocalDelta; - Vector2 totalScale = GetScaleAffectingRootMotion(out parentBoneScale); - skeletonDelta.Scale(totalScale); - - Vector2 rootMotionTranslation = new Vector2( - rootMotionTranslateXPerY * skeletonDelta.y, - rootMotionTranslateYPerX * skeletonDelta.x); - - skeletonDelta.x *= rootMotionScaleX; - skeletonDelta.y *= rootMotionScaleY; - skeletonDelta.x += rootMotionTranslation.x; - skeletonDelta.y += rootMotionTranslation.y; - - if (!transformPositionX) skeletonDelta.x = 0f; - if (!transformPositionY) skeletonDelta.y = 0f; - return skeletonDelta; - } - - void SetEffectiveBoneOffsetsTo (Vector2 displacementSkeletonSpace, Vector2 parentBoneScale) { - // Move top level bones in opposite direction of the root motion bone - var skeleton = skeletonComponent.Skeleton; - foreach (var topLevelBone in topLevelBones) { - if (topLevelBone == rootMotionBone) { - if (transformPositionX) topLevelBone.x = displacementSkeletonSpace.x / skeleton.ScaleX; - if (transformPositionY) topLevelBone.y = displacementSkeletonSpace.y / skeleton.ScaleY; - } - else { - float offsetX = (initialOffset.x - rootMotionBone.x) * parentBoneScale.x; - float offsetY = (initialOffset.y - rootMotionBone.y) * parentBoneScale.y; - if (transformPositionX) topLevelBone.x = (displacementSkeletonSpace.x / skeleton.ScaleX) + offsetX; - if (transformPositionY) topLevelBone.y = (displacementSkeletonSpace.y / skeleton.ScaleY) + offsetY; - } - } - } - - void ClearEffectiveBoneOffsets (Vector2 parentBoneScale) { - SetEffectiveBoneOffsetsTo(Vector2.zero, parentBoneScale); - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotionBase.cs.meta b/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotionBase.cs.meta deleted file mode 100644 index 719fd629f..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotionBase.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: fc23a4f220b20024ab0592719f92587d -timeCreated: 1592849332 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs b/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs index 48c4ec713..ba87ee247 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs +++ b/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -34,45 +34,31 @@ using UnityEngine; namespace Spine.Unity { - + #if NEW_PREFAB_SYSTEM [ExecuteAlways] #else [ExecuteInEditMode] #endif [AddComponentMenu("Spine/SkeletonAnimation")] - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonAnimation-Component")] public class SkeletonAnimation : SkeletonRenderer, ISkeletonAnimation, IAnimationStateComponent { #region IAnimationStateComponent /// - /// This is the Spine.AnimationState object of this SkeletonAnimation. You can control animations through it. + /// This is the Spine.AnimationState object of this SkeletonAnimation. You can control animations through it. /// Note that this object, like .skeleton, is not guaranteed to exist in Awake. Do all accesses and caching to it in Start public Spine.AnimationState state; /// - /// This is the Spine.AnimationState object of this SkeletonAnimation. You can control animations through it. + /// This is the Spine.AnimationState object of this SkeletonAnimation. You can control animations through it. /// Note that this object, like .skeleton, is not guaranteed to exist in Awake. Do all accesses and caching to it in Start - public Spine.AnimationState AnimationState { - get { - Initialize(false); - return this.state; - } - } - private bool wasUpdatedAfterInit = true; + public Spine.AnimationState AnimationState { get { return this.state; } } #endregion #region Bone Callbacks ISkeletonAnimation - protected event UpdateBonesDelegate _BeforeApply; protected event UpdateBonesDelegate _UpdateLocal; protected event UpdateBonesDelegate _UpdateWorld; protected event UpdateBonesDelegate _UpdateComplete; - /// - /// Occurs before the animations are applied. - /// Use this callback when you want to change the skeleton state before animations are applied on top. - /// - public event UpdateBonesDelegate BeforeApply { add { _BeforeApply += value; } remove { _BeforeApply -= value; } } - /// /// Occurs after the animations are applied and before world space values are resolved. /// Use this callback when you want to set bone local values. @@ -110,12 +96,8 @@ namespace Spine.Unity { } } set { - Initialize(false); - if (_animationName == value) { - TrackEntry entry = state.GetCurrent(0); - if (entry != null && entry.loop == loop) - return; - } + if (_animationName == value) + return; _animationName = value; if (string.IsNullOrEmpty(value)) { @@ -140,16 +122,14 @@ namespace Spine.Unity { #region Runtime Instantiation /// Adds and prepares a SkeletonAnimation component to a GameObject at runtime. /// The newly instantiated SkeletonAnimation - public static SkeletonAnimation AddToGameObject (GameObject gameObject, SkeletonDataAsset skeletonDataAsset, - bool quiet = false) { - return SkeletonRenderer.AddSpineComponent(gameObject, skeletonDataAsset, quiet); + public static SkeletonAnimation AddToGameObject (GameObject gameObject, SkeletonDataAsset skeletonDataAsset) { + return SkeletonRenderer.AddSpineComponent(gameObject, skeletonDataAsset); } /// Instantiates a new UnityEngine.GameObject and adds a prepared SkeletonAnimation component to it. /// The newly instantiated SkeletonAnimation component. - public static SkeletonAnimation NewSkeletonAnimationGameObject (SkeletonDataAsset skeletonDataAsset, - bool quiet = false) { - return SkeletonRenderer.NewSpineGameObject(skeletonDataAsset, quiet); + public static SkeletonAnimation NewSkeletonAnimationGameObject (SkeletonDataAsset skeletonDataAsset) { + return SkeletonRenderer.NewSpineGameObject(skeletonDataAsset); } #endregion @@ -163,68 +143,50 @@ namespace Spine.Unity { /// /// Initialize this component. Attempts to load the SkeletonData and creates the internal Spine objects and buffers. /// If set to true, force overwrite an already initialized object. - public override void Initialize (bool overwrite, bool quiet = false) { + public override void Initialize (bool overwrite) { if (valid && !overwrite) return; - base.Initialize(overwrite, quiet); + + base.Initialize(overwrite); if (!valid) return; - state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData()); - wasUpdatedAfterInit = false; + state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData()); + if (!string.IsNullOrEmpty(_animationName)) { var animationObject = skeletonDataAsset.GetSkeletonData(false).FindAnimation(_animationName); if (animationObject != null) { - state.SetAnimation(0, animationObject, loop); + animationObject.PoseSkeleton(skeleton, 0f); + skeleton.UpdateWorldTransform(); + #if UNITY_EDITOR - if (!Application.isPlaying) - Update(0f); + if (Application.isPlaying) { + #endif + + // In Unity Editor edit mode, make this block not run. + state.SetAnimation(0, animationObject, loop); + + #if UNITY_EDITOR + } #endif } } } void Update () { - #if UNITY_EDITOR - if (!Application.isPlaying) { - Update(0f); - return; - } - #endif - Update(Time.deltaTime); } /// Progresses the AnimationState according to the given deltaTime, and applies it to the Skeleton. Use Time.deltaTime to update manually. Use deltaTime 0 to update without progressing the time. public void Update (float deltaTime) { - if (!valid || state == null) + if (!valid) return; - wasUpdatedAfterInit = true; - if (updateMode < UpdateMode.OnlyAnimationStatus) - return; - UpdateAnimationStatus(deltaTime); - - if (updateMode == UpdateMode.OnlyAnimationStatus) - return; - ApplyAnimation(); - } - - protected void UpdateAnimationStatus (float deltaTime) { deltaTime *= timeScale; skeleton.Update(deltaTime); state.Update(deltaTime); - } - - protected void ApplyAnimation () { - if (_BeforeApply != null) - _BeforeApply(this); - - if (updateMode != UpdateMode.OnlyEventTimelines) - state.Apply(skeleton); - else - state.ApplyEventTimelinesOnly(skeleton); + state.Apply(skeleton); if (_UpdateLocal != null) _UpdateLocal(this); @@ -241,11 +203,6 @@ namespace Spine.Unity { } } - public override void LateUpdate () { - // instantiation can happen from Update() after this component, leading to a missing Update() call. - if (!wasUpdatedAfterInit) Update(0); - base.LateUpdate(); - } } } diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs b/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs deleted file mode 100644 index aae79e0a5..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs +++ /dev/null @@ -1,825 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER -#define NEW_PREFAB_SYSTEM -#endif - -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; - -namespace Spine.Unity { - #if NEW_PREFAB_SYSTEM - [ExecuteAlways] - #else - [ExecuteInEditMode] - #endif - [RequireComponent(typeof(CanvasRenderer), typeof(RectTransform)), DisallowMultipleComponent] - [AddComponentMenu("Spine/SkeletonGraphic (Unity UI Canvas)")] - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonGraphic-Component")] - public class SkeletonGraphic : MaskableGraphic, ISkeletonComponent, IAnimationStateComponent, ISkeletonAnimation, IHasSkeletonDataAsset { - - #region Inspector - public SkeletonDataAsset skeletonDataAsset; - public SkeletonDataAsset SkeletonDataAsset { get { return skeletonDataAsset; } } - - [SpineSkin(dataField:"skeletonDataAsset", defaultAsEmptyString:true)] - public string initialSkinName; - public bool initialFlipX, initialFlipY; - - [SpineAnimation(dataField:"skeletonDataAsset")] - public string startingAnimation; - public bool startingLoop; - public float timeScale = 1f; - public bool freeze; - - /// Update mode to optionally limit updates to e.g. only apply animations but not update the mesh. - public UpdateMode UpdateMode { get { return updateMode; } set { updateMode = value; } } - protected UpdateMode updateMode = UpdateMode.FullUpdate; - - /// Update mode used when the MeshRenderer becomes invisible - /// (when OnBecameInvisible() is called). Update mode is automatically - /// reset to UpdateMode.FullUpdate when the mesh becomes visible again. - public UpdateMode updateWhenInvisible = UpdateMode.FullUpdate; - - public bool unscaledTime; - public bool allowMultipleCanvasRenderers = false; - public List canvasRenderers = new List(); - protected List rawImages = new List(); - protected int usedRenderersCount = 0; - - // Submesh Separation - public const string SeparatorPartGameObjectName = "Part"; - /// Slot names used to populate separatorSlots list when the Skeleton is initialized. Changing this after initialization does nothing. - [SerializeField] [SpineSlot] protected string[] separatorSlotNames = new string[0]; - - /// Slots that determine where the render is split. This is used by components such as SkeletonRenderSeparator so that the skeleton can be rendered by two separate renderers on different GameObjects. - [System.NonSerialized] public readonly List separatorSlots = new List(); - public bool enableSeparatorSlots = false; - [SerializeField] protected List separatorParts = new List(); - public List SeparatorParts { get { return separatorParts; } } - public bool updateSeparatorPartLocation = true; - - private bool wasUpdatedAfterInit = true; - private Texture baseTexture = null; - - #if UNITY_EDITOR - protected override void OnValidate () { - // This handles Scene View preview. - base.OnValidate (); - if (this.IsValid) { - if (skeletonDataAsset == null) { - Clear(); - } else if (skeletonDataAsset.skeletonJSON == null) { - Clear(); - } else if (skeletonDataAsset.GetSkeletonData(true) != skeleton.data) { - Clear(); - Initialize(true); - if (!allowMultipleCanvasRenderers && (skeletonDataAsset.atlasAssets.Length > 1 || skeletonDataAsset.atlasAssets[0].MaterialCount > 1)) - Debug.LogError("Unity UI does not support multiple textures per Renderer. Please enable 'Advanced - Multiple CanvasRenderers' to generate the required CanvasRenderer GameObjects. Otherwise your skeleton will not be rendered correctly.", this); - } else { - if (freeze) return; - - if (!string.IsNullOrEmpty(initialSkinName)) { - var skin = skeleton.data.FindSkin(initialSkinName); - if (skin != null) { - if (skin == skeleton.data.defaultSkin) - skeleton.SetSkin((Skin)null); - else - skeleton.SetSkin(skin); - } - - } - - // Only provide visual feedback to inspector changes in Unity Editor Edit mode. - if (!Application.isPlaying) { - skeleton.ScaleX = this.initialFlipX ? -1 : 1; - skeleton.ScaleY = this.initialFlipY ? -1 : 1; - - state.ClearTrack(0); - skeleton.SetToSetupPose(); - if (!string.IsNullOrEmpty(startingAnimation)) { - state.SetAnimation(0, startingAnimation, startingLoop); - Update(0f); - } - } - } - } else { - // Under some circumstances (e.g. sometimes on the first import) OnValidate is called - // before SpineEditorUtilities.ImportSpineContent, causing an unnecessary exception. - // The (skeletonDataAsset.skeletonJSON != null) condition serves to prevent this exception. - if (skeletonDataAsset != null && skeletonDataAsset.skeletonJSON != null) - Initialize(true); - } - } - - protected override void Reset () { - - base.Reset(); - if (material == null || material.shader != Shader.Find("Spine/SkeletonGraphic")) - Debug.LogWarning("SkeletonGraphic works best with the SkeletonGraphic material."); - } - #endif - #endregion - - #region Runtime Instantiation - /// Create a new GameObject with a SkeletonGraphic component. - /// Material for the canvas renderer to use. Usually, the default SkeletonGraphic material will work. - public static SkeletonGraphic NewSkeletonGraphicGameObject (SkeletonDataAsset skeletonDataAsset, Transform parent, Material material) { - var sg = SkeletonGraphic.AddSkeletonGraphicComponent(new GameObject("New Spine GameObject"), skeletonDataAsset, material); - if (parent != null) sg.transform.SetParent(parent, false); - return sg; - } - - /// Add a SkeletonGraphic component to a GameObject. - /// Material for the canvas renderer to use. Usually, the default SkeletonGraphic material will work. - public static SkeletonGraphic AddSkeletonGraphicComponent (GameObject gameObject, SkeletonDataAsset skeletonDataAsset, Material material) { - var c = gameObject.AddComponent(); - if (skeletonDataAsset != null) { - c.material = material; - c.skeletonDataAsset = skeletonDataAsset; - c.Initialize(false); - } - return c; - } - #endregion - - #region Overrides - [System.NonSerialized] readonly Dictionary customTextureOverride = new Dictionary(); - /// Use this Dictionary to override a Texture with a different Texture. - public Dictionary CustomTextureOverride { get { return customTextureOverride; } } - - [System.NonSerialized] readonly Dictionary customMaterialOverride = new Dictionary(); - /// Use this Dictionary to override the Material where the Texture was used at the original atlas. - public Dictionary CustomMaterialOverride { get { return customMaterialOverride; } } - - // This is used by the UI system to determine what to put in the MaterialPropertyBlock. - Texture overrideTexture; - public Texture OverrideTexture { - get { return overrideTexture; } - set { - overrideTexture = value; - canvasRenderer.SetTexture(this.mainTexture); // Refresh canvasRenderer's texture. Make sure it handles null. - } - } - #endregion - - #region Internals - public override Texture mainTexture { - get { - if (overrideTexture != null) return overrideTexture; - return baseTexture; - } - } - - protected override void Awake () { - - base.Awake (); - this.onCullStateChanged.AddListener(OnCullStateChanged); - - SyncRawImagesWithCanvasRenderers(); - if (!this.IsValid) { -#if UNITY_EDITOR - // workaround for special import case of open scene where OnValidate and Awake are - // called in wrong order, before setup of Spine assets. - if (!Application.isPlaying) { - if (this.skeletonDataAsset != null && this.skeletonDataAsset.skeletonJSON == null) - return; - } -#endif - Initialize(false); - Rebuild(CanvasUpdate.PreRender); - } - } - - protected override void OnDestroy () { - Clear(); - base.OnDestroy(); - } - - public override void Rebuild (CanvasUpdate update) { - base.Rebuild(update); - if (canvasRenderer.cull) return; - if (update == CanvasUpdate.PreRender) UpdateMesh(keepRendererCount : true); - if (allowMultipleCanvasRenderers) canvasRenderer.Clear(); - } - - protected override void OnDisable () { - base.OnDisable(); - foreach (var canvasRenderer in canvasRenderers) { - canvasRenderer.Clear(); - } - } - - public virtual void Update () { - #if UNITY_EDITOR - if (!Application.isPlaying) { - Update(0f); - return; - } - #endif - - if (freeze) return; - Update(unscaledTime ? Time.unscaledDeltaTime : Time.deltaTime); - } - - public virtual void Update (float deltaTime) { - if (!this.IsValid) return; - - wasUpdatedAfterInit = true; - if (updateMode < UpdateMode.OnlyAnimationStatus) - return; - UpdateAnimationStatus(deltaTime); - - if (updateMode == UpdateMode.OnlyAnimationStatus) - return; - ApplyAnimation(); - } - - protected void SyncRawImagesWithCanvasRenderers () { - rawImages.Clear(); - foreach (var canvasRenderer in canvasRenderers) { - var rawImage = canvasRenderer.GetComponent(); - if (rawImage == null) { - rawImage = canvasRenderer.gameObject.AddComponent(); - rawImage.maskable = this.maskable; - rawImage.raycastTarget = false; - } - rawImages.Add(rawImage); - } - } - - protected void UpdateAnimationStatus (float deltaTime) { - deltaTime *= timeScale; - skeleton.Update(deltaTime); - state.Update(deltaTime); - } - - protected void ApplyAnimation () { - if (BeforeApply != null) - BeforeApply(this); - - if (updateMode != UpdateMode.OnlyEventTimelines) - state.Apply(skeleton); - else - state.ApplyEventTimelinesOnly(skeleton); - - if (UpdateLocal != null) - UpdateLocal(this); - - skeleton.UpdateWorldTransform(); - - if (UpdateWorld != null) { - UpdateWorld(this); - skeleton.UpdateWorldTransform(); - } - - if (UpdateComplete != null) - UpdateComplete(this); - } - - public void LateUpdate () { - // instantiation can happen from Update() after this component, leading to a missing Update() call. - if (!wasUpdatedAfterInit) Update(0); - if (freeze) return; - if (updateMode != UpdateMode.FullUpdate) return; - - UpdateMesh(); - } - - protected void OnCullStateChanged (bool culled) { - if (culled) - OnBecameInvisible(); - else - OnBecameVisible(); - } - - public void OnBecameVisible () { - updateMode = UpdateMode.FullUpdate; - } - - public void OnBecameInvisible () { - updateMode = updateWhenInvisible; - } - - public void ReapplySeparatorSlotNames () { - if (!IsValid) - return; - - separatorSlots.Clear(); - for (int i = 0, n = separatorSlotNames.Length; i < n; i++) { - string slotName = separatorSlotNames[i]; - if (slotName == "") - continue; - var slot = skeleton.FindSlot(slotName); - if (slot != null) { - separatorSlots.Add(slot); - } - #if UNITY_EDITOR - else - { - Debug.LogWarning(slotName + " is not a slot in " + skeletonDataAsset.skeletonJSON.name); - } - #endif - } - UpdateSeparatorPartParents(); - } - #endregion - - #region API - protected Skeleton skeleton; - public Skeleton Skeleton { - get { - Initialize(false); - return skeleton; - } - set { - skeleton = value; - } - } - public SkeletonData SkeletonData { get { return skeleton == null ? null : skeleton.data; } } - public bool IsValid { get { return skeleton != null; } } - - public delegate void SkeletonRendererDelegate (SkeletonGraphic skeletonGraphic); - - /// OnRebuild is raised after the Skeleton is successfully initialized. - public event SkeletonRendererDelegate OnRebuild; - - /// OnMeshAndMaterialsUpdated is at the end of LateUpdate after the Mesh and - /// all materials have been updated. - public event SkeletonRendererDelegate OnMeshAndMaterialsUpdated; - - protected Spine.AnimationState state; - public Spine.AnimationState AnimationState { - get { - Initialize(false); - return state; - } - } - - [SerializeField] protected Spine.Unity.MeshGenerator meshGenerator = new MeshGenerator(); - public Spine.Unity.MeshGenerator MeshGenerator { get { return this.meshGenerator; } } - DoubleBuffered meshBuffers; - SkeletonRendererInstruction currentInstructions = new SkeletonRendererInstruction(); - readonly ExposedList meshes = new ExposedList(); - - public Mesh GetLastMesh () { - return meshBuffers.GetCurrent().mesh; - } - - public bool MatchRectTransformWithBounds () { - UpdateMesh(); - - if (!this.allowMultipleCanvasRenderers) - return MatchRectTransformSingleRenderer(); - else - return MatchRectTransformMultipleRenderers(); - } - - protected bool MatchRectTransformSingleRenderer () { - Mesh mesh = this.GetLastMesh(); - if (mesh == null) { - return false; - } - if (mesh.vertexCount == 0) { - this.rectTransform.sizeDelta = new Vector2(50f, 50f); - this.rectTransform.pivot = new Vector2(0.5f, 0.5f); - return false; - } - mesh.RecalculateBounds(); - SetRectTransformBounds(mesh.bounds); - return true; - } - - protected bool MatchRectTransformMultipleRenderers () { - bool anyBoundsAdded = false; - Bounds combinedBounds = new Bounds(); - for (int i = 0; i < canvasRenderers.Count; ++i) { - var canvasRenderer = canvasRenderers[i]; - if (!canvasRenderer.gameObject.activeSelf) - continue; - - Mesh mesh = meshes.Items[i]; - if (mesh == null || mesh.vertexCount == 0) - continue; - - mesh.RecalculateBounds(); - var bounds = mesh.bounds; - if (anyBoundsAdded) - combinedBounds.Encapsulate(bounds); - else { - anyBoundsAdded = true; - combinedBounds = bounds; - } - } - - if (!anyBoundsAdded) { - this.rectTransform.sizeDelta = new Vector2(50f, 50f); - this.rectTransform.pivot = new Vector2(0.5f, 0.5f); - return false; - } - - SetRectTransformBounds(combinedBounds); - return true; - } - - private void SetRectTransformBounds (Bounds combinedBounds) { - var size = combinedBounds.size; - var center = combinedBounds.center; - var p = new Vector2( - 0.5f - (center.x / size.x), - 0.5f - (center.y / size.y) - ); - - this.rectTransform.sizeDelta = size; - this.rectTransform.pivot = p; - } - - public event UpdateBonesDelegate BeforeApply; - public event UpdateBonesDelegate UpdateLocal; - public event UpdateBonesDelegate UpdateWorld; - public event UpdateBonesDelegate UpdateComplete; - - /// Occurs after the vertex data populated every frame, before the vertices are pushed into the mesh. - public event Spine.Unity.MeshGeneratorDelegate OnPostProcessVertices; - - public void Clear () { - skeleton = null; - canvasRenderer.Clear(); - - for (int i = 0; i < canvasRenderers.Count; ++i) - canvasRenderers[i].Clear(); - DestroyMeshes(); - DisposeMeshBuffers(); - } - - public void TrimRenderers () { - var newList = new List(); - foreach (var canvasRenderer in canvasRenderers) { - if (canvasRenderer.gameObject.activeSelf) { - newList.Add(canvasRenderer); - } - else { - if (Application.isEditor && !Application.isPlaying) - DestroyImmediate(canvasRenderer.gameObject); - else - Destroy(canvasRenderer.gameObject); - } - } - canvasRenderers = newList; - SyncRawImagesWithCanvasRenderers(); - } - - public void Initialize (bool overwrite) { - if (this.IsValid && !overwrite) return; - - if (this.skeletonDataAsset == null) return; - var skeletonData = this.skeletonDataAsset.GetSkeletonData(false); - if (skeletonData == null) return; - - if (skeletonDataAsset.atlasAssets.Length <= 0 || skeletonDataAsset.atlasAssets[0].MaterialCount <= 0) return; - - this.state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData()); - if (state == null) { - Clear(); - return; - } - - this.skeleton = new Skeleton(skeletonData) { - ScaleX = this.initialFlipX ? -1 : 1, - ScaleY = this.initialFlipY ? -1 : 1 - }; - - InitMeshBuffers(); - baseTexture = skeletonDataAsset.atlasAssets[0].PrimaryMaterial.mainTexture; - canvasRenderer.SetTexture(this.mainTexture); // Needed for overwriting initializations. - - // Set the initial Skin and Animation - if (!string.IsNullOrEmpty(initialSkinName)) - skeleton.SetSkin(initialSkinName); - - separatorSlots.Clear(); - for (int i = 0; i < separatorSlotNames.Length; i++) - separatorSlots.Add(skeleton.FindSlot(separatorSlotNames[i])); - - wasUpdatedAfterInit = false; - if (!string.IsNullOrEmpty(startingAnimation)) { - var animationObject = skeletonDataAsset.GetSkeletonData(false).FindAnimation(startingAnimation); - if (animationObject != null) { - state.SetAnimation(0, animationObject, startingLoop); - #if UNITY_EDITOR - if (!Application.isPlaying) - Update(0f); - #endif - } - } - - if (OnRebuild != null) - OnRebuild(this); - } - - public void UpdateMesh (bool keepRendererCount = false) { - if (!this.IsValid) return; - - skeleton.SetColor(this.color); - - var currentInstructions = this.currentInstructions; - if (!this.allowMultipleCanvasRenderers) { - UpdateMeshSingleCanvasRenderer(); - } - else { - UpdateMeshMultipleCanvasRenderers(currentInstructions, keepRendererCount); - } - - if (OnMeshAndMaterialsUpdated != null) - OnMeshAndMaterialsUpdated(this); - } - - public bool HasMultipleSubmeshInstructions () { - if (!IsValid) - return false; - return MeshGenerator.RequiresMultipleSubmeshesByDrawOrder(skeleton); - } - #endregion - - protected void InitMeshBuffers () { - if (meshBuffers != null) { - meshBuffers.GetNext().Clear(); - meshBuffers.GetNext().Clear(); - } - else { - meshBuffers = new DoubleBuffered(); - } - } - - protected void DisposeMeshBuffers () { - if (meshBuffers != null) { - meshBuffers.GetNext().Dispose(); - meshBuffers.GetNext().Dispose(); - meshBuffers = null; - } - } - - protected void UpdateMeshSingleCanvasRenderer () { - if (canvasRenderers.Count > 0) - DisableUnusedCanvasRenderers(usedCount : 0); - - var smartMesh = meshBuffers.GetNext(); - MeshGenerator.GenerateSingleSubmeshInstruction(currentInstructions, skeleton, null); - bool updateTriangles = SkeletonRendererInstruction.GeometryNotEqual(currentInstructions, smartMesh.instructionUsed); - - meshGenerator.Begin(); - if (currentInstructions.hasActiveClipping && currentInstructions.submeshInstructions.Count > 0) { - meshGenerator.AddSubmesh(currentInstructions.submeshInstructions.Items[0], updateTriangles); - } - else { - meshGenerator.BuildMeshWithArrays(currentInstructions, updateTriangles); - } - - if (canvas != null) meshGenerator.ScaleVertexData(canvas.referencePixelsPerUnit); - if (OnPostProcessVertices != null) OnPostProcessVertices.Invoke(this.meshGenerator.Buffers); - - var mesh = smartMesh.mesh; - meshGenerator.FillVertexData(mesh); - if (updateTriangles) meshGenerator.FillTriangles(mesh); - meshGenerator.FillLateVertexData(mesh); - - canvasRenderer.SetMesh(mesh); - smartMesh.instructionUsed.Set(currentInstructions); - - if (currentInstructions.submeshInstructions.Count > 0) { - var material = currentInstructions.submeshInstructions.Items[0].material; - if (material != null && baseTexture != material.mainTexture) { - baseTexture = material.mainTexture; - if (overrideTexture == null) - canvasRenderer.SetTexture(this.mainTexture); - } - } - - //this.UpdateMaterial(); // note: This would allocate memory. - usedRenderersCount = 0; - } - - protected void UpdateMeshMultipleCanvasRenderers (SkeletonRendererInstruction currentInstructions, bool keepRendererCount) { - MeshGenerator.GenerateSkeletonRendererInstruction(currentInstructions, skeleton, null, - enableSeparatorSlots ? separatorSlots : null, - enableSeparatorSlots ? separatorSlots.Count > 0 : false, - false); - - int submeshCount = currentInstructions.submeshInstructions.Count; - if (keepRendererCount && submeshCount != usedRenderersCount) - return; - EnsureCanvasRendererCount(submeshCount); - EnsureMeshesCount(submeshCount); - EnsureSeparatorPartCount(); - - var c = canvas; - float scale = (c == null) ? 100 : c.referencePixelsPerUnit; - - // Generate meshes. - var meshesItems = meshes.Items; - bool useOriginalTextureAndMaterial = (customMaterialOverride.Count == 0 && customTextureOverride.Count == 0); - int separatorSlotGroupIndex = 0; - Transform parent = this.separatorSlots.Count == 0 ? this.transform : this.separatorParts[0]; - - if (updateSeparatorPartLocation) { - for (int p = 0; p < this.separatorParts.Count; ++p) { - separatorParts[p].position = this.transform.position; - separatorParts[p].rotation = this.transform.rotation; - } - } - - int targetSiblingIndex = 0; - for (int i = 0; i < submeshCount; i++) { - var submeshInstructionItem = currentInstructions.submeshInstructions.Items[i]; - meshGenerator.Begin(); - meshGenerator.AddSubmesh(submeshInstructionItem); - - var targetMesh = meshesItems[i]; - meshGenerator.ScaleVertexData(scale); - if (OnPostProcessVertices != null) OnPostProcessVertices.Invoke(this.meshGenerator.Buffers); - meshGenerator.FillVertexData(targetMesh); - meshGenerator.FillTriangles(targetMesh); - meshGenerator.FillLateVertexData(targetMesh); - - var submeshMaterial = submeshInstructionItem.material; - var canvasRenderer = canvasRenderers[i]; - if (i >= usedRenderersCount) - canvasRenderer.gameObject.SetActive(true); - - canvasRenderer.SetMesh(targetMesh); - canvasRenderer.materialCount = 1; - - if (canvasRenderer.transform.parent != parent.transform) { - canvasRenderer.transform.SetParent(parent.transform, false); - canvasRenderer.transform.localPosition = Vector3.zero; - } - canvasRenderer.transform.SetSiblingIndex(targetSiblingIndex++); - if (submeshInstructionItem.forceSeparate) { - targetSiblingIndex = 0; - parent = separatorParts[++separatorSlotGroupIndex]; - } - - if (useOriginalTextureAndMaterial) - canvasRenderer.SetMaterial(this.materialForRendering, submeshMaterial.mainTexture); - else { - var originalTexture = submeshMaterial.mainTexture; - Material usedMaterial; - Texture usedTexture; - if (!customMaterialOverride.TryGetValue(originalTexture, out usedMaterial)) - usedMaterial = material; - if (!customTextureOverride.TryGetValue(originalTexture, out usedTexture)) - usedTexture = originalTexture; - canvasRenderer.SetMaterial(usedMaterial, usedTexture); - } - } - - DisableUnusedCanvasRenderers(usedCount : submeshCount); - usedRenderersCount = submeshCount; - } - - protected void EnsureCanvasRendererCount (int targetCount) { - #if UNITY_EDITOR - RemoveNullCanvasRenderers(); - #endif - int currentCount = canvasRenderers.Count; - for (int i = currentCount; i < targetCount; ++i) { - var go = new GameObject(string.Format("Renderer{0}", i), typeof(RectTransform)); - go.transform.SetParent(this.transform, false); - go.transform.localPosition = Vector3.zero; - var canvasRenderer = go.AddComponent(); - canvasRenderers.Add(canvasRenderer); - var rawImage = go.AddComponent(); - rawImage.maskable = this.maskable; - rawImage.raycastTarget = false; - rawImages.Add(rawImage); - } - } - - protected void DisableUnusedCanvasRenderers (int usedCount) { - #if UNITY_EDITOR - RemoveNullCanvasRenderers(); - #endif - for (int i = usedCount; i < canvasRenderers.Count; i++) { - canvasRenderers[i].Clear(); - canvasRenderers[i].gameObject.SetActive(false); - } - } - - #if UNITY_EDITOR - private void RemoveNullCanvasRenderers () { - if (Application.isEditor && !Application.isPlaying) { - for (int i = canvasRenderers.Count - 1; i >= 0; --i) { - if (canvasRenderers[i] == null) { - canvasRenderers.RemoveAt(i); - } - } - } - } - #endif - - protected void EnsureMeshesCount (int targetCount) { - int oldCount = meshes.Count; - meshes.EnsureCapacity(targetCount); - for (int i = oldCount; i < targetCount; i++) - meshes.Add(SpineMesh.NewSkeletonMesh()); - } - - protected void DestroyMeshes () { - foreach (var mesh in meshes) { -#if UNITY_EDITOR - if (Application.isEditor && !Application.isPlaying) - UnityEngine.Object.DestroyImmediate(mesh); - else - UnityEngine.Object.Destroy(mesh); -#else - UnityEngine.Object.Destroy(mesh); -#endif - } - meshes.Clear(); - } - - protected void EnsureSeparatorPartCount () { - #if UNITY_EDITOR - RemoveNullSeparatorParts(); - #endif - int targetCount = separatorSlots.Count + 1; - if (targetCount == 1) - return; - - #if UNITY_EDITOR - if (Application.isEditor && !Application.isPlaying) { - for (int i = separatorParts.Count-1; i >= 0; --i) { - if (separatorParts[i] == null) { - separatorParts.RemoveAt(i); - } - } - } - #endif - int currentCount = separatorParts.Count; - for (int i = currentCount; i < targetCount; ++i) { - var go = new GameObject(string.Format("{0}[{1}]", SeparatorPartGameObjectName, i), typeof(RectTransform)); - go.transform.SetParent(this.transform, false); - go.transform.localPosition = Vector3.zero; - separatorParts.Add(go.transform); - } - } - - protected void UpdateSeparatorPartParents () { - int usedCount = separatorSlots.Count + 1; - if (usedCount == 1) { - usedCount = 0; // placed directly at the SkeletonGraphic parent - for (int i = 0; i < canvasRenderers.Count; ++i) { - var canvasRenderer = canvasRenderers[i]; - if (canvasRenderer.transform.parent.name.Contains(SeparatorPartGameObjectName)) { - canvasRenderer.transform.SetParent(this.transform, false); - canvasRenderer.transform.localPosition = Vector3.zero; - } - } - } - for (int i = 0; i < separatorParts.Count; ++i) { - bool isUsed = i < usedCount; - separatorParts[i].gameObject.SetActive(isUsed); - } - } - - #if UNITY_EDITOR - private void RemoveNullSeparatorParts () { - if (Application.isEditor && !Application.isPlaying) { - for (int i = separatorParts.Count - 1; i >= 0; --i) { - if (separatorParts[i] == null) { - separatorParts.RemoveAt(i); - } - } - } - } - #endif - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs b/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs index 3355aa610..9ca40bdea 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs +++ b/Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEngine; @@ -32,25 +32,16 @@ using System.Collections.Generic; namespace Spine.Unity { [RequireComponent(typeof(Animator))] - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonMecanim-Component")] public class SkeletonMecanim : SkeletonRenderer, ISkeletonAnimation { [SerializeField] protected MecanimTranslator translator; public MecanimTranslator Translator { get { return translator; } } - private bool wasUpdatedAfterInit = true; #region Bone Callbacks (ISkeletonAnimation) - protected event UpdateBonesDelegate _BeforeApply; protected event UpdateBonesDelegate _UpdateLocal; protected event UpdateBonesDelegate _UpdateWorld; protected event UpdateBonesDelegate _UpdateComplete; - /// - /// Occurs before the animations are applied. - /// Use this callback when you want to change the skeleton state before animations are applied on top. - /// - public event UpdateBonesDelegate BeforeApply { add { _BeforeApply += value; } remove { _BeforeApply -= value; } } - /// /// Occurs after the animations are applied and before world space values are resolved. /// Use this callback when you want to set bone local values. @@ -69,43 +60,26 @@ namespace Spine.Unity { public event UpdateBonesDelegate UpdateComplete { add { _UpdateComplete += value; } remove { _UpdateComplete -= value; } } #endregion - public override void Initialize (bool overwrite, bool quiet = false) { - if (valid && !overwrite) - return; - - base.Initialize(overwrite, quiet); - - if (!valid) - return; + public override void Initialize (bool overwrite) { + if (valid && !overwrite) return; + base.Initialize(overwrite); + if (!valid) return; if (translator == null) translator = new MecanimTranslator(); translator.Initialize(GetComponent(), this.skeletonDataAsset); - wasUpdatedAfterInit = false; } public void Update () { if (!valid) return; - wasUpdatedAfterInit = true; - // animation status is kept by Mecanim Animator component - if (updateMode <= UpdateMode.OnlyAnimationStatus) - return; - ApplyAnimation(); - } - - protected void ApplyAnimation () { - if (_BeforeApply != null) - _BeforeApply(this); - - #if UNITY_EDITOR + #if UNITY_EDITOR var translatorAnimator = translator.Animator; if (translatorAnimator != null && !translatorAnimator.isInitialized) translatorAnimator.Rebind(); if (Application.isPlaying) { translator.Apply(skeleton); - } - else { + } else { if (translatorAnimator != null && translatorAnimator.isInitialized && translatorAnimator.isActiveAndEnabled && translatorAnimator.runtimeAnimatorController != null) { // Note: Rebind is required to prevent warning "Animator is not playing an AnimatorController" with prefabs @@ -113,9 +87,9 @@ namespace Spine.Unity { translator.Apply(skeleton); } } - #else + #else translator.Apply(skeleton); - #endif + #endif // UpdateWorldTransform and Bone Callbacks { @@ -134,31 +108,15 @@ namespace Spine.Unity { } } - public override void LateUpdate () { - // instantiation can happen from Update() after this component, leading to a missing Update() call. - if (!wasUpdatedAfterInit) Update(); - base.LateUpdate(); - } - [System.Serializable] public class MecanimTranslator { - - const float WeightEpsilon = 0.0001f; - #region Inspector public bool autoReset = true; - public bool useCustomMixMode = true; public MixMode[] layerMixModes = new MixMode[0]; public MixBlend[] layerBlendModes = new MixBlend[0]; #endregion - public delegate void OnClipAppliedDelegate (Spine.Animation clip, int layerIndex, float weight, - float time, float lastTime, bool playsBackward); - protected event OnClipAppliedDelegate _OnClipApplied; - - public event OnClipAppliedDelegate OnClipApplied { add { _OnClipApplied += value; } remove { _OnClipApplied -= value; } } - - public enum MixMode { AlwaysMix, MixNext, Hard } + public enum MixMode { AlwaysMix, MixNext, SpineStyle } readonly Dictionary animationTable = new Dictionary(IntEqualityComparer.Instance); readonly Dictionary clipNameHashCodeTable = new Dictionary(AnimationClipEqualityComparer.Instance); @@ -186,26 +144,6 @@ namespace Spine.Unity { Animator animator; public Animator Animator { get { return this.animator; } } - public int MecanimLayerCount { - get { - if (!animator) - return 0; - return animator.layerCount; - } - } - - public string[] MecanimLayerNames { - get { - if (!animator) - return new string[0]; - string[] layerNames = new string[animator.layerCount]; - for (int i = 0; i < animator.layerCount; ++i) { - layerNames[i] = animator.GetLayerName(i); - } - return layerNames; - } - } - public void Initialize(Animator animator, SkeletonDataAsset skeletonDataAsset) { this.animator = animator; @@ -220,86 +158,22 @@ namespace Spine.Unity { ClearClipInfosForLayers(); } - private bool ApplyAnimation (Skeleton skeleton, AnimatorClipInfo info, AnimatorStateInfo stateInfo, - int layerIndex, float layerWeight, MixBlend layerBlendMode, bool useClipWeight1 = false) { - float weight = info.weight * layerWeight; - if (weight < WeightEpsilon) - return false; - - var clip = GetAnimation(info.clip); - if (clip == null) - return false; - - var time = AnimationTime(stateInfo.normalizedTime, info.clip.length, - info.clip.isLooping, stateInfo.speed < 0); - weight = useClipWeight1 ? layerWeight : weight; - clip.Apply(skeleton, 0, time, info.clip.isLooping, null, - weight, layerBlendMode, MixDirection.In); - if (_OnClipApplied != null) - OnClipAppliedCallback(clip, stateInfo, layerIndex, time, info.clip.isLooping, weight); - return true; - } - - private bool ApplyInterruptionAnimation (Skeleton skeleton, - bool interpolateWeightTo1, AnimatorClipInfo info, AnimatorStateInfo stateInfo, - int layerIndex, float layerWeight, MixBlend layerBlendMode, float interruptingClipTimeAddition, - bool useClipWeight1 = false) { - - float clipWeight = interpolateWeightTo1 ? (info.weight + 1.0f) * 0.5f : info.weight; - float weight = clipWeight * layerWeight; - if (weight < WeightEpsilon) - return false; - - var clip = GetAnimation(info.clip); - if (clip == null) - return false; - - var time = AnimationTime(stateInfo.normalizedTime + interruptingClipTimeAddition, - info.clip.length, stateInfo.speed < 0); - weight = useClipWeight1 ? layerWeight : weight; - clip.Apply(skeleton, 0, time, info.clip.isLooping, null, - weight, layerBlendMode, MixDirection.In); - if (_OnClipApplied != null) { - OnClipAppliedCallback(clip, stateInfo, layerIndex, time, info.clip.isLooping, weight); - } - return true; - } - - private void OnClipAppliedCallback (Spine.Animation clip, AnimatorStateInfo stateInfo, - int layerIndex, float time, bool isLooping, float weight) { - - float speedFactor = stateInfo.speedMultiplier * stateInfo.speed; - float lastTime = time - (Time.deltaTime * speedFactor); - if (isLooping && clip.duration != 0) { - time %= clip.duration; - lastTime %= clip.duration; - } - _OnClipApplied(clip, layerIndex, weight, time, lastTime, speedFactor < 0); - } - public void Apply (Skeleton skeleton) { + if (layerMixModes.Length < animator.layerCount) + System.Array.Resize(ref layerMixModes, animator.layerCount); + #if UNITY_EDITOR if (!Application.isPlaying) { GetLayerBlendModes(); } #endif - - if (layerMixModes.Length < animator.layerCount) { - int oldSize = layerMixModes.Length; - System.Array.Resize(ref layerMixModes, animator.layerCount); - for (int layer = oldSize; layer < animator.layerCount; ++layer) { - bool isAdditiveLayer = false; - if (layer < layerBlendModes.Length) - isAdditiveLayer = layerBlendModes[layer] == MixBlend.Add; - layerMixModes[layer] = isAdditiveLayer ? MixMode.AlwaysMix : MixMode.MixNext; - } - } - InitClipInfosForLayers(); for (int layer = 0, n = animator.layerCount; layer < n; layer++) { GetStateUpdatesFromAnimator(layer); } + //skeleton.Update(Time.deltaTime); // Doesn't actually do anything, currently. (Spine 3.6). + // Clear Previous if (autoReset) { var previousAnimations = this.previousAnimations; @@ -320,22 +194,18 @@ namespace Spine.Unity { bool isInterruptionActive, shallInterpolateWeightTo1; GetAnimatorClipInfos(layer, out isInterruptionActive, out clipInfoCount, out nextClipInfoCount, out interruptingClipInfoCount, out clipInfo, out nextClipInfo, out interruptingClipInfo, out shallInterpolateWeightTo1); - + for (int c = 0; c < clipInfoCount; c++) { var info = clipInfo[c]; - float weight = info.weight * layerWeight; if (weight < WeightEpsilon) continue; - var clip = GetAnimation(info.clip); - if (clip != null) - previousAnimations.Add(clip); + float weight = info.weight * layerWeight; if (weight == 0) continue; + previousAnimations.Add(GetAnimation(info.clip)); } if (hasNext) { for (int c = 0; c < nextClipInfoCount; c++) { var info = nextClipInfo[c]; - float weight = info.weight * layerWeight; if (weight < WeightEpsilon) continue; - var clip = GetAnimation(info.clip); - if (clip != null) - previousAnimations.Add(clip); + float weight = info.weight * layerWeight; if (weight == 0) continue; + previousAnimations.Add(GetAnimation(info.clip)); } } @@ -344,10 +214,8 @@ namespace Spine.Unity { { var info = interruptingClipInfo[c]; float clipWeight = shallInterpolateWeightTo1 ? (info.weight + 1.0f) * 0.5f : info.weight; - float weight = clipWeight * layerWeight; if (weight < WeightEpsilon) continue; - var clip = GetAnimation(info.clip); - if (clip != null) - previousAnimations.Add(clip); + float weight = clipWeight * layerWeight; if (weight == 0) continue; + previousAnimations.Add(GetAnimation(info.clip)); } } } @@ -363,114 +231,98 @@ namespace Spine.Unity { AnimatorStateInfo interruptingStateInfo; float interruptingClipTimeAddition; GetAnimatorStateInfos(layer, out isInterruptionActive, out stateInfo, out nextStateInfo, out interruptingStateInfo, out interruptingClipTimeAddition); - + bool hasNext = nextStateInfo.fullPathHash != 0; - + int clipInfoCount, nextClipInfoCount, interruptingClipInfoCount; IList clipInfo, nextClipInfo, interruptingClipInfo; - bool interpolateWeightTo1; + bool shallInterpolateWeightTo1; GetAnimatorClipInfos(layer, out isInterruptionActive, out clipInfoCount, out nextClipInfoCount, out interruptingClipInfoCount, - out clipInfo, out nextClipInfo, out interruptingClipInfo, out interpolateWeightTo1); + out clipInfo, out nextClipInfo, out interruptingClipInfo, out shallInterpolateWeightTo1); + MixMode mode = layerMixModes[layer]; MixBlend layerBlendMode = (layer < layerBlendModes.Length) ? layerBlendModes[layer] : MixBlend.Replace; - MixMode mode = GetMixMode(layer, layerBlendMode); if (mode == MixMode.AlwaysMix) { // Always use Mix instead of Applying the first non-zero weighted clip. for (int c = 0; c < clipInfoCount; c++) { - ApplyAnimation(skeleton, clipInfo[c], stateInfo, layer, layerWeight, layerBlendMode); + var info = clipInfo[c]; float weight = info.weight * layerWeight; if (weight == 0) continue; + GetAnimation(info.clip).Apply(skeleton, 0, AnimationTime(stateInfo.normalizedTime, info.clip.length, stateInfo.loop, stateInfo.speed < 0), stateInfo.loop, null, weight, layerBlendMode, MixDirection.In); } if (hasNext) { for (int c = 0; c < nextClipInfoCount; c++) { - ApplyAnimation(skeleton, nextClipInfo[c], nextStateInfo, layer, layerWeight, layerBlendMode); + var info = nextClipInfo[c]; float weight = info.weight * layerWeight; if (weight == 0) continue; + GetAnimation(info.clip).Apply(skeleton, 0, AnimationTime(nextStateInfo.normalizedTime, info.clip.length, nextStateInfo.speed < 0), nextStateInfo.loop, null, weight, layerBlendMode, MixDirection.In); } } if (isInterruptionActive) { for (int c = 0; c < interruptingClipInfoCount; c++) { - ApplyInterruptionAnimation(skeleton, interpolateWeightTo1, - interruptingClipInfo[c], interruptingStateInfo, - layer, layerWeight, layerBlendMode, interruptingClipTimeAddition); + var info = interruptingClipInfo[c]; + float clipWeight = shallInterpolateWeightTo1 ? (info.weight + 1.0f) * 0.5f : info.weight; + float weight = clipWeight * layerWeight; if (weight == 0) continue; + GetAnimation(info.clip).Apply(skeleton, 0, AnimationTime(interruptingStateInfo.normalizedTime + interruptingClipTimeAddition, info.clip.length, interruptingStateInfo.speed < 0), + interruptingStateInfo.loop, null, weight, layerBlendMode, MixDirection.In); } } - } else { // case MixNext || Hard - // Apply first non-zero weighted clip + } else { // case MixNext || SpineStyle + // Apply first non-zero weighted clip int c = 0; for (; c < clipInfoCount; c++) { - if (!ApplyAnimation(skeleton, clipInfo[c], stateInfo, layer, layerWeight, layerBlendMode, useClipWeight1:true)) - continue; - ++c; break; + var info = clipInfo[c]; float weight = info.weight * layerWeight; if (weight == 0) continue; + GetAnimation(info.clip).Apply(skeleton, 0, AnimationTime(stateInfo.normalizedTime, info.clip.length, stateInfo.loop, stateInfo.speed < 0), stateInfo.loop, null, 1f, layerBlendMode, MixDirection.In); + break; } // Mix the rest for (; c < clipInfoCount; c++) { - ApplyAnimation(skeleton, clipInfo[c], stateInfo, layer, layerWeight, layerBlendMode); + var info = clipInfo[c]; float weight = info.weight * layerWeight; if (weight == 0) continue; + GetAnimation(info.clip).Apply(skeleton, 0, AnimationTime(stateInfo.normalizedTime, info.clip.length, stateInfo.loop, stateInfo.speed < 0), stateInfo.loop, null, weight, layerBlendMode, MixDirection.In); } c = 0; if (hasNext) { // Apply next clip directly instead of mixing (ie: no crossfade, ignores mecanim transition weights) - if (mode == MixMode.Hard) { + if (mode == MixMode.SpineStyle) { for (; c < nextClipInfoCount; c++) { - if (!ApplyAnimation(skeleton, nextClipInfo[c], nextStateInfo, layer, layerWeight, layerBlendMode, useClipWeight1:true)) - continue; - ++c; break; + var info = nextClipInfo[c]; float weight = info.weight * layerWeight; if (weight == 0) continue; + GetAnimation(info.clip).Apply(skeleton, 0, AnimationTime(nextStateInfo.normalizedTime, info.clip.length, nextStateInfo.speed < 0), nextStateInfo.loop, null, 1f, layerBlendMode, MixDirection.In); + break; } } // Mix the rest for (; c < nextClipInfoCount; c++) { - if (!ApplyAnimation(skeleton, nextClipInfo[c], nextStateInfo, layer, layerWeight, layerBlendMode)) - continue; + var info = nextClipInfo[c]; float weight = info.weight * layerWeight; if (weight == 0) continue; + GetAnimation(info.clip).Apply(skeleton, 0, AnimationTime(nextStateInfo.normalizedTime, info.clip.length, nextStateInfo.speed < 0), nextStateInfo.loop, null, weight, layerBlendMode, MixDirection.In); } } c = 0; if (isInterruptionActive) { // Apply next clip directly instead of mixing (ie: no crossfade, ignores mecanim transition weights) - if (mode == MixMode.Hard) { + if (mode == MixMode.SpineStyle) { for (; c < interruptingClipInfoCount; c++) { - if (ApplyInterruptionAnimation(skeleton, interpolateWeightTo1, - interruptingClipInfo[c], interruptingStateInfo, - layer, layerWeight, layerBlendMode, interruptingClipTimeAddition, useClipWeight1:true)) { - - ++c; break; - } + var info = interruptingClipInfo[c]; + float clipWeight = shallInterpolateWeightTo1 ? (info.weight + 1.0f) * 0.5f : info.weight; + float weight = clipWeight * layerWeight; if (weight == 0) continue; + GetAnimation(info.clip).Apply(skeleton, 0, AnimationTime(interruptingStateInfo.normalizedTime + interruptingClipTimeAddition, info.clip.length, interruptingStateInfo.speed < 0), interruptingStateInfo.loop, null, 1f, layerBlendMode, MixDirection.In); + break; } } // Mix the rest for (; c < interruptingClipInfoCount; c++) { - ApplyInterruptionAnimation(skeleton, interpolateWeightTo1, - interruptingClipInfo[c], interruptingStateInfo, - layer, layerWeight, layerBlendMode, interruptingClipTimeAddition); + var info = interruptingClipInfo[c]; + float clipWeight = shallInterpolateWeightTo1 ? (info.weight + 1.0f) * 0.5f : info.weight; + float weight = clipWeight * layerWeight; if (weight == 0) continue; + GetAnimation(info.clip).Apply(skeleton, 0, AnimationTime(interruptingStateInfo.normalizedTime + interruptingClipTimeAddition, info.clip.length, interruptingStateInfo.speed < 0), interruptingStateInfo.loop, null, weight, layerBlendMode, MixDirection.In); } } } } } - public KeyValuePair GetActiveAnimationAndTime (int layer) { - if (layer >= layerClipInfos.Length) - return new KeyValuePair(null, 0); - - var layerInfos = layerClipInfos[layer]; - bool isInterruptionActive = layerInfos.isInterruptionActive; - AnimationClip clip = null; - Spine.Animation animation = null; - AnimatorStateInfo stateInfo; - if (isInterruptionActive && layerInfos.interruptingClipInfoCount > 0) { - clip = layerInfos.interruptingClipInfos[0].clip; - stateInfo = layerInfos.interruptingStateInfo; - } - else { - clip = layerInfos.clipInfos[0].clip; - stateInfo = layerInfos.stateInfo; - } - animation = GetAnimation(clip); - float time = AnimationTime(stateInfo.normalizedTime, clip.length, - clip.isLooping, stateInfo.speed < 0); - return new KeyValuePair(animation, time); - } - static float AnimationTime (float normalizedTime, float clipLength, bool loop, bool reversed) { - float time = AnimationTime(normalizedTime, clipLength, reversed); + if (reversed) + normalizedTime = (1 - normalizedTime + (int)normalizedTime) + (int)normalizedTime; + float time = normalizedTime * clipLength; if (loop) return time; const float EndSnapEpsilon = 1f / 30f; // Workaround for end-duration keys not being applied. return (clipLength - time < EndSnapEpsilon) ? clipLength : time; // return a time snapped to clipLength; @@ -478,9 +330,8 @@ namespace Spine.Unity { static float AnimationTime (float normalizedTime, float clipLength, bool reversed) { if (reversed) - normalizedTime = (1 - normalizedTime); - if (normalizedTime < 0.0f) - normalizedTime = (normalizedTime % 1.0f) + 1.0f; + normalizedTime = (1 - normalizedTime + (int)normalizedTime) + (int)normalizedTime; + return normalizedTime * clipLength; } @@ -508,24 +359,7 @@ namespace Spine.Unity { } } - private MixMode GetMixMode (int layer, MixBlend layerBlendMode) { - if (useCustomMixMode) { - MixMode mode = layerMixModes[layer]; - // Note: at additive blending it makes no sense to use constant weight 1 at a fadeout anim add1 as - // with override layers, so we use AlwaysMix instead to use the proper weights. - // AlwaysMix leads to the expected result = lower_layer + lerp(add1, add2, transition_weight). - if (layerBlendMode == MixBlend.Add && mode == MixMode.MixNext) { - mode = MixMode.AlwaysMix; - layerMixModes[layer] = mode; - } - return mode; - } - else { - return layerBlendMode == MixBlend.Add ? MixMode.AlwaysMix : MixMode.MixNext; - } - } - -#if UNITY_EDITOR + #if UNITY_EDITOR void GetLayerBlendModes() { if (layerBlendModes.Length < animator.layerCount) { System.Array.Resize(ref layerBlendModes, animator.layerCount); @@ -533,7 +367,7 @@ namespace Spine.Unity { for (int layer = 0, n = animator.layerCount; layer < n; ++layer) { var controller = animator.runtimeAnimatorController as UnityEditor.Animations.AnimatorController; if (controller != null) { - layerBlendModes[layer] = MixBlend.First; + layerBlendModes[layer] = MixBlend.Replace; if (layer > 0) { layerBlendModes[layer] = controller.layers[layer].blendingMode == UnityEditor.Animations.AnimatorLayerBlendingMode.Additive ? MixBlend.Add : MixBlend.Replace; @@ -544,7 +378,7 @@ namespace Spine.Unity { #endif void GetStateUpdatesFromAnimator (int layer) { - + var layerInfos = layerClipInfos[layer]; int clipInfoCount = animator.GetCurrentAnimatorClipInfoCount(layer); int nextClipInfoCount = animator.GetNextAnimatorClipInfoCount(layer); @@ -568,8 +402,9 @@ namespace Spine.Unity { var interruptingStateInfo = animator.GetNextAnimatorStateInfo(layer); layerInfos.isLastFrameOfInterruption = interruptingStateInfo.fullPathHash == 0; if (!layerInfos.isLastFrameOfInterruption) { - animator.GetNextAnimatorClipInfo(layer, interruptingClipInfos); layerInfos.interruptingClipInfoCount = interruptingClipInfos.Count; + + animator.GetNextAnimatorClipInfo(layer, interruptingClipInfos); float oldTime = layerInfos.interruptingStateInfo.normalizedTime; float newTime = interruptingStateInfo.normalizedTime; layerInfos.interruptingClipTimeAddition = newTime - oldTime; diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs b/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs index a40a51052..cc3d934aa 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs +++ b/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,34 +15,26 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER #define NEW_PREFAB_SYSTEM #endif -#if UNITY_2018_1_OR_NEWER -#define PER_MATERIAL_PROPERTY_BLOCKS -#endif - #if UNITY_2017_1_OR_NEWER #define BUILT_IN_SPRITE_MASK_COMPONENT #endif -#if UNITY_2019_3_OR_NEWER -#define CONFIGURABLE_ENTER_PLAY_MODE -#endif - #define SPINE_OPTIONAL_RENDEROVERRIDE #define SPINE_OPTIONAL_MATERIALOVERRIDE @@ -57,38 +49,19 @@ namespace Spine.Unity { [ExecuteInEditMode] #endif [RequireComponent(typeof(MeshFilter), typeof(MeshRenderer)), DisallowMultipleComponent] - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonRenderer-Component")] + [HelpURL("http://esotericsoftware.com/spine-unity-rendering")] public class SkeletonRenderer : MonoBehaviour, ISkeletonComponent, IHasSkeletonDataAsset { - public SkeletonDataAsset skeletonDataAsset; + [SerializeField] public SkeletonDataAsset skeletonDataAsset; #region Initialization settings /// Skin name to use when the Skeleton is initialized. - [SpineSkin(defaultAsEmptyString:true)] public string initialSkinName; + [SerializeField] [SpineSkin(defaultAsEmptyString:true)] public string initialSkinName; - /// Enable this parameter when overwriting the Skeleton's skin from an editor script. - /// Otherwise any changes will be overwritten by the next inspector update. - #if UNITY_EDITOR - public bool EditorSkipSkinSync { - get { return editorSkipSkinSync; } - set { editorSkipSkinSync = value; } - } - protected bool editorSkipSkinSync = false; - #endif /// Flip X and Y to use when the Skeleton is initialized. - public bool initialFlipX, initialFlipY; + [SerializeField] public bool initialFlipX, initialFlipY; #endregion #region Advanced Render Settings - - /// Update mode to optionally limit updates to e.g. only apply animations but not update the mesh. - public UpdateMode UpdateMode { get { return updateMode; } set { updateMode = value; } } - protected UpdateMode updateMode = UpdateMode.FullUpdate; - - /// Update mode used when the MeshRenderer becomes invisible - /// (when OnBecameInvisible() is called). Update mode is automatically - /// reset to UpdateMode.FullUpdate when the mesh becomes visible again. - public UpdateMode updateWhenInvisible = UpdateMode.FullUpdate; - // Submesh Separation /// Slot names used to populate separatorSlots list when the Skeleton is initialized. Changing this after initialization does nothing. [UnityEngine.Serialization.FormerlySerializedAs("submeshSeparators")][SerializeField][SpineSlot] protected string[] separatorSlotNames = new string[0]; @@ -117,16 +90,6 @@ namespace Spine.Unity { /// This disables SkeletonRenderSeparator functionality. public bool singleSubmesh = false; - #if PER_MATERIAL_PROPERTY_BLOCKS - /// Applies only when 3+ submeshes are used (2+ materials with alternating order, e.g. "A B A"). - /// If true, GPU instancing is disabled at all materials and MaterialPropertyBlocks are assigned at each - /// material to prevent aggressive batching of submeshes by e.g. the LWRP renderer, leading to incorrect - /// draw order (e.g. "A1 B A2" changed to "A1A2 B"). - /// You can disable this parameter when everything is drawn correctly to save the additional performance cost. - /// - public bool fixDrawOrder = false; - #endif - /// If true, the mesh generator adds normals to the output mesh. For better performance and reduced memory requirements, use a shader that assumes the desired normal. [UnityEngine.Serialization.FormerlySerializedAs("calculateNormals")] public bool addNormals = false; @@ -138,17 +101,9 @@ namespace Spine.Unity { /// Interaction modes with components are identical to Unity's , /// see https://docs.unity3d.com/ScriptReference/SpriteMaskInteraction.html. public SpriteMaskInteraction maskInteraction = SpriteMaskInteraction.None; - + [System.Serializable] public class SpriteMaskInteractionMaterials { - public bool AnyMaterialCreated { - get { - return materialsMaskDisabled.Length > 0 || - materialsInsideMask.Length > 0 || - materialsOutsideMask.Length > 0; - } - } - /// Material references for switching material sets at runtime when changes to . public Material[] materialsMaskDisabled = new Material[0]; /// Material references for switching material sets at runtime when changes to . @@ -158,7 +113,7 @@ namespace Spine.Unity { } /// Material references for switching material sets at runtime when changes. public SpriteMaskInteractionMaterials maskMaterials = new SpriteMaskInteractionMaterials(); - + /// Shader property ID used for the Stencil comparison function. public static readonly int STENCIL_COMP_PARAM_ID = Shader.PropertyToID("_StencilComp"); /// Shader property value used as Stencil comparison function for . @@ -186,16 +141,14 @@ namespace Spine.Unity { generateMeshOverride += value; if (disableRenderingOnOverride && generateMeshOverride != null) { Initialize(false); - if (meshRenderer) - meshRenderer.enabled = false; + meshRenderer.enabled = false; } } remove { generateMeshOverride -= value; if (disableRenderingOnOverride && generateMeshOverride == null) { Initialize(false); - if (meshRenderer) - meshRenderer.enabled = true; + meshRenderer.enabled = true; } } } @@ -242,24 +195,20 @@ namespace Spine.Unity { /// OnRebuild is raised after the Skeleton is successfully initialized. public event SkeletonRendererDelegate OnRebuild; - /// OnMeshAndMaterialsUpdated is called at the end of LateUpdate after the Mesh and - /// all materials have been updated. - public event SkeletonRendererDelegate OnMeshAndMaterialsUpdated; - public SkeletonDataAsset SkeletonDataAsset { get { return skeletonDataAsset; } } // ISkeletonComponent #region Runtime Instantiation - public static T NewSpineGameObject (SkeletonDataAsset skeletonDataAsset, bool quiet = false) where T : SkeletonRenderer { - return SkeletonRenderer.AddSpineComponent(new GameObject("New Spine GameObject"), skeletonDataAsset, quiet); + public static T NewSpineGameObject (SkeletonDataAsset skeletonDataAsset) where T : SkeletonRenderer { + return SkeletonRenderer.AddSpineComponent(new GameObject("New Spine GameObject"), skeletonDataAsset); } /// Add and prepare a Spine component that derives from SkeletonRenderer to a GameObject at runtime. /// T should be SkeletonRenderer or any of its derived classes. - public static T AddSpineComponent (GameObject gameObject, SkeletonDataAsset skeletonDataAsset, bool quiet = false) where T : SkeletonRenderer { + public static T AddSpineComponent (GameObject gameObject, SkeletonDataAsset skeletonDataAsset) where T : SkeletonRenderer { var c = gameObject.AddComponent(); if (skeletonDataAsset != null) { c.skeletonDataAsset = skeletonDataAsset; - c.Initialize(false, quiet); + c.Initialize(false); } return c; } @@ -280,15 +229,8 @@ namespace Spine.Unity { public virtual void Awake () { Initialize(false); - updateMode = updateWhenInvisible; } - #if UNITY_EDITOR && CONFIGURABLE_ENTER_PLAY_MODE - public virtual void Start () { - Initialize(false); - } - #endif - void OnDisable () { if (clearStateOnDisable && valid) ClearState(); @@ -318,14 +260,18 @@ namespace Spine.Unity { /// /// Initialize this component. Attempts to load the SkeletonData and creates the internal Skeleton object and buffers. /// If set to true, it will overwrite internal objects if they were already generated. Otherwise, the initialized component will ignore subsequent calls to initialize. - public virtual void Initialize (bool overwrite, bool quiet = false) { + public virtual void Initialize (bool overwrite) { if (valid && !overwrite) return; // Clear { - // Note: do not reset meshFilter.sharedMesh or meshRenderer.sharedMaterial to null, - // otherwise constant reloading will be triggered at prefabs. + if (meshFilter != null) + meshFilter.sharedMesh = null; + + meshRenderer = GetComponent(); + if (meshRenderer != null && meshRenderer.enabled) meshRenderer.sharedMaterial = null; + currentInstructions.Clear(); rendererBuffers.Clear(); meshGenerator.Begin(); @@ -345,8 +291,8 @@ namespace Spine.Unity { rendererBuffers.Initialize(); skeleton = new Skeleton(skeletonData) { - ScaleX = initialFlipX ? -1 : 1, - ScaleY = initialFlipY ? -1 : 1 + scaleX = initialFlipX ? -1 : 1, + scaleY = initialFlipY ? -1 : 1 }; if (!string.IsNullOrEmpty(initialSkinName) && !string.Equals(initialSkinName, "default", System.StringComparison.Ordinal)) @@ -360,14 +306,6 @@ namespace Spine.Unity { if (OnRebuild != null) OnRebuild(this); - - #if UNITY_EDITOR - if (!Application.isPlaying) { - string errorMessage = null; - if (!quiet && MaterialChecks.IsMaterialSetupProblematic(this, ref errorMessage)) - Debug.LogWarningFormat(this, "Problematic material setup at {0}: {1}", this.name, errorMessage); - } - #endif } /// @@ -375,17 +313,6 @@ namespace Spine.Unity { public virtual void LateUpdate () { if (!valid) return; - #if UNITY_EDITOR && NEW_PREFAB_SYSTEM - // Don't store mesh or material at the prefab, otherwise it will permanently reload - var prefabType = UnityEditor.PrefabUtility.GetPrefabAssetType(this); - if (UnityEditor.PrefabUtility.IsPartOfPrefabAsset(this) && - (prefabType == UnityEditor.PrefabAssetType.Regular || prefabType == UnityEditor.PrefabAssetType.Variant)) { - return; - } - #endif - - if (updateMode != UpdateMode.FullUpdate) return; - #if SPINE_OPTIONAL_RENDEROVERRIDE bool doMeshOverride = generateMeshOverride != null; if ((!meshRenderer.enabled) && !doMeshOverride) return; @@ -405,11 +332,11 @@ namespace Spine.Unity { // STEP 1.9. Post-process workingInstructions. ================================================================================== #if SPINE_OPTIONAL_MATERIALOVERRIDE - if (customMaterialOverride.Count > 0) // isCustomMaterialOverridePopulated + if (customMaterialOverride.Count > 0) // isCustomMaterialOverridePopulated MeshGenerator.TryReplaceMaterials(workingSubmeshInstructions, customMaterialOverride); #endif - // STEP 2. Update vertex buffer based on verts from the attachments. =========================================================== + // STEP 2. Update vertex buffer based on verts from the attachments. =========================================================== meshGenerator.settings = new MeshGenerator.Settings { pmaVertexColors = this.pmaVertexColors, zSpacing = this.zSpacing, @@ -431,21 +358,21 @@ namespace Spine.Unity { MeshGenerator.GenerateSkeletonRendererInstruction(currentInstructions, skeleton, customSlotMaterials, separatorSlots, doMeshOverride, this.immutableTriangles); // STEP 1.9. Post-process workingInstructions. ================================================================================== -#if SPINE_OPTIONAL_MATERIALOVERRIDE - if (customMaterialOverride.Count > 0) // isCustomMaterialOverridePopulated + #if SPINE_OPTIONAL_MATERIALOVERRIDE + if (customMaterialOverride.Count > 0) // isCustomMaterialOverridePopulated MeshGenerator.TryReplaceMaterials(workingSubmeshInstructions, customMaterialOverride); -#endif + #endif -#if SPINE_OPTIONAL_RENDEROVERRIDE + #if SPINE_OPTIONAL_RENDEROVERRIDE if (doMeshOverride) { this.generateMeshOverride(currentInstructions); if (disableRenderingOnOverride) return; } -#endif + #endif updateTriangles = SkeletonRendererInstruction.GeometryNotEqual(currentInstructions, currentSmartMesh.instructionUsed); - // STEP 2. Update vertex buffer based on verts from the attachments. =========================================================== + // STEP 2. Update vertex buffer based on verts from the attachments. =========================================================== meshGenerator.settings = new MeshGenerator.Settings { pmaVertexColors = this.pmaVertexColors, zSpacing = this.zSpacing, @@ -469,16 +396,12 @@ namespace Spine.Unity { rendererBuffers.UpdateSharedMaterials(workingSubmeshInstructions); - bool materialsChanged = rendererBuffers.MaterialsChangedInLastUpdate(); if (updateTriangles) { // Check if the triangles should also be updated. meshGenerator.FillTriangles(currentMesh); meshRenderer.sharedMaterials = rendererBuffers.GetUpdatedSharedMaterialsArray(); - } else if (materialsChanged) { + } else if (rendererBuffers.MaterialsChangedInLastUpdate()) { meshRenderer.sharedMaterials = rendererBuffers.GetUpdatedSharedMaterialsArray(); } - if (materialsChanged && (this.maskMaterials.AnyMaterialCreated)) { - this.maskMaterials = new SpriteMaskInteractionMaterials(); - } meshGenerator.FillLateVertexData(currentMesh); @@ -491,26 +414,6 @@ namespace Spine.Unity { AssignSpriteMaskMaterials(); } #endif - - #if PER_MATERIAL_PROPERTY_BLOCKS - if (fixDrawOrder && meshRenderer.sharedMaterials.Length > 2) { - SetMaterialSettingsToFixDrawOrder(); - } - #endif - - if (OnMeshAndMaterialsUpdated != null) - OnMeshAndMaterialsUpdated(this); - } - - public void OnBecameVisible () { - UpdateMode previousUpdateMode = updateMode; - updateMode = UpdateMode.FullUpdate; - if (previousUpdateMode != UpdateMode.FullUpdate) - LateUpdate(); // OnBecameVisible is called after LateUpdate() - } - - public void OnBecameInvisible () { - updateMode = updateWhenInvisible; } public void FindAndApplySeparatorSlots (string startsWith, bool clearExistingSeparators = true, bool updateStringArray = false) { @@ -565,7 +468,7 @@ namespace Spine.Unity { separatorSlots.Add(slot); } #if UNITY_EDITOR - else if (!string.IsNullOrEmpty(separatorSlotNames[i])) + else { Debug.LogWarning(separatorSlotNames[i] + " is not a slot in " + skeletonDataAsset.skeletonJSON.name); } @@ -582,11 +485,6 @@ namespace Spine.Unity { } #endif - if (Application.isPlaying) { - if (maskInteraction != SpriteMaskInteraction.None && maskMaterials.materialsMaskDisabled.Length == 0) - maskMaterials.materialsMaskDisabled = meshRenderer.sharedMaterials; - } - if (maskMaterials.materialsMaskDisabled.Length > 0 && maskMaterials.materialsMaskDisabled[0] != null && maskInteraction == SpriteMaskInteraction.None) { this.meshRenderer.materials = maskMaterials.materialsMaskDisabled; @@ -602,7 +500,7 @@ namespace Spine.Unity { if (maskMaterials.materialsOutsideMask.Length == 0 || maskMaterials.materialsOutsideMask[0] == null) { if (!InitSpriteMaskMaterialsOutsideMask()) return; - } + } this.meshRenderer.materials = maskMaterials.materialsOutsideMask; } } @@ -674,38 +572,5 @@ namespace Spine.Unity { #endif // UNITY_EDITOR #endif //#if BUILT_IN_SPRITE_MASK_COMPONENT - - #if PER_MATERIAL_PROPERTY_BLOCKS - private MaterialPropertyBlock reusedPropertyBlock; - public static readonly int SUBMESH_DUMMY_PARAM_ID = Shader.PropertyToID("_Submesh"); - - /// - /// This method was introduced as a workaround for too aggressive submesh draw call batching, - /// leading to incorrect draw order when 3+ materials are used at submeshes in alternating order. - /// Otherwise, e.g. when using Lightweight Render Pipeline, deliberately separated draw calls - /// "A1 B A2" are reordered to "A1A2 B", regardless of batching-related project settings. - /// - private void SetMaterialSettingsToFixDrawOrder() { - if (reusedPropertyBlock == null) reusedPropertyBlock = new MaterialPropertyBlock(); - - bool hasPerRendererBlock = meshRenderer.HasPropertyBlock(); - if (hasPerRendererBlock) { - meshRenderer.GetPropertyBlock(reusedPropertyBlock); - } - - for (int i = 0; i < meshRenderer.sharedMaterials.Length; ++i) { - if (!meshRenderer.sharedMaterials[i]) - continue; - - if (!hasPerRendererBlock) meshRenderer.GetPropertyBlock(reusedPropertyBlock, i); - // Note: this parameter shall not exist at any shader, then Unity will create separate - // material instances (not in terms of memory cost or leakage). - reusedPropertyBlock.SetFloat(SUBMESH_DUMMY_PARAM_ID, i); - meshRenderer.SetPropertyBlock(reusedPropertyBlock, i); - - meshRenderer.sharedMaterials[i].enableInstancing = false; - } - } - #endif } } diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials/SkeletonGraphicCustomMaterials.cs b/Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials/SkeletonGraphicCustomMaterials.cs deleted file mode 100644 index afbb84b2c..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials/SkeletonGraphicCustomMaterials.cs +++ /dev/null @@ -1,211 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER -#define NEW_PREFAB_SYSTEM -#endif - -using System; -using System.Collections.Generic; -using UnityEngine; - -namespace Spine.Unity { - #if NEW_PREFAB_SYSTEM - [ExecuteAlways] - #else - [ExecuteInEditMode] - #endif - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonGraphicCustomMaterials")] - public class SkeletonGraphicCustomMaterials : MonoBehaviour { - - #region Inspector - public SkeletonGraphic skeletonGraphic; - [SerializeField] protected List customMaterialOverrides = new List(); - [SerializeField] protected List customTextureOverrides = new List(); - - #if UNITY_EDITOR - void Reset () { - skeletonGraphic = GetComponent(); - - // Populate material list - if (skeletonGraphic != null && skeletonGraphic.skeletonDataAsset != null) { - var atlasAssets = skeletonGraphic.skeletonDataAsset.atlasAssets; - - var initialAtlasMaterialOverrides = new List(); - foreach (AtlasAssetBase atlasAsset in atlasAssets) { - foreach (Material atlasMaterial in atlasAsset.Materials) { - var atlasMaterialOverride = new AtlasMaterialOverride { - overrideEnabled = false, - originalTexture = atlasMaterial.mainTexture - }; - - initialAtlasMaterialOverrides.Add(atlasMaterialOverride); - } - } - customMaterialOverrides = initialAtlasMaterialOverrides; - } - - // Populate texture list - if (skeletonGraphic != null && skeletonGraphic.skeletonDataAsset != null) { - var atlasAssets = skeletonGraphic.skeletonDataAsset.atlasAssets; - - var initialAtlasTextureOverrides = new List(); - foreach (AtlasAssetBase atlasAsset in atlasAssets) { - foreach (Material atlasMaterial in atlasAsset.Materials) { - var atlasTextureOverride = new AtlasTextureOverride { - overrideEnabled = false, - originalTexture = atlasMaterial.mainTexture - }; - - initialAtlasTextureOverrides.Add(atlasTextureOverride); - } - } - customTextureOverrides = initialAtlasTextureOverrides; - } - } - #endif - #endregion - - void SetCustomMaterialOverrides () { - if (skeletonGraphic == null) { - Debug.LogError("skeletonGraphic == null"); - return; - } - - for (int i = 0; i < customMaterialOverrides.Count; i++) { - AtlasMaterialOverride atlasMaterialOverride = customMaterialOverrides[i]; - if (atlasMaterialOverride.overrideEnabled) - skeletonGraphic.CustomMaterialOverride[atlasMaterialOverride.originalTexture] = atlasMaterialOverride.replacementMaterial; - } - } - - void RemoveCustomMaterialOverrides () { - if (skeletonGraphic == null) { - Debug.LogError("skeletonGraphic == null"); - return; - } - - for (int i = 0; i < customMaterialOverrides.Count; i++) { - AtlasMaterialOverride atlasMaterialOverride = customMaterialOverrides[i]; - Material currentMaterial; - - if (!skeletonGraphic.CustomMaterialOverride.TryGetValue(atlasMaterialOverride.originalTexture, out currentMaterial)) - continue; - - // Do not revert the material if it was changed by something else - if (currentMaterial != atlasMaterialOverride.replacementMaterial) - continue; - - skeletonGraphic.CustomMaterialOverride.Remove(atlasMaterialOverride.originalTexture); - } - } - - void SetCustomTextureOverrides () { - if (skeletonGraphic == null) { - Debug.LogError("skeletonGraphic == null"); - return; - } - - for (int i = 0; i < customTextureOverrides.Count; i++) { - AtlasTextureOverride atlasTextureOverride = customTextureOverrides[i]; - if (atlasTextureOverride.overrideEnabled) - skeletonGraphic.CustomTextureOverride[atlasTextureOverride.originalTexture] = atlasTextureOverride.replacementTexture; - } - } - - void RemoveCustomTextureOverrides () { - if (skeletonGraphic == null) { - Debug.LogError("skeletonGraphic == null"); - return; - } - - for (int i = 0; i < customTextureOverrides.Count; i++) { - AtlasTextureOverride atlasTextureOverride = customTextureOverrides[i]; - Texture currentTexture; - - if (!skeletonGraphic.CustomTextureOverride.TryGetValue(atlasTextureOverride.originalTexture, out currentTexture)) - continue; - - // Do not revert the material if it was changed by something else - if (currentTexture != atlasTextureOverride.replacementTexture) - continue; - - skeletonGraphic.CustomTextureOverride.Remove(atlasTextureOverride.originalTexture); - } - } - - // OnEnable applies the overrides at runtime, and when the editor loads. - void OnEnable () { - if (skeletonGraphic == null) - skeletonGraphic = GetComponent(); - - if (skeletonGraphic == null) { - Debug.LogError("skeletonGraphic == null"); - return; - } - - skeletonGraphic.Initialize(false); - SetCustomMaterialOverrides(); - SetCustomTextureOverrides(); - } - - // OnDisable removes the overrides at runtime, and in the editor when the component is disabled or destroyed. - void OnDisable () { - if (skeletonGraphic == null) { - Debug.LogError("skeletonGraphic == null"); - return; - } - - RemoveCustomMaterialOverrides(); - RemoveCustomTextureOverrides(); - } - - [Serializable] - public struct AtlasMaterialOverride : IEquatable { - public bool overrideEnabled; - public Texture originalTexture; - public Material replacementMaterial; - - public bool Equals (AtlasMaterialOverride other) { - return overrideEnabled == other.overrideEnabled && originalTexture == other.originalTexture && replacementMaterial == other.replacementMaterial; - } - } - - [Serializable] - public struct AtlasTextureOverride : IEquatable { - public bool overrideEnabled; - public Texture originalTexture; - public Texture replacementTexture; - - public bool Equals (AtlasTextureOverride other) { - return overrideEnabled == other.overrideEnabled && originalTexture == other.originalTexture && replacementTexture == other.replacementTexture; - } - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials/SkeletonGraphicCustomMaterials.cs.meta b/Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials/SkeletonGraphicCustomMaterials.cs.meta deleted file mode 100644 index 3f0170a1f..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials/SkeletonGraphicCustomMaterials.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 6c8717e10b272bf42b05d363ac2679a6 -timeCreated: 1588789074 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/ActivateBasedOnFlipDirection.cs b/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/ActivateBasedOnFlipDirection.cs deleted file mode 100644 index 4855fd089..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/ActivateBasedOnFlipDirection.cs +++ /dev/null @@ -1,92 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; - -namespace Spine.Unity { - - /// - /// Utility component to support flipping of 2D hinge chains (chains of HingeJoint2D objects) along - /// with the parent skeleton by activating the respective mirrored versions of the hinge chain. - /// Note: This component is automatically attached when calling "Create Hinge Chain 2D" at , - /// do not attempt to use this component for other purposes. - /// - public class ActivateBasedOnFlipDirection : MonoBehaviour { - - public SkeletonRenderer skeletonRenderer; - public SkeletonGraphic skeletonGraphic; - public GameObject activeOnNormalX; - public GameObject activeOnFlippedX; - HingeJoint2D[] jointsNormalX; - HingeJoint2D[] jointsFlippedX; - ISkeletonComponent skeletonComponent; - - bool wasFlippedXBefore = false; - - private void Start () { - jointsNormalX = activeOnNormalX.GetComponentsInChildren(); - jointsFlippedX = activeOnFlippedX.GetComponentsInChildren(); - skeletonComponent = skeletonRenderer != null ? (ISkeletonComponent)skeletonRenderer : (ISkeletonComponent)skeletonGraphic; - } - - private void FixedUpdate () { - bool isFlippedX = (skeletonComponent.Skeleton.ScaleX < 0); - if (isFlippedX != wasFlippedXBefore) { - HandleFlip(isFlippedX); - } - wasFlippedXBefore = isFlippedX; - } - - void HandleFlip (bool isFlippedX) { - GameObject gameObjectToActivate = isFlippedX ? activeOnFlippedX : activeOnNormalX; - GameObject gameObjectToDeactivate = isFlippedX ? activeOnNormalX : activeOnFlippedX; - - gameObjectToActivate.SetActive(true); - gameObjectToDeactivate.SetActive(false); - - ResetJointPositions(isFlippedX ? jointsFlippedX : jointsNormalX); - ResetJointPositions(isFlippedX ? jointsNormalX : jointsFlippedX); - CompensateMovementAfterFlipX(gameObjectToActivate.transform, gameObjectToDeactivate.transform); - } - - void ResetJointPositions (HingeJoint2D[] joints) { - for (int i = 0; i < joints.Length; ++i) { - var joint = joints[i]; - var parent = joint.connectedBody.transform; - joint.transform.position = parent.TransformPoint(joint.connectedAnchor); - } - } - - void CompensateMovementAfterFlipX (Transform toActivate, Transform toDeactivate) { - Transform targetLocation = toDeactivate.GetChild(0); - Transform currentLocation = toActivate.GetChild(0); - toActivate.position += targetLocation.position - currentLocation.position; - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/ActivateBasedOnFlipDirection.cs.meta b/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/ActivateBasedOnFlipDirection.cs.meta deleted file mode 100644 index 428af1bde..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/ActivateBasedOnFlipDirection.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 70ae96e4f2feb654681a2f16e4effeec -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowLocationRigidbody.cs b/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowLocationRigidbody.cs deleted file mode 100644 index f0ede08ee..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowLocationRigidbody.cs +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; - -namespace Spine.Unity { - - /// - /// Utility component to support flipping of hinge chains (chains of HingeJoint objects) along with the parent skeleton. - /// - /// Note: This component is automatically attached when calling "Create Hinge Chain" at . - /// - [RequireComponent(typeof(Rigidbody))] - public class FollowLocationRigidbody : MonoBehaviour { - - public Transform reference; - Rigidbody ownRigidbody; - - private void Awake () { - ownRigidbody = this.GetComponent(); - } - - void FixedUpdate () { - ownRigidbody.rotation = reference.rotation; - ownRigidbody.position = reference.position; - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowLocationRigidbody.cs.meta b/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowLocationRigidbody.cs.meta deleted file mode 100644 index 4354d36df..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowLocationRigidbody.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9fc20d5e917562341a5007777a9d0db2 -timeCreated: 1571763023 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowLocationRigidbody2D.cs b/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowLocationRigidbody2D.cs deleted file mode 100644 index 76c12b99d..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowLocationRigidbody2D.cs +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; - -namespace Spine.Unity { - - /// - /// Utility component to support flipping of hinge chains (chains of HingeJoint objects) along with the parent skeleton. - /// - /// Note: This component is automatically attached when calling "Create Hinge Chain" at . - /// - [RequireComponent(typeof(Rigidbody2D))] - public class FollowLocationRigidbody2D : MonoBehaviour { - - public Transform reference; - public bool followFlippedX; - Rigidbody2D ownRigidbody; - - private void Awake () { - ownRigidbody = this.GetComponent(); - } - - void FixedUpdate () { - if (followFlippedX) { - ownRigidbody.rotation = ((-reference.rotation.eulerAngles.z + 270f) % 360f) - 90f; - } - else - ownRigidbody.rotation = reference.rotation.eulerAngles.z; - ownRigidbody.position = reference.position; - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowLocationRigidbody2D.cs.meta b/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowLocationRigidbody2D.cs.meta deleted file mode 100644 index a62ccec60..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowLocationRigidbody2D.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 02aae87c39b869548a9051fbdb1975e6 -timeCreated: 1572012493 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowSkeletonUtilityRootRotation.cs b/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowSkeletonUtilityRootRotation.cs deleted file mode 100644 index a970ae98d..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowSkeletonUtilityRootRotation.cs +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; - -namespace Spine.Unity { - - /// - /// Utility component to support flipping of hinge chains (chains of HingeJoint objects) along with the parent skeleton. - /// Note that flipping needs to be performed by 180 degree rotation at , - /// by setting to true, not via negative scale. - /// - /// Note: This component is automatically attached when calling "Create Hinge Chain" at , - /// do not attempt to use this component for other purposes. - /// - public class FollowSkeletonUtilityRootRotation : MonoBehaviour { - - const float FLIP_ANGLE_THRESHOLD = 100.0f; - - public Transform reference; - Vector3 prevLocalEulerAngles; - - private void Start () { - prevLocalEulerAngles = this.transform.localEulerAngles; - } - - void FixedUpdate () { - this.transform.rotation = reference.rotation; - - bool wasFlippedAroundY = Mathf.Abs(this.transform.localEulerAngles.y - prevLocalEulerAngles.y) > FLIP_ANGLE_THRESHOLD; - bool wasFlippedAroundX = Mathf.Abs(this.transform.localEulerAngles.x - prevLocalEulerAngles.x) > FLIP_ANGLE_THRESHOLD; - if (wasFlippedAroundY) - CompensatePositionToYRotation(); - if (wasFlippedAroundX) - CompensatePositionToXRotation(); - - prevLocalEulerAngles = this.transform.localEulerAngles; - } - - /// - /// Compensates the position so that a child at the reference position remains in the same place, - /// to counter any movement that occurred by rotation. - /// - void CompensatePositionToYRotation () { - Vector3 newPosition = reference.position + (reference.position - this.transform.position); - newPosition.y = this.transform.position.y; - this.transform.position = newPosition; - } - - /// - /// Compensates the position so that a child at the reference position remains in the same place, - /// to counter any movement that occurred by rotation. - /// - void CompensatePositionToXRotation () { - Vector3 newPosition = reference.position + (reference.position - this.transform.position); - newPosition.x = this.transform.position.x; - this.transform.position = newPosition; - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowSkeletonUtilityRootRotation.cs.meta b/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowSkeletonUtilityRootRotation.cs.meta deleted file mode 100644 index 602924101..000000000 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/FollowSkeletonUtilityRootRotation.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 456a736ebb92ebf4b959fa9c4b704427 -timeCreated: 1571763206 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Deprecated.meta b/Assets/Spine/Runtime/spine-unity/Deprecated.meta deleted file mode 100644 index 099ea4ab9..000000000 --- a/Assets/Spine/Runtime/spine-unity/Deprecated.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 04817e31b917de6489f349dd332d7468 -folderAsset: yes -timeCreated: 1563295668 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/ISkeletonAnimation.cs b/Assets/Spine/Runtime/spine-unity/ISkeletonAnimation.cs index 90486e381..1b5254e94 100644 --- a/Assets/Spine/Runtime/spine-unity/ISkeletonAnimation.cs +++ b/Assets/Spine/Runtime/spine-unity/ISkeletonAnimation.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,28 +15,19 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ namespace Spine.Unity { - public enum UpdateMode { - Nothing = 0, - OnlyAnimationStatus, - OnlyEventTimelines = 4, // added as index 4 to keep scene behavior unchanged. - EverythingExceptMesh = 2, - FullUpdate, - //Reserved 4 for OnlyEventTimelines - }; - public delegate void UpdateBonesDelegate (ISkeletonAnimation animated); /// A Spine-Unity Component that animates a Skeleton but not necessarily with a Spine.AnimationState. @@ -52,7 +43,7 @@ namespace Spine.Unity { /// Gets the SkeletonDataAsset of the Spine Component. SkeletonDataAsset SkeletonDataAsset { get; } } - + /// A Spine-Unity Component that manages a Spine.Skeleton instance, instantiated from a SkeletonDataAsset. public interface ISkeletonComponent { /// Gets the SkeletonDataAsset of the Spine Component. diff --git a/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicDefaultOutline.mat b/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicDefaultOutline.mat deleted file mode 100644 index 7082bbf64..000000000 --- a/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicDefaultOutline.mat +++ /dev/null @@ -1,95 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: SkeletonGraphicDefaultOutline - m_Shader: {fileID: 4800000, guid: 8f5d14d2a7fedb84998c50eb96c8b748, type: 3} - m_ShaderKeywords: _USE8NEIGHBOURHOOD_ON - m_LightmapFlags: 5 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _AlphaTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - PixelSnap: 0 - - _BumpScale: 1 - - _ColorMask: 15 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _EnableExternalAlpha: 0 - - _Glossiness: 0.5 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _OutlineMipLevel: 0 - - _OutlineReferenceTexWidth: 1024 - - _OutlineSmoothness: 1 - - _OutlineWidth: 3 - - _Parallax: 0.02 - - _SrcBlend: 1 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - - _StraightAlphaInput: 0 - - _ThresholdEnd: 0.25 - - _UVSec: 0 - - _Use8Neighbourhood: 1 - - _UseUIAlphaClip: 0 - - _ZWrite: 1 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _Flip: {r: 1, g: 1, b: 1, a: 1} - - _OutlineColor: {r: 1, g: 1, b: 0, a: 1} - - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicTintBlackOutline.mat b/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicTintBlackOutline.mat deleted file mode 100644 index 30d42c7f6..000000000 --- a/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicTintBlackOutline.mat +++ /dev/null @@ -1,88 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: SkeletonGraphicTintBlackOutline - m_Shader: {fileID: 4800000, guid: d55d64dd09c46af40a319933a62fa1b2, type: 3} - m_ShaderKeywords: _USE8NEIGHBOURHOOD_ON - m_LightmapFlags: 5 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _BumpScale: 1 - - _ColorMask: 15 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _Glossiness: 0.5 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _OutlineMipLevel: 0 - - _OutlineReferenceTexWidth: 1024 - - _OutlineSmoothness: 1 - - _OutlineWidth: 3 - - _Parallax: 0.02 - - _SrcBlend: 1 - - _Stencil: 0 - - _StencilComp: 8 - - _StencilOp: 0 - - _StencilReadMask: 255 - - _StencilWriteMask: 255 - - _StraightAlphaInput: 0 - - _ThresholdEnd: 0.25 - - _UVSec: 0 - - _Use8Neighbourhood: 1 - - _UseUIAlphaClip: 0 - - _ZWrite: 1 - m_Colors: - - _Black: {r: 0, g: 0, b: 0, a: 0} - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _OutlineColor: {r: 1, g: 1, b: 0, a: 1} diff --git a/Assets/Spine/Runtime/spine-unity/Mesh Generation/DoubleBuffered.cs b/Assets/Spine/Runtime/spine-unity/Mesh Generation/DoubleBuffered.cs index 9b2c8d9ad..0a1e2fc4a 100644 --- a/Assets/Spine/Runtime/spine-unity/Mesh Generation/DoubleBuffered.cs +++ b/Assets/Spine/Runtime/spine-unity/Mesh Generation/DoubleBuffered.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ namespace Spine.Unity { diff --git a/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshGenerator.cs b/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshGenerator.cs deleted file mode 100644 index 6827dc771..000000000 --- a/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshGenerator.cs +++ /dev/null @@ -1,1387 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#if UNITY_2019_3_OR_NEWER -#define MESH_SET_TRIANGLES_PROVIDES_LENGTH_PARAM -#endif - -// Not for optimization. Do not disable. -#define SPINE_TRIANGLECHECK // Avoid calling SetTriangles at the cost of checking for mesh differences (vertex counts, memberwise attachment list compare) every frame. -//#define SPINE_DEBUG - -using UnityEngine; -using System; -using System.Collections.Generic; - -namespace Spine.Unity { - public delegate void MeshGeneratorDelegate (MeshGeneratorBuffers buffers); - public struct MeshGeneratorBuffers { - /// The vertex count that will actually be used for the mesh. The Lengths of the buffer arrays may be larger than this number. - public int vertexCount; - - /// Vertex positions. To be used for UnityEngine.Mesh.vertices. - public Vector3[] vertexBuffer; - - /// Vertex UVs. To be used for UnityEngine.Mesh.uvs. - public Vector2[] uvBuffer; - - /// Vertex colors. To be used for UnityEngine.Mesh.colors32. - public Color32[] colorBuffer; - - /// The Spine rendering component's MeshGenerator. - public MeshGenerator meshGenerator; - } - - /// Holds several methods to prepare and generate a UnityEngine mesh based on a skeleton. Contains buffers needed to perform the operation, and serializes settings for mesh generation. - [System.Serializable] - public class MeshGenerator { - public Settings settings = Settings.Default; - - [System.Serializable] - public struct Settings { - public bool useClipping; - [Space] - [Range(-0.1f, 0f)] public float zSpacing; - [Space] - [Header("Vertex Data")] - public bool pmaVertexColors; - public bool tintBlack; - [Tooltip("Enable when using Additive blend mode at SkeletonGraphic under a CanvasGroup. " + - "When enabled, Additive alpha value is stored at uv2.g instead of color.a to capture CanvasGroup modifying color.a.")] - public bool canvasGroupTintBlack; - public bool calculateTangents; - public bool addNormals; - public bool immutableTriangles; - - static public Settings Default { - get { - return new Settings { - pmaVertexColors = true, - zSpacing = 0f, - useClipping = true, - tintBlack = false, - calculateTangents = false, - //renderMeshes = true, - addNormals = false, - immutableTriangles = false - }; - } - } - } - - const float BoundsMinDefault = float.PositiveInfinity; - const float BoundsMaxDefault = float.NegativeInfinity; - - [NonSerialized] readonly ExposedList vertexBuffer = new ExposedList(4); - [NonSerialized] readonly ExposedList uvBuffer = new ExposedList(4); - [NonSerialized] readonly ExposedList colorBuffer = new ExposedList(4); - [NonSerialized] readonly ExposedList> submeshes = new ExposedList> { new ExposedList(6) }; // start with 1 submesh. - - [NonSerialized] Vector2 meshBoundsMin, meshBoundsMax; - [NonSerialized] float meshBoundsThickness; - [NonSerialized] int submeshIndex = 0; - - [NonSerialized] SkeletonClipping clipper = new SkeletonClipping(); - [NonSerialized] float[] tempVerts = new float[8]; - [NonSerialized] int[] regionTriangles = { 0, 1, 2, 2, 3, 0 }; - - #region Optional Buffers - // These optional buffers are lazy-instantiated when the feature is used. - [NonSerialized] Vector3[] normals; - [NonSerialized] Vector4[] tangents; - [NonSerialized] Vector2[] tempTanBuffer; - [NonSerialized] ExposedList uv2; - [NonSerialized] ExposedList uv3; - #endregion - - public int VertexCount { get { return vertexBuffer.Count; } } - - /// A set of mesh arrays whose values are modifiable by the user. Modify these values before they are passed to the UnityEngine mesh object in order to see the effect. - public MeshGeneratorBuffers Buffers { - get { - return new MeshGeneratorBuffers { - vertexCount = this.VertexCount, - vertexBuffer = this.vertexBuffer.Items, - uvBuffer = this.uvBuffer.Items, - colorBuffer = this.colorBuffer.Items, - meshGenerator = this - }; - } - } - - public MeshGenerator () { - submeshes.TrimExcess(); - } - - #region Step 1 : Generate Instructions - /// - /// A specialized variant of . - /// Generates renderer instructions using a single submesh, using only a single material and texture. - /// - /// The resulting instructions. - /// The skeleton to generate renderer instructions for. - /// Material to be set at the renderer instruction. When null, the last attachment - /// in the draw order list is assigned as the instruction's material. - public static void GenerateSingleSubmeshInstruction (SkeletonRendererInstruction instructionOutput, Skeleton skeleton, Material material) { - ExposedList drawOrder = skeleton.drawOrder; - int drawOrderCount = drawOrder.Count; - - // Clear last state of attachments and submeshes - instructionOutput.Clear(); // submeshInstructions.Clear(); attachments.Clear(); - var workingSubmeshInstructions = instructionOutput.submeshInstructions; - - #if SPINE_TRIANGLECHECK - instructionOutput.attachments.Resize(drawOrderCount); - var workingAttachmentsItems = instructionOutput.attachments.Items; - int totalRawVertexCount = 0; - #endif - - var current = new SubmeshInstruction { - skeleton = skeleton, - preActiveClippingSlotSource = -1, - startSlot = 0, - #if SPINE_TRIANGLECHECK - rawFirstVertexIndex = 0, - #endif - material = material, - forceSeparate = false, - endSlot = drawOrderCount - }; - - #if SPINE_TRIANGLECHECK - object rendererObject = null; - bool skeletonHasClipping = false; - var drawOrderItems = drawOrder.Items; - for (int i = 0; i < drawOrderCount; i++) { - Slot slot = drawOrderItems[i]; - if (!slot.bone.active) { - workingAttachmentsItems[i] = null; - continue; - } - Attachment attachment = slot.attachment; - - workingAttachmentsItems[i] = attachment; - int attachmentTriangleCount; - int attachmentVertexCount; - - var regionAttachment = attachment as RegionAttachment; - if (regionAttachment != null) { - rendererObject = regionAttachment.RendererObject; - attachmentVertexCount = 4; - attachmentTriangleCount = 6; - } else { - var meshAttachment = attachment as MeshAttachment; - if (meshAttachment != null) { - rendererObject = meshAttachment.RendererObject; - attachmentVertexCount = meshAttachment.worldVerticesLength >> 1; - attachmentTriangleCount = meshAttachment.triangles.Length; - } else { - var clippingAttachment = attachment as ClippingAttachment; - if (clippingAttachment != null) { - current.hasClipping = true; - skeletonHasClipping = true; - } - attachmentVertexCount = 0; - attachmentTriangleCount = 0; - } - } - current.rawTriangleCount += attachmentTriangleCount; - current.rawVertexCount += attachmentVertexCount; - totalRawVertexCount += attachmentVertexCount; - } - - #if !SPINE_TK2D - if (material == null && rendererObject != null) - current.material = (Material)((AtlasRegion)rendererObject).page.rendererObject; - #else - if (material == null && rendererObject != null) - current.material = (rendererObject is Material) ? (Material)rendererObject : (Material)((AtlasRegion)rendererObject).page.rendererObject; - #endif - - instructionOutput.hasActiveClipping = skeletonHasClipping; - instructionOutput.rawVertexCount = totalRawVertexCount; - #endif - - if (totalRawVertexCount > 0) { - workingSubmeshInstructions.Resize(1); - workingSubmeshInstructions.Items[0] = current; - } - else { - workingSubmeshInstructions.Resize(0); - } - } - - public static bool RequiresMultipleSubmeshesByDrawOrder (Skeleton skeleton) { - - #if SPINE_TK2D - return false; - #endif - ExposedList drawOrder = skeleton.drawOrder; - int drawOrderCount = drawOrder.Count; - var drawOrderItems = drawOrder.Items; - - Material lastRendererMaterial = null; - for (int i = 0; i < drawOrderCount; i++) { - Slot slot = drawOrderItems[i]; - if (!slot.bone.active) continue; - Attachment attachment = slot.attachment; - var rendererAttachment = attachment as IHasRendererObject; - if (rendererAttachment != null) { - AtlasRegion atlasRegion = (AtlasRegion)rendererAttachment.RendererObject; - Material material = (Material)atlasRegion.page.rendererObject; - if (lastRendererMaterial != material) { - if (lastRendererMaterial != null) - return true; - else - lastRendererMaterial = material; - } - } - } - return false; - } - - public static void GenerateSkeletonRendererInstruction (SkeletonRendererInstruction instructionOutput, Skeleton skeleton, Dictionary customSlotMaterials, List separatorSlots, bool generateMeshOverride, bool immutableTriangles = false) { - // if (skeleton == null) throw new ArgumentNullException("skeleton"); - // if (instructionOutput == null) throw new ArgumentNullException("instructionOutput"); - - ExposedList drawOrder = skeleton.drawOrder; - int drawOrderCount = drawOrder.Count; - - // Clear last state of attachments and submeshes - instructionOutput.Clear(); // submeshInstructions.Clear(); attachments.Clear(); - var workingSubmeshInstructions = instructionOutput.submeshInstructions; - #if SPINE_TRIANGLECHECK - instructionOutput.attachments.Resize(drawOrderCount); - var workingAttachmentsItems = instructionOutput.attachments.Items; - int totalRawVertexCount = 0; - bool skeletonHasClipping = false; - #endif - - var current = new SubmeshInstruction { - skeleton = skeleton, - preActiveClippingSlotSource = -1 - }; - - #if !SPINE_TK2D - bool isCustomSlotMaterialsPopulated = customSlotMaterials != null && customSlotMaterials.Count > 0; - #endif - - int separatorCount = separatorSlots == null ? 0 : separatorSlots.Count; - bool hasSeparators = separatorCount > 0; - - int clippingAttachmentSource = -1; - int lastPreActiveClipping = -1; // The index of the last slot that had an active ClippingAttachment. - SlotData clippingEndSlot = null; - int submeshIndex = 0; - var drawOrderItems = drawOrder.Items; - for (int i = 0; i < drawOrderCount; i++) { - Slot slot = drawOrderItems[i]; - if (!slot.bone.active) { - workingAttachmentsItems[i] = null; - continue; - } - Attachment attachment = slot.attachment; - #if SPINE_TRIANGLECHECK - workingAttachmentsItems[i] = attachment; - int attachmentVertexCount = 0, attachmentTriangleCount = 0; - #endif - - object rendererObject = null; // An AtlasRegion in plain Spine-Unity. Spine-TK2D hooks into TK2D's system. eventual source of Material object. - bool noRender = false; // Using this allows empty slots as separators, and keeps separated parts more stable despite slots being reordered - - var regionAttachment = attachment as RegionAttachment; - if (regionAttachment != null) { - rendererObject = regionAttachment.RendererObject; - #if SPINE_TRIANGLECHECK - attachmentVertexCount = 4; - attachmentTriangleCount = 6; - #endif - } else { - var meshAttachment = attachment as MeshAttachment; - if (meshAttachment != null) { - rendererObject = meshAttachment.RendererObject; - #if SPINE_TRIANGLECHECK - attachmentVertexCount = meshAttachment.worldVerticesLength >> 1; - attachmentTriangleCount = meshAttachment.triangles.Length; - #endif - } else { - #if SPINE_TRIANGLECHECK - var clippingAttachment = attachment as ClippingAttachment; - if (clippingAttachment != null) { - clippingEndSlot = clippingAttachment.endSlot; - clippingAttachmentSource = i; - current.hasClipping = true; - skeletonHasClipping = true; - } - #endif - noRender = true; - } - } - - // Create a new SubmeshInstruction when material changes. (or when forced to separate by a submeshSeparator) - // Slot with a separator/new material will become the starting slot of the next new instruction. - if (hasSeparators) { //current.forceSeparate = hasSeparators && separatorSlots.Contains(slot); - current.forceSeparate = false; - for (int s = 0; s < separatorCount; s++) { - if (Slot.ReferenceEquals(slot, separatorSlots[s])) { - current.forceSeparate = true; - break; - } - } - } - - if (noRender) { - if (current.forceSeparate && generateMeshOverride) { // && current.rawVertexCount > 0) { - { // Add - current.endSlot = i; - current.preActiveClippingSlotSource = lastPreActiveClipping; - - workingSubmeshInstructions.Resize(submeshIndex + 1); - workingSubmeshInstructions.Items[submeshIndex] = current; - - submeshIndex++; - } - - current.startSlot = i; - lastPreActiveClipping = clippingAttachmentSource; - #if SPINE_TRIANGLECHECK - current.rawTriangleCount = 0; - current.rawVertexCount = 0; - current.rawFirstVertexIndex = totalRawVertexCount; - current.hasClipping = clippingAttachmentSource >= 0; - #endif - } - } else { - #if !SPINE_TK2D - Material material; - if (isCustomSlotMaterialsPopulated) { - if (!customSlotMaterials.TryGetValue(slot, out material)) - material = (Material)((AtlasRegion)rendererObject).page.rendererObject; - } else { - material = (Material)((AtlasRegion)rendererObject).page.rendererObject; - } - #else - Material material = (rendererObject is Material) ? (Material)rendererObject : (Material)((AtlasRegion)rendererObject).page.rendererObject; - #endif - - if (current.forceSeparate || (current.rawVertexCount > 0 && !System.Object.ReferenceEquals(current.material, material))) { // Material changed. Add the previous submesh. - { // Add - current.endSlot = i; - current.preActiveClippingSlotSource = lastPreActiveClipping; - - workingSubmeshInstructions.Resize(submeshIndex + 1); - workingSubmeshInstructions.Items[submeshIndex] = current; - submeshIndex++; - } - current.startSlot = i; - lastPreActiveClipping = clippingAttachmentSource; - #if SPINE_TRIANGLECHECK - current.rawTriangleCount = 0; - current.rawVertexCount = 0; - current.rawFirstVertexIndex = totalRawVertexCount; - current.hasClipping = clippingAttachmentSource >= 0; - #endif - } - - // Update state for the next Attachment. - current.material = material; - #if SPINE_TRIANGLECHECK - current.rawTriangleCount += attachmentTriangleCount; - current.rawVertexCount += attachmentVertexCount; - current.rawFirstVertexIndex = totalRawVertexCount; - totalRawVertexCount += attachmentVertexCount; - #endif - } - - if (clippingEndSlot != null && slot.data == clippingEndSlot && i != clippingAttachmentSource) { - clippingEndSlot = null; - clippingAttachmentSource = -1; - } - } - - if (current.rawVertexCount > 0) { - { // Add last or only submesh. - current.endSlot = drawOrderCount; - current.preActiveClippingSlotSource = lastPreActiveClipping; - current.forceSeparate = false; - - workingSubmeshInstructions.Resize(submeshIndex + 1); - workingSubmeshInstructions.Items[submeshIndex] = current; - //submeshIndex++; - } - } - - #if SPINE_TRIANGLECHECK - instructionOutput.hasActiveClipping = skeletonHasClipping; - instructionOutput.rawVertexCount = totalRawVertexCount; - #endif - instructionOutput.immutableTriangles = immutableTriangles; - } - - public static void TryReplaceMaterials (ExposedList workingSubmeshInstructions, Dictionary customMaterialOverride) { - // Material overrides are done here so they can be applied per submesh instead of per slot - // but they will still be passed through the GenerateMeshOverride delegate, - // and will still go through the normal material match check step in STEP 3. - var wsii = workingSubmeshInstructions.Items; - for (int i = 0; i < workingSubmeshInstructions.Count; i++) { - var m = wsii[i].material; - Material mo; - if (customMaterialOverride.TryGetValue(m, out mo)) - wsii[i].material = mo; - } - } - #endregion - - #region Step 2 : Populate vertex data and triangle index buffers. - public void Begin () { - vertexBuffer.Clear(false); - colorBuffer.Clear(false); - uvBuffer.Clear(false); - clipper.ClipEnd(); - - { - meshBoundsMin.x = BoundsMinDefault; - meshBoundsMin.y = BoundsMinDefault; - meshBoundsMax.x = BoundsMaxDefault; - meshBoundsMax.y = BoundsMaxDefault; - meshBoundsThickness = 0f; - } - - submeshIndex = 0; - submeshes.Count = 1; - //submeshes.Items[0].Clear(false); - } - - public void AddSubmesh (SubmeshInstruction instruction, bool updateTriangles = true) { - var settings = this.settings; - - int newSubmeshCount = submeshIndex + 1; - if (submeshes.Items.Length < newSubmeshCount) - submeshes.Resize(newSubmeshCount); - submeshes.Count = newSubmeshCount; - var submesh = submeshes.Items[submeshIndex]; - if (submesh == null) - submeshes.Items[submeshIndex] = submesh = new ExposedList(); - submesh.Clear(false); - - var skeleton = instruction.skeleton; - var drawOrderItems = skeleton.drawOrder.Items; - - Color32 color = default(Color32); - float skeletonA = skeleton.a, skeletonR = skeleton.r, skeletonG = skeleton.g, skeletonB = skeleton.b; - Vector2 meshBoundsMin = this.meshBoundsMin, meshBoundsMax = this.meshBoundsMax; - - // Settings - float zSpacing = settings.zSpacing; - bool pmaVertexColors = settings.pmaVertexColors; - bool tintBlack = settings.tintBlack; - #if SPINE_TRIANGLECHECK - bool useClipping = settings.useClipping && instruction.hasClipping; - #else - bool useClipping = settings.useClipping; - #endif - bool canvasGroupTintBlack = settings.tintBlack && settings.canvasGroupTintBlack; - - if (useClipping) { - if (instruction.preActiveClippingSlotSource >= 0) { - var slot = drawOrderItems[instruction.preActiveClippingSlotSource]; - clipper.ClipStart(slot, slot.attachment as ClippingAttachment); - } - } - - for (int slotIndex = instruction.startSlot; slotIndex < instruction.endSlot; slotIndex++) { - var slot = drawOrderItems[slotIndex]; - if (!slot.bone.active) { - clipper.ClipEnd(slot); - continue; - } - var attachment = slot.attachment; - float z = zSpacing * slotIndex; - - var workingVerts = this.tempVerts; - float[] uvs; - int[] attachmentTriangleIndices; - int attachmentVertexCount; - int attachmentIndexCount; - - Color c = default(Color); - - // Identify and prepare values. - var region = attachment as RegionAttachment; - if (region != null) { - region.ComputeWorldVertices(slot.bone, workingVerts, 0); - uvs = region.uvs; - attachmentTriangleIndices = regionTriangles; - c.r = region.r; c.g = region.g; c.b = region.b; c.a = region.a; - attachmentVertexCount = 4; - attachmentIndexCount = 6; - } else { - var mesh = attachment as MeshAttachment; - if (mesh != null) { - int meshVerticesLength = mesh.worldVerticesLength; - if (workingVerts.Length < meshVerticesLength) { - workingVerts = new float[meshVerticesLength]; - this.tempVerts = workingVerts; - } - mesh.ComputeWorldVertices(slot, 0, meshVerticesLength, workingVerts, 0); //meshAttachment.ComputeWorldVertices(slot, tempVerts); - uvs = mesh.uvs; - attachmentTriangleIndices = mesh.triangles; - c.r = mesh.r; c.g = mesh.g; c.b = mesh.b; c.a = mesh.a; - attachmentVertexCount = meshVerticesLength >> 1; // meshVertexCount / 2; - attachmentIndexCount = mesh.triangles.Length; - } else { - if (useClipping) { - var clippingAttachment = attachment as ClippingAttachment; - if (clippingAttachment != null) { - clipper.ClipStart(slot, clippingAttachment); - continue; - } - } - - // If not any renderable attachment. - clipper.ClipEnd(slot); - continue; - } - } - - float tintBlackAlpha = 1.0f; - if (pmaVertexColors) { - color.a = (byte)(skeletonA * slot.a * c.a * 255); - color.r = (byte)(skeletonR * slot.r * c.r * color.a); - color.g = (byte)(skeletonG * slot.g * c.g * color.a); - color.b = (byte)(skeletonB * slot.b * c.b * color.a); - if (slot.data.blendMode == BlendMode.Additive) { - if (canvasGroupTintBlack) - tintBlackAlpha = 0; - else - color.a = 0; - } - } else { - color.a = (byte)(skeletonA * slot.a * c.a * 255); - color.r = (byte)(skeletonR * slot.r * c.r * 255); - color.g = (byte)(skeletonG * slot.g * c.g * 255); - color.b = (byte)(skeletonB * slot.b * c.b * 255); - } - - if (useClipping && clipper.IsClipping) { - clipper.ClipTriangles(workingVerts, attachmentVertexCount << 1, attachmentTriangleIndices, attachmentIndexCount, uvs); - workingVerts = clipper.clippedVertices.Items; - attachmentVertexCount = clipper.clippedVertices.Count >> 1; - attachmentTriangleIndices = clipper.clippedTriangles.Items; - attachmentIndexCount = clipper.clippedTriangles.Count; - uvs = clipper.clippedUVs.Items; - } - - // Actually add slot/attachment data into buffers. - if (attachmentVertexCount != 0 && attachmentIndexCount != 0) { - if (tintBlack) { - float r2 = slot.r2; - float g2 = slot.g2; - float b2 = slot.b2; - if (pmaVertexColors) { - float alpha = skeletonA * slot.a * c.a; - r2 *= alpha; - g2 *= alpha; - b2 *= alpha; - } - AddAttachmentTintBlack(r2, g2, b2, tintBlackAlpha, attachmentVertexCount); - } - - //AddAttachment(workingVerts, uvs, color, attachmentTriangleIndices, attachmentVertexCount, attachmentIndexCount, ref meshBoundsMin, ref meshBoundsMax, z); - int ovc = vertexBuffer.Count; - // Add data to vertex buffers - { - int newVertexCount = ovc + attachmentVertexCount; - int oldArraySize = vertexBuffer.Items.Length; - if (newVertexCount > oldArraySize) { - int newArraySize = (int)(oldArraySize * 1.3f); - if (newArraySize < newVertexCount) newArraySize = newVertexCount; - Array.Resize(ref vertexBuffer.Items, newArraySize); - Array.Resize(ref uvBuffer.Items, newArraySize); - Array.Resize(ref colorBuffer.Items, newArraySize); - } - vertexBuffer.Count = uvBuffer.Count = colorBuffer.Count = newVertexCount; - } - - var vbi = vertexBuffer.Items; - var ubi = uvBuffer.Items; - var cbi = colorBuffer.Items; - if (ovc == 0) { - for (int i = 0; i < attachmentVertexCount; i++) { - int vi = ovc + i; - int i2 = i << 1; // i * 2 - float x = workingVerts[i2]; - float y = workingVerts[i2 + 1]; - - vbi[vi].x = x; - vbi[vi].y = y; - vbi[vi].z = z; - ubi[vi].x = uvs[i2]; - ubi[vi].y = uvs[i2 + 1]; - cbi[vi] = color; - - // Calculate bounds. - if (x < meshBoundsMin.x) meshBoundsMin.x = x; - if (x > meshBoundsMax.x) meshBoundsMax.x = x; - if (y < meshBoundsMin.y) meshBoundsMin.y = y; - if (y > meshBoundsMax.y) meshBoundsMax.y = y; - } - } else { - for (int i = 0; i < attachmentVertexCount; i++) { - int vi = ovc + i; - int i2 = i << 1; // i * 2 - float x = workingVerts[i2]; - float y = workingVerts[i2 + 1]; - - vbi[vi].x = x; - vbi[vi].y = y; - vbi[vi].z = z; - ubi[vi].x = uvs[i2]; - ubi[vi].y = uvs[i2 + 1]; - cbi[vi] = color; - - // Calculate bounds. - if (x < meshBoundsMin.x) meshBoundsMin.x = x; - else if (x > meshBoundsMax.x) meshBoundsMax.x = x; - if (y < meshBoundsMin.y) meshBoundsMin.y = y; - else if (y > meshBoundsMax.y) meshBoundsMax.y = y; - } - } - - - // Add data to triangle buffer - if (updateTriangles) { - int oldTriangleCount = submesh.Count; - { //submesh.Resize(oldTriangleCount + attachmentIndexCount); - int newTriangleCount = oldTriangleCount + attachmentIndexCount; - if (newTriangleCount > submesh.Items.Length) Array.Resize(ref submesh.Items, newTriangleCount); - submesh.Count = newTriangleCount; - } - var submeshItems = submesh.Items; - for (int i = 0; i < attachmentIndexCount; i++) - submeshItems[oldTriangleCount + i] = attachmentTriangleIndices[i] + ovc; - } - } - - clipper.ClipEnd(slot); - } - clipper.ClipEnd(); - - this.meshBoundsMin = meshBoundsMin; - this.meshBoundsMax = meshBoundsMax; - meshBoundsThickness = instruction.endSlot * zSpacing; - - // Trim or zero submesh triangles. - var currentSubmeshItems = submesh.Items; - for (int i = submesh.Count, n = currentSubmeshItems.Length; i < n; i++) - currentSubmeshItems[i] = 0; - - submeshIndex++; // Next AddSubmesh will use a new submeshIndex value. - } - - public void BuildMesh (SkeletonRendererInstruction instruction, bool updateTriangles) { - var wsii = instruction.submeshInstructions.Items; - for (int i = 0, n = instruction.submeshInstructions.Count; i < n; i++) - this.AddSubmesh(wsii[i], updateTriangles); - } - - // Use this faster method when no clipping is involved. - public void BuildMeshWithArrays (SkeletonRendererInstruction instruction, bool updateTriangles) { - var settings = this.settings; - bool canvasGroupTintBlack = settings.tintBlack && settings.canvasGroupTintBlack; - int totalVertexCount = instruction.rawVertexCount; - - // Add data to vertex buffers - { - if (totalVertexCount > vertexBuffer.Items.Length) { // Manual ExposedList.Resize() - Array.Resize(ref vertexBuffer.Items, totalVertexCount); - Array.Resize(ref uvBuffer.Items, totalVertexCount); - Array.Resize(ref colorBuffer.Items, totalVertexCount); - } - vertexBuffer.Count = uvBuffer.Count = colorBuffer.Count = totalVertexCount; - } - - // Populate Verts - Color32 color = default(Color32); - - int vertexIndex = 0; - var tempVerts = this.tempVerts; - Vector2 bmin = this.meshBoundsMin; - Vector2 bmax = this.meshBoundsMax; - - var vbi = vertexBuffer.Items; - var ubi = uvBuffer.Items; - var cbi = colorBuffer.Items; - int lastSlotIndex = 0; - - // drawOrder[endSlot] is excluded - for (int si = 0, n = instruction.submeshInstructions.Count; si < n; si++) { - var submesh = instruction.submeshInstructions.Items[si]; - var skeleton = submesh.skeleton; - var drawOrderItems = skeleton.drawOrder.Items; - float a = skeleton.a, r = skeleton.r, g = skeleton.g, b = skeleton.b; - - int endSlot = submesh.endSlot; - int startSlot = submesh.startSlot; - lastSlotIndex = endSlot; - - if (settings.tintBlack) { - Vector2 rg, b2; - int vi = vertexIndex; - b2.y = 1f; - - { - if (uv2 == null) { - uv2 = new ExposedList(); - uv3 = new ExposedList(); - } - if (totalVertexCount > uv2.Items.Length) { // Manual ExposedList.Resize() - Array.Resize(ref uv2.Items, totalVertexCount); - Array.Resize(ref uv3.Items, totalVertexCount); - } - uv2.Count = uv3.Count = totalVertexCount; - } - - var uv2i = uv2.Items; - var uv3i = uv3.Items; - - for (int slotIndex = startSlot; slotIndex < endSlot; slotIndex++) { - var slot = drawOrderItems[slotIndex]; - if (!slot.bone.active) continue; - var attachment = slot.attachment; - - rg.x = slot.r2; //r - rg.y = slot.g2; //g - b2.x = slot.b2; //b - b2.y = 1.0f; - - var regionAttachment = attachment as RegionAttachment; - if (regionAttachment != null) { - if (settings.pmaVertexColors) { - float alpha = a * slot.a * regionAttachment.a; - rg.x *= alpha; - rg.y *= alpha; - b2.x *= alpha; - b2.y = slot.data.blendMode == BlendMode.Additive ? 0 : alpha; - } - uv2i[vi] = rg; uv2i[vi + 1] = rg; uv2i[vi + 2] = rg; uv2i[vi + 3] = rg; - uv3i[vi] = b2; uv3i[vi + 1] = b2; uv3i[vi + 2] = b2; uv3i[vi + 3] = b2; - vi += 4; - } else { //} if (settings.renderMeshes) { - var meshAttachment = attachment as MeshAttachment; - if (meshAttachment != null) { - if (settings.pmaVertexColors) { - float alpha = a * slot.a * meshAttachment.a; - rg.x *= alpha; - rg.y *= alpha; - b2.x *= alpha; - b2.y = slot.data.blendMode == BlendMode.Additive ? 0 : alpha; - } - int meshVertexCount = meshAttachment.worldVerticesLength; - for (int iii = 0; iii < meshVertexCount; iii += 2) { - uv2i[vi] = rg; - uv3i[vi] = b2; - vi++; - } - } - } - } - } - - for (int slotIndex = startSlot; slotIndex < endSlot; slotIndex++) { - var slot = drawOrderItems[slotIndex]; - if (!slot.bone.active) continue; - var attachment = slot.attachment; - float z = slotIndex * settings.zSpacing; - - var regionAttachment = attachment as RegionAttachment; - if (regionAttachment != null) { - regionAttachment.ComputeWorldVertices(slot.bone, tempVerts, 0); - - float x1 = tempVerts[RegionAttachment.BLX], y1 = tempVerts[RegionAttachment.BLY]; - float x2 = tempVerts[RegionAttachment.ULX], y2 = tempVerts[RegionAttachment.ULY]; - float x3 = tempVerts[RegionAttachment.URX], y3 = tempVerts[RegionAttachment.URY]; - float x4 = tempVerts[RegionAttachment.BRX], y4 = tempVerts[RegionAttachment.BRY]; - vbi[vertexIndex].x = x1; vbi[vertexIndex].y = y1; vbi[vertexIndex].z = z; - vbi[vertexIndex + 1].x = x4; vbi[vertexIndex + 1].y = y4; vbi[vertexIndex + 1].z = z; - vbi[vertexIndex + 2].x = x2; vbi[vertexIndex + 2].y = y2; vbi[vertexIndex + 2].z = z; - vbi[vertexIndex + 3].x = x3; vbi[vertexIndex + 3].y = y3; vbi[vertexIndex + 3].z = z; - - if (settings.pmaVertexColors) { - color.a = (byte)(a * slot.a * regionAttachment.a * 255); - color.r = (byte)(r * slot.r * regionAttachment.r * color.a); - color.g = (byte)(g * slot.g * regionAttachment.g * color.a); - color.b = (byte)(b * slot.b * regionAttachment.b * color.a); - if (slot.data.blendMode == BlendMode.Additive && !canvasGroupTintBlack) color.a = 0; - } else { - color.a = (byte)(a * slot.a * regionAttachment.a * 255); - color.r = (byte)(r * slot.r * regionAttachment.r * 255); - color.g = (byte)(g * slot.g * regionAttachment.g * 255); - color.b = (byte)(b * slot.b * regionAttachment.b * 255); - } - - cbi[vertexIndex] = color; cbi[vertexIndex + 1] = color; cbi[vertexIndex + 2] = color; cbi[vertexIndex + 3] = color; - - float[] regionUVs = regionAttachment.uvs; - ubi[vertexIndex].x = regionUVs[RegionAttachment.BLX]; ubi[vertexIndex].y = regionUVs[RegionAttachment.BLY]; - ubi[vertexIndex + 1].x = regionUVs[RegionAttachment.BRX]; ubi[vertexIndex + 1].y = regionUVs[RegionAttachment.BRY]; - ubi[vertexIndex + 2].x = regionUVs[RegionAttachment.ULX]; ubi[vertexIndex + 2].y = regionUVs[RegionAttachment.ULY]; - ubi[vertexIndex + 3].x = regionUVs[RegionAttachment.URX]; ubi[vertexIndex + 3].y = regionUVs[RegionAttachment.URY]; - - if (x1 < bmin.x) bmin.x = x1; // Potential first attachment bounds initialization. Initial min should not block initial max. Same for Y below. - if (x1 > bmax.x) bmax.x = x1; - if (x2 < bmin.x) bmin.x = x2; - else if (x2 > bmax.x) bmax.x = x2; - if (x3 < bmin.x) bmin.x = x3; - else if (x3 > bmax.x) bmax.x = x3; - if (x4 < bmin.x) bmin.x = x4; - else if (x4 > bmax.x) bmax.x = x4; - - if (y1 < bmin.y) bmin.y = y1; - if (y1 > bmax.y) bmax.y = y1; - if (y2 < bmin.y) bmin.y = y2; - else if (y2 > bmax.y) bmax.y = y2; - if (y3 < bmin.y) bmin.y = y3; - else if (y3 > bmax.y) bmax.y = y3; - if (y4 < bmin.y) bmin.y = y4; - else if (y4 > bmax.y) bmax.y = y4; - - vertexIndex += 4; - } else { //if (settings.renderMeshes) { - var meshAttachment = attachment as MeshAttachment; - if (meshAttachment != null) { - int meshVertexCount = meshAttachment.worldVerticesLength; - if (tempVerts.Length < meshVertexCount) this.tempVerts = tempVerts = new float[meshVertexCount]; - meshAttachment.ComputeWorldVertices(slot, tempVerts); - - if (settings.pmaVertexColors) { - color.a = (byte)(a * slot.a * meshAttachment.a * 255); - color.r = (byte)(r * slot.r * meshAttachment.r * color.a); - color.g = (byte)(g * slot.g * meshAttachment.g * color.a); - color.b = (byte)(b * slot.b * meshAttachment.b * color.a); - if (slot.data.blendMode == BlendMode.Additive && !canvasGroupTintBlack) color.a = 0; - } else { - color.a = (byte)(a * slot.a * meshAttachment.a * 255); - color.r = (byte)(r * slot.r * meshAttachment.r * 255); - color.g = (byte)(g * slot.g * meshAttachment.g * 255); - color.b = (byte)(b * slot.b * meshAttachment.b * 255); - } - - float[] attachmentUVs = meshAttachment.uvs; - - // Potential first attachment bounds initialization. See conditions in RegionAttachment logic. - if (vertexIndex == 0) { - // Initial min should not block initial max. - // vi == vertexIndex does not always mean the bounds are fresh. It could be a submesh. Do not nuke old values by omitting the check. - // Should know that this is the first attachment in the submesh. slotIndex == startSlot could be an empty slot. - float fx = tempVerts[0], fy = tempVerts[1]; - if (fx < bmin.x) bmin.x = fx; - if (fx > bmax.x) bmax.x = fx; - if (fy < bmin.y) bmin.y = fy; - if (fy > bmax.y) bmax.y = fy; - } - - for (int iii = 0; iii < meshVertexCount; iii += 2) { - float x = tempVerts[iii], y = tempVerts[iii + 1]; - vbi[vertexIndex].x = x; vbi[vertexIndex].y = y; vbi[vertexIndex].z = z; - cbi[vertexIndex] = color; ubi[vertexIndex].x = attachmentUVs[iii]; ubi[vertexIndex].y = attachmentUVs[iii + 1]; - - if (x < bmin.x) bmin.x = x; - else if (x > bmax.x) bmax.x = x; - - if (y < bmin.y) bmin.y = y; - else if (y > bmax.y) bmax.y = y; - - vertexIndex++; - } - } - } - } - } - - this.meshBoundsMin = bmin; - this.meshBoundsMax = bmax; - this.meshBoundsThickness = lastSlotIndex * settings.zSpacing; - - int submeshInstructionCount = instruction.submeshInstructions.Count; - submeshes.Count = submeshInstructionCount; - - // Add triangles - if (updateTriangles) { - // Match submesh buffers count with submeshInstruction count. - if (this.submeshes.Items.Length < submeshInstructionCount) { - this.submeshes.Resize(submeshInstructionCount); - for (int i = 0, n = submeshInstructionCount; i < n; i++) { - var submeshBuffer = this.submeshes.Items[i]; - if (submeshBuffer == null) - this.submeshes.Items[i] = new ExposedList(); - else - submeshBuffer.Clear(false); - } - } - - var submeshInstructionsItems = instruction.submeshInstructions.Items; // This relies on the resize above. - - // Fill the buffers. - int attachmentFirstVertex = 0; - for (int smbi = 0; smbi < submeshInstructionCount; smbi++) { - var submeshInstruction = submeshInstructionsItems[smbi]; - var currentSubmeshBuffer = this.submeshes.Items[smbi]; - { //submesh.Resize(submesh.rawTriangleCount); - int newTriangleCount = submeshInstruction.rawTriangleCount; - if (newTriangleCount > currentSubmeshBuffer.Items.Length) - Array.Resize(ref currentSubmeshBuffer.Items, newTriangleCount); - else if (newTriangleCount < currentSubmeshBuffer.Items.Length) { - // Zero the extra. - var sbi = currentSubmeshBuffer.Items; - for (int ei = newTriangleCount, nn = sbi.Length; ei < nn; ei++) - sbi[ei] = 0; - } - currentSubmeshBuffer.Count = newTriangleCount; - } - - var tris = currentSubmeshBuffer.Items; - int triangleIndex = 0; - var skeleton = submeshInstruction.skeleton; - var drawOrderItems = skeleton.drawOrder.Items; - for (int slotIndex = submeshInstruction.startSlot, endSlot = submeshInstruction.endSlot; slotIndex < endSlot; slotIndex++) { - var slot = drawOrderItems[slotIndex]; - if (!slot.bone.active) continue; - - var attachment = drawOrderItems[slotIndex].attachment; - if (attachment is RegionAttachment) { - tris[triangleIndex] = attachmentFirstVertex; - tris[triangleIndex + 1] = attachmentFirstVertex + 2; - tris[triangleIndex + 2] = attachmentFirstVertex + 1; - tris[triangleIndex + 3] = attachmentFirstVertex + 2; - tris[triangleIndex + 4] = attachmentFirstVertex + 3; - tris[triangleIndex + 5] = attachmentFirstVertex + 1; - triangleIndex += 6; - attachmentFirstVertex += 4; - continue; - } - var meshAttachment = attachment as MeshAttachment; - if (meshAttachment != null) { - int[] attachmentTriangles = meshAttachment.triangles; - for (int ii = 0, nn = attachmentTriangles.Length; ii < nn; ii++, triangleIndex++) - tris[triangleIndex] = attachmentFirstVertex + attachmentTriangles[ii]; - attachmentFirstVertex += meshAttachment.worldVerticesLength >> 1; // length/2; - } - } - } - } - } - - public void ScaleVertexData (float scale) { - var vbi = vertexBuffer.Items; - for (int i = 0, n = vertexBuffer.Count; i < n; i++) { - vbi[i] *= scale; // vbi[i].x *= scale; vbi[i].y *= scale; - } - - meshBoundsMin *= scale; - meshBoundsMax *= scale; - meshBoundsThickness *= scale; - } - - void AddAttachmentTintBlack (float r2, float g2, float b2, float a, int vertexCount) { - var rg = new Vector2(r2, g2); - var bo = new Vector2(b2, a); - - int ovc = vertexBuffer.Count; - int newVertexCount = ovc + vertexCount; - { - if (uv2 == null) { - uv2 = new ExposedList(); - uv3 = new ExposedList(); - } - if (newVertexCount > uv2.Items.Length) { // Manual ExposedList.Resize() - Array.Resize(ref uv2.Items, newVertexCount); - Array.Resize(ref uv3.Items, newVertexCount); - } - uv2.Count = uv3.Count = newVertexCount; - } - - var uv2i = uv2.Items; - var uv3i = uv3.Items; - for (int i = 0; i < vertexCount; i++) { - uv2i[ovc + i] = rg; - uv3i[ovc + i] = bo; - } - } - #endregion - - #region Step 3 : Transfer vertex and triangle data to UnityEngine.Mesh - public void FillVertexData (Mesh mesh) { - var vbi = vertexBuffer.Items; - var ubi = uvBuffer.Items; - var cbi = colorBuffer.Items; - int vbiLength = vbi.Length; - - // Zero the extra. - { - int listCount = vertexBuffer.Count; - var vector3zero = Vector3.zero; - for (int i = listCount; i < vbiLength; i++) - vbi[i] = vector3zero; - } - - // Set the vertex buffer. - { - mesh.vertices = vbi; - mesh.uv = ubi; - mesh.colors32 = cbi; - - if (float.IsInfinity(meshBoundsMin.x)) { // meshBoundsMin.x == BoundsMinDefault // == doesn't work on float Infinity constants. - mesh.bounds = new Bounds(); - } else { - //mesh.bounds = ArraysMeshGenerator.ToBounds(meshBoundsMin, meshBoundsMax); - float halfWidth = (meshBoundsMax.x - meshBoundsMin.x) * 0.5f; - float halfHeight = (meshBoundsMax.y - meshBoundsMin.y) * 0.5f; - mesh.bounds = new Bounds { - center = new Vector3(meshBoundsMin.x + halfWidth, meshBoundsMin.y + halfHeight), - extents = new Vector3(halfWidth, halfHeight, meshBoundsThickness * 0.5f) - }; - } - } - - { - if (settings.addNormals) { - int oldLength = 0; - - if (normals == null) - normals = new Vector3[vbiLength]; - else - oldLength = normals.Length; - - if (oldLength != vbiLength) { - Array.Resize(ref this.normals, vbiLength); - var localNormals = this.normals; - for (int i = oldLength; i < vbiLength; i++) localNormals[i] = Vector3.back; - } - mesh.normals = this.normals; - } - - if (settings.tintBlack) { - if (uv2 != null) { - // Sometimes, the vertex buffer becomes smaller. We need to trim the size of the tint black buffers to match. - if (vbiLength != uv2.Items.Length) { - Array.Resize(ref uv2.Items, vbiLength); - Array.Resize(ref uv3.Items, vbiLength); - uv2.Count = uv3.Count = vbiLength; - } - mesh.uv2 = this.uv2.Items; - mesh.uv3 = this.uv3.Items; - } - } - } - } - - public void FillLateVertexData (Mesh mesh) { - if (settings.calculateTangents) { - int vertexCount = this.vertexBuffer.Count; - var sbi = submeshes.Items; - int submeshCount = submeshes.Count; - var vbi = vertexBuffer.Items; - var ubi = uvBuffer.Items; - - MeshGenerator.SolveTangents2DEnsureSize(ref this.tangents, ref this.tempTanBuffer, vertexCount, vbi.Length); - for (int i = 0; i < submeshCount; i++) { - var submesh = sbi[i].Items; - int triangleCount = sbi[i].Count; - MeshGenerator.SolveTangents2DTriangles(this.tempTanBuffer, submesh, triangleCount, vbi, ubi, vertexCount); - } - MeshGenerator.SolveTangents2DBuffer(this.tangents, this.tempTanBuffer, vertexCount); - mesh.tangents = this.tangents; - } - } - - public void FillTriangles (Mesh mesh) { - int submeshCount = submeshes.Count; - var submeshesItems = submeshes.Items; - mesh.subMeshCount = submeshCount; - - for (int i = 0; i < submeshCount; i++) -#if MESH_SET_TRIANGLES_PROVIDES_LENGTH_PARAM - mesh.SetTriangles(submeshesItems[i].Items, 0, submeshesItems[i].Count, i, false); -#else - mesh.SetTriangles(submeshesItems[i].Items, i, false); -#endif - } - #endregion - - public void EnsureVertexCapacity (int minimumVertexCount, bool inlcudeTintBlack = false, bool includeTangents = false, bool includeNormals = false) { - if (minimumVertexCount > vertexBuffer.Items.Length) { - Array.Resize(ref vertexBuffer.Items, minimumVertexCount); - Array.Resize(ref uvBuffer.Items, minimumVertexCount); - Array.Resize(ref colorBuffer.Items, minimumVertexCount); - - if (inlcudeTintBlack) { - if (uv2 == null) { - uv2 = new ExposedList(minimumVertexCount); - uv3 = new ExposedList(minimumVertexCount); - } - uv2.Resize(minimumVertexCount); - uv3.Resize(minimumVertexCount); - } - - if (includeNormals) { - if (normals == null) - normals = new Vector3[minimumVertexCount]; - else - Array.Resize(ref normals, minimumVertexCount); - - } - - if (includeTangents) { - if (tangents == null) - tangents = new Vector4[minimumVertexCount]; - else - Array.Resize(ref tangents, minimumVertexCount); - } - } - } - - /// Trims internal buffers to reduce the resulting mesh data stream size. - public void TrimExcess () { - vertexBuffer.TrimExcess(); - uvBuffer.TrimExcess(); - colorBuffer.TrimExcess(); - - if (uv2 != null) uv2.TrimExcess(); - if (uv3 != null) uv3.TrimExcess(); - - int vbiLength = vertexBuffer.Items.Length; - if (normals != null) Array.Resize(ref normals, vbiLength); - if (tangents != null) Array.Resize(ref tangents, vbiLength); - } - - #region TangentSolver2D - // Thanks to contributions from forum user ToddRivers - - /// Step 1 of solving tangents. Ensure you have buffers of the correct size. - /// Eventual Vector4[] tangent buffer to assign to Mesh.tangents. - /// Temporary Vector2 buffer for calculating directions. - /// Number of vertices that require tangents (or the size of the vertex array) - internal static void SolveTangents2DEnsureSize (ref Vector4[] tangentBuffer, ref Vector2[] tempTanBuffer, int vertexCount, int vertexBufferLength) { - if (tangentBuffer == null || tangentBuffer.Length != vertexBufferLength) - tangentBuffer = new Vector4[vertexBufferLength]; - - if (tempTanBuffer == null || tempTanBuffer.Length < vertexCount * 2) - tempTanBuffer = new Vector2[vertexCount * 2]; // two arrays in one. - } - - /// Step 2 of solving tangents. Fills (part of) a temporary tangent-solution buffer based on the vertices and uvs defined by a submesh's triangle buffer. Only needs to be called once for single-submesh meshes. - /// A temporary Vector3[] for calculating tangents. - /// The mesh's current vertex position buffer. - /// The mesh's current triangles buffer. - /// The mesh's current uvs buffer. - /// Number of vertices that require tangents (or the size of the vertex array) - /// The number of triangle indexes in the triangle array to be used. - internal static void SolveTangents2DTriangles (Vector2[] tempTanBuffer, int[] triangles, int triangleCount, Vector3[] vertices, Vector2[] uvs, int vertexCount) { - Vector2 sdir; - Vector2 tdir; - for (int t = 0; t < triangleCount; t += 3) { - int i1 = triangles[t + 0]; - int i2 = triangles[t + 1]; - int i3 = triangles[t + 2]; - - Vector3 v1 = vertices[i1]; - Vector3 v2 = vertices[i2]; - Vector3 v3 = vertices[i3]; - - Vector2 w1 = uvs[i1]; - Vector2 w2 = uvs[i2]; - Vector2 w3 = uvs[i3]; - - float x1 = v2.x - v1.x; - float x2 = v3.x - v1.x; - float y1 = v2.y - v1.y; - float y2 = v3.y - v1.y; - - float s1 = w2.x - w1.x; - float s2 = w3.x - w1.x; - float t1 = w2.y - w1.y; - float t2 = w3.y - w1.y; - - float div = s1 * t2 - s2 * t1; - float r = (div == 0f) ? 0f : 1f / div; - - sdir.x = (t2 * x1 - t1 * x2) * r; - sdir.y = (t2 * y1 - t1 * y2) * r; - tempTanBuffer[i1] = tempTanBuffer[i2] = tempTanBuffer[i3] = sdir; - - tdir.x = (s1 * x2 - s2 * x1) * r; - tdir.y = (s1 * y2 - s2 * y1) * r; - tempTanBuffer[vertexCount + i1] = tempTanBuffer[vertexCount + i2] = tempTanBuffer[vertexCount + i3] = tdir; - } - } - - /// Step 3 of solving tangents. Fills a Vector4[] tangents array according to values calculated in step 2. - /// A Vector4[] that will eventually be used to set Mesh.tangents - /// A temporary Vector3[] for calculating tangents. - /// Number of vertices that require tangents (or the size of the vertex array) - internal static void SolveTangents2DBuffer (Vector4[] tangents, Vector2[] tempTanBuffer, int vertexCount) { - Vector4 tangent; - tangent.z = 0; - for (int i = 0; i < vertexCount; ++i) { - Vector2 t = tempTanBuffer[i]; - - // t.Normalize() (aggressively inlined). Even better if offloaded to GPU via vertex shader. - float magnitude = Mathf.Sqrt(t.x * t.x + t.y * t.y); - if (magnitude > 1E-05) { - float reciprocalMagnitude = 1f/magnitude; - t.x *= reciprocalMagnitude; - t.y *= reciprocalMagnitude; - } - - Vector2 t2 = tempTanBuffer[vertexCount + i]; - tangent.x = t.x; - tangent.y = t.y; - //tangent.z = 0; - tangent.w = (t.y * t2.x > t.x * t2.y) ? 1 : -1; // 2D direction calculation. Used for binormals. - tangents[i] = tangent; - } - } - #endregion - - #region AttachmentRendering - static List AttachmentVerts = new List(); - static List AttachmentUVs = new List(); - static List AttachmentColors32 = new List(); - static List AttachmentIndices = new List(); - - /// Fills mesh vertex data to render a RegionAttachment. - public static void FillMeshLocal (Mesh mesh, RegionAttachment regionAttachment) { - if (mesh == null) return; - if (regionAttachment == null) return; - - AttachmentVerts.Clear(); - var offsets = regionAttachment.Offset; - AttachmentVerts.Add(new Vector3(offsets[RegionAttachment.BLX], offsets[RegionAttachment.BLY])); - AttachmentVerts.Add(new Vector3(offsets[RegionAttachment.ULX], offsets[RegionAttachment.ULY])); - AttachmentVerts.Add(new Vector3(offsets[RegionAttachment.URX], offsets[RegionAttachment.URY])); - AttachmentVerts.Add(new Vector3(offsets[RegionAttachment.BRX], offsets[RegionAttachment.BRY])); - - AttachmentUVs.Clear(); - var uvs = regionAttachment.UVs; - AttachmentUVs.Add(new Vector2(uvs[RegionAttachment.ULX], uvs[RegionAttachment.ULY])); - AttachmentUVs.Add(new Vector2(uvs[RegionAttachment.URX], uvs[RegionAttachment.URY])); - AttachmentUVs.Add(new Vector2(uvs[RegionAttachment.BRX], uvs[RegionAttachment.BRY])); - AttachmentUVs.Add(new Vector2(uvs[RegionAttachment.BLX], uvs[RegionAttachment.BLY])); - - AttachmentColors32.Clear(); - Color32 c = (Color32)(new Color(regionAttachment.r, regionAttachment.g, regionAttachment.b, regionAttachment.a)); - for (int i = 0; i < 4; i++) - AttachmentColors32.Add(c); - - AttachmentIndices.Clear(); - AttachmentIndices.AddRange(new[] { 0, 2, 1, 0, 3, 2 }); - - mesh.Clear(); - mesh.name = regionAttachment.Name; - mesh.SetVertices(AttachmentVerts); - mesh.SetUVs(0, AttachmentUVs); - mesh.SetColors(AttachmentColors32); - mesh.SetTriangles(AttachmentIndices, 0); - mesh.RecalculateBounds(); - - AttachmentVerts.Clear(); - AttachmentUVs.Clear(); - AttachmentColors32.Clear(); - AttachmentIndices.Clear(); - } - - public static void FillMeshLocal (Mesh mesh, MeshAttachment meshAttachment, SkeletonData skeletonData) { - if (mesh == null) return; - if (meshAttachment == null) return; - int vertexCount = meshAttachment.WorldVerticesLength / 2; - - AttachmentVerts.Clear(); - if (meshAttachment.IsWeighted()) { - int count = meshAttachment.WorldVerticesLength; - int[] meshAttachmentBones = meshAttachment.bones; - int v = 0; - - float[] vertices = meshAttachment.vertices; - for (int w = 0, b = 0; w < count; w += 2) { - float wx = 0, wy = 0; - int n = meshAttachmentBones[v++]; - n += v; - for (; v < n; v++, b += 3) { - BoneMatrix bm = BoneMatrix.CalculateSetupWorld(skeletonData.bones.Items[meshAttachmentBones[v]]); - float vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; - wx += (vx * bm.a + vy * bm.b + bm.x) * weight; - wy += (vx * bm.c + vy * bm.d + bm.y) * weight; - } - AttachmentVerts.Add(new Vector3(wx, wy)); - } - } else { - var localVerts = meshAttachment.Vertices; - Vector3 pos = default(Vector3); - for (int i = 0; i < vertexCount; i++) { - int ii = i * 2; - pos.x = localVerts[ii]; - pos.y = localVerts[ii + 1]; - AttachmentVerts.Add(pos); - } - } - - var uvs = meshAttachment.uvs; - Vector2 uv = default(Vector2); - Color32 c = (Color32)(new Color(meshAttachment.r, meshAttachment.g, meshAttachment.b, meshAttachment.a)); - AttachmentUVs.Clear(); - AttachmentColors32.Clear(); - for (int i = 0; i < vertexCount; i++) { - int ii = i * 2; - uv.x = uvs[ii]; - uv.y = uvs[ii + 1]; - AttachmentUVs.Add(uv); - - AttachmentColors32.Add(c); - } - - AttachmentIndices.Clear(); - AttachmentIndices.AddRange(meshAttachment.triangles); - - mesh.Clear(); - mesh.name = meshAttachment.Name; - mesh.SetVertices(AttachmentVerts); - mesh.SetUVs(0, AttachmentUVs); - mesh.SetColors(AttachmentColors32); - mesh.SetTriangles(AttachmentIndices, 0); - mesh.RecalculateBounds(); - - AttachmentVerts.Clear(); - AttachmentUVs.Clear(); - AttachmentColors32.Clear(); - AttachmentIndices.Clear(); - } - #endregion - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshGenerator.cs.meta b/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshGenerator.cs.meta deleted file mode 100644 index 712b49275..000000000 --- a/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshGenerator.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 311447d6e56727c4dad7611d5fa5afbf -timeCreated: 1563322425 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshRendererBuffers.cs b/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshRendererBuffers.cs deleted file mode 100644 index e108bbda9..000000000 --- a/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshRendererBuffers.cs +++ /dev/null @@ -1,135 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -// Not for optimization. Do not disable. -#define SPINE_TRIANGLECHECK // Avoid calling SetTriangles at the cost of checking for mesh differences (vertex counts, memberwise attachment list compare) every frame. -//#define SPINE_DEBUG - -using UnityEngine; -using System; -using System.Collections.Generic; - -namespace Spine.Unity { - /// A double-buffered Mesh, and a shared material array, bundled for use by Spine components that need to push a Mesh and materials to a Unity MeshRenderer and MeshFilter. - public class MeshRendererBuffers : IDisposable { - DoubleBuffered doubleBufferedMesh; - internal readonly ExposedList submeshMaterials = new ExposedList(); - internal Material[] sharedMaterials = new Material[0]; - - public void Initialize () { - if (doubleBufferedMesh != null) { - doubleBufferedMesh.GetNext().Clear(); - doubleBufferedMesh.GetNext().Clear(); - submeshMaterials.Clear(); - } else { - doubleBufferedMesh = new DoubleBuffered(); - } - } - - /// Returns a sharedMaterials array for use on a MeshRenderer. - /// - public Material[] GetUpdatedSharedMaterialsArray () { - if (submeshMaterials.Count == sharedMaterials.Length) - submeshMaterials.CopyTo(sharedMaterials); - else - sharedMaterials = submeshMaterials.ToArray(); - - return sharedMaterials; - } - - /// Returns true if the materials were modified since the buffers were last updated. - public bool MaterialsChangedInLastUpdate () { - int newSubmeshMaterials = submeshMaterials.Count; - var sharedMaterials = this.sharedMaterials; - if (newSubmeshMaterials != sharedMaterials.Length) return true; - - var submeshMaterialsItems = submeshMaterials.Items; - for (int i = 0; i < newSubmeshMaterials; i++) - if (!Material.ReferenceEquals(submeshMaterialsItems[i], sharedMaterials[i])) return true; //if (submeshMaterialsItems[i].GetInstanceID() != sharedMaterials[i].GetInstanceID()) return true; - - return false; - } - - /// Updates the internal shared materials array with the given instruction list. - public void UpdateSharedMaterials (ExposedList instructions) { - int newSize = instructions.Count; - { //submeshMaterials.Resize(instructions.Count); - if (newSize > submeshMaterials.Items.Length) - Array.Resize(ref submeshMaterials.Items, newSize); - submeshMaterials.Count = newSize; - } - - var submeshMaterialsItems = submeshMaterials.Items; - var instructionsItems = instructions.Items; - for (int i = 0; i < newSize; i++) - submeshMaterialsItems[i] = instructionsItems[i].material; - } - - public SmartMesh GetNextMesh () { - return doubleBufferedMesh.GetNext(); - } - - public void Clear () { - sharedMaterials = new Material[0]; - submeshMaterials.Clear(); - } - - public void Dispose () { - if (doubleBufferedMesh == null) return; - doubleBufferedMesh.GetNext().Dispose(); - doubleBufferedMesh.GetNext().Dispose(); - doubleBufferedMesh = null; - } - - ///This is a Mesh that also stores the instructions SkeletonRenderer generated for it. - public class SmartMesh : IDisposable { - public Mesh mesh = SpineMesh.NewSkeletonMesh(); - public SkeletonRendererInstruction instructionUsed = new SkeletonRendererInstruction(); - - public void Clear () { - mesh.Clear(); - instructionUsed.Clear(); - } - - public void Dispose () { - if (mesh != null) { - #if UNITY_EDITOR - if (Application.isEditor && !Application.isPlaying) - UnityEngine.Object.DestroyImmediate(mesh); - else - UnityEngine.Object.Destroy(mesh); - #else - UnityEngine.Object.Destroy(mesh); - #endif - } - mesh = null; - } - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshRendererBuffers.cs.meta b/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshRendererBuffers.cs.meta deleted file mode 100644 index 3e4c8a1b2..000000000 --- a/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshRendererBuffers.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b1ab80744ac17724dbc0d15fdb6f4727 -timeCreated: 1563322425 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Mesh Generation/SkeletonRendererInstruction.cs b/Assets/Spine/Runtime/spine-unity/Mesh Generation/SkeletonRendererInstruction.cs deleted file mode 100644 index 54821fa5f..000000000 --- a/Assets/Spine/Runtime/spine-unity/Mesh Generation/SkeletonRendererInstruction.cs +++ /dev/null @@ -1,178 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -// Not for optimization. Do not disable. -#define SPINE_TRIANGLECHECK // Avoid calling SetTriangles at the cost of checking for mesh differences (vertex counts, memberwise attachment list compare) every frame. -//#define SPINE_DEBUG - -using UnityEngine; -using System; -using System.Collections.Generic; - -namespace Spine.Unity { - /// Instructions used by a SkeletonRenderer to render a mesh. - public class SkeletonRendererInstruction { - public readonly ExposedList submeshInstructions = new ExposedList(); - - public bool immutableTriangles; - #if SPINE_TRIANGLECHECK - public bool hasActiveClipping; - public int rawVertexCount = -1; - public readonly ExposedList attachments = new ExposedList(); - #endif - - public void Clear () { - #if SPINE_TRIANGLECHECK - this.attachments.Clear(false); - rawVertexCount = -1; - hasActiveClipping = false; - #endif - this.submeshInstructions.Clear(false); - } - - public void Dispose () { - attachments.Clear(true); - } - - public void SetWithSubset (ExposedList instructions, int startSubmesh, int endSubmesh) { - #if SPINE_TRIANGLECHECK - int runningVertexCount = 0; - #endif - - var submeshes = this.submeshInstructions; - submeshes.Clear(false); - int submeshCount = endSubmesh - startSubmesh; - submeshes.Resize(submeshCount); - var submeshesItems = submeshes.Items; - var instructionsItems = instructions.Items; - for (int i = 0; i < submeshCount; i++) { - var instruction = instructionsItems[startSubmesh + i]; - submeshesItems[i] = instruction; - #if SPINE_TRIANGLECHECK - this.hasActiveClipping |= instruction.hasClipping; - submeshesItems[i].rawFirstVertexIndex = runningVertexCount; // Ensure current instructions have correct cached values. - runningVertexCount += instruction.rawVertexCount; // vertexCount will also be used for the rest of this method. - #endif - } - #if SPINE_TRIANGLECHECK - this.rawVertexCount = runningVertexCount; - - // assumption: instructions are contiguous. start and end are valid within instructions. - - int startSlot = instructionsItems[startSubmesh].startSlot; - int endSlot = instructionsItems[endSubmesh - 1].endSlot; - attachments.Clear(false); - int attachmentCount = endSlot - startSlot; - attachments.Resize(attachmentCount); - var attachmentsItems = attachments.Items; - - var drawOrderItems = instructionsItems[0].skeleton.drawOrder.Items; - for (int i = 0; i < attachmentCount; i++) { - Slot slot = drawOrderItems[startSlot + i]; - if (!slot.bone.active) continue; - attachmentsItems[i] = slot.attachment; - } - - #endif - } - - public void Set (SkeletonRendererInstruction other) { - this.immutableTriangles = other.immutableTriangles; - - #if SPINE_TRIANGLECHECK - this.hasActiveClipping = other.hasActiveClipping; - this.rawVertexCount = other.rawVertexCount; - this.attachments.Clear(false); - this.attachments.EnsureCapacity(other.attachments.Capacity); - this.attachments.Count = other.attachments.Count; - other.attachments.CopyTo(this.attachments.Items); - #endif - - this.submeshInstructions.Clear(false); - this.submeshInstructions.EnsureCapacity(other.submeshInstructions.Capacity); - this.submeshInstructions.Count = other.submeshInstructions.Count; - other.submeshInstructions.CopyTo(this.submeshInstructions.Items); - } - - public static bool GeometryNotEqual (SkeletonRendererInstruction a, SkeletonRendererInstruction b) { - #if SPINE_TRIANGLECHECK - #if UNITY_EDITOR - if (!Application.isPlaying) - return true; - #endif - - if (a.hasActiveClipping || b.hasActiveClipping) return true; // Triangles are unpredictable when clipping is active. - - // Everything below assumes the raw vertex and triangle counts were used. (ie, no clipping was done) - if (a.rawVertexCount != b.rawVertexCount) return true; - - if (a.immutableTriangles != b.immutableTriangles) return true; - - int attachmentCountB = b.attachments.Count; - if (a.attachments.Count != attachmentCountB) return true; // Bounds check for the looped storedAttachments count below. - - // Submesh count changed - int submeshCountA = a.submeshInstructions.Count; - int submeshCountB = b.submeshInstructions.Count; - if (submeshCountA != submeshCountB) return true; - - // Submesh Instruction mismatch - var submeshInstructionsItemsA = a.submeshInstructions.Items; - var submeshInstructionsItemsB = b.submeshInstructions.Items; - - var attachmentsA = a.attachments.Items; - var attachmentsB = b.attachments.Items; - for (int i = 0; i < attachmentCountB; i++) - if (!System.Object.ReferenceEquals(attachmentsA[i], attachmentsB[i])) return true; - - for (int i = 0; i < submeshCountB; i++) { - var submeshA = submeshInstructionsItemsA[i]; - var submeshB = submeshInstructionsItemsB[i]; - - if (!( - submeshA.rawVertexCount == submeshB.rawVertexCount && - submeshA.startSlot == submeshB.startSlot && - submeshA.endSlot == submeshB.endSlot - && submeshA.rawTriangleCount == submeshB.rawTriangleCount && - submeshA.rawFirstVertexIndex == submeshB.rawFirstVertexIndex - )) - return true; - } - - return false; - #else - // In normal immutable triangle use, immutableTriangles will be initially false, forcing the smartmesh to update the first time but never again after that, unless there was an immutableTriangles flag mismatch.. - if (a.immutableTriangles || b.immutableTriangles) - return (a.immutableTriangles != b.immutableTriangles); - - return true; - #endif - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Mesh Generation/SkeletonRendererInstruction.cs.meta b/Assets/Spine/Runtime/spine-unity/Mesh Generation/SkeletonRendererInstruction.cs.meta deleted file mode 100644 index 50a8a97d8..000000000 --- a/Assets/Spine/Runtime/spine-unity/Mesh Generation/SkeletonRendererInstruction.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d07866ade25bd0b44a7bb1d59bacf4cb -timeCreated: 1563322425 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Mesh Generation/SpineMesh.cs b/Assets/Spine/Runtime/spine-unity/Mesh Generation/SpineMesh.cs index 31a25e197..fb1408112 100644 --- a/Assets/Spine/Runtime/spine-unity/Mesh Generation/SpineMesh.cs +++ b/Assets/Spine/Runtime/spine-unity/Mesh Generation/SpineMesh.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,19 +15,19 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -// Not for optimization. Do not disable. +// Not for optimization. Do not disable. #define SPINE_TRIANGLECHECK // Avoid calling SetTriangles at the cost of checking for mesh differences (vertex counts, memberwise attachment list compare) every frame. //#define SPINE_DEBUG @@ -73,12 +73,1487 @@ namespace Spine.Unity { public override string ToString () { return - string.Format("[SubmeshInstruction: slots {0} to {1}. (Material){2}. preActiveClippingSlotSource:{3}]", - startSlot, - endSlot - 1, - material == null ? "" : material.name, + string.Format("[SubmeshInstruction: slots {0} to {1}. (Material){2}. preActiveClippingSlotSource:{3}]", + startSlot, + endSlot - 1, + material == null ? "" : material.name, preActiveClippingSlotSource ); } } + + public delegate void MeshGeneratorDelegate (MeshGeneratorBuffers buffers); + public struct MeshGeneratorBuffers { + /// The vertex count that will actually be used for the mesh. The Lengths of the buffer arrays may be larger than this number. + public int vertexCount; + + /// Vertex positions. To be used for UnityEngine.Mesh.vertices. + public Vector3[] vertexBuffer; + + /// Vertex UVs. To be used for UnityEngine.Mesh.uvs. + public Vector2[] uvBuffer; + + /// Vertex colors. To be used for UnityEngine.Mesh.colors32. + public Color32[] colorBuffer; + + /// The Spine rendering component's MeshGenerator. + public MeshGenerator meshGenerator; + } + + /// Holds several methods to prepare and generate a UnityEngine mesh based on a skeleton. Contains buffers needed to perform the operation, and serializes settings for mesh generation. + [System.Serializable] + public class MeshGenerator { + public Settings settings = Settings.Default; + + [System.Serializable] + public struct Settings { + public bool useClipping; + [Space] + [Range(-0.1f, 0f)] public float zSpacing; + [Space] + [Header("Vertex Data")] + public bool pmaVertexColors; + public bool tintBlack; + public bool calculateTangents; + public bool addNormals; + public bool immutableTriangles; + + static public Settings Default { + get { + return new Settings { + pmaVertexColors = true, + zSpacing = 0f, + useClipping = true, + tintBlack = false, + calculateTangents = false, + //renderMeshes = true, + addNormals = false, + immutableTriangles = false + }; + } + } + } + + const float BoundsMinDefault = float.PositiveInfinity; + const float BoundsMaxDefault = float.NegativeInfinity; + + [NonSerialized] readonly ExposedList vertexBuffer = new ExposedList(4); + [NonSerialized] readonly ExposedList uvBuffer = new ExposedList(4); + [NonSerialized] readonly ExposedList colorBuffer = new ExposedList(4); + [NonSerialized] readonly ExposedList> submeshes = new ExposedList> { new ExposedList(6) }; // start with 1 submesh. + + [NonSerialized] Vector2 meshBoundsMin, meshBoundsMax; + [NonSerialized] float meshBoundsThickness; + [NonSerialized] int submeshIndex = 0; + + [NonSerialized] SkeletonClipping clipper = new SkeletonClipping(); + [NonSerialized] float[] tempVerts = new float[8]; + [NonSerialized] int[] regionTriangles = { 0, 1, 2, 2, 3, 0 }; + + #region Optional Buffers + // These optional buffers are lazy-instantiated when the feature is used. + [NonSerialized] Vector3[] normals; + [NonSerialized] Vector4[] tangents; + [NonSerialized] Vector2[] tempTanBuffer; + [NonSerialized] ExposedList uv2; + [NonSerialized] ExposedList uv3; + #endregion + + public int VertexCount { get { return vertexBuffer.Count; } } + + /// A set of mesh arrays whose values are modifiable by the user. Modify these values before they are passed to the UnityEngine mesh object in order to see the effect. + public MeshGeneratorBuffers Buffers { + get { + return new MeshGeneratorBuffers { + vertexCount = this.VertexCount, + vertexBuffer = this.vertexBuffer.Items, + uvBuffer = this.uvBuffer.Items, + colorBuffer = this.colorBuffer.Items, + meshGenerator = this + }; + } + } + + public MeshGenerator () { + submeshes.TrimExcess(); + } + + #region Step 1 : Generate Instructions + public static void GenerateSingleSubmeshInstruction (SkeletonRendererInstruction instructionOutput, Skeleton skeleton, Material material) { + ExposedList drawOrder = skeleton.drawOrder; + int drawOrderCount = drawOrder.Count; + + // Clear last state of attachments and submeshes + instructionOutput.Clear(); // submeshInstructions.Clear(); attachments.Clear(); + var workingSubmeshInstructions = instructionOutput.submeshInstructions; + workingSubmeshInstructions.Resize(1); + + #if SPINE_TRIANGLECHECK + instructionOutput.attachments.Resize(drawOrderCount); + var workingAttachmentsItems = instructionOutput.attachments.Items; + int totalRawVertexCount = 0; + #endif + + var current = new SubmeshInstruction { + skeleton = skeleton, + preActiveClippingSlotSource = -1, + startSlot = 0, + #if SPINE_TRIANGLECHECK + rawFirstVertexIndex = 0, + #endif + material = material, + forceSeparate = false, + endSlot = drawOrderCount + }; + + #if SPINE_TRIANGLECHECK + bool skeletonHasClipping = false; + var drawOrderItems = drawOrder.Items; + for (int i = 0; i < drawOrderCount; i++) { + Slot slot = drawOrderItems[i]; + Attachment attachment = slot.attachment; + + workingAttachmentsItems[i] = attachment; + int attachmentTriangleCount; + int attachmentVertexCount; + + var regionAttachment = attachment as RegionAttachment; + if (regionAttachment != null) { + attachmentVertexCount = 4; + attachmentTriangleCount = 6; + } else { + var meshAttachment = attachment as MeshAttachment; + if (meshAttachment != null) { + attachmentVertexCount = meshAttachment.worldVerticesLength >> 1; + attachmentTriangleCount = meshAttachment.triangles.Length; + } else { + var clippingAttachment = attachment as ClippingAttachment; + if (clippingAttachment != null) { + current.hasClipping = true; + skeletonHasClipping = true; + } + attachmentVertexCount = 0; + attachmentTriangleCount = 0; + } + } + current.rawTriangleCount += attachmentTriangleCount; + current.rawVertexCount += attachmentVertexCount; + totalRawVertexCount += attachmentVertexCount; + + } + + instructionOutput.hasActiveClipping = skeletonHasClipping; + instructionOutput.rawVertexCount = totalRawVertexCount; + #endif + + workingSubmeshInstructions.Items[0] = current; + } + + public static void GenerateSkeletonRendererInstruction (SkeletonRendererInstruction instructionOutput, Skeleton skeleton, Dictionary customSlotMaterials, List separatorSlots, bool generateMeshOverride, bool immutableTriangles = false) { + // if (skeleton == null) throw new ArgumentNullException("skeleton"); + // if (instructionOutput == null) throw new ArgumentNullException("instructionOutput"); + + ExposedList drawOrder = skeleton.drawOrder; + int drawOrderCount = drawOrder.Count; + + // Clear last state of attachments and submeshes + instructionOutput.Clear(); // submeshInstructions.Clear(); attachments.Clear(); + var workingSubmeshInstructions = instructionOutput.submeshInstructions; + #if SPINE_TRIANGLECHECK + instructionOutput.attachments.Resize(drawOrderCount); + var workingAttachmentsItems = instructionOutput.attachments.Items; + int totalRawVertexCount = 0; + bool skeletonHasClipping = false; + #endif + + var current = new SubmeshInstruction { + skeleton = skeleton, + preActiveClippingSlotSource = -1 + }; + + #if !SPINE_TK2D + bool isCustomSlotMaterialsPopulated = customSlotMaterials != null && customSlotMaterials.Count > 0; + #endif + + int separatorCount = separatorSlots == null ? 0 : separatorSlots.Count; + bool hasSeparators = separatorCount > 0; + + int clippingAttachmentSource = -1; + int lastPreActiveClipping = -1; // The index of the last slot that had an active ClippingAttachment. + SlotData clippingEndSlot = null; + int submeshIndex = 0; + var drawOrderItems = drawOrder.Items; + for (int i = 0; i < drawOrderCount; i++) { + Slot slot = drawOrderItems[i]; + Attachment attachment = slot.attachment; + #if SPINE_TRIANGLECHECK + workingAttachmentsItems[i] = attachment; + int attachmentVertexCount = 0, attachmentTriangleCount = 0; + #endif + + object rendererObject = null; // An AtlasRegion in plain Spine-Unity. Spine-TK2D hooks into TK2D's system. eventual source of Material object. + bool noRender = false; // Using this allows empty slots as separators, and keeps separated parts more stable despite slots being reordered + + var regionAttachment = attachment as RegionAttachment; + if (regionAttachment != null) { + rendererObject = regionAttachment.RendererObject; + #if SPINE_TRIANGLECHECK + attachmentVertexCount = 4; + attachmentTriangleCount = 6; + #endif + } else { + var meshAttachment = attachment as MeshAttachment; + if (meshAttachment != null) { + rendererObject = meshAttachment.RendererObject; + #if SPINE_TRIANGLECHECK + attachmentVertexCount = meshAttachment.worldVerticesLength >> 1; + attachmentTriangleCount = meshAttachment.triangles.Length; + #endif + } else { + #if SPINE_TRIANGLECHECK + var clippingAttachment = attachment as ClippingAttachment; + if (clippingAttachment != null) { + clippingEndSlot = clippingAttachment.endSlot; + clippingAttachmentSource = i; + current.hasClipping = true; + skeletonHasClipping = true; + } + #endif + noRender = true; + } + } + + if (clippingEndSlot != null && slot.data == clippingEndSlot && i != clippingAttachmentSource) { + clippingEndSlot = null; + clippingAttachmentSource = -1; + } + + // Create a new SubmeshInstruction when material changes. (or when forced to separate by a submeshSeparator) + // Slot with a separator/new material will become the starting slot of the next new instruction. + if (hasSeparators) { //current.forceSeparate = hasSeparators && separatorSlots.Contains(slot); + current.forceSeparate = false; + for (int s = 0; s < separatorCount; s++) { + if (Slot.ReferenceEquals(slot, separatorSlots[s])) { + current.forceSeparate = true; + break; + } + } + } + + if (noRender) { + if (current.forceSeparate && generateMeshOverride) { // && current.rawVertexCount > 0) { + { // Add + current.endSlot = i; + current.preActiveClippingSlotSource = lastPreActiveClipping; + + workingSubmeshInstructions.Resize(submeshIndex + 1); + workingSubmeshInstructions.Items[submeshIndex] = current; + + submeshIndex++; + } + + current.startSlot = i; + lastPreActiveClipping = clippingAttachmentSource; + #if SPINE_TRIANGLECHECK + current.rawTriangleCount = 0; + current.rawVertexCount = 0; + current.rawFirstVertexIndex = totalRawVertexCount; + current.hasClipping = clippingAttachmentSource >= 0; + #endif + } + } else { + #if !SPINE_TK2D + Material material; + if (isCustomSlotMaterialsPopulated) { + if (!customSlotMaterials.TryGetValue(slot, out material)) + material = (Material)((AtlasRegion)rendererObject).page.rendererObject; + } else { + material = (Material)((AtlasRegion)rendererObject).page.rendererObject; + } + #else + Material material = (rendererObject is Material) ? (Material)rendererObject : (Material)((AtlasRegion)rendererObject).page.rendererObject; + #endif + + if (current.forceSeparate || (current.rawVertexCount > 0 && !System.Object.ReferenceEquals(current.material, material))) { // Material changed. Add the previous submesh. + { // Add + current.endSlot = i; + current.preActiveClippingSlotSource = lastPreActiveClipping; + + workingSubmeshInstructions.Resize(submeshIndex + 1); + workingSubmeshInstructions.Items[submeshIndex] = current; + submeshIndex++; + } + current.startSlot = i; + lastPreActiveClipping = clippingAttachmentSource; + #if SPINE_TRIANGLECHECK + current.rawTriangleCount = 0; + current.rawVertexCount = 0; + current.rawFirstVertexIndex = totalRawVertexCount; + current.hasClipping = clippingAttachmentSource >= 0; + #endif + } + + // Update state for the next Attachment. + current.material = material; + #if SPINE_TRIANGLECHECK + current.rawTriangleCount += attachmentTriangleCount; + current.rawVertexCount += attachmentVertexCount; + current.rawFirstVertexIndex = totalRawVertexCount; + totalRawVertexCount += attachmentVertexCount; + #endif + } + } + + if (current.rawVertexCount > 0) { + { // Add last or only submesh. + current.endSlot = drawOrderCount; + current.preActiveClippingSlotSource = lastPreActiveClipping; + current.forceSeparate = false; + + workingSubmeshInstructions.Resize(submeshIndex + 1); + workingSubmeshInstructions.Items[submeshIndex] = current; + //submeshIndex++; + } + } + + #if SPINE_TRIANGLECHECK + instructionOutput.hasActiveClipping = skeletonHasClipping; + instructionOutput.rawVertexCount = totalRawVertexCount; + #endif + instructionOutput.immutableTriangles = immutableTriangles; + } + + public static void TryReplaceMaterials (ExposedList workingSubmeshInstructions, Dictionary customMaterialOverride) { + // Material overrides are done here so they can be applied per submesh instead of per slot + // but they will still be passed through the GenerateMeshOverride delegate, + // and will still go through the normal material match check step in STEP 3. + var wsii = workingSubmeshInstructions.Items; + for (int i = 0; i < workingSubmeshInstructions.Count; i++) { + var m = wsii[i].material; + Material mo; + if (customMaterialOverride.TryGetValue(m, out mo)) + wsii[i].material = mo; + } + } + #endregion + + #region Step 2 : Populate vertex data and triangle index buffers. + public void Begin () { + vertexBuffer.Clear(false); + colorBuffer.Clear(false); + uvBuffer.Clear(false); + clipper.ClipEnd(); + + { + meshBoundsMin.x = BoundsMinDefault; + meshBoundsMin.y = BoundsMinDefault; + meshBoundsMax.x = BoundsMaxDefault; + meshBoundsMax.y = BoundsMaxDefault; + meshBoundsThickness = 0f; + } + + submeshIndex = 0; + submeshes.Count = 1; + //submeshes.Items[0].Clear(false); + } + + public void AddSubmesh (SubmeshInstruction instruction, bool updateTriangles = true) { + var settings = this.settings; + + int newSubmeshCount = submeshIndex + 1; + if (submeshes.Items.Length < newSubmeshCount) + submeshes.Resize(newSubmeshCount); + submeshes.Count = newSubmeshCount; + var submesh = submeshes.Items[submeshIndex]; + if (submesh == null) + submeshes.Items[submeshIndex] = submesh = new ExposedList(); + submesh.Clear(false); + + var skeleton = instruction.skeleton; + var drawOrderItems = skeleton.drawOrder.Items; + + Color32 color = default(Color32); + float skeletonA = skeleton.a * 255, skeletonR = skeleton.r, skeletonG = skeleton.g, skeletonB = skeleton.b; + Vector2 meshBoundsMin = this.meshBoundsMin, meshBoundsMax = this.meshBoundsMax; + + // Settings + float zSpacing = settings.zSpacing; + bool pmaVertexColors = settings.pmaVertexColors; + bool tintBlack = settings.tintBlack; + #if SPINE_TRIANGLECHECK + bool useClipping = settings.useClipping && instruction.hasClipping; + #else + bool useClipping = settings.useClipping; + #endif + + if (useClipping) { + if (instruction.preActiveClippingSlotSource >= 0) { + var slot = drawOrderItems[instruction.preActiveClippingSlotSource]; + clipper.ClipStart(slot, slot.attachment as ClippingAttachment); + } + } + + for (int slotIndex = instruction.startSlot; slotIndex < instruction.endSlot; slotIndex++) { + var slot = drawOrderItems[slotIndex]; + var attachment = slot.attachment; + float z = zSpacing * slotIndex; + + var workingVerts = this.tempVerts; + float[] uvs; + int[] attachmentTriangleIndices; + int attachmentVertexCount; + int attachmentIndexCount; + + Color c = default(Color); + + // Identify and prepare values. + var region = attachment as RegionAttachment; + if (region != null) { + region.ComputeWorldVertices(slot.bone, workingVerts, 0); + uvs = region.uvs; + attachmentTriangleIndices = regionTriangles; + c.r = region.r; c.g = region.g; c.b = region.b; c.a = region.a; + attachmentVertexCount = 4; + attachmentIndexCount = 6; + } else { + var mesh = attachment as MeshAttachment; + if (mesh != null) { + int meshVerticesLength = mesh.worldVerticesLength; + if (workingVerts.Length < meshVerticesLength) { + workingVerts = new float[meshVerticesLength]; + this.tempVerts = workingVerts; + } + mesh.ComputeWorldVertices(slot, 0, meshVerticesLength, workingVerts, 0); //meshAttachment.ComputeWorldVertices(slot, tempVerts); + uvs = mesh.uvs; + attachmentTriangleIndices = mesh.triangles; + c.r = mesh.r; c.g = mesh.g; c.b = mesh.b; c.a = mesh.a; + attachmentVertexCount = meshVerticesLength >> 1; // meshVertexCount / 2; + attachmentIndexCount = mesh.triangles.Length; + } else { + if (useClipping) { + var clippingAttachment = attachment as ClippingAttachment; + if (clippingAttachment != null) { + clipper.ClipStart(slot, clippingAttachment); + continue; + } + } + + // If not any renderable attachment. + clipper.ClipEnd(slot); + continue; + } + } + + if (pmaVertexColors) { + color.a = (byte)(skeletonA * slot.a * c.a); + color.r = (byte)(skeletonR * slot.r * c.r * color.a); + color.g = (byte)(skeletonG * slot.g * c.g * color.a); + color.b = (byte)(skeletonB * slot.b * c.b * color.a); + if (slot.data.blendMode == BlendMode.Additive) color.a = 0; + } else { + color.a = (byte)(skeletonA * slot.a * c.a); + color.r = (byte)(skeletonR * slot.r * c.r * 255); + color.g = (byte)(skeletonG * slot.g * c.g * 255); + color.b = (byte)(skeletonB * slot.b * c.b * 255); + } + + if (useClipping && clipper.IsClipping) { + clipper.ClipTriangles(workingVerts, attachmentVertexCount << 1, attachmentTriangleIndices, attachmentIndexCount, uvs); + workingVerts = clipper.clippedVertices.Items; + attachmentVertexCount = clipper.clippedVertices.Count >> 1; + attachmentTriangleIndices = clipper.clippedTriangles.Items; + attachmentIndexCount = clipper.clippedTriangles.Count; + uvs = clipper.clippedUVs.Items; + } + + // Actually add slot/attachment data into buffers. + if (attachmentVertexCount != 0 && attachmentIndexCount != 0) { + if (tintBlack) + AddAttachmentTintBlack(slot.r2, slot.g2, slot.b2, attachmentVertexCount); + + //AddAttachment(workingVerts, uvs, color, attachmentTriangleIndices, attachmentVertexCount, attachmentIndexCount, ref meshBoundsMin, ref meshBoundsMax, z); + int ovc = vertexBuffer.Count; + // Add data to vertex buffers + { + int newVertexCount = ovc + attachmentVertexCount; + int oldArraySize = vertexBuffer.Items.Length; + if (newVertexCount > oldArraySize) { + int newArraySize = (int)(oldArraySize * 1.3f); + if (newArraySize < newVertexCount) newArraySize = newVertexCount; + Array.Resize(ref vertexBuffer.Items, newArraySize); + Array.Resize(ref uvBuffer.Items, newArraySize); + Array.Resize(ref colorBuffer.Items, newArraySize); + } + vertexBuffer.Count = uvBuffer.Count = colorBuffer.Count = newVertexCount; + } + + var vbi = vertexBuffer.Items; + var ubi = uvBuffer.Items; + var cbi = colorBuffer.Items; + if (ovc == 0) { + for (int i = 0; i < attachmentVertexCount; i++) { + int vi = ovc + i; + int i2 = i << 1; // i * 2 + float x = workingVerts[i2]; + float y = workingVerts[i2 + 1]; + + vbi[vi].x = x; + vbi[vi].y = y; + vbi[vi].z = z; + ubi[vi].x = uvs[i2]; + ubi[vi].y = uvs[i2 + 1]; + cbi[vi] = color; + + // Calculate bounds. + if (x < meshBoundsMin.x) meshBoundsMin.x = x; + if (x > meshBoundsMax.x) meshBoundsMax.x = x; + if (y < meshBoundsMin.y) meshBoundsMin.y = y; + if (y > meshBoundsMax.y) meshBoundsMax.y = y; + } + } else { + for (int i = 0; i < attachmentVertexCount; i++) { + int vi = ovc + i; + int i2 = i << 1; // i * 2 + float x = workingVerts[i2]; + float y = workingVerts[i2 + 1]; + + vbi[vi].x = x; + vbi[vi].y = y; + vbi[vi].z = z; + ubi[vi].x = uvs[i2]; + ubi[vi].y = uvs[i2 + 1]; + cbi[vi] = color; + + // Calculate bounds. + if (x < meshBoundsMin.x) meshBoundsMin.x = x; + else if (x > meshBoundsMax.x) meshBoundsMax.x = x; + if (y < meshBoundsMin.y) meshBoundsMin.y = y; + else if (y > meshBoundsMax.y) meshBoundsMax.y = y; + } + } + + + // Add data to triangle buffer + if (updateTriangles) { + int oldTriangleCount = submesh.Count; + { //submesh.Resize(oldTriangleCount + attachmentIndexCount); + int newTriangleCount = oldTriangleCount + attachmentIndexCount; + if (newTriangleCount > submesh.Items.Length) Array.Resize(ref submesh.Items, newTriangleCount); + submesh.Count = newTriangleCount; + } + var submeshItems = submesh.Items; + for (int i = 0; i < attachmentIndexCount; i++) + submeshItems[oldTriangleCount + i] = attachmentTriangleIndices[i] + ovc; + } + } + + clipper.ClipEnd(slot); + } + clipper.ClipEnd(); + + this.meshBoundsMin = meshBoundsMin; + this.meshBoundsMax = meshBoundsMax; + meshBoundsThickness = instruction.endSlot * zSpacing; + + // Trim or zero submesh triangles. + var currentSubmeshItems = submesh.Items; + for (int i = submesh.Count, n = currentSubmeshItems.Length; i < n; i++) + currentSubmeshItems[i] = 0; + + submeshIndex++; // Next AddSubmesh will use a new submeshIndex value. + } + + public void BuildMesh (SkeletonRendererInstruction instruction, bool updateTriangles) { + var wsii = instruction.submeshInstructions.Items; + for (int i = 0, n = instruction.submeshInstructions.Count; i < n; i++) + this.AddSubmesh(wsii[i], updateTriangles); + } + + // Use this faster method when no clipping is involved. + public void BuildMeshWithArrays (SkeletonRendererInstruction instruction, bool updateTriangles) { + var settings = this.settings; + int totalVertexCount = instruction.rawVertexCount; + + // Add data to vertex buffers + { + if (totalVertexCount > vertexBuffer.Items.Length) { // Manual ExposedList.Resize() + Array.Resize(ref vertexBuffer.Items, totalVertexCount); + Array.Resize(ref uvBuffer.Items, totalVertexCount); + Array.Resize(ref colorBuffer.Items, totalVertexCount); + } + vertexBuffer.Count = uvBuffer.Count = colorBuffer.Count = totalVertexCount; + } + + // Populate Verts + Color32 color = default(Color32); + + int vertexIndex = 0; + var tempVerts = this.tempVerts; + Vector2 bmin = this.meshBoundsMin; + Vector2 bmax = this.meshBoundsMax; + + var vbi = vertexBuffer.Items; + var ubi = uvBuffer.Items; + var cbi = colorBuffer.Items; + int lastSlotIndex = 0; + + // drawOrder[endSlot] is excluded + for (int si = 0, n = instruction.submeshInstructions.Count; si < n; si++) { + var submesh = instruction.submeshInstructions.Items[si]; + var skeleton = submesh.skeleton; + var skeletonDrawOrderItems = skeleton.drawOrder.Items; + float a = skeleton.a * 255, r = skeleton.r, g = skeleton.g, b = skeleton.b; + + int endSlot = submesh.endSlot; + int startSlot = submesh.startSlot; + lastSlotIndex = endSlot; + + if (settings.tintBlack) { + Vector2 rg, b2; + int vi = vertexIndex; + b2.y = 1f; + + { + if (uv2 == null) { + uv2 = new ExposedList(); + uv3 = new ExposedList(); + } + if (totalVertexCount > uv2.Items.Length) { // Manual ExposedList.Resize() + Array.Resize(ref uv2.Items, totalVertexCount); + Array.Resize(ref uv3.Items, totalVertexCount); + } + uv2.Count = uv3.Count = totalVertexCount; + } + + var uv2i = uv2.Items; + var uv3i = uv3.Items; + + for (int slotIndex = startSlot; slotIndex < endSlot; slotIndex++) { + var slot = skeletonDrawOrderItems[slotIndex]; + var attachment = slot.attachment; + + rg.x = slot.r2; //r + rg.y = slot.g2; //g + b2.x = slot.b2; //b + + var regionAttachment = attachment as RegionAttachment; + if (regionAttachment != null) { + uv2i[vi] = rg; uv2i[vi + 1] = rg; uv2i[vi + 2] = rg; uv2i[vi + 3] = rg; + uv3i[vi] = b2; uv3i[vi + 1] = b2; uv3i[vi + 2] = b2; uv3i[vi + 3] = b2; + vi += 4; + } else { //} if (settings.renderMeshes) { + var meshAttachment = attachment as MeshAttachment; + if (meshAttachment != null) { + int meshVertexCount = meshAttachment.worldVerticesLength; + for (int iii = 0; iii < meshVertexCount; iii += 2) { + uv2i[vi] = rg; + uv3i[vi] = b2; + vi++; + } + } + } + } + } + + for (int slotIndex = startSlot; slotIndex < endSlot; slotIndex++) { + var slot = skeletonDrawOrderItems[slotIndex]; + var attachment = slot.attachment; + float z = slotIndex * settings.zSpacing; + + var regionAttachment = attachment as RegionAttachment; + if (regionAttachment != null) { + regionAttachment.ComputeWorldVertices(slot.bone, tempVerts, 0); + + float x1 = tempVerts[RegionAttachment.BLX], y1 = tempVerts[RegionAttachment.BLY]; + float x2 = tempVerts[RegionAttachment.ULX], y2 = tempVerts[RegionAttachment.ULY]; + float x3 = tempVerts[RegionAttachment.URX], y3 = tempVerts[RegionAttachment.URY]; + float x4 = tempVerts[RegionAttachment.BRX], y4 = tempVerts[RegionAttachment.BRY]; + vbi[vertexIndex].x = x1; vbi[vertexIndex].y = y1; vbi[vertexIndex].z = z; + vbi[vertexIndex + 1].x = x4; vbi[vertexIndex + 1].y = y4; vbi[vertexIndex + 1].z = z; + vbi[vertexIndex + 2].x = x2; vbi[vertexIndex + 2].y = y2; vbi[vertexIndex + 2].z = z; + vbi[vertexIndex + 3].x = x3; vbi[vertexIndex + 3].y = y3; vbi[vertexIndex + 3].z = z; + + if (settings.pmaVertexColors) { + color.a = (byte)(a * slot.a * regionAttachment.a); + color.r = (byte)(r * slot.r * regionAttachment.r * color.a); + color.g = (byte)(g * slot.g * regionAttachment.g * color.a); + color.b = (byte)(b * slot.b * regionAttachment.b * color.a); + if (slot.data.blendMode == BlendMode.Additive) color.a = 0; + } else { + color.a = (byte)(a * slot.a * regionAttachment.a); + color.r = (byte)(r * slot.r * regionAttachment.r * 255); + color.g = (byte)(g * slot.g * regionAttachment.g * 255); + color.b = (byte)(b * slot.b * regionAttachment.b * 255); + } + + cbi[vertexIndex] = color; cbi[vertexIndex + 1] = color; cbi[vertexIndex + 2] = color; cbi[vertexIndex + 3] = color; + + float[] regionUVs = regionAttachment.uvs; + ubi[vertexIndex].x = regionUVs[RegionAttachment.BLX]; ubi[vertexIndex].y = regionUVs[RegionAttachment.BLY]; + ubi[vertexIndex + 1].x = regionUVs[RegionAttachment.BRX]; ubi[vertexIndex + 1].y = regionUVs[RegionAttachment.BRY]; + ubi[vertexIndex + 2].x = regionUVs[RegionAttachment.ULX]; ubi[vertexIndex + 2].y = regionUVs[RegionAttachment.ULY]; + ubi[vertexIndex + 3].x = regionUVs[RegionAttachment.URX]; ubi[vertexIndex + 3].y = regionUVs[RegionAttachment.URY]; + + if (x1 < bmin.x) bmin.x = x1; // Potential first attachment bounds initialization. Initial min should not block initial max. Same for Y below. + if (x1 > bmax.x) bmax.x = x1; + if (x2 < bmin.x) bmin.x = x2; + else if (x2 > bmax.x) bmax.x = x2; + if (x3 < bmin.x) bmin.x = x3; + else if (x3 > bmax.x) bmax.x = x3; + if (x4 < bmin.x) bmin.x = x4; + else if (x4 > bmax.x) bmax.x = x4; + + if (y1 < bmin.y) bmin.y = y1; + if (y1 > bmax.y) bmax.y = y1; + if (y2 < bmin.y) bmin.y = y2; + else if (y2 > bmax.y) bmax.y = y2; + if (y3 < bmin.y) bmin.y = y3; + else if (y3 > bmax.y) bmax.y = y3; + if (y4 < bmin.y) bmin.y = y4; + else if (y4 > bmax.y) bmax.y = y4; + + vertexIndex += 4; + } else { //if (settings.renderMeshes) { + var meshAttachment = attachment as MeshAttachment; + if (meshAttachment != null) { + int meshVertexCount = meshAttachment.worldVerticesLength; + if (tempVerts.Length < meshVertexCount) this.tempVerts = tempVerts = new float[meshVertexCount]; + meshAttachment.ComputeWorldVertices(slot, tempVerts); + + if (settings.pmaVertexColors) { + color.a = (byte)(a * slot.a * meshAttachment.a); + color.r = (byte)(r * slot.r * meshAttachment.r * color.a); + color.g = (byte)(g * slot.g * meshAttachment.g * color.a); + color.b = (byte)(b * slot.b * meshAttachment.b * color.a); + if (slot.data.blendMode == BlendMode.Additive) color.a = 0; + } else { + color.a = (byte)(a * slot.a * meshAttachment.a); + color.r = (byte)(r * slot.r * meshAttachment.r * 255); + color.g = (byte)(g * slot.g * meshAttachment.g * 255); + color.b = (byte)(b * slot.b * meshAttachment.b * 255); + } + + float[] attachmentUVs = meshAttachment.uvs; + + // Potential first attachment bounds initialization. See conditions in RegionAttachment logic. + if (vertexIndex == 0) { + // Initial min should not block initial max. + // vi == vertexIndex does not always mean the bounds are fresh. It could be a submesh. Do not nuke old values by omitting the check. + // Should know that this is the first attachment in the submesh. slotIndex == startSlot could be an empty slot. + float fx = tempVerts[0], fy = tempVerts[1]; + if (fx < bmin.x) bmin.x = fx; + if (fx > bmax.x) bmax.x = fx; + if (fy < bmin.y) bmin.y = fy; + if (fy > bmax.y) bmax.y = fy; + } + + for (int iii = 0; iii < meshVertexCount; iii += 2) { + float x = tempVerts[iii], y = tempVerts[iii + 1]; + vbi[vertexIndex].x = x; vbi[vertexIndex].y = y; vbi[vertexIndex].z = z; + cbi[vertexIndex] = color; ubi[vertexIndex].x = attachmentUVs[iii]; ubi[vertexIndex].y = attachmentUVs[iii + 1]; + + if (x < bmin.x) bmin.x = x; + else if (x > bmax.x) bmax.x = x; + + if (y < bmin.y) bmin.y = y; + else if (y > bmax.y) bmax.y = y; + + vertexIndex++; + } + } + } + } + } + + this.meshBoundsMin = bmin; + this.meshBoundsMax = bmax; + this.meshBoundsThickness = lastSlotIndex * settings.zSpacing; + + int submeshInstructionCount = instruction.submeshInstructions.Count; + submeshes.Count = submeshInstructionCount; + + // Add triangles + if (updateTriangles) { + // Match submesh buffers count with submeshInstruction count. + if (this.submeshes.Items.Length < submeshInstructionCount) { + this.submeshes.Resize(submeshInstructionCount); + for (int i = 0, n = submeshInstructionCount; i < n; i++) { + var submeshBuffer = this.submeshes.Items[i]; + if (submeshBuffer == null) + this.submeshes.Items[i] = new ExposedList(); + else + submeshBuffer.Clear(false); + } + } + + var submeshInstructionsItems = instruction.submeshInstructions.Items; // This relies on the resize above. + + // Fill the buffers. + int attachmentFirstVertex = 0; + for (int smbi = 0; smbi < submeshInstructionCount; smbi++) { + var submeshInstruction = submeshInstructionsItems[smbi]; + var currentSubmeshBuffer = this.submeshes.Items[smbi]; + { //submesh.Resize(submesh.rawTriangleCount); + int newTriangleCount = submeshInstruction.rawTriangleCount; + if (newTriangleCount > currentSubmeshBuffer.Items.Length) + Array.Resize(ref currentSubmeshBuffer.Items, newTriangleCount); + else if (newTriangleCount < currentSubmeshBuffer.Items.Length) { + // Zero the extra. + var sbi = currentSubmeshBuffer.Items; + for (int ei = newTriangleCount, nn = sbi.Length; ei < nn; ei++) + sbi[ei] = 0; + } + currentSubmeshBuffer.Count = newTriangleCount; + } + + var tris = currentSubmeshBuffer.Items; + int triangleIndex = 0; + var skeleton = submeshInstruction.skeleton; + var skeletonDrawOrderItems = skeleton.drawOrder.Items; + for (int a = submeshInstruction.startSlot, endSlot = submeshInstruction.endSlot; a < endSlot; a++) { + var attachment = skeletonDrawOrderItems[a].attachment; + if (attachment is RegionAttachment) { + tris[triangleIndex] = attachmentFirstVertex; + tris[triangleIndex + 1] = attachmentFirstVertex + 2; + tris[triangleIndex + 2] = attachmentFirstVertex + 1; + tris[triangleIndex + 3] = attachmentFirstVertex + 2; + tris[triangleIndex + 4] = attachmentFirstVertex + 3; + tris[triangleIndex + 5] = attachmentFirstVertex + 1; + triangleIndex += 6; + attachmentFirstVertex += 4; + continue; + } + var meshAttachment = attachment as MeshAttachment; + if (meshAttachment != null) { + int[] attachmentTriangles = meshAttachment.triangles; + for (int ii = 0, nn = attachmentTriangles.Length; ii < nn; ii++, triangleIndex++) + tris[triangleIndex] = attachmentFirstVertex + attachmentTriangles[ii]; + attachmentFirstVertex += meshAttachment.worldVerticesLength >> 1; // length/2; + } + } + } + } + } + + public void ScaleVertexData (float scale) { + var vbi = vertexBuffer.Items; + for (int i = 0, n = vertexBuffer.Count; i < n; i++) { + vbi[i] *= scale; // vbi[i].x *= scale; vbi[i].y *= scale; + } + + meshBoundsMin *= scale; + meshBoundsMax *= scale; + meshBoundsThickness *= scale; + } + + void AddAttachmentTintBlack (float r2, float g2, float b2, int vertexCount) { + var rg = new Vector2(r2, g2); + var bo = new Vector2(b2, 1f); + + int ovc = vertexBuffer.Count; + int newVertexCount = ovc + vertexCount; + { + if (uv2 == null) { + uv2 = new ExposedList(); + uv3 = new ExposedList(); + } + if (newVertexCount > uv2.Items.Length) { // Manual ExposedList.Resize() + Array.Resize(ref uv2.Items, newVertexCount); + Array.Resize(ref uv3.Items, newVertexCount); + } + uv2.Count = uv3.Count = newVertexCount; + } + + var uv2i = uv2.Items; + var uv3i = uv3.Items; + for (int i = 0; i < vertexCount; i++) { + uv2i[ovc + i] = rg; + uv3i[ovc + i] = bo; + } + } + #endregion + + #region Step 3 : Transfer vertex and triangle data to UnityEngine.Mesh + public void FillVertexData (Mesh mesh) { + var vbi = vertexBuffer.Items; + var ubi = uvBuffer.Items; + var cbi = colorBuffer.Items; + int vbiLength = vbi.Length; + + // Zero the extra. + { + int listCount = vertexBuffer.Count; + var vector3zero = Vector3.zero; + for (int i = listCount; i < vbiLength; i++) + vbi[i] = vector3zero; + } + + // Set the vertex buffer. + { + mesh.vertices = vbi; + mesh.uv = ubi; + mesh.colors32 = cbi; + + if (float.IsInfinity(meshBoundsMin.x)) { // meshBoundsMin.x == BoundsMinDefault // == doesn't work on float Infinity constants. + mesh.bounds = new Bounds(); + } else { + //mesh.bounds = ArraysMeshGenerator.ToBounds(meshBoundsMin, meshBoundsMax); + float halfWidth = (meshBoundsMax.x - meshBoundsMin.x) * 0.5f; + float halfHeight = (meshBoundsMax.y - meshBoundsMin.y) * 0.5f; + mesh.bounds = new Bounds { + center = new Vector3(meshBoundsMin.x + halfWidth, meshBoundsMin.y + halfHeight), + extents = new Vector3(halfWidth, halfHeight, meshBoundsThickness * 0.5f) + }; + } + } + + { + if (settings.addNormals) { + int oldLength = 0; + + if (normals == null) + normals = new Vector3[vbiLength]; + else + oldLength = normals.Length; + + if (oldLength != vbiLength) { + Array.Resize(ref this.normals, vbiLength); + var localNormals = this.normals; + for (int i = oldLength; i < vbiLength; i++) localNormals[i] = Vector3.back; + } + mesh.normals = this.normals; + } + + if (settings.tintBlack) { + if (uv2 != null) { + // Sometimes, the vertex buffer becomes smaller. We need to trim the size of the tint black buffers to match. + if (vbiLength != uv2.Items.Length) { + Array.Resize(ref uv2.Items, vbiLength); + Array.Resize(ref uv3.Items, vbiLength); + uv2.Count = uv3.Count = vbiLength; + } + mesh.uv2 = this.uv2.Items; + mesh.uv3 = this.uv3.Items; + } + } + } + } + + public void FillLateVertexData (Mesh mesh) { + if (settings.calculateTangents) { + int vertexCount = this.vertexBuffer.Count; + var sbi = submeshes.Items; + int submeshCount = submeshes.Count; + var vbi = vertexBuffer.Items; + var ubi = uvBuffer.Items; + + MeshGenerator.SolveTangents2DEnsureSize(ref this.tangents, ref this.tempTanBuffer, vertexCount, vbi.Length); + for (int i = 0; i < submeshCount; i++) { + var submesh = sbi[i].Items; + int triangleCount = sbi[i].Count; + MeshGenerator.SolveTangents2DTriangles(this.tempTanBuffer, submesh, triangleCount, vbi, ubi, vertexCount); + } + MeshGenerator.SolveTangents2DBuffer(this.tangents, this.tempTanBuffer, vertexCount); + mesh.tangents = this.tangents; + } + } + + public void FillTriangles (Mesh mesh) { + int submeshCount = submeshes.Count; + var submeshesItems = submeshes.Items; + mesh.subMeshCount = submeshCount; + + for (int i = 0; i < submeshCount; i++) + mesh.SetTriangles(submeshesItems[i].Items, i, false); + } + + public void FillTrianglesSingle (Mesh mesh) { + mesh.SetTriangles(submeshes.Items[0].Items, 0, false); + } + #endregion + + public void EnsureVertexCapacity (int minimumVertexCount, bool inlcudeTintBlack = false, bool includeTangents = false, bool includeNormals = false) { + if (minimumVertexCount > vertexBuffer.Items.Length) { + Array.Resize(ref vertexBuffer.Items, minimumVertexCount); + Array.Resize(ref uvBuffer.Items, minimumVertexCount); + Array.Resize(ref colorBuffer.Items, minimumVertexCount); + + if (inlcudeTintBlack) { + if (uv2 == null) { + uv2 = new ExposedList(minimumVertexCount); + uv3 = new ExposedList(minimumVertexCount); + } + uv2.Resize(minimumVertexCount); + uv3.Resize(minimumVertexCount); + } + + if (includeNormals) { + if (normals == null) + normals = new Vector3[minimumVertexCount]; + else + Array.Resize(ref normals, minimumVertexCount); + + } + + if (includeTangents) { + if (tangents == null) + tangents = new Vector4[minimumVertexCount]; + else + Array.Resize(ref tangents, minimumVertexCount); + } + } + } + + /// Trims internal buffers to reduce the resulting mesh data stream size. + public void TrimExcess () { + vertexBuffer.TrimExcess(); + uvBuffer.TrimExcess(); + colorBuffer.TrimExcess(); + + if (uv2 != null) uv2.TrimExcess(); + if (uv3 != null) uv3.TrimExcess(); + + int vbiLength = vertexBuffer.Items.Length; + if (normals != null) Array.Resize(ref normals, vbiLength); + if (tangents != null) Array.Resize(ref tangents, vbiLength); + } + + #region TangentSolver2D + // Thanks to contributions from forum user ToddRivers + + /// Step 1 of solving tangents. Ensure you have buffers of the correct size. + /// Eventual Vector4[] tangent buffer to assign to Mesh.tangents. + /// Temporary Vector2 buffer for calculating directions. + /// Number of vertices that require tangents (or the size of the vertex array) + internal static void SolveTangents2DEnsureSize (ref Vector4[] tangentBuffer, ref Vector2[] tempTanBuffer, int vertexCount, int vertexBufferLength) { + if (tangentBuffer == null || tangentBuffer.Length != vertexBufferLength) + tangentBuffer = new Vector4[vertexBufferLength]; + + if (tempTanBuffer == null || tempTanBuffer.Length < vertexCount * 2) + tempTanBuffer = new Vector2[vertexCount * 2]; // two arrays in one. + } + + /// Step 2 of solving tangents. Fills (part of) a temporary tangent-solution buffer based on the vertices and uvs defined by a submesh's triangle buffer. Only needs to be called once for single-submesh meshes. + /// A temporary Vector3[] for calculating tangents. + /// The mesh's current vertex position buffer. + /// The mesh's current triangles buffer. + /// The mesh's current uvs buffer. + /// Number of vertices that require tangents (or the size of the vertex array) + /// The number of triangle indexes in the triangle array to be used. + internal static void SolveTangents2DTriangles (Vector2[] tempTanBuffer, int[] triangles, int triangleCount, Vector3[] vertices, Vector2[] uvs, int vertexCount) { + Vector2 sdir; + Vector2 tdir; + for (int t = 0; t < triangleCount; t += 3) { + int i1 = triangles[t + 0]; + int i2 = triangles[t + 1]; + int i3 = triangles[t + 2]; + + Vector3 v1 = vertices[i1]; + Vector3 v2 = vertices[i2]; + Vector3 v3 = vertices[i3]; + + Vector2 w1 = uvs[i1]; + Vector2 w2 = uvs[i2]; + Vector2 w3 = uvs[i3]; + + float x1 = v2.x - v1.x; + float x2 = v3.x - v1.x; + float y1 = v2.y - v1.y; + float y2 = v3.y - v1.y; + + float s1 = w2.x - w1.x; + float s2 = w3.x - w1.x; + float t1 = w2.y - w1.y; + float t2 = w3.y - w1.y; + + float div = s1 * t2 - s2 * t1; + float r = (div == 0f) ? 0f : 1f / div; + + sdir.x = (t2 * x1 - t1 * x2) * r; + sdir.y = (t2 * y1 - t1 * y2) * r; + tempTanBuffer[i1] = tempTanBuffer[i2] = tempTanBuffer[i3] = sdir; + + tdir.x = (s1 * x2 - s2 * x1) * r; + tdir.y = (s1 * y2 - s2 * y1) * r; + tempTanBuffer[vertexCount + i1] = tempTanBuffer[vertexCount + i2] = tempTanBuffer[vertexCount + i3] = tdir; + } + } + + /// Step 3 of solving tangents. Fills a Vector4[] tangents array according to values calculated in step 2. + /// A Vector4[] that will eventually be used to set Mesh.tangents + /// A temporary Vector3[] for calculating tangents. + /// Number of vertices that require tangents (or the size of the vertex array) + internal static void SolveTangents2DBuffer (Vector4[] tangents, Vector2[] tempTanBuffer, int vertexCount) { + Vector4 tangent; + tangent.z = 0; + for (int i = 0; i < vertexCount; ++i) { + Vector2 t = tempTanBuffer[i]; + + // t.Normalize() (aggressively inlined). Even better if offloaded to GPU via vertex shader. + float magnitude = Mathf.Sqrt(t.x * t.x + t.y * t.y); + if (magnitude > 1E-05) { + float reciprocalMagnitude = 1f/magnitude; + t.x *= reciprocalMagnitude; + t.y *= reciprocalMagnitude; + } + + Vector2 t2 = tempTanBuffer[vertexCount + i]; + tangent.x = t.x; + tangent.y = t.y; + //tangent.z = 0; + tangent.w = (t.y * t2.x > t.x * t2.y) ? 1 : -1; // 2D direction calculation. Used for binormals. + tangents[i] = tangent; + } + } + #endregion + + #region AttachmentRendering + static List AttachmentVerts = new List(); + static List AttachmentUVs = new List(); + static List AttachmentColors32 = new List(); + static List AttachmentIndices = new List(); + + /// Fills mesh vertex data to render a RegionAttachment. + public static void FillMeshLocal (Mesh mesh, RegionAttachment regionAttachment) { + if (mesh == null) return; + if (regionAttachment == null) return; + + AttachmentVerts.Clear(); + var offsets = regionAttachment.Offset; + AttachmentVerts.Add(new Vector3(offsets[RegionAttachment.BLX], offsets[RegionAttachment.BLY])); + AttachmentVerts.Add(new Vector3(offsets[RegionAttachment.ULX], offsets[RegionAttachment.ULY])); + AttachmentVerts.Add(new Vector3(offsets[RegionAttachment.URX], offsets[RegionAttachment.URY])); + AttachmentVerts.Add(new Vector3(offsets[RegionAttachment.BRX], offsets[RegionAttachment.BRY])); + + AttachmentUVs.Clear(); + var uvs = regionAttachment.UVs; + AttachmentUVs.Add(new Vector2(uvs[RegionAttachment.ULX], uvs[RegionAttachment.ULY])); + AttachmentUVs.Add(new Vector2(uvs[RegionAttachment.URX], uvs[RegionAttachment.URY])); + AttachmentUVs.Add(new Vector2(uvs[RegionAttachment.BRX], uvs[RegionAttachment.BRY])); + AttachmentUVs.Add(new Vector2(uvs[RegionAttachment.BLX], uvs[RegionAttachment.BLY])); + + AttachmentColors32.Clear(); + Color32 c = (Color32)(new Color(regionAttachment.r, regionAttachment.g, regionAttachment.b, regionAttachment.a)); + for (int i = 0; i < 4; i++) + AttachmentColors32.Add(c); + + AttachmentIndices.Clear(); + AttachmentIndices.AddRange(new[] { 0, 2, 1, 0, 3, 2 }); + + mesh.Clear(); + mesh.name = regionAttachment.Name; + mesh.SetVertices(AttachmentVerts); + mesh.SetUVs(0, AttachmentUVs); + mesh.SetColors(AttachmentColors32); + mesh.SetTriangles(AttachmentIndices, 0); + mesh.RecalculateBounds(); + + AttachmentVerts.Clear(); + AttachmentUVs.Clear(); + AttachmentColors32.Clear(); + AttachmentIndices.Clear(); + } + + public static void FillMeshLocal (Mesh mesh, MeshAttachment meshAttachment, SkeletonData skeletonData) { + if (mesh == null) return; + if (meshAttachment == null) return; + int vertexCount = meshAttachment.WorldVerticesLength / 2; + + AttachmentVerts.Clear(); + if (meshAttachment.IsWeighted()) { + int count = meshAttachment.WorldVerticesLength; + int[] meshAttachmentBones = meshAttachment.bones; + int v = 0; + + float[] vertices = meshAttachment.vertices; + for (int w = 0, b = 0; w < count; w += 2) { + float wx = 0, wy = 0; + int n = meshAttachmentBones[v++]; + n += v; + for (; v < n; v++, b += 3) { + BoneMatrix bm = BoneMatrix.CalculateSetupWorld(skeletonData.bones.Items[meshAttachmentBones[v]]); + float vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; + wx += (vx * bm.a + vy * bm.b + bm.x) * weight; + wy += (vx * bm.c + vy * bm.d + bm.y) * weight; + } + AttachmentVerts.Add(new Vector3(wx, wy)); + } + } else { + var localVerts = meshAttachment.Vertices; + Vector3 pos = default(Vector3); + for (int i = 0; i < vertexCount; i++) { + int ii = i * 2; + pos.x = localVerts[ii]; + pos.y = localVerts[ii + 1]; + AttachmentVerts.Add(pos); + } + } + + var uvs = meshAttachment.uvs; + Vector2 uv = default(Vector2); + Color32 c = (Color32)(new Color(meshAttachment.r, meshAttachment.g, meshAttachment.b, meshAttachment.a)); + AttachmentUVs.Clear(); + AttachmentColors32.Clear(); + for (int i = 0; i < vertexCount; i++) { + int ii = i * 2; + uv.x = uvs[ii]; + uv.y = uvs[ii + 1]; + AttachmentUVs.Add(uv); + + AttachmentColors32.Add(c); + } + + AttachmentIndices.Clear(); + AttachmentIndices.AddRange(meshAttachment.triangles); + + mesh.Clear(); + mesh.name = meshAttachment.Name; + mesh.SetVertices(AttachmentVerts); + mesh.SetUVs(0, AttachmentUVs); + mesh.SetColors(AttachmentColors32); + mesh.SetTriangles(AttachmentIndices, 0); + mesh.RecalculateBounds(); + + AttachmentVerts.Clear(); + AttachmentUVs.Clear(); + AttachmentColors32.Clear(); + AttachmentIndices.Clear(); + } + #endregion + } + + /// A double-buffered Mesh, and a shared material array, bundled for use by Spine components that need to push a Mesh and materials to a Unity MeshRenderer and MeshFilter. + public class MeshRendererBuffers : IDisposable { + DoubleBuffered doubleBufferedMesh; + internal readonly ExposedList submeshMaterials = new ExposedList(); + internal Material[] sharedMaterials = new Material[0]; + + public void Initialize () { + if (doubleBufferedMesh != null) { + doubleBufferedMesh.GetNext().Clear(); + doubleBufferedMesh.GetNext().Clear(); + submeshMaterials.Clear(); + } else { + doubleBufferedMesh = new DoubleBuffered(); + } + } + + /// Returns a sharedMaterials array for use on a MeshRenderer. + /// + public Material[] GetUpdatedSharedMaterialsArray () { + if (submeshMaterials.Count == sharedMaterials.Length) + submeshMaterials.CopyTo(sharedMaterials); + else + sharedMaterials = submeshMaterials.ToArray(); + + return sharedMaterials; + } + + /// Returns true if the materials were modified since the buffers were last updated. + public bool MaterialsChangedInLastUpdate () { + int newSubmeshMaterials = submeshMaterials.Count; + var sharedMaterials = this.sharedMaterials; + if (newSubmeshMaterials != sharedMaterials.Length) return true; + + var submeshMaterialsItems = submeshMaterials.Items; + for (int i = 0; i < newSubmeshMaterials; i++) + if (!Material.ReferenceEquals(submeshMaterialsItems[i], sharedMaterials[i])) return true; //if (submeshMaterialsItems[i].GetInstanceID() != sharedMaterials[i].GetInstanceID()) return true; + + return false; + } + + /// Updates the internal shared materials array with the given instruction list. + public void UpdateSharedMaterials (ExposedList instructions) { + int newSize = instructions.Count; + { //submeshMaterials.Resize(instructions.Count); + if (newSize > submeshMaterials.Items.Length) + Array.Resize(ref submeshMaterials.Items, newSize); + submeshMaterials.Count = newSize; + } + + var submeshMaterialsItems = submeshMaterials.Items; + var instructionsItems = instructions.Items; + for (int i = 0; i < newSize; i++) + submeshMaterialsItems[i] = instructionsItems[i].material; + } + + public SmartMesh GetNextMesh () { + return doubleBufferedMesh.GetNext(); + } + + public void Clear () { + sharedMaterials = new Material[0]; + submeshMaterials.Clear(); + } + + public void Dispose () { + if (doubleBufferedMesh == null) return; + doubleBufferedMesh.GetNext().Dispose(); + doubleBufferedMesh.GetNext().Dispose(); + doubleBufferedMesh = null; + } + + ///This is a Mesh that also stores the instructions SkeletonRenderer generated for it. + public class SmartMesh : IDisposable { + public Mesh mesh = SpineMesh.NewSkeletonMesh(); + public SkeletonRendererInstruction instructionUsed = new SkeletonRendererInstruction(); + + public void Clear () { + mesh.Clear(); + instructionUsed.Clear(); + } + + public void Dispose () { + if (mesh != null) { + #if UNITY_EDITOR + if (Application.isEditor && !Application.isPlaying) + UnityEngine.Object.DestroyImmediate(mesh); + else + UnityEngine.Object.Destroy(mesh); + #else + UnityEngine.Object.Destroy(mesh); + #endif + } + mesh = null; + } + } + } + + /// Instructions used by a SkeletonRenderer to render a mesh. + public class SkeletonRendererInstruction { + public readonly ExposedList submeshInstructions = new ExposedList(); + + public bool immutableTriangles; + #if SPINE_TRIANGLECHECK + public bool hasActiveClipping; + public int rawVertexCount = -1; + public readonly ExposedList attachments = new ExposedList(); + #endif + + public void Clear () { + #if SPINE_TRIANGLECHECK + this.attachments.Clear(false); + rawVertexCount = -1; + hasActiveClipping = false; + #endif + this.submeshInstructions.Clear(false); + } + + public void Dispose () { + attachments.Clear(true); + } + + public void SetWithSubset (ExposedList instructions, int startSubmesh, int endSubmesh) { + #if SPINE_TRIANGLECHECK + int runningVertexCount = 0; + #endif + + var submeshes = this.submeshInstructions; + submeshes.Clear(false); + int submeshCount = endSubmesh - startSubmesh; + submeshes.Resize(submeshCount); + var submeshesItems = submeshes.Items; + var instructionsItems = instructions.Items; + for (int i = 0; i < submeshCount; i++) { + var instruction = instructionsItems[startSubmesh + i]; + submeshesItems[i] = instruction; + #if SPINE_TRIANGLECHECK + this.hasActiveClipping |= instruction.hasClipping; + submeshesItems[i].rawFirstVertexIndex = runningVertexCount; // Ensure current instructions have correct cached values. + runningVertexCount += instruction.rawVertexCount; // vertexCount will also be used for the rest of this method. + #endif + } + #if SPINE_TRIANGLECHECK + this.rawVertexCount = runningVertexCount; + + // assumption: instructions are contiguous. start and end are valid within instructions. + + int startSlot = instructionsItems[startSubmesh].startSlot; + int endSlot = instructionsItems[endSubmesh - 1].endSlot; + attachments.Clear(false); + int attachmentCount = endSlot - startSlot; + attachments.Resize(attachmentCount); + var attachmentsItems = attachments.Items; + + var drawOrder = instructionsItems[0].skeleton.drawOrder.Items; + for (int i = 0; i < attachmentCount; i++) + attachmentsItems[i] = drawOrder[startSlot + i].attachment; + #endif + } + + public void Set (SkeletonRendererInstruction other) { + this.immutableTriangles = other.immutableTriangles; + + #if SPINE_TRIANGLECHECK + this.hasActiveClipping = other.hasActiveClipping; + this.rawVertexCount = other.rawVertexCount; + this.attachments.Clear(false); + this.attachments.EnsureCapacity(other.attachments.Capacity); + this.attachments.Count = other.attachments.Count; + other.attachments.CopyTo(this.attachments.Items); + #endif + + this.submeshInstructions.Clear(false); + this.submeshInstructions.EnsureCapacity(other.submeshInstructions.Capacity); + this.submeshInstructions.Count = other.submeshInstructions.Count; + other.submeshInstructions.CopyTo(this.submeshInstructions.Items); + } + + public static bool GeometryNotEqual (SkeletonRendererInstruction a, SkeletonRendererInstruction b) { + #if SPINE_TRIANGLECHECK + #if UNITY_EDITOR + if (!Application.isPlaying) + return true; + #endif + + if (a.hasActiveClipping || b.hasActiveClipping) return true; // Triangles are unpredictable when clipping is active. + + // Everything below assumes the raw vertex and triangle counts were used. (ie, no clipping was done) + if (a.rawVertexCount != b.rawVertexCount) return true; + + if (a.immutableTriangles != b.immutableTriangles) return true; + + int attachmentCountB = b.attachments.Count; + if (a.attachments.Count != attachmentCountB) return true; // Bounds check for the looped storedAttachments count below. + + // Submesh count changed + int submeshCountA = a.submeshInstructions.Count; + int submeshCountB = b.submeshInstructions.Count; + if (submeshCountA != submeshCountB) return true; + + // Submesh Instruction mismatch + var submeshInstructionsItemsA = a.submeshInstructions.Items; + var submeshInstructionsItemsB = b.submeshInstructions.Items; + + var attachmentsA = a.attachments.Items; + var attachmentsB = b.attachments.Items; + for (int i = 0; i < attachmentCountB; i++) + if (!System.Object.ReferenceEquals(attachmentsA[i], attachmentsB[i])) return true; + + for (int i = 0; i < submeshCountB; i++) { + var submeshA = submeshInstructionsItemsA[i]; + var submeshB = submeshInstructionsItemsB[i]; + + if (!( + submeshA.rawVertexCount == submeshB.rawVertexCount && + submeshA.startSlot == submeshB.startSlot && + submeshA.endSlot == submeshB.endSlot + && submeshA.rawTriangleCount == submeshB.rawTriangleCount && + submeshA.rawFirstVertexIndex == submeshB.rawFirstVertexIndex + )) + return true; + } + + return false; + #else + // In normal immutable triangle use, immutableTriangles will be initially false, forcing the smartmesh to update the first time but never again after that, unless there was an immutableTriangles flag mismatch.. + if (a.immutableTriangles || b.immutableTriangles) + return (a.immutableTriangles != b.immutableTriangles); + + return true; + #endif + } + } + + } diff --git a/Assets/Spine/Runtime/spine-unity/Components/RootMotion.meta b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier.meta similarity index 67% rename from Assets/Spine/Runtime/spine-unity/Components/RootMotion.meta rename to Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier.meta index d8d3bd381..87efa1ac4 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/RootMotion.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 2b957aa69dae9f948bacdeec549d28ea +guid: bdfae2bc4b385b84eb4f5f6855d0f991 folderAsset: yes -timeCreated: 1593173800 +timeCreated: 1537527020 licenseType: Pro DefaultImporter: userData: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/AnimationMatchModifierAsset.cs b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/AnimationMatchModifierAsset.cs new file mode 100644 index 000000000..0442fc805 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/AnimationMatchModifierAsset.cs @@ -0,0 +1,263 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +using Spine; +using Spine.Unity; + +namespace Spine.Unity.Modules { + + //[CreateAssetMenu(menuName = "Spine/SkeletonData Modifiers/Animation Match", order = 200)] + public class AnimationMatchModifierAsset : SkeletonDataModifierAsset { + + public bool matchAllAnimations = true; + + public override void Apply (SkeletonData skeletonData) { + if (matchAllAnimations) + AnimationTools.MatchAnimationTimelines(skeletonData.animations, skeletonData); + } + + public static class AnimationTools { + + #region Filler Timelines + /// + /// Matches the animation timelines across the given set of animations. + /// This allows unkeyed properties to assume setup pose when animations are naively mixed using Animation.Apply. + /// + /// An enumerable collection animations whose timelines will be matched. + /// The SkeletonData where the animations belong. + public static void MatchAnimationTimelines (IEnumerable animations, SkeletonData skeletonData) { + if (animations == null) return; + if (skeletonData == null) throw new System.ArgumentNullException("skeletonData", "Timelines can't be matched without a SkeletonData source."); + + // Build a reference collection of timelines to match + // and a collection of dummy timelines that can be used to fill-in missing items. + var timelineDictionary = new Dictionary(); + foreach (var animation in animations) { + foreach (var timeline in animation.timelines) { + if (timeline is EventTimeline) continue; + + int propertyID = timeline.PropertyId; + if (!timelineDictionary.ContainsKey(propertyID)) { + timelineDictionary.Add(propertyID, GetFillerTimeline(timeline, skeletonData)); + } + } + } + var idsToMatch = new List(timelineDictionary.Keys); + + // For each animation in the list, check for and add missing timelines. + var currentAnimationIDs = new HashSet(); + foreach (var animation in animations) { + currentAnimationIDs.Clear(); + foreach (var timeline in animation.timelines) { + if (timeline is EventTimeline) continue; + currentAnimationIDs.Add(timeline.PropertyId); + } + + var animationTimelines = animation.timelines; + foreach (int propertyID in idsToMatch) { + if (!currentAnimationIDs.Contains(propertyID)) + animationTimelines.Add(timelineDictionary[propertyID]); + } + } + + // These are locals, but sometimes Unity's GC does weird stuff. So let's clean up. + timelineDictionary.Clear(); + timelineDictionary = null; + idsToMatch.Clear(); + idsToMatch = null; + currentAnimationIDs.Clear(); + currentAnimationIDs = null; + } + + static Timeline GetFillerTimeline (Timeline timeline, SkeletonData skeletonData) { + int propertyID = timeline.PropertyId; + int tt = propertyID >> 24; + var timelineType = (TimelineType)tt; + + switch (timelineType) { + // Bone + case TimelineType.Rotate: + return GetFillerTimeline((RotateTimeline)timeline, skeletonData); + case TimelineType.Translate: + return GetFillerTimeline((TranslateTimeline)timeline, skeletonData); + case TimelineType.Scale: + return GetFillerTimeline((ScaleTimeline)timeline, skeletonData); + case TimelineType.Shear: + return GetFillerTimeline((ShearTimeline)timeline, skeletonData); + + // Slot + case TimelineType.Attachment: + return GetFillerTimeline((AttachmentTimeline)timeline, skeletonData); + case TimelineType.Color: + return GetFillerTimeline((ColorTimeline)timeline, skeletonData); + case TimelineType.TwoColor: + return GetFillerTimeline((TwoColorTimeline)timeline, skeletonData); + case TimelineType.Deform: + return GetFillerTimeline((DeformTimeline)timeline, skeletonData); + + // Skeleton + case TimelineType.DrawOrder: + return GetFillerTimeline((DrawOrderTimeline)timeline, skeletonData); + + // IK Constraint + case TimelineType.IkConstraint: + return GetFillerTimeline((IkConstraintTimeline)timeline, skeletonData); + + // TransformConstraint + case TimelineType.TransformConstraint: + return GetFillerTimeline((TransformConstraintTimeline)timeline, skeletonData); + + // Path Constraint + case TimelineType.PathConstraintPosition: + return GetFillerTimeline((PathConstraintPositionTimeline)timeline, skeletonData); + case TimelineType.PathConstraintSpacing: + return GetFillerTimeline((PathConstraintSpacingTimeline)timeline, skeletonData); + case TimelineType.PathConstraintMix: + return GetFillerTimeline((PathConstraintMixTimeline)timeline, skeletonData); + } + + return null; + } + + static RotateTimeline GetFillerTimeline (RotateTimeline timeline, SkeletonData skeletonData) { + var t = new RotateTimeline(1); + t.boneIndex = timeline.boneIndex; + t.SetFrame(0, 0, 0); + return t; + } + + static TranslateTimeline GetFillerTimeline (TranslateTimeline timeline, SkeletonData skeletonData) { + var t = new TranslateTimeline(1); + t.boneIndex = timeline.boneIndex; + t.SetFrame(0, 0, 0, 0); + return t; + } + + static ScaleTimeline GetFillerTimeline (ScaleTimeline timeline, SkeletonData skeletonData) { + var t = new ScaleTimeline(1); + t.boneIndex = timeline.boneIndex; + t.SetFrame(0, 0, 0, 0); + return t; + } + + static ShearTimeline GetFillerTimeline (ShearTimeline timeline, SkeletonData skeletonData) { + var t = new ShearTimeline(1); + t.boneIndex = timeline.boneIndex; + t.SetFrame(0, 0, 0, 0); + return t; + } + + static AttachmentTimeline GetFillerTimeline (AttachmentTimeline timeline, SkeletonData skeletonData) { + var t = new AttachmentTimeline(1); + t.slotIndex = timeline.slotIndex; + var slotData = skeletonData.slots.Items[t.slotIndex]; + t.SetFrame(0, 0, slotData.attachmentName); + return t; + } + + static ColorTimeline GetFillerTimeline (ColorTimeline timeline, SkeletonData skeletonData) { + var t = new ColorTimeline(1); + t.slotIndex = timeline.slotIndex; + var slotData = skeletonData.slots.Items[t.slotIndex]; + t.SetFrame(0, 0, slotData.r, slotData.g, slotData.b, slotData.a); + return t; + } + + static TwoColorTimeline GetFillerTimeline (TwoColorTimeline timeline, SkeletonData skeletonData) { + var t = new TwoColorTimeline(1); + t.slotIndex = timeline.slotIndex; + var slotData = skeletonData.slots.Items[t.slotIndex]; + t.SetFrame(0, 0, slotData.r, slotData.g, slotData.b, slotData.a, slotData.r2, slotData.g2, slotData.b2); + return t; + } + + static DeformTimeline GetFillerTimeline (DeformTimeline timeline, SkeletonData skeletonData) { + var t = new DeformTimeline(1); + t.slotIndex = timeline.slotIndex; + t.attachment = timeline.attachment; + + if (t.attachment.IsWeighted()) { + t.SetFrame(0, 0, new float[t.attachment.vertices.Length]); + } else { + t.SetFrame(0, 0, t.attachment.vertices.Clone() as float[]); + } + + return t; + } + + static DrawOrderTimeline GetFillerTimeline (DrawOrderTimeline timeline, SkeletonData skeletonData) { + var t = new DrawOrderTimeline(1); + t.SetFrame(0, 0, null); // null means use setup pose in DrawOrderTimeline.Apply. + return t; + } + + static IkConstraintTimeline GetFillerTimeline (IkConstraintTimeline timeline, SkeletonData skeletonData) { + var t = new IkConstraintTimeline(1); + var ikConstraintData = skeletonData.ikConstraints.Items[timeline.ikConstraintIndex]; + t.SetFrame(0, 0, ikConstraintData.mix, ikConstraintData.bendDirection, ikConstraintData.compress, ikConstraintData.stretch); + return t; + } + + static TransformConstraintTimeline GetFillerTimeline (TransformConstraintTimeline timeline, SkeletonData skeletonData) { + var t = new TransformConstraintTimeline(1); + var data = skeletonData.transformConstraints.Items[timeline.transformConstraintIndex]; + t.SetFrame(0, 0, data.rotateMix, data.translateMix, data.scaleMix, data.shearMix); + return t; + } + + static PathConstraintPositionTimeline GetFillerTimeline (PathConstraintPositionTimeline timeline, SkeletonData skeletonData) { + var t = new PathConstraintPositionTimeline(1); + var data = skeletonData.pathConstraints.Items[timeline.pathConstraintIndex]; + t.SetFrame(0, 0, data.position); + return t; + } + + static PathConstraintSpacingTimeline GetFillerTimeline (PathConstraintSpacingTimeline timeline, SkeletonData skeletonData) { + var t = new PathConstraintSpacingTimeline(1); + var data = skeletonData.pathConstraints.Items[timeline.pathConstraintIndex]; + t.SetFrame(0, 0, data.spacing); + return t; + } + + static PathConstraintMixTimeline GetFillerTimeline (PathConstraintMixTimeline timeline, SkeletonData skeletonData) { + var t = new PathConstraintMixTimeline(1); + var data = skeletonData.pathConstraints.Items[timeline.pathConstraintIndex]; + t.SetFrame(0, 0, data.rotateMix, data.translateMix); + return t; + } + #endregion + } + + } + +} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicCustomMaterialsInspector.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/AnimationMatchModifierAsset.cs.meta similarity index 75% rename from Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicCustomMaterialsInspector.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/AnimationMatchModifierAsset.cs.meta index 4a5d35197..f6b0ff213 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/SkeletonGraphicCustomMaterialsInspector.cs.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/AnimationMatchModifierAsset.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 349bf125947e3aa4bb78690fec69ea17 -timeCreated: 1588789940 +guid: df7d457928e0f4041a439f9847f72290 +timeCreated: 1537527074 licenseType: Pro MonoImporter: serializedVersion: 2 diff --git a/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/AnimationMatchModifierAsset.txt b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/AnimationMatchModifierAsset.txt new file mode 100644 index 000000000..0d5d6ae8c --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/AnimationMatchModifierAsset.txt @@ -0,0 +1,6 @@ +AnimationMatchModifierAsset +=========================== + +This is a SkeletonDataModifierAsset. Add it to a SkeletonDataAsset to apply its effects when its SkeletonData is loaded. + +AnimationMatchModifierAsset processes animations so that their timelines match. This allows them to function with naive Animation Apply systems such as SkeletonMecanim without the need for autoreset functionality. \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/AnimationMatchModifierAsset.txt.meta b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/AnimationMatchModifierAsset.txt.meta new file mode 100644 index 000000000..c26ae498e --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/AnimationMatchModifierAsset.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b4436c0c78cc5ee469089ed864f4e1ea +timeCreated: 1537528259 +licenseType: Pro +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/Default Match All Animations.asset b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/Default Match All Animations.asset new file mode 100644 index 000000000..4f0bab3f7 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/Default Match All Animations.asset @@ -0,0 +1,14 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: df7d457928e0f4041a439f9847f72290, type: 3} + m_Name: Default Match All Animations + m_EditorClassIdentifier: + matchAllAnimations: 1 diff --git a/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/Default Match All Animations.asset.meta b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/Default Match All Animations.asset.meta new file mode 100644 index 000000000..983a67077 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/AnimationMatchModifier/Default Match All Animations.asset.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8623082208cae724e88314ec951691e1 +timeCreated: 1537527914 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools.meta b/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools.meta new file mode 100644 index 000000000..fee2e8cca --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f601b524e4da4704a9e0f6b7e05d6ca6 +folderAsset: yes +timeCreated: 1478437840 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs b/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs new file mode 100644 index 000000000..4912fd83c --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs @@ -0,0 +1,1135 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +using UnityEngine; +using System.Collections.Generic; + +namespace Spine.Unity.Modules.AttachmentTools { + public static class AttachmentRegionExtensions { + #region GetRegion + /// + /// Tries to get the region (image) of a renderable attachment. If the attachment is not renderable, it returns null. + public static AtlasRegion GetRegion (this Attachment attachment) { + var renderableAttachment = attachment as IHasRendererObject; + if (renderableAttachment != null) + return renderableAttachment.RendererObject as AtlasRegion; + + return null; + } + + /// Gets the region (image) of a RegionAttachment + public static AtlasRegion GetRegion (this RegionAttachment regionAttachment) { + return regionAttachment.RendererObject as AtlasRegion; + } + + /// Gets the region (image) of a MeshAttachment + public static AtlasRegion GetRegion (this MeshAttachment meshAttachment) { + return meshAttachment.RendererObject as AtlasRegion; + } + #endregion + #region SetRegion + /// + /// Tries to set the region (image) of a renderable attachment. If the attachment is not renderable, nothing is applied. + public static void SetRegion (this Attachment attachment, AtlasRegion region, bool updateOffset = true) { + var regionAttachment = attachment as RegionAttachment; + if (regionAttachment != null) + regionAttachment.SetRegion(region, updateOffset); + + var meshAttachment = attachment as MeshAttachment; + if (meshAttachment != null) + meshAttachment.SetRegion(region, updateOffset); + } + + /// Sets the region (image) of a RegionAttachment + public static void SetRegion (this RegionAttachment attachment, AtlasRegion region, bool updateOffset = true) { + if (region == null) throw new System.ArgumentNullException("region"); + + // (AtlasAttachmentLoader.cs) + attachment.RendererObject = region; + attachment.SetUVs(region.u, region.v, region.u2, region.v2, region.rotate); + attachment.regionOffsetX = region.offsetX; + attachment.regionOffsetY = region.offsetY; + attachment.regionWidth = region.width; + attachment.regionHeight = region.height; + attachment.regionOriginalWidth = region.originalWidth; + attachment.regionOriginalHeight = region.originalHeight; + + if (updateOffset) attachment.UpdateOffset(); + } + + /// Sets the region (image) of a MeshAttachment + public static void SetRegion (this MeshAttachment attachment, AtlasRegion region, bool updateUVs = true) { + if (region == null) throw new System.ArgumentNullException("region"); + + // (AtlasAttachmentLoader.cs) + attachment.RendererObject = region; + attachment.RegionU = region.u; + attachment.RegionV = region.v; + attachment.RegionU2 = region.u2; + attachment.RegionV2 = region.v2; + attachment.RegionRotate = region.rotate; + attachment.regionOffsetX = region.offsetX; + attachment.regionOffsetY = region.offsetY; + attachment.regionWidth = region.width; + attachment.regionHeight = region.height; + attachment.regionOriginalWidth = region.originalWidth; + attachment.regionOriginalHeight = region.originalHeight; + + if (updateUVs) attachment.UpdateUVs(); + } + #endregion + + #region Runtime RegionAttachments + /// + /// Creates a RegionAttachment based on a sprite. This method creates a real, usable AtlasRegion. That AtlasRegion uses a new AtlasPage with the Material provided./// + public static RegionAttachment ToRegionAttachment (this Sprite sprite, Material material, float rotation = 0f) { + return sprite.ToRegionAttachment(material.ToSpineAtlasPage(), rotation); + } + + /// + /// Creates a RegionAttachment based on a sprite. This method creates a real, usable AtlasRegion. That AtlasRegion uses the AtlasPage provided./// + public static RegionAttachment ToRegionAttachment (this Sprite sprite, AtlasPage page, float rotation = 0f) { + if (sprite == null) throw new System.ArgumentNullException("sprite"); + if (page == null) throw new System.ArgumentNullException("page"); + var region = sprite.ToAtlasRegion(page); + var unitsPerPixel = 1f / sprite.pixelsPerUnit; + return region.ToRegionAttachment(sprite.name, unitsPerPixel, rotation); + } + + /// + /// Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate texture of the Sprite's texture data. Returns a RegionAttachment that uses it. Use this if you plan to use a premultiply alpha shader such as "Spine/Skeleton" + public static RegionAttachment ToRegionAttachmentPMAClone (this Sprite sprite, Shader shader, TextureFormat textureFormat = AtlasUtilities.SpineTextureFormat, bool mipmaps = AtlasUtilities.UseMipMaps, Material materialPropertySource = null, float rotation = 0f) { + if (sprite == null) throw new System.ArgumentNullException("sprite"); + if (shader == null) throw new System.ArgumentNullException("shader"); + var region = sprite.ToAtlasRegionPMAClone(shader, textureFormat, mipmaps, materialPropertySource); + var unitsPerPixel = 1f / sprite.pixelsPerUnit; + return region.ToRegionAttachment(sprite.name, unitsPerPixel, rotation); + } + + public static RegionAttachment ToRegionAttachmentPMAClone (this Sprite sprite, Material materialPropertySource, TextureFormat textureFormat = AtlasUtilities.SpineTextureFormat, bool mipmaps = AtlasUtilities.UseMipMaps, float rotation = 0f) { + return sprite.ToRegionAttachmentPMAClone(materialPropertySource.shader, textureFormat, mipmaps, materialPropertySource, rotation); + } + + /// + /// Creates a new RegionAttachment from a given AtlasRegion. + public static RegionAttachment ToRegionAttachment (this AtlasRegion region, string attachmentName, float scale = 0.01f, float rotation = 0f) { + if (string.IsNullOrEmpty(attachmentName)) throw new System.ArgumentException("attachmentName can't be null or empty.", "attachmentName"); + if (region == null) throw new System.ArgumentNullException("region"); + + // (AtlasAttachmentLoader.cs) + var attachment = new RegionAttachment(attachmentName); + + attachment.RendererObject = region; + attachment.SetUVs(region.u, region.v, region.u2, region.v2, region.rotate); + attachment.regionOffsetX = region.offsetX; + attachment.regionOffsetY = region.offsetY; + attachment.regionWidth = region.width; + attachment.regionHeight = region.height; + attachment.regionOriginalWidth = region.originalWidth; + attachment.regionOriginalHeight = region.originalHeight; + + attachment.Path = region.name; + attachment.scaleX = 1; + attachment.scaleY = 1; + attachment.rotation = rotation; + + attachment.r = 1; + attachment.g = 1; + attachment.b = 1; + attachment.a = 1; + + // pass OriginalWidth and OriginalHeight because UpdateOffset uses it in its calculation. + attachment.width = attachment.regionOriginalWidth * scale; + attachment.height = attachment.regionOriginalHeight * scale; + + attachment.SetColor(Color.white); + attachment.UpdateOffset(); + return attachment; + } + + /// Sets the scale. Call regionAttachment.UpdateOffset to apply the change. + public static void SetScale (this RegionAttachment regionAttachment, Vector2 scale) { + regionAttachment.scaleX = scale.x; + regionAttachment.scaleY = scale.y; + } + + /// Sets the scale. Call regionAttachment.UpdateOffset to apply the change. + public static void SetScale (this RegionAttachment regionAttachment, float x, float y) { + regionAttachment.scaleX = x; + regionAttachment.scaleY = y; + } + + /// Sets the position offset. Call regionAttachment.UpdateOffset to apply the change. + public static void SetPositionOffset (this RegionAttachment regionAttachment, Vector2 offset) { + regionAttachment.x = offset.x; + regionAttachment.y = offset.y; + } + + /// Sets the position offset. Call regionAttachment.UpdateOffset to apply the change. + public static void SetPositionOffset (this RegionAttachment regionAttachment, float x, float y) { + regionAttachment.x = x; + regionAttachment.y = y; + } + + /// Sets the rotation. Call regionAttachment.UpdateOffset to apply the change. + public static void SetRotation (this RegionAttachment regionAttachment, float rotation) { + regionAttachment.rotation = rotation; + } + #endregion + } + + public static class AtlasUtilities { + internal const TextureFormat SpineTextureFormat = TextureFormat.RGBA32; + internal const float DefaultMipmapBias = -0.5f; + internal const bool UseMipMaps = false; + internal const float DefaultScale = 0.01f; + + const int NonrenderingRegion = -1; + + public static AtlasRegion ToAtlasRegion (this Texture2D t, Material materialPropertySource, float scale = DefaultScale) { + return t.ToAtlasRegion(materialPropertySource.shader, scale, materialPropertySource); + } + + public static AtlasRegion ToAtlasRegion (this Texture2D t, Shader shader, float scale = DefaultScale, Material materialPropertySource = null) { + var material = new Material(shader); + if (materialPropertySource != null) { + material.CopyPropertiesFromMaterial(materialPropertySource); + material.shaderKeywords = materialPropertySource.shaderKeywords; + } + + material.mainTexture = t; + var page = material.ToSpineAtlasPage(); + + float width = t.width; + float height = t.height; + + var region = new AtlasRegion(); + region.name = t.name; + region.index = -1; + region.rotate = false; + + // World space units + Vector2 boundsMin = Vector2.zero, boundsMax = new Vector2(width, height) * scale; + + // Texture space/pixel units + region.width = (int)width; + region.originalWidth = (int)width; + region.height = (int)height; + region.originalHeight = (int)height; + region.offsetX = width * (0.5f - InverseLerp(boundsMin.x, boundsMax.x, 0)); + region.offsetY = height * (0.5f - InverseLerp(boundsMin.y, boundsMax.y, 0)); + + // Use the full area of the texture. + region.u = 0; + region.v = 1; + region.u2 = 1; + region.v2 = 0; + region.x = 0; + region.y = 0; + + region.page = page; + + return region; + } + + /// + /// Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate of the Sprite's texture data. + public static AtlasRegion ToAtlasRegionPMAClone (this Texture2D t, Material materialPropertySource, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps) { + return t.ToAtlasRegionPMAClone(materialPropertySource.shader, textureFormat, mipmaps, materialPropertySource); + } + + /// + /// Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate of the Sprite's texture data. + public static AtlasRegion ToAtlasRegionPMAClone (this Texture2D t, Shader shader, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, Material materialPropertySource = null) { + var material = new Material(shader); + if (materialPropertySource != null) { + material.CopyPropertiesFromMaterial(materialPropertySource); + material.shaderKeywords = materialPropertySource.shaderKeywords; + } + var newTexture = t.GetClone(textureFormat, mipmaps); + newTexture.ApplyPMA(true); + + newTexture.name = t.name + "-pma-"; + material.name = t.name + shader.name; + + material.mainTexture = newTexture; + var page = material.ToSpineAtlasPage(); + + var region = newTexture.ToAtlasRegion(shader); + region.page = page; + + return region; + } + + /// + /// Creates a new Spine.AtlasPage from a UnityEngine.Material. If the material has a preassigned texture, the page width and height will be set. + public static AtlasPage ToSpineAtlasPage (this Material m) { + var newPage = new AtlasPage { + rendererObject = m, + name = m.name + }; + + var t = m.mainTexture; + if (t != null) { + newPage.width = t.width; + newPage.height = t.height; + } + + return newPage; + } + + /// + /// Creates a Spine.AtlasRegion from a UnityEngine.Sprite. + public static AtlasRegion ToAtlasRegion (this Sprite s, AtlasPage page) { + if (page == null) throw new System.ArgumentNullException("page", "page cannot be null. AtlasPage determines which texture region belongs and how it should be rendered. You can use material.ToSpineAtlasPage() to get a shareable AtlasPage from a Material, or use the sprite.ToAtlasRegion(material) overload."); + var region = s.ToAtlasRegion(); + region.page = page; + return region; + } + + /// + /// Creates a Spine.AtlasRegion from a UnityEngine.Sprite. This creates a new AtlasPage object for every AtlasRegion you create. You can centralize Material control by creating a shared atlas page using Material.ToSpineAtlasPage and using the sprite.ToAtlasRegion(AtlasPage) overload. + public static AtlasRegion ToAtlasRegion (this Sprite s, Material material) { + var region = s.ToAtlasRegion(); + region.page = material.ToSpineAtlasPage(); + return region; + } + + public static AtlasRegion ToAtlasRegionPMAClone (this Sprite s, Material materialPropertySource, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps) { + return s.ToAtlasRegionPMAClone(materialPropertySource.shader, textureFormat, mipmaps, materialPropertySource); + } + + /// + /// Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate of the Sprite's texture data. + public static AtlasRegion ToAtlasRegionPMAClone (this Sprite s, Shader shader, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, Material materialPropertySource = null) { + var material = new Material(shader); + if (materialPropertySource != null) { + material.CopyPropertiesFromMaterial(materialPropertySource); + material.shaderKeywords = materialPropertySource.shaderKeywords; + } + + var tex = s.ToTexture(textureFormat, mipmaps); + tex.ApplyPMA(true); + + tex.name = s.name + "-pma-"; + material.name = tex.name + shader.name; + + material.mainTexture = tex; + var page = material.ToSpineAtlasPage(); + + var region = s.ToAtlasRegion(true); + region.page = page; + + return region; + } + + internal static AtlasRegion ToAtlasRegion (this Sprite s, bool isolatedTexture = false) { + var region = new AtlasRegion(); + region.name = s.name; + region.index = -1; + region.rotate = s.packed && s.packingRotation != SpritePackingRotation.None; + + // World space units + Bounds bounds = s.bounds; + Vector2 boundsMin = bounds.min, boundsMax = bounds.max; + + // Texture space/pixel units + Rect spineRect = s.rect.SpineUnityFlipRect(s.texture.height); + region.width = (int)spineRect.width; + region.originalWidth = (int)spineRect.width; + region.height = (int)spineRect.height; + region.originalHeight = (int)spineRect.height; + region.offsetX = spineRect.width * (0.5f - InverseLerp(boundsMin.x, boundsMax.x, 0)); + region.offsetY = spineRect.height * (0.5f - InverseLerp(boundsMin.y, boundsMax.y, 0)); + + if (isolatedTexture) { + region.u = 0; + region.v = 1; + region.u2 = 1; + region.v2 = 0; + region.x = 0; + region.y = 0; + } else { + Texture2D tex = s.texture; + Rect uvRect = TextureRectToUVRect(s.textureRect, tex.width, tex.height); + region.u = uvRect.xMin; + region.v = uvRect.yMax; + region.u2 = uvRect.xMax; + region.v2 = uvRect.yMin; + region.x = (int)spineRect.x; + region.y = (int)spineRect.y; + } + + return region; + } + + #region Runtime Repacking + /// + /// Fills the outputAttachments list with new attachment objects based on the attachments in sourceAttachments, but mapped to a new single texture using the same material. + /// The list of attachments to be repacked. + /// The List(Attachment) to populate with the newly created Attachment objects. + /// + /// May be null. If no Material property source is provided, no special + public static void GetRepackedAttachments (List sourceAttachments, List outputAttachments, Material materialPropertySource, out Material outputMaterial, out Texture2D outputTexture, int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, string newAssetName = "Repacked Attachments", bool clearCache = false, bool useOriginalNonrenderables = true) { + if (sourceAttachments == null) throw new System.ArgumentNullException("sourceAttachments"); + if (outputAttachments == null) throw new System.ArgumentNullException("outputAttachments"); + + // Use these to detect and use shared regions. + var existingRegions = new Dictionary(); + var regionIndexes = new List(); + var texturesToPack = new List(); + var originalRegions = new List(); + + outputAttachments.Clear(); + outputAttachments.AddRange(sourceAttachments); + + int newRegionIndex = 0; + for (int i = 0, n = sourceAttachments.Count; i < n; i++) { + var originalAttachment = sourceAttachments[i]; + + if (IsRenderable(originalAttachment)) { + var newAttachment = originalAttachment.GetClone(true); + var region = newAttachment.GetRegion(); + int existingIndex; + if (existingRegions.TryGetValue(region, out existingIndex)) { + regionIndexes.Add(existingIndex); // Store the region index for the eventual new attachment. + } else { + originalRegions.Add(region); + texturesToPack.Add(region.ToTexture()); // Add the texture to the PackTextures argument + existingRegions.Add(region, newRegionIndex); // Add the region to the dictionary of known regions + regionIndexes.Add(newRegionIndex); // Store the region index for the eventual new attachment. + newRegionIndex++; + } + + outputAttachments[i] = newAttachment; + } else { + outputAttachments[i] = useOriginalNonrenderables ? originalAttachment : originalAttachment.GetClone(true); + regionIndexes.Add(NonrenderingRegion); // Output attachments pairs with regionIndexes list 1:1. Pad with a sentinel if the attachment doesn't have a region. + } + } + + // Fill a new texture with the collected attachment textures. + var newTexture = new Texture2D(maxAtlasSize, maxAtlasSize, textureFormat, mipmaps); + newTexture.mipMapBias = AtlasUtilities.DefaultMipmapBias; + newTexture.name = newAssetName; + // Copy settings + if (texturesToPack.Count > 0) { + newTexture.anisoLevel = texturesToPack[0].anisoLevel; + } + var rects = newTexture.PackTextures(texturesToPack.ToArray(), padding, maxAtlasSize); + + // Rehydrate the repacked textures as a Material, Spine atlas and Spine.AtlasAttachments + Shader shader = materialPropertySource == null ? Shader.Find("Spine/Skeleton") : materialPropertySource.shader; + var newMaterial = new Material(shader); + if (materialPropertySource != null) { + newMaterial.CopyPropertiesFromMaterial(materialPropertySource); + newMaterial.shaderKeywords = materialPropertySource.shaderKeywords; + } + + newMaterial.name = newAssetName; + newMaterial.mainTexture = newTexture; + var page = newMaterial.ToSpineAtlasPage(); + page.name = newAssetName; + + var repackedRegions = new List(); + for (int i = 0, n = originalRegions.Count; i < n; i++) { + var oldRegion = originalRegions[i]; + var newRegion = UVRectToAtlasRegion(rects[i], oldRegion.name, page, oldRegion.offsetX, oldRegion.offsetY, oldRegion.rotate); + repackedRegions.Add(newRegion); + } + + // Map the cloned attachments to the repacked atlas. + for (int i = 0, n = outputAttachments.Count; i < n; i++) { + var a = outputAttachments[i]; + if (IsRenderable(a)) + a.SetRegion(repackedRegions[regionIndexes[i]]); + } + + // Clean up. + if (clearCache) + AtlasUtilities.ClearCache(); + + outputTexture = newTexture; + outputMaterial = newMaterial; + } + + /// + /// Creates and populates a duplicate skin with cloned attachments that are backed by a new packed texture atlas comprised of all the regions from the original skin. + /// GetRepackedSkin is an expensive operation, preferably call it at level load time. No Spine.Atlas object is created so there is no way to find AtlasRegions except through the Attachments using them. + public static Skin GetRepackedSkin (this Skin o, string newName, Material materialPropertySource, out Material outputMaterial, out Texture2D outputTexture, int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, bool useOriginalNonrenderables = true) { + return GetRepackedSkin(o, newName, materialPropertySource.shader, out outputMaterial, out outputTexture, maxAtlasSize, padding, textureFormat, mipmaps, materialPropertySource, useOriginalNonrenderables); + } + + /// + /// Creates and populates a duplicate skin with cloned attachments that are backed by a new packed texture atlas comprised of all the regions from the original skin. + /// GetRepackedSkin is an expensive operation, preferably call it at level load time. No Spine.Atlas object is created so there is no way to find AtlasRegions except through the Attachments using them. + public static Skin GetRepackedSkin (this Skin o, string newName, Shader shader, out Material outputMaterial, out Texture2D outputTexture, int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, Material materialPropertySource = null, bool clearCache = false, bool useOriginalNonrenderables = true) { + if (o == null) throw new System.NullReferenceException("Skin was null"); + var skinAttachments = o.Attachments; + var newSkin = new Skin(newName); + + // Use these to detect and use shared regions. + var existingRegions = new Dictionary(); + var regionIndexes = new List(); + + // Collect all textures from the attachments of the original skin. + var repackedAttachments = new List(); + var texturesToPack = new List(); + var originalRegions = new List(); + int newRegionIndex = 0; + foreach (var skinEntry in skinAttachments) { + var originalKey = skinEntry.Key; + var originalAttachment = skinEntry.Value; + + Attachment newAttachment; + if (IsRenderable(originalAttachment)) { + newAttachment = originalAttachment.GetClone(true); + var region = newAttachment.GetRegion(); + int existingIndex; + if (existingRegions.TryGetValue(region, out existingIndex)) { + regionIndexes.Add(existingIndex); // Store the region index for the eventual new attachment. + } else { + originalRegions.Add(region); + texturesToPack.Add(region.ToTexture()); // Add the texture to the PackTextures argument + existingRegions.Add(region, newRegionIndex); // Add the region to the dictionary of known regions + regionIndexes.Add(newRegionIndex); // Store the region index for the eventual new attachment. + newRegionIndex++; + } + + repackedAttachments.Add(newAttachment); + newSkin.AddAttachment(originalKey.slotIndex, originalKey.name, newAttachment); + } else { + newSkin.AddAttachment(originalKey.slotIndex, originalKey.name, useOriginalNonrenderables ? originalAttachment : originalAttachment.GetClone(true)); + } + } + + // Fill a new texture with the collected attachment textures. + var newTexture = new Texture2D(maxAtlasSize, maxAtlasSize, textureFormat, mipmaps); + newTexture.mipMapBias = AtlasUtilities.DefaultMipmapBias; + newTexture.anisoLevel = texturesToPack[0].anisoLevel; + newTexture.name = newName; + var rects = newTexture.PackTextures(texturesToPack.ToArray(), padding, maxAtlasSize); + + // Rehydrate the repacked textures as a Material, Spine atlas and Spine.AtlasAttachments + var newMaterial = new Material(shader); + if (materialPropertySource != null) { + newMaterial.CopyPropertiesFromMaterial(materialPropertySource); + newMaterial.shaderKeywords = materialPropertySource.shaderKeywords; + } + + newMaterial.name = newName; + newMaterial.mainTexture = newTexture; + var page = newMaterial.ToSpineAtlasPage(); + page.name = newName; + + var repackedRegions = new List(); + for (int i = 0, n = originalRegions.Count; i < n; i++) { + var oldRegion = originalRegions[i]; + var newRegion = UVRectToAtlasRegion(rects[i], oldRegion.name, page, oldRegion.offsetX, oldRegion.offsetY, oldRegion.rotate); + repackedRegions.Add(newRegion); + } + + // Map the cloned attachments to the repacked atlas. + for (int i = 0, n = repackedAttachments.Count; i < n; i++) { + var a = repackedAttachments[i]; + if (IsRenderable(a)) + a.SetRegion(repackedRegions[regionIndexes[i]]); + } + + // Clean up. + if (clearCache) + AtlasUtilities.ClearCache(); + + outputTexture = newTexture; + outputMaterial = newMaterial; + return newSkin; + } + + public static Sprite ToSprite (this AtlasRegion ar, float pixelsPerUnit = 100) { + return Sprite.Create(ar.GetMainTexture(), ar.GetUnityRect(), new Vector2(0.5f, 0.5f), pixelsPerUnit); + } + + static Dictionary CachedRegionTextures = new Dictionary(); + static List CachedRegionTexturesList = new List(); + + public static void ClearCache () { + foreach (var t in CachedRegionTexturesList) { + UnityEngine.Object.Destroy(t); + } + CachedRegionTextures.Clear(); + CachedRegionTexturesList.Clear(); + } + + /// Creates a new Texture2D object based on an AtlasRegion. + /// If applyImmediately is true, Texture2D.Apply is called immediately after the Texture2D is filled with data. + public static Texture2D ToTexture (this AtlasRegion ar, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps) { + Texture2D output; + + CachedRegionTextures.TryGetValue(ar, out output); + if (output == null) { + Texture2D sourceTexture = ar.GetMainTexture(); + Rect r = ar.GetUnityRect(sourceTexture.height); + int width = (int)r.width; + int height = (int)r.height; + output = new Texture2D(width, height, textureFormat, mipmaps) { name = ar.name }; + AtlasUtilities.CopyTexture(sourceTexture, r, output); + CachedRegionTextures.Add(ar, output); + CachedRegionTexturesList.Add(output); + } + + return output; + } + + static Texture2D ToTexture (this Sprite s, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps) { + var spriteTexture = s.texture; + var r = s.textureRect; + var newTexture = new Texture2D((int)r.width, (int)r.height, textureFormat, mipmaps); + AtlasUtilities.CopyTexture(spriteTexture, r, newTexture); + return newTexture; + } + + static Texture2D GetClone (this Texture2D t, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps) { + var newTexture = new Texture2D((int)t.width, (int)t.height, textureFormat, mipmaps); + AtlasUtilities.CopyTexture(t, new Rect(0, 0, t.width, t.height), newTexture); + return newTexture; + } + + static void CopyTexture (Texture2D source, Rect sourceRect, Texture2D destination) { + if (SystemInfo.copyTextureSupport == UnityEngine.Rendering.CopyTextureSupport.None) { + // GetPixels fallback for old devices. + Color[] pixelBuffer = source.GetPixels((int)sourceRect.x, (int)sourceRect.y, (int)sourceRect.width, (int)sourceRect.height); + destination.SetPixels(pixelBuffer); + destination.Apply(); + } else { + Graphics.CopyTexture(source, 0, 0, (int)sourceRect.x, (int)sourceRect.y, (int)sourceRect.width, (int)sourceRect.height, destination, 0, 0, 0, 0); + } + } + + static bool IsRenderable (Attachment a) { + return a is IHasRendererObject; + } + + /// + /// Get a rect with flipped Y so that a Spine atlas rect gets converted to a Unity Sprite rect and vice versa. + static Rect SpineUnityFlipRect (this Rect rect, int textureHeight) { + rect.y = textureHeight - rect.y - rect.height; + return rect; + } + + /// + /// Gets the Rect of an AtlasRegion according to Unity texture coordinates (x-right, y-up). + /// This overload relies on region.page.height being correctly set. + static Rect GetUnityRect (this AtlasRegion region) { + return region.GetSpineAtlasRect().SpineUnityFlipRect(region.page.height); + } + + /// + /// Gets the Rect of an AtlasRegion according to Unity texture coordinates (x-right, y-up). + static Rect GetUnityRect (this AtlasRegion region, int textureHeight) { + return region.GetSpineAtlasRect().SpineUnityFlipRect(textureHeight); + } + + /// + /// Returns a Rect of the AtlasRegion according to Spine texture coordinates. (x-right, y-down) + static Rect GetSpineAtlasRect (this AtlasRegion region, bool includeRotate = true) { + if (includeRotate && region.rotate) + return new Rect(region.x, region.y, region.height, region.width); + else + return new Rect(region.x, region.y, region.width, region.height); + } + + /// + /// Denormalize a uvRect into a texture-space Rect. + static Rect UVRectToTextureRect (Rect uvRect, int texWidth, int texHeight) { + uvRect.x *= texWidth; + uvRect.width *= texWidth; + uvRect.y *= texHeight; + uvRect.height *= texHeight; + return uvRect; + } + + /// + /// Normalize a texture Rect into UV coordinates. + static Rect TextureRectToUVRect (Rect textureRect, int texWidth, int texHeight) { + textureRect.x = Mathf.InverseLerp(0, texWidth, textureRect.x); + textureRect.y = Mathf.InverseLerp(0, texHeight, textureRect.y); + textureRect.width = Mathf.InverseLerp(0, texWidth, textureRect.width); + textureRect.height = Mathf.InverseLerp(0, texHeight, textureRect.height); + return textureRect; + } + + /// + /// Creates a new Spine AtlasRegion according to a Unity UV Rect (x-right, y-up, uv-normalized). + static AtlasRegion UVRectToAtlasRegion (Rect uvRect, string name, AtlasPage page, float offsetX, float offsetY, bool rotate) { + var tr = UVRectToTextureRect(uvRect, page.width, page.height); + var rr = tr.SpineUnityFlipRect(page.height); + + int x = (int)rr.x, y = (int)rr.y; + int w, h; + if (rotate) { + w = (int)rr.height; + h = (int)rr.width; + } else { + w = (int)rr.width; + h = (int)rr.height; + } + + return new AtlasRegion { + page = page, + name = name, + + u = uvRect.xMin, + u2 = uvRect.xMax, + v = uvRect.yMax, + v2 = uvRect.yMin, + + index = -1, + + width = w, + originalWidth = w, + height = h, + originalHeight = h, + offsetX = offsetX, + offsetY = offsetY, + x = x, + y = y, + + rotate = rotate + }; + } + + /// + /// Convenience method for getting the main texture of the material of the page of the region. + static Texture2D GetMainTexture (this AtlasRegion region) { + var material = (region.page.rendererObject as Material); + return material.mainTexture as Texture2D; + } + + static void ApplyPMA (this Texture2D texture, bool applyImmediately = true) { + var pixels = texture.GetPixels(); + for (int i = 0, n = pixels.Length; i < n; i++) { + Color p = pixels[i]; + float a = p.a; + p.r = p.r * a; + p.g = p.g * a; + p.b = p.b * a; + pixels[i] = p; + } + texture.SetPixels(pixels); + if (applyImmediately) + texture.Apply(); + } + #endregion + + static float InverseLerp (float a, float b, float value) { + return (value - a) / (b - a); + } + } + + public static class SkinUtilities { + + #region Skeleton Skin Extensions + /// + /// Convenience method for duplicating a skeleton's current active skin so changes to it will not affect other skeleton instances. . + public static Skin UnshareSkin (this Skeleton skeleton, bool includeDefaultSkin, bool unshareAttachments, AnimationState state = null) { + // 1. Copy the current skin and set the skeleton's skin to the new one. + var newSkin = skeleton.GetClonedSkin("cloned skin", includeDefaultSkin, unshareAttachments, true); + skeleton.SetSkin(newSkin); + + // 2. Apply correct attachments: skeleton.SetToSetupPose + animationState.Apply + if (state != null) { + skeleton.SetToSetupPose(); + state.Apply(skeleton); + } + + // 3. Return unshared skin. + return newSkin; + } + + public static Skin GetClonedSkin (this Skeleton skeleton, string newSkinName, bool includeDefaultSkin = false, bool cloneAttachments = false, bool cloneMeshesAsLinked = true) { + var newSkin = new Skin(newSkinName); // may have null name. Harmless. + var defaultSkin = skeleton.data.DefaultSkin; + var activeSkin = skeleton.skin; + + if (includeDefaultSkin) + defaultSkin.CopyTo(newSkin, true, cloneAttachments, cloneMeshesAsLinked); + + if (activeSkin != null) + activeSkin.CopyTo(newSkin, true, cloneAttachments, cloneMeshesAsLinked); + + return newSkin; + } + #endregion + + /// + /// Gets a shallow copy of the skin. The cloned skin's attachments are shared with the original skin. + public static Skin GetClone (this Skin original) { + var newSkin = new Skin(original.name + " clone"); + var newSkinAttachments = newSkin.Attachments; + + foreach (var a in original.Attachments) + newSkinAttachments[a.Key] = a.Value; + + return newSkin; + } + + /// Adds an attachment to the skin for the specified slot index and name. If the name already exists for the slot, the previous value is replaced. + public static void SetAttachment (this Skin skin, string slotName, string keyName, Attachment attachment, Skeleton skeleton) { + int slotIndex = skeleton.FindSlotIndex(slotName); + if (skeleton == null) throw new System.ArgumentNullException("skeleton", "skeleton cannot be null."); + if (slotIndex == -1) throw new System.ArgumentException(string.Format("Slot '{0}' does not exist in skeleton.", slotName), "slotName"); + skin.AddAttachment(slotIndex, keyName, attachment); + } + + /// Adds skin items from another skin. For items that already exist, the previous values are replaced. + public static void AddAttachments (this Skin skin, Skin otherSkin) { + if (otherSkin == null) return; + otherSkin.CopyTo(skin, true, false); + } + + /// Gets an attachment from the skin for the specified slot index and name. + public static Attachment GetAttachment (this Skin skin, string slotName, string keyName, Skeleton skeleton) { + int slotIndex = skeleton.FindSlotIndex(slotName); + if (skeleton == null) throw new System.ArgumentNullException("skeleton", "skeleton cannot be null."); + if (slotIndex == -1) throw new System.ArgumentException(string.Format("Slot '{0}' does not exist in skeleton.", slotName), "slotName"); + return skin.GetAttachment(slotIndex, keyName); + } + + /// Adds an attachment to the skin for the specified slot index and name. If the name already exists for the slot, the previous value is replaced. + public static void SetAttachment (this Skin skin, int slotIndex, string keyName, Attachment attachment) { + skin.AddAttachment(slotIndex, keyName, attachment); + } + + public static void RemoveAttachment (this Skin skin, string slotName, string keyName, SkeletonData skeletonData) { + int slotIndex = skeletonData.FindSlotIndex(slotName); + if (skeletonData == null) throw new System.ArgumentNullException("skeletonData", "skeletonData cannot be null."); + if (slotIndex == -1) throw new System.ArgumentException(string.Format("Slot '{0}' does not exist in skeleton.", slotName), "slotName"); + skin.RemoveAttachment(slotIndex, keyName); + } + + public static void Clear (this Skin skin) { + skin.Attachments.Clear(); + } + + //[System.Obsolete] + public static void Append (this Skin destination, Skin source) { + source.CopyTo(destination, true, false); + } + + public static void CopyTo (this Skin source, Skin destination, bool overwrite, bool cloneAttachments, bool cloneMeshesAsLinked = true) { + var sourceAttachments = source.Attachments; + var destinationAttachments = destination.Attachments; + + if (cloneAttachments) { + if (overwrite) { + foreach (var e in sourceAttachments) + destinationAttachments[e.Key] = e.Value.GetClone(cloneMeshesAsLinked); + } else { + foreach (var e in sourceAttachments) { + if (destinationAttachments.ContainsKey(e.Key)) continue; + destinationAttachments.Add(e.Key, e.Value.GetClone(cloneMeshesAsLinked)); + } + } + } else { + if (overwrite) { + foreach (var e in sourceAttachments) + destinationAttachments[e.Key] = e.Value; + } else { + foreach (var e in sourceAttachments) { + if (destinationAttachments.ContainsKey(e.Key)) continue; + destinationAttachments.Add(e.Key, e.Value); + } + } + } + } + + + } + + public static class AttachmentCloneExtensions { + /// + /// Clones the attachment. + public static Attachment GetClone (this Attachment o, bool cloneMeshesAsLinked) { + var regionAttachment = o as RegionAttachment; + if (regionAttachment != null) + return regionAttachment.GetClone(); + + var meshAttachment = o as MeshAttachment; + if (meshAttachment != null) + return cloneMeshesAsLinked ? meshAttachment.GetLinkedClone() : meshAttachment.GetClone(); + + var boundingBoxAttachment = o as BoundingBoxAttachment; + if (boundingBoxAttachment != null) + return boundingBoxAttachment.GetClone(); + + var pathAttachment = o as PathAttachment; + if (pathAttachment != null) + return pathAttachment.GetClone(); + + var pointAttachment = o as PointAttachment; + if (pointAttachment != null) + return pointAttachment.GetClone(); + + var clippingAttachment = o as ClippingAttachment; + if (clippingAttachment != null) + return clippingAttachment.GetClone(); + + return null; + } + + public static RegionAttachment GetClone (this RegionAttachment o) { + return new RegionAttachment(o.Name) { + x = o.x, + y = o.y, + rotation = o.rotation, + scaleX = o.scaleX, + scaleY = o.scaleY, + width = o.width, + height = o.height, + + r = o.r, + g = o.g, + b = o.b, + a = o.a, + + Path = o.Path, + RendererObject = o.RendererObject, + regionOffsetX = o.regionOffsetX, + regionOffsetY = o.regionOffsetY, + regionWidth = o.regionWidth, + regionHeight = o.regionHeight, + regionOriginalWidth = o.regionOriginalWidth, + regionOriginalHeight = o.regionOriginalHeight, + uvs = o.uvs.Clone() as float[], + offset = o.offset.Clone() as float[] + }; + } + + public static ClippingAttachment GetClone (this ClippingAttachment o) { + var ca = new ClippingAttachment(o.Name) { + endSlot = o.endSlot + }; + CloneVertexAttachment(o, ca); + return ca; + } + + public static PointAttachment GetClone (this PointAttachment o) { + var pa = new PointAttachment(o.Name) { + rotation = o.rotation, + x = o.x, + y = o.y + }; + return pa; + } + + public static BoundingBoxAttachment GetClone (this BoundingBoxAttachment o) { + var ba = new BoundingBoxAttachment(o.Name); + CloneVertexAttachment(o, ba); + return ba; + } + + public static MeshAttachment GetLinkedClone (this MeshAttachment o, bool inheritDeform = true) { + return o.GetLinkedMesh(o.Name, o.RendererObject as AtlasRegion, inheritDeform, copyOriginalProperties: true); + } + + /// + /// Returns a clone of the MeshAttachment. This will cause Deform animations to stop working unless you explicity set the .parentMesh to the original. + public static MeshAttachment GetClone (this MeshAttachment o) { + var ma = new MeshAttachment(o.Name) { + r = o.r, + g = o.g, + b = o.b, + a = o.a, + + inheritDeform = o.inheritDeform, + + Path = o.Path, + RendererObject = o.RendererObject, + + regionOffsetX = o.regionOffsetX, + regionOffsetY = o.regionOffsetY, + regionWidth = o.regionWidth, + regionHeight = o.regionHeight, + regionOriginalWidth = o.regionOriginalWidth, + regionOriginalHeight = o.regionOriginalHeight, + RegionU = o.RegionU, + RegionV = o.RegionV, + RegionU2 = o.RegionU2, + RegionV2 = o.RegionV2, + RegionRotate = o.RegionRotate, + uvs = o.uvs.Clone() as float[] + }; + + // Linked mesh + if (o.ParentMesh != null) { + // bones, vertices, worldVerticesLength, regionUVs, triangles, HullLength, Edges, Width, Height + ma.ParentMesh = o.ParentMesh; + } else { + CloneVertexAttachment(o, ma); // bones, vertices, worldVerticesLength + ma.regionUVs = o.regionUVs.Clone() as float[]; + ma.triangles = o.triangles.Clone() as int[]; + ma.hulllength = o.hulllength; + + // Nonessential. + ma.Edges = (o.Edges == null) ? null : o.Edges.Clone() as int[]; // Allow absence of Edges array when nonessential data is not exported. + ma.Width = o.Width; + ma.Height = o.Height; + } + + return ma; + } + + public static PathAttachment GetClone (this PathAttachment o) { + var newPathAttachment = new PathAttachment(o.Name) { + lengths = o.lengths.Clone() as float[], + closed = o.closed, + constantSpeed = o.constantSpeed + }; + CloneVertexAttachment(o, newPathAttachment); + + return newPathAttachment; + } + + static void CloneVertexAttachment (VertexAttachment src, VertexAttachment dest) { + dest.worldVerticesLength = src.worldVerticesLength; + if (src.bones != null) + dest.bones = src.bones.Clone() as int[]; + + if (src.vertices != null) + dest.vertices = src.vertices.Clone() as float[]; + } + + + #region Runtime Linked MeshAttachments + /// + /// Returns a new linked mesh linked to this MeshAttachment. It will be mapped to the AtlasRegion provided. + public static MeshAttachment GetLinkedMesh (this MeshAttachment o, string newLinkedMeshName, AtlasRegion region, bool inheritDeform = true, bool copyOriginalProperties = false) { + //if (string.IsNullOrEmpty(attachmentName)) throw new System.ArgumentException("attachmentName cannot be null or empty", "attachmentName"); + if (region == null) throw new System.ArgumentNullException("region"); + + // If parentMesh is a linked mesh, create a link to its parent. Preserves Deform animations. + if (o.ParentMesh != null) + o = o.ParentMesh; + + // 1. NewMeshAttachment (AtlasAttachmentLoader.cs) + var mesh = new MeshAttachment(newLinkedMeshName); + mesh.SetRegion(region, false); + + // 2. (SkeletonJson.cs::ReadAttachment. case: LinkedMesh) + mesh.Path = newLinkedMeshName; + if (copyOriginalProperties) { + mesh.r = o.r; + mesh.g = o.g; + mesh.b = o.b; + mesh.a = o.a; + } else { + mesh.r = 1f; + mesh.g = 1f; + mesh.b = 1f; + mesh.a = 1f; + } + + //mesh.ParentMesh property call below sets mesh.Width and mesh.Height + + // 3. Link mesh with parent. (SkeletonJson.cs) + mesh.inheritDeform = inheritDeform; + mesh.ParentMesh = o; + mesh.UpdateUVs(); + + return mesh; + } + + /// + /// Returns a new linked mesh linked to this MeshAttachment. It will be mapped to an AtlasRegion generated from a Sprite. The AtlasRegion will be mapped to a new Material based on the shader. + /// For better caching and batching, use GetLinkedMesh(string, AtlasRegion, bool) + public static MeshAttachment GetLinkedMesh (this MeshAttachment o, Sprite sprite, Shader shader, bool inheritDeform = true, Material materialPropertySource = null) { + var m = new Material(shader); + if (materialPropertySource != null) { + m.CopyPropertiesFromMaterial(materialPropertySource); + m.shaderKeywords = materialPropertySource.shaderKeywords; + } + return o.GetLinkedMesh(sprite.name, sprite.ToAtlasRegion(), inheritDeform); + } + + /// + /// Returns a new linked mesh linked to this MeshAttachment. It will be mapped to an AtlasRegion generated from a Sprite. The AtlasRegion will be mapped to a new Material based on the shader. + /// For better caching and batching, use GetLinkedMesh(string, AtlasRegion, bool) + public static MeshAttachment GetLinkedMesh (this MeshAttachment o, Sprite sprite, Material materialPropertySource, bool inheritDeform = true) { + return o.GetLinkedMesh(sprite, materialPropertySource.shader, inheritDeform, materialPropertySource); + } + #endregion + + #region RemappedClone Convenience Methods + /// + /// Gets a clone of the attachment remapped with a sprite image. + /// The remapped clone. + /// The original attachment. + /// The sprite whose texture to use. + /// The source material used to copy the shader and material properties from. + /// If true, a premultiply alpha clone of the original texture will be created. + /// If true MeshAttachments will be cloned as linked meshes and will inherit animation from the original attachment. + /// If true the size of the original attachment will be followed, instead of using the Sprite size. + public static Attachment GetRemappedClone (this Attachment o, Sprite sprite, Material sourceMaterial, bool premultiplyAlpha = true, bool cloneMeshAsLinked = true, bool useOriginalRegionSize = false) { + var atlasRegion = premultiplyAlpha ? sprite.ToAtlasRegionPMAClone(sourceMaterial) : sprite.ToAtlasRegion(new Material(sourceMaterial) { mainTexture = sprite.texture } ); + return o.GetRemappedClone(atlasRegion, cloneMeshAsLinked, useOriginalRegionSize, 1f/sprite.pixelsPerUnit); + } + + /// + /// Gets a clone of the attachment remapped with an atlasRegion image. + /// The remapped clone. + /// The original attachment. + /// Atlas region. + /// If true MeshAttachments will be cloned as linked meshes and will inherit animation from the original attachment. + /// If true the size of the original attachment will be followed, instead of using the Sprite size. + /// Unity units per pixel scale used to scale the atlas region size when not using the original region size. + public static Attachment GetRemappedClone (this Attachment o, AtlasRegion atlasRegion, bool cloneMeshAsLinked = true, bool useOriginalRegionSize = false, float scale = 0.01f) { + var regionAttachment = o as RegionAttachment; + if (regionAttachment != null) { + RegionAttachment newAttachment = regionAttachment.GetClone(); + newAttachment.SetRegion(atlasRegion, false); + if (!useOriginalRegionSize) { + newAttachment.width = atlasRegion.width * scale; + newAttachment.height = atlasRegion.height * scale; + } + newAttachment.UpdateOffset(); + return newAttachment; + } else { + var meshAttachment = o as MeshAttachment; + if (meshAttachment != null) { + MeshAttachment newAttachment = cloneMeshAsLinked ? meshAttachment.GetLinkedClone(cloneMeshAsLinked) : meshAttachment.GetClone(); + newAttachment.SetRegion(atlasRegion); + return newAttachment; + } + } + + return o.GetClone(true); // Non-renderable Attachments will return as normal cloned attachments. + } + #endregion + } +} diff --git a/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs.meta new file mode 100644 index 000000000..68ad280ef --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8dd46dbf979fcb7459246cd37aad09ef +timeCreated: 1478437807 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/BoundingBoxFollower.meta b/Assets/Spine/Runtime/spine-unity/Modules/BoundingBoxFollower.meta new file mode 100644 index 000000000..56d0730a1 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/BoundingBoxFollower.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 86b1ae3ec8681c646aea49654969b73c +folderAsset: yes +timeCreated: 1455492474 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollower.cs b/Assets/Spine/Runtime/spine-unity/Modules/BoundingBoxFollower/BoundingBoxFollower.cs similarity index 74% rename from Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollower.cs rename to Assets/Spine/Runtime/spine-unity/Modules/BoundingBoxFollower/BoundingBoxFollower.cs index f841a02ef..d5e720d98 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollower.cs +++ b/Assets/Spine/Runtime/spine-unity/Modules/BoundingBoxFollower/BoundingBoxFollower.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -41,7 +41,6 @@ namespace Spine.Unity { #else [ExecuteInEditMode] #endif - [HelpURL("http://esotericsoftware.com/spine-unity#BoundingBoxFollower")] public class BoundingBoxFollower : MonoBehaviour { internal static bool DebugMessages = true; @@ -92,7 +91,7 @@ namespace Spine.Unity { return; skeletonRenderer.Initialize(false); - + if (string.IsNullOrEmpty(slotName)) return; @@ -104,19 +103,12 @@ namespace Spine.Unity { skeletonRenderer.skeleton == slot.Skeleton // Skeleton object did not change. && slotName == slot.data.name // Slot object did not change. - ) + ) return; - slot = null; - currentAttachment = null; - currentAttachmentName = null; - currentCollider = null; - colliderTable.Clear(); - nameTable.Clear(); + DisposeColliders(); var skeleton = skeletonRenderer.skeleton; - if (skeleton == null) - return; slot = skeleton.FindSlot(slotName); int slotIndex = skeleton.FindSlotIndex(slotName); @@ -126,35 +118,32 @@ namespace Spine.Unity { return; } - int requiredCollidersCount = 0; - var colliders = GetComponents(); if (this.gameObject.activeInHierarchy) { foreach (var skin in skeleton.Data.Skins) - AddCollidersForSkin(skin, slotIndex, colliders, ref requiredCollidersCount); + AddSkin(skin, slotIndex); if (skeleton.skin != null) - AddCollidersForSkin(skeleton.skin, slotIndex, colliders, ref requiredCollidersCount); + AddSkin(skeleton.skin, slotIndex); } - DisposeExcessCollidersAfter(requiredCollidersCount); if (BoundingBoxFollower.DebugMessages) { bool valid = colliderTable.Count != 0; if (!valid) { if (this.gameObject.activeInHierarchy) Debug.LogWarning("Bounding Box Follower not valid! Slot [" + slotName + "] does not contain any Bounding Box Attachments!"); - else + else Debug.LogWarning("Bounding Box Follower tried to rebuild as a prefab."); } } } - void AddCollidersForSkin (Skin skin, int slotIndex, PolygonCollider2D[] previousColliders, ref int collidersCount) { + void AddSkin (Skin skin, int slotIndex) { if (skin == null) return; - var skinEntries = new List(); - skin.GetAttachments(slotIndex, skinEntries); + var attachmentNames = new List(); + skin.FindNamesForSlot(slotIndex, attachmentNames); - foreach (var entry in skinEntries) { - var attachment = skin.GetAttachment(slotIndex, entry.Name); + foreach (var skinKey in attachmentNames) { + var attachment = skin.GetAttachment(slotIndex, skinKey); var boundingBoxAttachment = attachment as BoundingBoxAttachment; if (BoundingBoxFollower.DebugMessages && attachment != null && boundingBoxAttachment == null) @@ -162,16 +151,13 @@ namespace Spine.Unity { if (boundingBoxAttachment != null) { if (!colliderTable.ContainsKey(boundingBoxAttachment)) { - var bbCollider = collidersCount < previousColliders.Length ? - previousColliders[collidersCount] : gameObject.AddComponent(); - ++collidersCount; - SkeletonUtility.SetColliderPointsLocal(bbCollider, slot, boundingBoxAttachment); - bbCollider.isTrigger = isTrigger; + var bbCollider = SkeletonUtility.AddBoundingBoxAsComponent(boundingBoxAttachment, slot, gameObject, isTrigger); + bbCollider.enabled = false; bbCollider.hideFlags = HideFlags.NotEditable; bbCollider.isTrigger = IsTrigger; colliderTable.Add(boundingBoxAttachment, bbCollider); - nameTable.Add(boundingBoxAttachment, entry.Name); + nameTable.Add(boundingBoxAttachment, skinKey); } } } @@ -180,9 +166,6 @@ namespace Spine.Unity { void OnDisable () { if (clearStateOnDisable) ClearState(); - - if (skeletonRenderer != null) - skeletonRenderer.OnRebuild -= HandleRebuild; } public void ClearState () { @@ -195,21 +178,33 @@ namespace Spine.Unity { currentCollider = null; } - void DisposeExcessCollidersAfter (int requiredCount) { + void DisposeColliders () { var colliders = GetComponents(); if (colliders.Length == 0) return; - for (int i = requiredCount; i < colliders.Length; ++i) { - var collider = colliders[i]; - if (collider != null) { -#if UNITY_EDITOR - if (Application.isEditor && !Application.isPlaying) - DestroyImmediate(collider); - else -#endif - Destroy(collider); + if (Application.isEditor) { + if (Application.isPlaying) { + foreach (var c in colliders) { + if (c != null) + Destroy(c); + } + } else { + foreach (var c in colliders) + if (c != null) + DestroyImmediate(c); } + } else { + foreach (PolygonCollider2D c in colliders) + if (c != null) + Destroy(c); } + + slot = null; + currentAttachment = null; + currentAttachmentName = null; + currentCollider = null; + colliderTable.Clear(); + nameTable.Clear(); } void LateUpdate () { diff --git a/Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollower.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/BoundingBoxFollower/BoundingBoxFollower.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/Following/BoundingBoxFollower.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/BoundingBoxFollower/BoundingBoxFollower.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials.meta b/Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials.meta rename to Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials.meta diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials/SkeletonRendererCustomMaterials.cs b/Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials/SkeletonRendererCustomMaterials.cs similarity index 86% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials/SkeletonRendererCustomMaterials.cs rename to Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials/SkeletonRendererCustomMaterials.cs index c137570be..0441c159b 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials/SkeletonRendererCustomMaterials.cs +++ b/Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials/SkeletonRendererCustomMaterials.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -38,13 +38,12 @@ using System; using System.Collections.Generic; using UnityEngine; -namespace Spine.Unity { +namespace Spine.Unity.Modules { #if NEW_PREFAB_SYSTEM [ExecuteAlways] #else [ExecuteInEditMode] #endif - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonRendererCustomMaterials")] public class SkeletonRendererCustomMaterials : MonoBehaviour { #region Inspector @@ -56,7 +55,7 @@ namespace Spine.Unity { void Reset () { skeletonRenderer = GetComponent(); - // Populate atlas list + // Populate atlas list if (skeletonRenderer != null && skeletonRenderer.skeletonDataAsset != null) { var atlasAssets = skeletonRenderer.skeletonDataAsset.atlasAssets; @@ -149,7 +148,7 @@ namespace Spine.Unity { if (!skeletonRenderer.CustomMaterialOverride.TryGetValue(atlasMaterialOverride.originalMaterial, out currentMaterial)) continue; - + // Do not revert the material if it was changed by something else if (currentMaterial != atlasMaterialOverride.replacementMaterial) continue; @@ -158,7 +157,7 @@ namespace Spine.Unity { } #endif } - + // OnEnable applies the overrides at runtime, and when the editor loads. void OnEnable () { if (skeletonRenderer == null) diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials/SkeletonRendererCustomMaterials.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials/SkeletonRendererCustomMaterials.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials/SkeletonRendererCustomMaterials.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials/SkeletonRendererCustomMaterials.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials/SkeletonRendererCustomMaterials.txt b/Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials/SkeletonRendererCustomMaterials.txt new file mode 100644 index 000000000..917077577 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials/SkeletonRendererCustomMaterials.txt @@ -0,0 +1,11 @@ +SkeletonRendererCustomMaterials by LostPolygon +=============================== +This is a basic serialization and inspector implementation for custom material overrides for SkeletonRenderer and its derived classes (SkeletonAnimation, SkeletonAnimator). + +## How to use +Right-click on your SkeletonRenderer and select "Add Basic Serialized Custom Materials". This will add and initialize the SkeletonRendererCustomMaterials to the same object. + +You can use this to store material override settings for SkeletonRenderer instances/prefabs so they will be applied automatically when your scene starts or when the prefab is instantiated. + +This script is not intended for use with code. +To dynamically set materials for your SkeletonRenderer through code, you can directly access `SkeletonRenderer.CustomMaterialOverride` for material array overrides and `SkeletonRenderer.CustomSlotMaterials` for slot material overrides. \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicDefaultOutline.mat.meta b/Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials/SkeletonRendererCustomMaterials.txt.meta similarity index 52% rename from Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicDefaultOutline.mat.meta rename to Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials/SkeletonRendererCustomMaterials.txt.meta index beaf12d1c..a97910679 100644 --- a/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicDefaultOutline.mat.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/CustomMaterials/SkeletonRendererCustomMaterials.txt.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: c4ee0f8f4be17434aa3df5774a03b366 -timeCreated: 1455140322 +guid: 3d4db6c367e463c4cb5566afc490163c +timeCreated: 1460572571 licenseType: Free -NativeFormatImporter: +TextScriptImporter: userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Ghost.meta b/Assets/Spine/Runtime/spine-unity/Modules/Ghost.meta new file mode 100644 index 000000000..cc485896c --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ghost.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 13193c9d213765f4c85f4c1faa615711 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Ghost/Shaders.meta b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/Shaders.meta new file mode 100644 index 000000000..0e0bd214c --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/Shaders.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: a0cee0de78cef7440ae0b5aac39ae971 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Ghost/Shaders/Spine-Special-Skeleton-Ghost.shader b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/Shaders/Spine-Special-Skeleton-Ghost.shader new file mode 100644 index 000000000..85923c323 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/Shaders/Spine-Special-Skeleton-Ghost.shader @@ -0,0 +1,67 @@ +// - Unlit + no shadow +// - Premultiplied Alpha Blending (One OneMinusSrcAlpha) +// - Double-sided, no depth + +Shader "Spine/Special/SkeletonGhost" { + Properties { + _Color ("Main Color", Color) = (1,1,1,1) + [NoScaleOffset] _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} + _TextureFade ("Texture Fade Out", Range(0,1)) = 0 + [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default + } + SubShader { + Tags { + "Queue"="Transparent" + "IgnoreProjector"="False" + "RenderType"="Transparent" + } + Fog { Mode Off } + Blend One OneMinusSrcAlpha + ZWrite Off + Cull Off + + Stencil { + Ref[_StencilRef] + Comp[_StencilComp] + Pass Keep + } + + Pass { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + sampler2D _MainTex; + fixed4 _Color; + fixed _TextureFade; + + struct VertexInput { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + float4 color : COLOR; + }; + + struct VertexOutput { + float4 pos : SV_POSITION; + float2 uv : TEXCOORD0; + float4 color : COLOR; + }; + + VertexOutput vert (VertexInput v) { + VertexOutput o; + o.pos = UnityObjectToClipPos(v.vertex); + o.uv = v.uv; + o.color = v.color; + return o; + } + + fixed4 frag (VertexOutput i) : COLOR { + fixed4 tc = tex2D(_MainTex, i.uv); + tc = fixed4(max(_TextureFade, tc.r), max(_TextureFade, tc.g), max(_TextureFade, tc.b), tc.a); + return tc * ((i.color * _Color) * tc.a); + } + ENDCG + } + } +} \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Ghost/Shaders/Spine-Special-Skeleton-Ghost.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/Shaders/Spine-Special-Skeleton-Ghost.shader.meta new file mode 100644 index 000000000..d24d9a340 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/Shaders/Spine-Special-Skeleton-Ghost.shader.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3873d4699ee8a4b4da8fa6b8c229b94d +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Ghost/SkeletonGhost.cs b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/SkeletonGhost.cs new file mode 100644 index 000000000..1316113e5 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/SkeletonGhost.cs @@ -0,0 +1,201 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +// Contributed by: Mitch Thompson + +using UnityEngine; +using System.Collections.Generic; + +namespace Spine.Unity.Modules { + + [RequireComponent(typeof(SkeletonRenderer))] + public class SkeletonGhost : MonoBehaviour { + // Internal Settings + const HideFlags GhostHideFlags = HideFlags.HideInHierarchy; + const string GhostingShaderName = "Spine/Special/SkeletonGhost"; + + [Header("Animation")] + public bool ghostingEnabled = true; + [Tooltip("The time between invididual ghost pieces being spawned.")] + [UnityEngine.Serialization.FormerlySerializedAs("spawnRate")] + public float spawnInterval = 1f/30f; + [Tooltip("Maximum number of ghosts that can exist at a time. If the fade speed is not fast enough, the oldest ghost will immediately disappear to enforce the maximum number.")] + public int maximumGhosts = 10; + public float fadeSpeed = 10; + + [Header("Rendering")] + public Shader ghostShader; + public Color32 color = new Color32(0xFF, 0xFF, 0xFF, 0x00); // default for additive. + [Tooltip("Remember to set color alpha to 0 if Additive is true")] + public bool additive = true; + [Tooltip("0 is Color and Alpha, 1 is Alpha only.")] + [Range(0, 1)] + public float textureFade = 1; + + [Header("Sorting")] + public bool sortWithDistanceOnly; + public float zOffset = 0f; + + float nextSpawnTime; + SkeletonGhostRenderer[] pool; + int poolIndex = 0; + SkeletonRenderer skeletonRenderer; + MeshRenderer meshRenderer; + MeshFilter meshFilter; + + readonly Dictionary materialTable = new Dictionary(); + + void Start () { + Initialize(false); + } + + public void Initialize (bool overwrite) { + if (pool == null || overwrite) { + if (ghostShader == null) + ghostShader = Shader.Find(GhostingShaderName); + + skeletonRenderer = GetComponent(); + meshFilter = GetComponent(); + meshRenderer = GetComponent(); + nextSpawnTime = Time.time + spawnInterval; + pool = new SkeletonGhostRenderer[maximumGhosts]; + for (int i = 0; i < maximumGhosts; i++) { + GameObject go = new GameObject(gameObject.name + " Ghost", typeof(SkeletonGhostRenderer)); + pool[i] = go.GetComponent(); + go.SetActive(false); + go.hideFlags = GhostHideFlags; + } + + var skeletonAnimation = skeletonRenderer as Spine.Unity.IAnimationStateComponent; + if (skeletonAnimation != null) + skeletonAnimation.AnimationState.Event += OnEvent; + } + } + + //SkeletonAnimation + /* + * Int Value: 0 sets ghostingEnabled to false, 1 sets ghostingEnabled to true + * Float Value: Values greater than 0 set the spawnRate equal the float value + * String Value: Pass RGBA hex color values in to set the color property. IE: "A0FF8BFF" + */ + void OnEvent (Spine.TrackEntry trackEntry, Spine.Event e) { + if (e.Data.Name.Equals("Ghosting", System.StringComparison.Ordinal)) { + ghostingEnabled = e.Int > 0; + if (e.Float > 0) + spawnInterval = e.Float; + + if (!string.IsNullOrEmpty(e.stringValue)) + this.color = HexToColor(e.String); + } + } + + //SkeletonAnimator + //SkeletonAnimator or Mecanim based animations only support toggling ghostingEnabled. Be sure not to set anything other than the Int param in Spine or String will take priority. + void Ghosting (float val) { + ghostingEnabled = val > 0; + } + + void Update () { + if (!ghostingEnabled) + return; + + if (Time.time >= nextSpawnTime) { + GameObject go = pool[poolIndex].gameObject; + + Material[] materials = meshRenderer.sharedMaterials; + for (int i = 0; i < materials.Length; i++) { + var originalMat = materials[i]; + Material ghostMat; + if (!materialTable.ContainsKey(originalMat)) { + ghostMat = new Material(originalMat) { + shader = ghostShader, + color = Color.white + }; + + if (ghostMat.HasProperty("_TextureFade")) + ghostMat.SetFloat("_TextureFade", textureFade); + + materialTable.Add(originalMat, ghostMat); + } else { + ghostMat = materialTable[originalMat]; + } + + materials[i] = ghostMat; + } + + var goTransform = go.transform; + goTransform.parent = transform; + + pool[poolIndex].Initialize(meshFilter.sharedMesh, materials, color, additive, fadeSpeed, meshRenderer.sortingLayerID, (sortWithDistanceOnly) ? meshRenderer.sortingOrder : meshRenderer.sortingOrder - 1); + + goTransform.localPosition = new Vector3(0f, 0f, zOffset); + goTransform.localRotation = Quaternion.identity; + goTransform.localScale = Vector3.one; + + goTransform.parent = null; + + poolIndex++; + + if (poolIndex == pool.Length) + poolIndex = 0; + + nextSpawnTime = Time.time + spawnInterval; + } + } + + void OnDestroy () { + if (pool != null) { + for (int i = 0; i < maximumGhosts; i++) + if (pool[i] != null) pool[i].Cleanup(); + } + + foreach (var mat in materialTable.Values) + Destroy(mat); + } + + //based on UnifyWiki http://wiki.unity3d.com/index.php?title=HexConverter + static Color32 HexToColor (string hex) { + const System.Globalization.NumberStyles HexNumber = System.Globalization.NumberStyles.HexNumber; + + if (hex.Length < 6) + return Color.magenta; + + hex = hex.Replace("#", ""); + byte r = byte.Parse(hex.Substring(0, 2), HexNumber); + byte g = byte.Parse(hex.Substring(2, 2), HexNumber); + byte b = byte.Parse(hex.Substring(4, 2), HexNumber); + byte a = 0xFF; + if (hex.Length == 8) + a = byte.Parse(hex.Substring(6, 2), HexNumber); + + return new Color32(r, g, b, a); + } + } + +} diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Ghost/SkeletonGhost.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/SkeletonGhost.cs.meta new file mode 100644 index 000000000..32cd44c59 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/SkeletonGhost.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 02f2fa991881c6d419500ccc40ad443f +timeCreated: 1431858330 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: + - ghostShader: {fileID: 4800000, guid: 3873d4699ee8a4b4da8fa6b8c229b94d, type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Ghost/SkeletonGhostRenderer.cs b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/SkeletonGhostRenderer.cs new file mode 100644 index 000000000..ba7120735 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/SkeletonGhostRenderer.cs @@ -0,0 +1,128 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +// Contributed by: Mitch Thompson + +using UnityEngine; +using System.Collections; + +namespace Spine.Unity.Modules { + public class SkeletonGhostRenderer : MonoBehaviour { + static readonly Color32 TransparentBlack = new Color32(0, 0, 0, 0); + const string colorPropertyName = "_Color"; + + float fadeSpeed = 10; + Color32 startColor; + MeshFilter meshFilter; + MeshRenderer meshRenderer; + + MaterialPropertyBlock mpb; + int colorId; + + void Awake () { + meshRenderer = gameObject.AddComponent(); + meshFilter = gameObject.AddComponent(); + + colorId = Shader.PropertyToID(colorPropertyName); + mpb = new MaterialPropertyBlock(); + } + + public void Initialize (Mesh mesh, Material[] materials, Color32 color, bool additive, float speed, int sortingLayerID, int sortingOrder) { + StopAllCoroutines(); + + gameObject.SetActive(true); + meshRenderer.sharedMaterials = materials; + meshRenderer.sortingLayerID = sortingLayerID; + meshRenderer.sortingOrder = sortingOrder; + meshFilter.sharedMesh = Instantiate(mesh); + startColor = color; + mpb.SetColor(colorId, color); + meshRenderer.SetPropertyBlock(mpb); + + fadeSpeed = speed; + + if (additive) + StartCoroutine(FadeAdditive()); + else + StartCoroutine(Fade()); + } + + IEnumerator Fade () { + Color32 c = startColor; + Color32 black = SkeletonGhostRenderer.TransparentBlack; + + float t = 1f; + for (float hardTimeLimit = 5f; hardTimeLimit > 0; hardTimeLimit -= Time.deltaTime) { + c = Color32.Lerp(black, startColor, t); + mpb.SetColor(colorId, c); + meshRenderer.SetPropertyBlock(mpb); + + t = Mathf.Lerp(t, 0, Time.deltaTime * fadeSpeed); + if (t <= 0) + break; + + yield return null; + } + + Destroy(meshFilter.sharedMesh); + gameObject.SetActive(false); + } + + IEnumerator FadeAdditive () { + Color32 c = startColor; + Color32 black = SkeletonGhostRenderer.TransparentBlack; + + float t = 1f; + + for (float hardTimeLimit = 5f; hardTimeLimit > 0; hardTimeLimit -= Time.deltaTime) { + c = Color32.Lerp(black, startColor, t); + mpb.SetColor(colorId, c); + meshRenderer.SetPropertyBlock(mpb); + + t = Mathf.Lerp(t, 0, Time.deltaTime * fadeSpeed); + if (t <= 0) + break; + + yield return null; + } + + Destroy(meshFilter.sharedMesh); + + gameObject.SetActive(false); + } + + public void Cleanup () { + if (meshFilter != null && meshFilter.sharedMesh != null) + Destroy(meshFilter.sharedMesh); + + Destroy(gameObject); + } + } + +} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Utility/BlendModeMaterialsUtility.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/SkeletonGhostRenderer.cs.meta similarity index 74% rename from Assets/Spine/Editor/spine-unity/Editor/Utility/BlendModeMaterialsUtility.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Ghost/SkeletonGhostRenderer.cs.meta index 5d96bd875..2f9fb1a1a 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Utility/BlendModeMaterialsUtility.cs.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ghost/SkeletonGhostRenderer.cs.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 -guid: 8094f8aedb33b7744b109c2c1294d37a +guid: 58e3a9b80754b7545a1dff4d8475b51f MonoImporter: - externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll.meta b/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll.meta new file mode 100644 index 000000000..cb9062592 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 90af663b37d994841b7ac03ae30fe2a9 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll/SkeletonRagdoll.cs b/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll/SkeletonRagdoll.cs new file mode 100644 index 000000000..6d2047e7c --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll/SkeletonRagdoll.cs @@ -0,0 +1,404 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +// Contributed by: Mitch Thompson + +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +namespace Spine.Unity.Modules { + [RequireComponent(typeof(SkeletonRenderer))] + public class SkeletonRagdoll : MonoBehaviour { + static Transform parentSpaceHelper; + + #region Inspector + [Header("Hierarchy")] + [SpineBone] + public string startingBoneName = ""; + [SpineBone] + public List stopBoneNames = new List(); + + [Header("Parameters")] + public bool applyOnStart; + [Tooltip("Warning! You will have to re-enable and tune mix values manually if attempting to remove the ragdoll system.")] + public bool disableIK = true; + public bool disableOtherConstraints = false; + [Space(18)] + [Tooltip("Set RootRigidbody IsKinematic to true when Apply is called.")] + public bool pinStartBone; + [Tooltip("Enable Collision between adjacent ragdoll elements (IE: Neck and Head)")] + public bool enableJointCollision; + public bool useGravity = true; + [Tooltip("If no BoundingBox Attachment is attached to a bone, this becomes the default Width or Radius of a Bone's ragdoll Rigidbody")] + public float thickness = 0.125f; + [Tooltip("Default rotational limit value. Min is negative this value, Max is this value.")] + public float rotationLimit = 20; + public float rootMass = 20; + [Tooltip("If your ragdoll seems unstable or uneffected by limits, try lowering this value.")] + [Range(0.01f, 1f)] + public float massFalloffFactor = 0.4f; + [Tooltip("The layer assigned to all of the rigidbody parts.")] + public int colliderLayer = 0; + [Range(0, 1)] + public float mix = 1; + #endregion + + ISkeletonAnimation targetSkeletonComponent; + Skeleton skeleton; + Dictionary boneTable = new Dictionary(); + Transform ragdollRoot; + public Rigidbody RootRigidbody { get; private set; } + public Bone StartingBone { get; private set; } + Vector3 rootOffset; + public Vector3 RootOffset { get { return this.rootOffset; } } + bool isActive; + public bool IsActive { get { return this.isActive; } } + + IEnumerator Start () { + if (parentSpaceHelper == null) { + parentSpaceHelper = (new GameObject("Parent Space Helper")).transform; + parentSpaceHelper.hideFlags = HideFlags.HideInHierarchy; + } + + targetSkeletonComponent = GetComponent() as ISkeletonAnimation; + if (targetSkeletonComponent == null) Debug.LogError("Attached Spine component does not implement ISkeletonAnimation. This script is not compatible."); + skeleton = targetSkeletonComponent.Skeleton; + + if (applyOnStart) { + yield return null; + Apply(); + } + } + + #region API + public Rigidbody[] RigidbodyArray { + get { + if (!isActive) + return new Rigidbody[0]; + + var rigidBodies = new Rigidbody[boneTable.Count]; + int i = 0; + foreach (Transform t in boneTable.Values) { + rigidBodies[i] = t.GetComponent(); + i++; + } + + return rigidBodies; + } + } + + public Vector3 EstimatedSkeletonPosition { + get { return RootRigidbody.position - rootOffset; } + } + + /// Instantiates the ragdoll simulation and applies its transforms to the skeleton. + public void Apply () { + isActive = true; + mix = 1; + + StartingBone = skeleton.FindBone(startingBoneName); + RecursivelyCreateBoneProxies(StartingBone); + + RootRigidbody = boneTable[StartingBone].GetComponent(); + RootRigidbody.isKinematic = pinStartBone; + RootRigidbody.mass = rootMass; + var boneColliders = new List(); + foreach (var pair in boneTable) { + var b = pair.Key; + var t = pair.Value; + Transform parentTransform; + boneColliders.Add(t.GetComponent()); + if (b == StartingBone) { + ragdollRoot = new GameObject("RagdollRoot").transform; + ragdollRoot.SetParent(transform, false); + if (b == skeleton.RootBone) { // RagdollRoot is skeleton root. + ragdollRoot.localPosition = new Vector3(b.WorldX, b.WorldY, 0); + ragdollRoot.localRotation = Quaternion.Euler(0, 0, GetPropagatedRotation(b)); + } else { + ragdollRoot.localPosition = new Vector3(b.Parent.WorldX, b.Parent.WorldY, 0); + ragdollRoot.localRotation = Quaternion.Euler(0, 0, GetPropagatedRotation(b.Parent)); + } + parentTransform = ragdollRoot; + rootOffset = t.position - transform.position; + } else { + parentTransform = boneTable[b.Parent]; + } + + // Add joint and attach to parent. + var rbParent = parentTransform.GetComponent(); + if (rbParent != null) { + var joint = t.gameObject.AddComponent(); + joint.connectedBody = rbParent; + Vector3 localPos = parentTransform.InverseTransformPoint(t.position); + localPos.x *= 1; + joint.connectedAnchor = localPos; + joint.axis = Vector3.forward; + + joint.GetComponent().mass = joint.connectedBody.mass * massFalloffFactor; + joint.limits = new JointLimits { + min = -rotationLimit, + max = rotationLimit, + }; + joint.useLimits = true; + joint.enableCollision = enableJointCollision; + } + } + + // Ignore collisions among bones. + for (int x = 0; x < boneColliders.Count; x++) { + for (int y = 0; y < boneColliders.Count; y++) { + if (x == y) continue; + Physics.IgnoreCollision(boneColliders[x], boneColliders[y]); + } + } + + // Destroy existing override-mode SkeletonUtilityBones. + var utilityBones = GetComponentsInChildren(); + if (utilityBones.Length > 0) { + var destroyedUtilityBoneNames = new List(); + foreach (var ub in utilityBones) { + if (ub.mode == SkeletonUtilityBone.Mode.Override) { + destroyedUtilityBoneNames.Add(ub.gameObject.name); + Destroy(ub.gameObject); + } + } + if (destroyedUtilityBoneNames.Count > 0) { + string msg = "Destroyed Utility Bones: "; + for (int i = 0; i < destroyedUtilityBoneNames.Count; i++) { + msg += destroyedUtilityBoneNames[i]; + if (i != destroyedUtilityBoneNames.Count - 1) { + msg += ","; + } + } + Debug.LogWarning(msg); + } + } + + // Disable skeleton constraints. + if (disableIK) { + var ikConstraints = skeleton.IkConstraints; + for (int i = 0, n = ikConstraints.Count; i < n; i++) + ikConstraints.Items[i].mix = 0; + } + + if (disableOtherConstraints) { + var transformConstraints = skeleton.transformConstraints; + for (int i = 0, n = transformConstraints.Count; i < n; i++) { + transformConstraints.Items[i].rotateMix = 0; + transformConstraints.Items[i].scaleMix = 0; + transformConstraints.Items[i].shearMix = 0; + transformConstraints.Items[i].translateMix = 0; + } + + var pathConstraints = skeleton.pathConstraints; + for (int i = 0, n = pathConstraints.Count; i < n; i++) { + pathConstraints.Items[i].rotateMix = 0; + pathConstraints.Items[i].translateMix = 0; + } + } + + targetSkeletonComponent.UpdateWorld += UpdateSpineSkeleton; + } + + /// Transitions the mix value from the current value to a target value. + public Coroutine SmoothMix (float target, float duration) { + return StartCoroutine(SmoothMixCoroutine(target, duration)); + } + + IEnumerator SmoothMixCoroutine (float target, float duration) { + float startTime = Time.time; + float startMix = mix; + while (mix > 0) { + skeleton.SetBonesToSetupPose(); + mix = Mathf.SmoothStep(startMix, target, (Time.time - startTime) / duration); + yield return null; + } + } + + /// Set the transform world position while preserving the ragdoll parts world position. + public void SetSkeletonPosition (Vector3 worldPosition) { + if (!isActive) { + Debug.LogWarning("Can't call SetSkeletonPosition while Ragdoll is not active!"); + return; + } + + Vector3 offset = worldPosition - transform.position; + transform.position = worldPosition; + foreach (Transform t in boneTable.Values) + t.position -= offset; + + UpdateSpineSkeleton(null); + skeleton.UpdateWorldTransform(); + } + + /// Removes the ragdoll instance and effect from the animated skeleton. + public void Remove () { + isActive = false; + foreach (var t in boneTable.Values) + Destroy(t.gameObject); + + Destroy(ragdollRoot.gameObject); + + boneTable.Clear(); + targetSkeletonComponent.UpdateWorld -= UpdateSpineSkeleton; + } + + public Rigidbody GetRigidbody (string boneName) { + var bone = skeleton.FindBone(boneName); + return (bone != null && boneTable.ContainsKey(bone)) ? boneTable[bone].GetComponent() : null; + } + #endregion + + void RecursivelyCreateBoneProxies (Bone b) { + string boneName = b.data.name; + if (stopBoneNames.Contains(boneName)) + return; + + var boneGameObject = new GameObject(boneName); + boneGameObject.layer = colliderLayer; + Transform t = boneGameObject.transform; + boneTable.Add(b, t); + + t.parent = transform; + t.localPosition = new Vector3(b.WorldX, b.WorldY, 0); + t.localRotation = Quaternion.Euler(0, 0, b.WorldRotationX - b.shearX); + t.localScale = new Vector3(b.WorldScaleX, b.WorldScaleY, 1); + + // MITCH: You left "todo: proper ragdoll branching" + var colliders = AttachBoundingBoxRagdollColliders(b); + if (colliders.Count == 0) { + float length = b.Data.Length; + if (length == 0) { + var ball = boneGameObject.AddComponent(); + ball.radius = thickness * 0.5f; + } else { + var box = boneGameObject.AddComponent(); + box.size = new Vector3(length, thickness, thickness); + box.center = new Vector3(length * 0.5f, 0); + } + } + var rb = boneGameObject.AddComponent(); + rb.constraints = RigidbodyConstraints.FreezePositionZ; + + foreach (Bone child in b.Children) + RecursivelyCreateBoneProxies(child); + } + + void UpdateSpineSkeleton (ISkeletonAnimation skeletonRenderer) { + bool flipX = skeleton.ScaleX < 0; + bool flipY = skeleton.ScaleY < 0; + bool flipXOR = flipX ^ flipY; + bool flipOR = flipX || flipY; + + foreach (var pair in boneTable) { + var b = pair.Key; + var t = pair.Value; + bool isStartingBone = b == StartingBone; + Transform parentTransform = isStartingBone ? ragdollRoot : boneTable[b.Parent]; + Vector3 parentTransformWorldPosition = parentTransform.position; + Quaternion parentTransformWorldRotation = parentTransform.rotation; + + parentSpaceHelper.position = parentTransformWorldPosition; + parentSpaceHelper.rotation = parentTransformWorldRotation; + parentSpaceHelper.localScale = parentTransform.localScale; + + Vector3 boneWorldPosition = t.position; + Vector3 right = parentSpaceHelper.InverseTransformDirection(t.right); + + Vector3 boneLocalPosition = parentSpaceHelper.InverseTransformPoint(boneWorldPosition); + float boneLocalRotation = Mathf.Atan2(right.y, right.x) * Mathf.Rad2Deg; + + if (flipOR) { + if (isStartingBone) { + if (flipX) boneLocalPosition.x *= -1f; + if (flipY) boneLocalPosition.y *= -1f; + + boneLocalRotation = boneLocalRotation * (flipXOR ? -1f : 1f); + if (flipX) boneLocalRotation += 180; + } else { + if (flipXOR) { + boneLocalRotation *= -1f; + boneLocalPosition.y *= -1f; // wtf?? + } + } + } + + b.x = Mathf.Lerp(b.x, boneLocalPosition.x, mix); + b.y = Mathf.Lerp(b.y, boneLocalPosition.y, mix); + b.rotation = Mathf.Lerp(b.rotation, boneLocalRotation, mix); + //b.AppliedRotation = Mathf.Lerp(b.AppliedRotation, boneLocalRotation, mix); + } + } + + List AttachBoundingBoxRagdollColliders (Bone b) { + const string AttachmentNameMarker = "ragdoll"; + var colliders = new List(); + + Transform t = boneTable[b]; + GameObject go = t.gameObject; + var skin = skeleton.Skin ?? skeleton.Data.DefaultSkin; + + var attachments = new List(); + foreach (Slot s in skeleton.Slots) { + if (s.Bone == b) { + skin.FindAttachmentsForSlot(skeleton.Slots.IndexOf(s), attachments); + foreach (var a in attachments) { + var bbAttachment = a as BoundingBoxAttachment; + if (bbAttachment != null) { + if (!a.Name.ToLower().Contains(AttachmentNameMarker)) + continue; + + var bbCollider = go.AddComponent(); + var bounds = SkeletonUtility.GetBoundingBoxBounds(bbAttachment, thickness); + bbCollider.center = bounds.center; + bbCollider.size = bounds.size; + colliders.Add(bbCollider); + } + } + } + } + + return colliders; + } + + static float GetPropagatedRotation (Bone b) { + Bone parent = b.Parent; + float a = b.AppliedRotation; + while (parent != null) { + a += parent.AppliedRotation; + parent = parent.parent; + } + return a; + } + + public class LayerFieldAttribute : PropertyAttribute {} + } + +} diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll/SkeletonRagdoll.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll/SkeletonRagdoll.cs.meta new file mode 100644 index 000000000..f19d6808f --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll/SkeletonRagdoll.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 373527d2bf3351348b9fcc499ce9ea23 +timeCreated: 1430552693 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll/SkeletonRagdoll2D.cs b/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll/SkeletonRagdoll2D.cs new file mode 100644 index 000000000..afd440070 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll/SkeletonRagdoll2D.cs @@ -0,0 +1,415 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +// Contributed by: Mitch Thompson + +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +namespace Spine.Unity.Modules { + [RequireComponent(typeof(SkeletonRenderer))] + public class SkeletonRagdoll2D : MonoBehaviour { + static Transform parentSpaceHelper; + + #region Inspector + [Header("Hierarchy")] + [SpineBone] + public string startingBoneName = ""; + [SpineBone] + public List stopBoneNames = new List(); + + [Header("Parameters")] + public bool applyOnStart; + [Tooltip("Warning! You will have to re-enable and tune mix values manually if attempting to remove the ragdoll system.")] + public bool disableIK = true; + public bool disableOtherConstraints = false; + [Space] + [Tooltip("Set RootRigidbody IsKinematic to true when Apply is called.")] + public bool pinStartBone; + public float gravityScale = 1; + [Tooltip("If no BoundingBox Attachment is attached to a bone, this becomes the default Width or Radius of a Bone's ragdoll Rigidbody")] + public float thickness = 0.125f; + [Tooltip("Default rotational limit value. Min is negative this value, Max is this value.")] + public float rotationLimit = 20; + public float rootMass = 20; + [Tooltip("If your ragdoll seems unstable or uneffected by limits, try lowering this value.")] + [Range(0.01f, 1f)] + public float massFalloffFactor = 0.4f; + [Tooltip("The layer assigned to all of the rigidbody parts.")] + [SkeletonRagdoll.LayerField] + public int colliderLayer = 0; + [Range(0, 1)] + public float mix = 1; + #endregion + + ISkeletonAnimation targetSkeletonComponent; + Skeleton skeleton; + Dictionary boneTable = new Dictionary(); + Transform ragdollRoot; + public Rigidbody2D RootRigidbody { get; private set; } + public Bone StartingBone { get; private set; } + Vector2 rootOffset; + public Vector3 RootOffset { get { return this.rootOffset; } } + bool isActive; + public bool IsActive { get { return this.isActive; } } + + IEnumerator Start () { + if (parentSpaceHelper == null) { + parentSpaceHelper = (new GameObject("Parent Space Helper")).transform; + } + + targetSkeletonComponent = GetComponent() as ISkeletonAnimation; + if (targetSkeletonComponent == null) Debug.LogError("Attached Spine component does not implement ISkeletonAnimation. This script is not compatible."); + skeleton = targetSkeletonComponent.Skeleton; + + if (applyOnStart) { + yield return null; + Apply(); + } + } + + #region API + public Rigidbody2D[] RigidbodyArray { + get { + if (!isActive) + return new Rigidbody2D[0]; + + var rigidBodies = new Rigidbody2D[boneTable.Count]; + int i = 0; + foreach (Transform t in boneTable.Values) { + rigidBodies[i] = t.GetComponent(); + i++; + } + + return rigidBodies; + } + } + + public Vector3 EstimatedSkeletonPosition { + get { return this.RootRigidbody.position - rootOffset; } + } + + /// Instantiates the ragdoll simulation and applies its transforms to the skeleton. + public void Apply () { + isActive = true; + mix = 1; + + Bone startingBone = this.StartingBone = skeleton.FindBone(startingBoneName); + RecursivelyCreateBoneProxies(startingBone); + + RootRigidbody = boneTable[startingBone].GetComponent(); + RootRigidbody.isKinematic = pinStartBone; + RootRigidbody.mass = rootMass; + var boneColliders = new List(); + foreach (var pair in boneTable) { + var b = pair.Key; + var t = pair.Value; + Transform parentTransform; + boneColliders.Add(t.GetComponent()); + if (b == startingBone) { + ragdollRoot = new GameObject("RagdollRoot").transform; + ragdollRoot.SetParent(transform, false); + if (b == skeleton.RootBone) { // RagdollRoot is skeleton root. + ragdollRoot.localPosition = new Vector3(b.WorldX, b.WorldY, 0); + ragdollRoot.localRotation = Quaternion.Euler(0, 0, GetPropagatedRotation(b)); + } else { + ragdollRoot.localPosition = new Vector3(b.Parent.WorldX, b.Parent.WorldY, 0); + ragdollRoot.localRotation = Quaternion.Euler(0, 0, GetPropagatedRotation(b.Parent)); + } + parentTransform = ragdollRoot; + rootOffset = t.position - transform.position; + } else { + parentTransform = boneTable[b.Parent]; + } + + // Add joint and attach to parent. + var rbParent = parentTransform.GetComponent(); + if (rbParent != null) { + var joint = t.gameObject.AddComponent(); + joint.connectedBody = rbParent; + Vector3 localPos = parentTransform.InverseTransformPoint(t.position); + joint.connectedAnchor = localPos; + + joint.GetComponent().mass = joint.connectedBody.mass * massFalloffFactor; + joint.limits = new JointAngleLimits2D { + min = -rotationLimit, + max = rotationLimit + }; + joint.useLimits = true; + } + } + + // Ignore collisions among bones. + for (int x = 0; x < boneColliders.Count; x++) { + for (int y = 0; y < boneColliders.Count; y++) { + if (x == y) continue; + Physics2D.IgnoreCollision(boneColliders[x], boneColliders[y]); + } + } + + // Destroy existing override-mode SkeletonUtility bones. + var utilityBones = GetComponentsInChildren(); + if (utilityBones.Length > 0) { + var destroyedUtilityBoneNames = new List(); + foreach (var ub in utilityBones) { + if (ub.mode == SkeletonUtilityBone.Mode.Override) { + destroyedUtilityBoneNames.Add(ub.gameObject.name); + Destroy(ub.gameObject); + } + } + if (destroyedUtilityBoneNames.Count > 0) { + string msg = "Destroyed Utility Bones: "; + for (int i = 0; i < destroyedUtilityBoneNames.Count; i++) { + msg += destroyedUtilityBoneNames[i]; + if (i != destroyedUtilityBoneNames.Count - 1) { + msg += ","; + } + } + Debug.LogWarning(msg); + } + } + + // Disable skeleton constraints. + if (disableIK) { + var ikConstraints = skeleton.IkConstraints; + for (int i = 0, n = ikConstraints.Count; i < n; i++) + ikConstraints.Items[i].mix = 0; + } + + if (disableOtherConstraints) { + var transformConstraints = skeleton.transformConstraints; + for (int i = 0, n = transformConstraints.Count; i < n; i++) { + transformConstraints.Items[i].rotateMix = 0; + transformConstraints.Items[i].scaleMix = 0; + transformConstraints.Items[i].shearMix = 0; + transformConstraints.Items[i].translateMix = 0; + } + + var pathConstraints = skeleton.pathConstraints; + for (int i = 0, n = pathConstraints.Count; i < n; i++) { + pathConstraints.Items[i].rotateMix = 0; + pathConstraints.Items[i].translateMix = 0; + } + } + + targetSkeletonComponent.UpdateWorld += UpdateSpineSkeleton; + } + + /// Transitions the mix value from the current value to a target value. + public Coroutine SmoothMix (float target, float duration) { + return StartCoroutine(SmoothMixCoroutine(target, duration)); + } + + IEnumerator SmoothMixCoroutine (float target, float duration) { + float startTime = Time.time; + float startMix = mix; + while (mix > 0) { + skeleton.SetBonesToSetupPose(); + mix = Mathf.SmoothStep(startMix, target, (Time.time - startTime) / duration); + yield return null; + } + } + + /// Set the transform world position while preserving the ragdoll parts world position. + public void SetSkeletonPosition (Vector3 worldPosition) { + if (!isActive) { + Debug.LogWarning("Can't call SetSkeletonPosition while Ragdoll is not active!"); + return; + } + + Vector3 offset = worldPosition - transform.position; + transform.position = worldPosition; + foreach (Transform t in boneTable.Values) + t.position -= offset; + + UpdateSpineSkeleton(null); + skeleton.UpdateWorldTransform(); + } + + /// Removes the ragdoll instance and effect from the animated skeleton. + public void Remove () { + isActive = false; + foreach (var t in boneTable.Values) + Destroy(t.gameObject); + + Destroy(ragdollRoot.gameObject); + boneTable.Clear(); + targetSkeletonComponent.UpdateWorld -= UpdateSpineSkeleton; + } + + public Rigidbody2D GetRigidbody (string boneName) { + var bone = skeleton.FindBone(boneName); + return (bone != null && boneTable.ContainsKey(bone)) ? boneTable[bone].GetComponent() : null; + } + #endregion + + /// Generates the ragdoll simulation's Transform and joint setup. + void RecursivelyCreateBoneProxies (Bone b) { + string boneName = b.data.name; + if (stopBoneNames.Contains(boneName)) + return; + + var boneGameObject = new GameObject(boneName); + boneGameObject.layer = this.colliderLayer; + Transform t = boneGameObject.transform; + boneTable.Add(b, t); + + t.parent = transform; + t.localPosition = new Vector3(b.WorldX, b.WorldY, 0); + t.localRotation = Quaternion.Euler(0, 0, b.WorldRotationX - b.shearX); + t.localScale = new Vector3(b.WorldScaleX, b.WorldScaleY, 0); + + // MITCH: You left "todo: proper ragdoll branching" + var colliders = AttachBoundingBoxRagdollColliders(b, boneGameObject, skeleton, this.gravityScale); + if (colliders.Count == 0) { + float length = b.data.length; + if (length == 0) { + var circle = boneGameObject.AddComponent(); + circle.radius = thickness * 0.5f; + } else { + var box = boneGameObject.AddComponent(); + box.size = new Vector2(length, thickness); + box.offset = new Vector2(length * 0.5f, 0); // box.center in UNITY_4 + } + } + + var rb = boneGameObject.GetComponent(); + if (rb == null) rb = boneGameObject.AddComponent(); + rb.gravityScale = this.gravityScale; + + foreach (Bone child in b.Children) + RecursivelyCreateBoneProxies(child); + } + + /// Performed every skeleton animation update to translate Unity Transforms positions into Spine bone transforms. + void UpdateSpineSkeleton (ISkeletonAnimation animatedSkeleton) { + bool flipX = skeleton.ScaleX < 0; + bool flipY = skeleton.ScaleY < 0; + bool flipXOR = flipX ^ flipY; + bool flipOR = flipX || flipY; + var startingBone = this.StartingBone; + + foreach (var pair in boneTable) { + var b = pair.Key; + var t = pair.Value; + bool isStartingBone = (b == startingBone); + Transform parentTransform = isStartingBone ? ragdollRoot : boneTable[b.Parent]; + Vector3 parentTransformWorldPosition = parentTransform.position; + Quaternion parentTransformWorldRotation = parentTransform.rotation; + + parentSpaceHelper.position = parentTransformWorldPosition; + parentSpaceHelper.rotation = parentTransformWorldRotation; + parentSpaceHelper.localScale = parentTransform.localScale; + + Vector3 boneWorldPosition = t.position; + Vector3 right = parentSpaceHelper.InverseTransformDirection(t.right); + + Vector3 boneLocalPosition = parentSpaceHelper.InverseTransformPoint(boneWorldPosition); + float boneLocalRotation = Mathf.Atan2(right.y, right.x) * Mathf.Rad2Deg; + if (flipOR) { + if (isStartingBone) { + if (flipX) boneLocalPosition.x *= -1f; + if (flipY) boneLocalPosition.y *= -1f; + + boneLocalRotation = boneLocalRotation * (flipXOR ? -1f : 1f); + if (flipX) boneLocalRotation += 180; + } else { + if (flipXOR) { + boneLocalRotation *= -1f; + boneLocalPosition.y *= -1f; // wtf?? + } + } + } + + b.x = Mathf.Lerp(b.x, boneLocalPosition.x, mix); + b.y = Mathf.Lerp(b.y, boneLocalPosition.y, mix); + b.rotation = Mathf.Lerp(b.rotation, boneLocalRotation, mix); + //b.AppliedRotation = Mathf.Lerp(b.AppliedRotation, boneLocalRotation, mix); + } + } + + static List AttachBoundingBoxRagdollColliders (Bone b, GameObject go, Skeleton skeleton, float gravityScale) { + const string AttachmentNameMarker = "ragdoll"; + var colliders = new List(); + var skin = skeleton.Skin ?? skeleton.Data.DefaultSkin; + + var attachments = new List(); + foreach (Slot slot in skeleton.Slots) { + if (slot.bone == b) { + skin.FindAttachmentsForSlot(skeleton.Slots.IndexOf(slot), attachments); + + bool bbAttachmentAdded = false; + foreach (var a in attachments) { + var bbAttachment = a as BoundingBoxAttachment; + if (bbAttachment != null) { + if (!a.Name.ToLower().Contains(AttachmentNameMarker)) + continue; + + bbAttachmentAdded = true; + var bbCollider = SkeletonUtility.AddBoundingBoxAsComponent(bbAttachment, slot, go, isTrigger: false); + colliders.Add(bbCollider); + } + } + + if (bbAttachmentAdded) + SkeletonUtility.AddBoneRigidbody2D(go, isKinematic: false, gravityScale: gravityScale); + } + } + + return colliders; + } + + static float GetPropagatedRotation (Bone b) { + Bone parent = b.Parent; + float a = b.AppliedRotation; + while (parent != null) { + a += parent.AppliedRotation; + parent = parent.parent; + } + return a; + } + + static Vector3 FlipScale (bool flipX, bool flipY) { + return new Vector3(flipX ? -1f : 1f, flipY ? -1f : 1f, 1f); + } + + #if UNITY_EDITOR + void OnDrawGizmosSelected () { + if (isActive) { + Gizmos.DrawWireSphere(transform.position, thickness * 1.2f); + Vector3 newTransformPos = RootRigidbody.position - rootOffset; + Gizmos.DrawLine(transform.position, newTransformPos); + Gizmos.DrawWireSphere(newTransformPos, thickness * 1.2f); + } + } + #endif + } + +} diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll/SkeletonRagdoll2D.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll/SkeletonRagdoll2D.cs.meta new file mode 100644 index 000000000..ed29795fe --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Ragdoll/SkeletonRagdoll2D.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e74a49a26242a214d9084fde00bfe3ab +timeCreated: 1431497383 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Shaders.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders.meta new file mode 100644 index 000000000..6cf986849 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3e6a65e2576c5b74dabb05c3d3fc2ae4 +folderAsset: yes +timeCreated: 1479258132 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Fill.shader b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Skeleton-Fill.shader similarity index 66% rename from Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Fill.shader rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Skeleton-Fill.shader index a02553f16..423a13920 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Fill.shader +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Skeleton-Fill.shader @@ -10,16 +10,7 @@ Shader "Spine/Skeleton Fill" { _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default } SubShader { Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } @@ -35,8 +26,6 @@ Shader "Spine/Skeleton Fill" { } Pass { - Name "Normal" - CGPROGRAM #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT #pragma vertex vert @@ -66,7 +55,7 @@ Shader "Spine/Skeleton Fill" { return o; } - float4 frag (VertexOutput i) : SV_Target { + float4 frag (VertexOutput i) : COLOR { float4 rawColor = tex2D(_MainTex,i.uv); float finalAlpha = (rawColor.a * i.vertexColor.a); @@ -100,27 +89,25 @@ Shader "Spine/Skeleton Fill" { sampler2D _MainTex; fixed _Cutoff; - struct VertexOutput { + struct VertexOutput { V2F_SHADOW_CASTER; - float4 uvAndAlpha : TEXCOORD1; + float2 uv : TEXCOORD1; }; - VertexOutput vert (appdata_base v, float4 vertexColor : COLOR) { + VertexOutput vert (appdata_base v) { VertexOutput o; - o.uvAndAlpha = v.texcoord; - o.uvAndAlpha.a = vertexColor.a; + o.uv = v.texcoord; TRANSFER_SHADOW_CASTER(o) return o; } - float4 frag (VertexOutput i) : SV_Target { - fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); - clip(texcol.a * i.uvAndAlpha.a - _Cutoff); + float4 frag (VertexOutput i) : COLOR { + fixed4 texcol = tex2D(_MainTex, i.uv); + clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) } ENDCG } } FallBack "Diffuse" - CustomEditor "SpineShaderWithOutlineGUI" -} +} \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Fill.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Skeleton-Fill.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Fill.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Skeleton-Fill.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Tint.shader b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Skeleton-Tint.shader similarity index 56% rename from Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Tint.shader rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Skeleton-Tint.shader index 4595bcb7f..5e4b458c7 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Tint.shader +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Skeleton-Tint.shader @@ -7,22 +7,12 @@ Shader "Spine/Skeleton Tint" { Properties { _Color ("Tint Color", Color) = (1,1,1,1) - _Black ("Dark Color", Color) = (0,0,0,0) + _Black ("Black Point", Color) = (0,0,0,0) [NoScaleOffset] _MainTex ("MainTex", 2D) = "black" {} [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - _Cutoff("Shadow alpha cutoff", Range(0,1)) = 0.1 - [Toggle(_DARK_COLOR_ALPHA_ADDITIVE)] _DarkColorAlphaAdditive("Additive DarkColor.A", Int) = 0 + _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default } SubShader { @@ -41,11 +31,8 @@ Shader "Spine/Skeleton Tint" { } Pass { - Name "Normal" - CGPROGRAM #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT - #pragma shader_feature _ _DARK_COLOR_ALPHA_ADDITIVE #pragma vertex vert #pragma fragment frag #include "UnityCG.cginc" @@ -73,11 +60,14 @@ Shader "Spine/Skeleton Tint" { return o; } - #include "CGIncludes/Spine-Skeleton-Tint-Common.cginc" - - float4 frag (VertexOutput i) : SV_Target { + float4 frag (VertexOutput i) : COLOR { float4 texColor = tex2D(_MainTex, i.uv); - return fragTintedColor(texColor, _Black.rgb, i.vertexColor, _Color.a, _Black.a); + + #if defined(_STRAIGHT_ALPHA_INPUT) + texColor.rgb *= texColor.a; + #endif + + return (texColor * i.vertexColor) + float4(((1-texColor.rgb) * _Black.rgb * texColor.a*_Color.a*i.vertexColor.a), 0); } ENDCG } @@ -102,26 +92,24 @@ Shader "Spine/Skeleton Tint" { sampler2D _MainTex; fixed _Cutoff; - struct VertexOutput { + struct VertexOutput { V2F_SHADOW_CASTER; - float4 uvAndAlpha : TEXCOORD1; + float2 uv : TEXCOORD1; }; - VertexOutput vert (appdata_base v, float4 vertexColor : COLOR) { + VertexOutput vert (appdata_base v) { VertexOutput o; - o.uvAndAlpha = v.texcoord; - o.uvAndAlpha.a = vertexColor.a; + o.uv = v.texcoord; TRANSFER_SHADOW_CASTER(o) return o; } - float4 frag (VertexOutput i) : SV_Target { - fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); - clip(texcol.a * i.uvAndAlpha.a - _Cutoff); + float4 frag (VertexOutput i) : COLOR { + fixed4 texcol = tex2D(_MainTex, i.uv); + clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) } ENDCG } } - CustomEditor "SpineShaderWithOutlineGUI" } diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Tint.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Skeleton-Tint.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Tint.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Skeleton-Tint.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Special-Skeleton-Grayscale.shader b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader similarity index 66% rename from Assets/Spine/Runtime/spine-unity/Shaders/Spine-Special-Skeleton-Grayscale.shader rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader index 75c1d4934..2dc66e519 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Special-Skeleton-Grayscale.shader +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader @@ -9,18 +9,8 @@ Shader "Spine/Special/Skeleton Grayscale" { _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default } - SubShader { Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } Blend One OneMinusSrcAlpha @@ -35,8 +25,6 @@ Shader "Spine/Special/Skeleton Grayscale" { } Pass { - Name "Normal" - CGPROGRAM #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT #pragma vertex vert @@ -65,7 +53,7 @@ Shader "Spine/Special/Skeleton Grayscale" { return o; } - float4 frag (VertexOutput i) : SV_Target { + float4 frag (VertexOutput i) : COLOR { float4 rawColor = tex2D(_MainTex,i.uv); float finalAlpha = (rawColor.a * i.vertexColor.a); @@ -101,27 +89,25 @@ Shader "Spine/Special/Skeleton Grayscale" { sampler2D _MainTex; fixed _Cutoff; - struct VertexOutput { + struct VertexOutput { V2F_SHADOW_CASTER; - float4 uvAndAlpha : TEXCOORD1; + float2 uv : TEXCOORD1; }; - VertexOutput vert (appdata_base v, float4 vertexColor : COLOR) { + VertexOutput vert (appdata_base v) { VertexOutput o; - o.uvAndAlpha = v.texcoord; - o.uvAndAlpha.a = vertexColor.a; + o.uv = v.texcoord; TRANSFER_SHADOW_CASTER(o) return o; } float4 frag (VertexOutput i) : SV_Target { - fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); - clip(texcol.a * i.uvAndAlpha.a - _Cutoff); + fixed4 texcol = tex2D(_MainTex, i.uv); + clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) } ENDCG } } FallBack "Diffuse" - CustomEditor "SpineShaderWithOutlineGUI" -} +} \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Special-Skeleton-Grayscale.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Spine-Special-Skeleton-Grayscale.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderMaths.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/ShaderMaths.cginc similarity index 86% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderMaths.cginc rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/ShaderMaths.cginc index 0bb3aae9a..d79c013f9 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderMaths.cginc +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/ShaderMaths.cginc @@ -1,13 +1,7 @@ #ifndef SHADER_MATHS_INCLUDED #define SHADER_MATHS_INCLUDED -#if defined(USE_LWRP) -#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl" -#elif defined(USE_URP) -#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" -#else #include "UnityCG.cginc" -#endif //////////////////////////////////////// // Maths functions @@ -42,7 +36,7 @@ inline half pow5 (half x) } inline float4 quat_from_axis_angle(float3 axis, float angleRadians) -{ +{ float4 qr; float half_angle = (angleRadians * 0.5); qr.x = axis.x * sin(half_angle); @@ -53,7 +47,7 @@ inline float4 quat_from_axis_angle(float3 axis, float angleRadians) } inline float3 rotate_vertex_position(float3 position, float3 axis, float angleRadians) -{ +{ float4 q = quat_from_axis_angle(axis, angleRadians); float3 v = position.xyz; return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v); @@ -73,4 +67,4 @@ float DecodeFloatRGB(float3 decomp) return dot( decomp.xyz, float3( 255.0/256, 255.0/(256*256), 255.0/(256*256*256) ) ); } -#endif // SHADER_MATHS_INCLUDED +#endif // SHADER_MATHS_INCLUDED \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderMaths.cginc.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/ShaderMaths.cginc.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderMaths.cginc.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/ShaderMaths.cginc.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderShared.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/ShaderShared.cginc similarity index 64% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderShared.cginc rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/ShaderShared.cginc index dd5d83fe4..75284d2a7 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderShared.cginc +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/ShaderShared.cginc @@ -3,13 +3,29 @@ #ifndef SHADER_SHARED_INCLUDED #define SHADER_SHARED_INCLUDED -#if defined(USE_LWRP) -#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl" -#elif defined(USE_URP) -#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" -#else #include "UnityCG.cginc" + +#ifdef UNITY_INSTANCING_ENABLED + + UNITY_INSTANCING_BUFFER_START(PerDrawSprite) + // SpriteRenderer.Color while Non-Batched/Instanced. + fixed4 unity_SpriteRendererColorArray[UNITY_INSTANCED_ARRAY_SIZE]; + // this could be smaller but that's how bit each entry is regardless of type + float4 unity_SpriteFlipArray[UNITY_INSTANCED_ARRAY_SIZE]; + UNITY_INSTANCING_BUFFER_END(PerDrawSprite) + + #define _RendererColor unity_SpriteRendererColorArray[unity_InstanceID] + #define _Flip unity_SpriteFlipArray[unity_InstanceID] + +#endif // instancing + +CBUFFER_START(UnityPerDrawSprite) +#ifndef UNITY_INSTANCING_ENABLED + fixed4 _RendererColor; + float4 _Flip; #endif + float _EnableExternalAlpha; +CBUFFER_END //////////////////////////////////////// // Space functions @@ -20,37 +36,14 @@ inline float4 calculateWorldPos(float4 vertex) return mul(unity_ObjectToWorld, vertex); } -#if defined(USE_LWRP) || defined(USE_URP) -// snaps post-transformed position to screen pixels -inline float4 UnityPixelSnap(float4 pos) -{ - float2 hpc = _ScreenParams.xy * 0.5f; -#if SHADER_API_PSSL - // sdk 4.5 splits round into v_floor_f32(x+0.5) ... sdk 5.0 uses v_rndne_f32, for compatabilty we use the 4.5 version - float2 temp = ((pos.xy / pos.w) * hpc) + float2(0.5f, 0.5f); - float2 pixelPos = float2(__v_floor_f32(temp.x), __v_floor_f32(temp.y)); -#else - float2 pixelPos = round((pos.xy / pos.w) * hpc); -#endif - pos.xy = pixelPos / hpc * pos.w; - return pos; -} -#endif - inline float4 calculateLocalPos(float4 vertex) { -#if !defined(USE_LWRP) && !defined(USE_URP) #ifdef UNITY_INSTANCING_ENABLED vertex.xy *= _Flip.xy; #endif -#endif -#if defined(USE_LWRP) || defined(USE_URP) - float4 pos = TransformObjectToHClip(vertex.xyz); -#else float4 pos = UnityObjectToClipPos(vertex); -#endif - + #ifdef PIXELSNAP_ON pos = UnityPixelSnap(pos); #endif @@ -60,11 +53,7 @@ inline float4 calculateLocalPos(float4 vertex) inline half3 calculateWorldNormal(float3 normal) { -#if defined(USE_LWRP) || defined(USE_URP) - return TransformObjectToWorldNormal(normal); -#else return UnityObjectToWorldNormal(normal); -#endif } //////////////////////////////////////// @@ -74,10 +63,7 @@ inline half3 calculateWorldNormal(float3 normal) #if defined(_NORMALMAP) uniform sampler2D _BumpMap; - -#if !defined(USE_LWRP) && !defined(USE_URP) uniform half _BumpScale; -#endif half3 UnpackScaleNormal(half4 packednormal, half bumpScale) { @@ -86,8 +72,7 @@ half3 UnpackScaleNormal(half4 packednormal, half bumpScale) #else half3 normal; normal.xy = (packednormal.wy * 2 - 1); - // Note: we allow scaled normals in LWRP since we might be using fewer instructions. - #if (SHADER_TARGET >= 30) || defined(USE_LWRP) || defined(USE_URP) + #if (SHADER_TARGET >= 30) // SM2.0: instruction count limitation // SM2.0: normal scaler is not supported normal.xy *= bumpScale; @@ -95,16 +80,12 @@ half3 UnpackScaleNormal(half4 packednormal, half bumpScale) normal.z = sqrt(1.0 - saturate(dot(normal.xy, normal.xy))); return normal; #endif -} +} inline half3 calculateWorldTangent(float4 tangent) { -#if defined(USE_LWRP) || defined(USE_URP) - return TransformObjectToWorldDir(tangent.xyz); -#else return UnityObjectToWorldDir(tangent); -#endif } inline half3 calculateWorldBinormal(half3 normalWorld, half3 tangentWorld, float tangentSign) @@ -130,52 +111,88 @@ inline half3 calculateNormalFromBumpMap(float2 texUV, half3 tangentWorld, half3 // Blending functions // -inline fixed4 prepareLitPixelForOutput(fixed4 finalPixel, fixed4 color) : SV_Target +inline fixed4 calculateLitPixel(fixed4 texureColor, fixed4 color, fixed3 lighting) : SV_Target { + fixed4 finalPixel; + #if defined(_ALPHABLEND_ON) //Normal Alpha - finalPixel.rgb *= finalPixel.a; + finalPixel.a = texureColor.a * color.a; + finalPixel.rgb = texureColor.rgb * color.rgb * (lighting * finalPixel.a); #elif defined(_ALPHAPREMULTIPLY_ON) //Pre multiplied alpha - finalPixel.rgb *= color.a; + finalPixel = texureColor * color; + finalPixel.rgb *= lighting * color.a; #elif defined(_MULTIPLYBLEND) //Multiply + finalPixel = texureColor * color; + finalPixel.rgb *= lighting; finalPixel = lerp(fixed4(1,1,1,1), finalPixel, finalPixel.a); #elif defined(_MULTIPLYBLEND_X2) //Multiply x2 - finalPixel.rgb *= 2.0f; + finalPixel.rgb = texureColor.rgb * color.rgb * lighting * 2.0f; + finalPixel.a = color.a * texureColor.a; finalPixel = lerp(fixed4(0.5f,0.5f,0.5f,0.5f), finalPixel, finalPixel.a); #elif defined(_ADDITIVEBLEND) //Additive - finalPixel *= 2.0f; - finalPixel.rgb *= color.a; + finalPixel = texureColor * 2.0f * color; + finalPixel.rgb *= lighting * color.a; #elif defined(_ADDITIVEBLEND_SOFT) //Additive soft - finalPixel.rgb *= finalPixel.a; -#else + finalPixel = texureColor * color; + finalPixel.rgb *= lighting * finalPixel.a; +#else //Opaque finalPixel.a = 1; + finalPixel.rgb = texureColor.rgb * color.rgb * lighting; #endif - return finalPixel; -} - -inline fixed4 calculateLitPixel(fixed4 texureColor, fixed4 color, fixed3 lighting) : SV_Target -{ - fixed4 finalPixel = texureColor * color * fixed4(lighting, 1); - finalPixel = prepareLitPixelForOutput(finalPixel, color); + return finalPixel; } inline fixed4 calculateLitPixel(fixed4 texureColor, fixed3 lighting) : SV_Target { - // note: we let the optimizer work, removed duplicate code. - return calculateLitPixel(texureColor, fixed4(1, 1, 1, 1), lighting); + fixed4 finalPixel; + +#if defined(_ALPHABLEND_ON) + //Normal Alpha + finalPixel.a = texureColor.a; + finalPixel.rgb = texureColor.rgb * (lighting * finalPixel.a); +#elif defined(_ALPHAPREMULTIPLY_ON) + //Pre multiplied alpha + finalPixel = texureColor; + finalPixel.rgb *= lighting; +#elif defined(_MULTIPLYBLEND) + //Multiply + finalPixel = texureColor; + finalPixel.rgb *= lighting; + finalPixel = lerp(fixed4(1,1,1,1), finalPixel, finalPixel.a); +#elif defined(_MULTIPLYBLEND_X2) + //Multiply x2 + finalPixel.rgb = texureColor.rgb * lighting * 2.0f; + finalPixel.a = texureColor.a; + finalPixel = lerp(fixed4(0.5f,0.5f,0.5f,0.5f), finalPixel, finalPixel.a); +#elif defined(_ADDITIVEBLEND) + //Additive + finalPixel = texureColor * 2.0f; + finalPixel.rgb *= lighting; +#elif defined(_ADDITIVEBLEND_SOFT) + //Additive soft + finalPixel = texureColor; + finalPixel.rgb *= lighting * finalPixel.a; +#else + //Opaque + finalPixel.a = 1; + finalPixel.rgb = texureColor.rgb * lighting; +#endif + + return finalPixel; } inline fixed4 calculateAdditiveLitPixel(fixed4 texureColor, fixed4 color, fixed3 lighting) : SV_Target { fixed4 finalPixel; - + #if defined(_ALPHABLEND_ON) || defined(_MULTIPLYBLEND) || defined(_MULTIPLYBLEND_X2) || defined(_ADDITIVEBLEND) || defined(_ADDITIVEBLEND_SOFT) //Normal Alpha, Additive and Multiply modes finalPixel.rgb = (texureColor.rgb * lighting * color.rgb) * (texureColor.a * color.a); @@ -189,14 +206,14 @@ inline fixed4 calculateAdditiveLitPixel(fixed4 texureColor, fixed4 color, fixed3 finalPixel.rgb = texureColor.rgb * lighting * color.rgb; finalPixel.a = 1.0; #endif - + return finalPixel; } inline fixed4 calculateAdditiveLitPixel(fixed4 texureColor, fixed3 lighting) : SV_Target { fixed4 finalPixel; - + #if defined(_ALPHABLEND_ON) || defined(_MULTIPLYBLEND) || defined(_MULTIPLYBLEND_X2) || defined(_ADDITIVEBLEND) || defined(_ADDITIVEBLEND_SOFT) //Normal Alpha, Additive and Multiply modes finalPixel.rgb = (texureColor.rgb * lighting) * texureColor.a; @@ -206,31 +223,90 @@ inline fixed4 calculateAdditiveLitPixel(fixed4 texureColor, fixed3 lighting) : S finalPixel.rgb = texureColor.rgb * lighting; finalPixel.a = 1.0; #endif - + return finalPixel; } inline fixed4 calculatePixel(fixed4 texureColor, fixed4 color) : SV_Target { - // note: we let the optimizer work, removed duplicate code. - return calculateLitPixel(texureColor, color, fixed3(1, 1, 1)); + fixed4 finalPixel; + +#if defined(_ALPHABLEND_ON) + //Normal Alpha + finalPixel.a = texureColor.a * color.a; + finalPixel.rgb = (texureColor.rgb * color.rgb) * finalPixel.a; +#elif defined(_ALPHAPREMULTIPLY_ON) + //Pre multiplied alpha + finalPixel = texureColor * color; + finalPixel.rgb *= color.a; +#elif defined(_MULTIPLYBLEND) + //Multiply + finalPixel = color * texureColor; + finalPixel = lerp(fixed4(1,1,1,1), finalPixel, finalPixel.a); +#elif defined(_MULTIPLYBLEND_X2) + //Multiply x2 + finalPixel.rgb = texureColor.rgb * color.rgb * 2.0f; + finalPixel.a = color.a * texureColor.a; + finalPixel = lerp(fixed4(0.5f,0.5f,0.5f,0.5f), finalPixel, finalPixel.a); +#elif defined(_ADDITIVEBLEND) + //Additive + finalPixel = texureColor * 2.0f * color; +#elif defined(_ADDITIVEBLEND_SOFT) + //Additive soft + finalPixel = color * texureColor; + finalPixel.rgb *= finalPixel.a; +#else + //Opaque + finalPixel.a = 1; + finalPixel.rgb = texureColor.rgb * color.rgb; +#endif + + return finalPixel; } inline fixed4 calculatePixel(fixed4 texureColor) : SV_Target { - // note: we let the optimizer work, removed duplicate code. - return calculateLitPixel(texureColor, fixed4(1, 1, 1, 1), fixed3(1, 1, 1)); + fixed4 finalPixel; + +#if defined(_ALPHABLEND_ON) + //Normal Alpha + finalPixel.a = texureColor.a; + finalPixel.rgb = texureColor.rgb * finalPixel.a; +#elif defined(_ALPHAPREMULTIPLY_ON) + //Pre multiplied alpha + finalPixel = texureColor; +#elif defined(_MULTIPLYBLEND) + //Multiply + finalPixel = texureColor; + finalPixel = lerp(fixed4(1,1,1,1), finalPixel, finalPixel.a); +#elif defined(_MULTIPLYBLEND_X2) + //Multiply x2 + finalPixel.rgb = texureColor.rgb * 2.0f; + finalPixel.a = texureColor.a; + finalPixel = lerp(fixed4(0.5f,0.5f,0.5f,0.5f), finalPixel, finalPixel.a); +#elif defined(_ADDITIVEBLEND) + //Additive + finalPixel = texureColor * 2.0f; +#elif defined(_ADDITIVEBLEND_SOFT) + //Additive soft + finalPixel = texureColor; + finalPixel.rgb *= finalPixel.a; +#else + //Opaque + finalPixel.a = 1; + finalPixel.rgb = texureColor.rgb; +#endif + + return finalPixel; } //////////////////////////////////////// // Alpha Clipping // -#if defined(_ALPHA_CLIP) +#if defined(_ALPHA_CLIP) -#if !defined(USE_LWRP) && !defined(USE_URP) uniform fixed _Cutoff; -#endif #define ALPHA_CLIP(pixel, color) clip((pixel.a * color.a) - _Cutoff); @@ -240,27 +316,11 @@ uniform fixed _Cutoff; #endif -//////////////////////////////////////// -// Additive Slot blend mode -// return unlit textureColor, alpha clip textureColor.a only -// -#if defined(_ALPHAPREMULTIPLY_ON) - #define RETURN_UNLIT_IF_ADDITIVE_SLOT(textureColor, vertexColor) \ - if (vertexColor.a == 0 && (vertexColor.r || vertexColor.g || vertexColor.b)) {\ - ALPHA_CLIP(texureColor, fixed4(1, 1, 1, 1))\ - return texureColor * vertexColor;\ - } -#else - #define RETURN_UNLIT_IF_ADDITIVE_SLOT(textureColor, vertexColor) -#endif - //////////////////////////////////////// // Color functions // -#if !defined(USE_LWRP) && !defined(USE_URP) uniform fixed4 _Color; -#endif inline fixed4 calculateVertexColor(fixed4 color) { @@ -269,12 +329,10 @@ inline fixed4 calculateVertexColor(fixed4 color) #if defined(_COLOR_ADJUST) -#if !defined(USE_LWRP) && !defined(USE_URP) uniform float _Hue; uniform float _Saturation; uniform float _Brightness; uniform fixed4 _OverlayColor; -#endif float3 rgb2hsv(float3 c) { @@ -287,7 +345,7 @@ float3 rgb2hsv(float3 c) return float3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); } -float3 hsv2rgb(float3 c) +float3 hsv2rgb(float3 c) { c = float3(c.x, clamp(c.yz, 0.0, 1.0)); float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); @@ -298,13 +356,13 @@ float3 hsv2rgb(float3 c) inline fixed4 adjustColor(fixed4 color) { float3 hsv = rgb2hsv(color.rgb); - - hsv.x += _Hue; - hsv.y *= _Saturation; + + hsv.x += _Hue; + hsv.y *= _Saturation; hsv.z *= _Brightness; - + color.rgb = hsv2rgb(hsv); - + return color; } @@ -324,7 +382,7 @@ inline fixed4 adjustColor(fixed4 color) #if defined(_FOG) && (defined(FOG_LINEAR) || defined(FOG_EXP) || defined(FOG_EXP2)) -inline fixed4 applyFog(fixed4 pixel, float fogCoordOrFactorAtLWRP) +inline fixed4 applyFog(fixed4 pixel, float1 fogCoord) { #if defined(_ADDITIVEBLEND) || defined(_ADDITIVEBLEND_SOFT) //In additive mode blend from clear to black based on luminance @@ -344,27 +402,21 @@ inline fixed4 applyFog(fixed4 pixel, float fogCoordOrFactorAtLWRP) #else //In opaque mode just return fog color; fixed4 fogColor = unity_FogColor; -#endif - - #if defined(USE_LWRP) || defined(USE_URP) - pixel.rgb = MixFogColor(pixel.rgb, fogColor.rgb, fogCoordOrFactorAtLWRP); - #else - UNITY_APPLY_FOG_COLOR(fogCoordOrFactorAtLWRP, pixel, fogColor); - #endif - +#endif + + UNITY_APPLY_FOG_COLOR(fogCoord, pixel, fogColor); + return pixel; } #define APPLY_FOG(pixel, input) pixel = applyFog(pixel, input.fogCoord); -#define APPLY_FOG_LWRP(pixel, fogFactor) pixel = applyFog(pixel, fogFactor); - + #define APPLY_FOG_ADDITIVE(pixel, input) \ UNITY_APPLY_FOG_COLOR(input.fogCoord, pixel.rgb, fixed4(0,0,0,0)); // fog towards black in additive pass - + #else #define APPLY_FOG(pixel, input) -#define APPLY_FOG_LWRP(pixel, fogFactor) #define APPLY_FOG_ADDITIVE(pixel, input) #endif @@ -375,11 +427,14 @@ inline fixed4 applyFog(fixed4 pixel, float fogCoordOrFactorAtLWRP) uniform sampler2D _MainTex; +#if ETC1_EXTERNAL_ALPHA +//External alpha texture for ETC1 compression +uniform sampler2D _AlphaTex; +#endif //ETC1_EXTERNAL_ALPHA + #if _TEXTURE_BLEND uniform sampler2D _BlendTex; -#if !defined(USE_LWRP) && !defined(USE_URP) uniform float _BlendAmount; -#endif inline fixed4 calculateBlendedTexturePixel(float2 texcoord) { @@ -390,13 +445,18 @@ inline fixed4 calculateBlendedTexturePixel(float2 texcoord) inline fixed4 calculateTexturePixel(float2 texcoord) { fixed4 pixel; - + #if _TEXTURE_BLEND pixel = calculateBlendedTexturePixel(texcoord); #else pixel = tex2D(_MainTex, texcoord); #endif // !_TEXTURE_BLEND +#if ETC1_EXTERNAL_ALPHA + fixed4 alpha = tex2D (_AlphaTex, texcoord); + pixel.a = lerp (pixel.a, alpha.r, _EnableExternalAlpha); +#endif + #if defined(_COLOR_ADJUST) pixel = adjustColor(pixel); #endif // _COLOR_ADJUST @@ -404,14 +464,11 @@ inline fixed4 calculateTexturePixel(float2 texcoord) return pixel; } -#if !defined(USE_LWRP) && !defined(USE_URP) uniform fixed4 _MainTex_ST; -#endif inline float2 calculateTextureCoord(float4 texcoord) { return TRANSFORM_TEX(texcoord, _MainTex); } - -#endif // SHADER_SHARED_INCLUDED +#endif // SHADER_SHARED_INCLUDED \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderShared.cginc.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/ShaderShared.cginc.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderShared.cginc.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/ShaderShared.cginc.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteLighting.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteLighting.cginc similarity index 78% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteLighting.cginc rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteLighting.cginc index 292f48fc6..018ca93cd 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteLighting.cginc +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteLighting.cginc @@ -2,7 +2,7 @@ #define SPRITE_LIGHTING_INCLUDED //Check for using mesh normals -#if !defined(_FIXED_NORMALS_VIEWSPACE) && !defined(_FIXED_NORMALS_VIEWSPACE_BACKFACE) && !defined(_FIXED_NORMALS_MODELSPACE) && !defined(_FIXED_NORMALS_MODELSPACE_BACKFACE) && !defined(_FIXED_NORMALS_WORLDSPACE) +#if !defined(_FIXED_NORMALS_VIEWSPACE) && !defined(_FIXED_NORMALS_VIEWSPACE_BACKFACE) && !defined(_FIXED_NORMALS_MODELSPACE) && !defined(_FIXED_NORMALS_MODELSPACE_BACKFACE) #define MESH_NORMALS #endif @@ -33,9 +33,7 @@ struct VertexInput // Normal functions // -#if !defined(USE_LWRP) && !defined(USE_URP) uniform float4 _FixedNormal = float4(0, 0, 1, 1); -#endif inline float3 getFixedNormal() { @@ -55,9 +53,9 @@ inline float calculateBackfacingSign(float3 worldPos) inline half3 calculateSpriteWorldNormal(VertexInput vertex, float backFaceSign) { #if defined(MESH_NORMALS) - + return calculateWorldNormal(vertex.normal); - + #else // !MESH_NORMALS float3 normal = getFixedNormal(); @@ -67,27 +65,24 @@ inline half3 calculateSpriteWorldNormal(VertexInput vertex, float backFaceSign) //Rotate fixed normal by inverse view matrix to convert the fixed normal into world space float3x3 invView = transpose((float3x3)UNITY_MATRIX_V); return normalize(mul(invView, normal)); -#elif defined (_FIXED_NORMALS_WORLDSPACE) - //World space fixed normal - return normal; #else - //Model space fixed normal. -#if defined(FIXED_NORMALS_BACKFACE_RENDERING) + //Model space fixed normal. +#if defined(FIXED_NORMALS_BACKFACE_RENDERING) //If back face rendering is enabled and the sprite is facing away from the camera (ie we're rendering the backface) then need to flip the normal normal *= backFaceSign; #endif return calculateWorldNormal(normal); #endif - + #endif // !MESH_NORMALS } inline half3 calculateSpriteViewNormal(VertexInput vertex, float backFaceSign) { #if defined(MESH_NORMALS) - + return normalize(mul((float3x3)UNITY_MATRIX_IT_MV, vertex.normal)); - + #else // !MESH_NORMALS float3 normal = getFixedNormal(); @@ -95,18 +90,15 @@ inline half3 calculateSpriteViewNormal(VertexInput vertex, float backFaceSign) #if defined(_FIXED_NORMALS_VIEWSPACE) || defined(_FIXED_NORMALS_VIEWSPACE_BACKFACE) //View space fixed normal return normal; -#elif defined (_FIXED_NORMALS_WORLDSPACE) - //World space fixed normal - return normalize(mul((float3x3)UNITY_MATRIX_V, normal)); #else //Model space fixed normal -#if defined(FIXED_NORMALS_BACKFACE_RENDERING) +#if defined(FIXED_NORMALS_BACKFACE_RENDERING) //If back face rendering is enabled and the sprite is facing away from the camera (ie we're rendering the backface) then need to flip the normal normal *= backFaceSign; #endif return normalize(mul((float3x3)UNITY_MATRIX_IT_MV, normal)); #endif - + #endif // !MESH_NORMALS } @@ -136,6 +128,9 @@ inline half3 calculateSpriteWorldBinormal(VertexInput vertex, half3 normalWorld, // Diffuse ramp functions // +//Disable for softer, more traditional diffuse ramping +#define HARD_DIFFUSE_RAMP + uniform sampler2D _DiffuseRamp; inline fixed3 calculateDiffuseRamp(float ramp) @@ -145,29 +140,13 @@ inline fixed3 calculateDiffuseRamp(float ramp) inline fixed3 calculateRampedDiffuse(fixed3 lightColor, float attenuation, float angleDot) { -#if defined(_FULLRANGE_HARD_RAMP) - float d = angleDot; - half3 ramp = calculateDiffuseRamp(d); - return lightColor * ramp * attenuation; -#elif defined(_FULLRANGE_SOFT_RAMP) - float d = angleDot; - half3 ramp = calculateDiffuseRamp(d * attenuation); - return lightColor * ramp; -#elif defined(_OLD_SOFT_RAMP) - // for unmodified behaviour with existing projects when - // the HARD_DIFFUSE_RAMP define was disabled in this file. - // uses only the right half of the ramp texture, as - // negative angleDot is clamped to [0,1] before. - float d = angleDot * 0.5 + 0.5; - half3 ramp = calculateDiffuseRamp(d); - return lightColor * ramp * (attenuation * 2); -#else // _OLD_HARD_RAMP - // old default, for unmodified behaviour with existing projects, - // uses only the right half of the ramp texture, as - // negative angleDot is clamped to [0,1] before. float d = angleDot * 0.5 + 0.5; +#if defined(HARD_DIFFUSE_RAMP) half3 ramp = calculateDiffuseRamp(d * attenuation * 2); return lightColor * ramp; +#else + half3 ramp = calculateDiffuseRamp(d); + return lightColor * ramp * (attenuation * 2); #endif } #endif // _DIFFUSE_RAMP @@ -177,10 +156,9 @@ inline fixed3 calculateRampedDiffuse(fixed3 lightColor, float attenuation, float // #ifdef _RIM_LIGHTING -#if !defined(USE_LWRP) && !defined(USE_URP) + uniform float _RimPower; uniform fixed4 _RimColor; -#endif inline fixed3 applyRimLighting(fixed3 posWorld, fixed3 normalWorld, fixed4 pixel) : SV_Target { @@ -188,11 +166,11 @@ inline fixed3 applyRimLighting(fixed3 posWorld, fixed3 normalWorld, fixed4 pixel float invDot = 1.0 - saturate(dot(normalWorld, viewDir)); float rimPower = pow(invDot, _RimPower); float rim = saturate(rimPower * _RimColor.a); - + #if defined(_DIFFUSE_RAMP) rim = calculateDiffuseRamp(rim).r; #endif - + return lerp(pixel.rgb, _RimColor.xyz * pixel.a, rim); } @@ -205,11 +183,8 @@ inline fixed3 applyRimLighting(fixed3 posWorld, fixed3 normalWorld, fixed4 pixel #ifdef _EMISSION uniform sampler2D _EmissionMap; - -#if !defined(USE_LWRP) && !defined(USE_URP) uniform fixed4 _EmissionColor; uniform float _EmissionPower; -#endif #define APPLY_EMISSION(diffuse, uv) diffuse += tex2D(_EmissionMap, uv).rgb * _EmissionColor.rgb * _EmissionPower; @@ -222,4 +197,4 @@ uniform float _EmissionPower; #endif //!_EMISSION -#endif // SPRITE_LIGHTING_INCLUDED +#endif // SPRITE_LIGHTING_INCLUDED \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteLighting.cginc.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteLighting.cginc.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteLighting.cginc.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteLighting.cginc.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpritePixelLighting.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpritePixelLighting.cginc similarity index 95% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpritePixelLighting.cginc rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpritePixelLighting.cginc index 8878df766..8c763f48d 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpritePixelLighting.cginc +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpritePixelLighting.cginc @@ -1,6 +1,6 @@ #ifndef SPRITE_PIXEL_LIGHTING_INCLUDED #define SPRITE_PIXEL_LIGHTING_INCLUDED - + #include "ShaderShared.cginc" #include "SpriteLighting.cginc" #include "SpriteSpecular.cginc" @@ -24,24 +24,24 @@ #define _LIGHT_COORD_INDEX_0 4 #define _LIGHT_COORD_INDEX_1 5 #define _FOG_COORD_INDEX 6 -#endif // _NORMALMAP +#endif // _NORMALMAP struct VertexOutput { - float4 pos : SV_POSITION; + float4 pos : SV_POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float4 posWorld : TEXCOORD1; half3 normalWorld : TEXCOORD2; #if defined(_NORMALMAP) - half3 tangentWorld : TEXCOORD3; + half3 tangentWorld : TEXCOORD3; half3 binormalWorld : TEXCOORD4; #endif // _NORMALMAP fixed3 vertexLighting : _VERTEX_LIGHTING_INDEX; LIGHTING_COORDS(_LIGHT_COORD_INDEX_0, _LIGHT_COORD_INDEX_1) #if defined(_FOG) UNITY_FOG_COORDS(_FOG_COORD_INDEX) -#endif // _FOG +#endif // _FOG UNITY_VERTEX_OUTPUT_STEREO }; @@ -56,16 +56,16 @@ inline fixed3 calculateLightDiffuse(VertexOutput input, float3 normalWorld, inou { //For directional lights _WorldSpaceLightPos0.w is set to zero float3 lightWorldDirection = normalize(_WorldSpaceLightPos0.xyz - input.posWorld.xyz * _WorldSpaceLightPos0.w); - + float attenuation = LIGHT_ATTENUATION(input); float angleDot = max(0, dot(normalWorld, lightWorldDirection)); - + #if defined(_DIFFUSE_RAMP) fixed3 lightDiffuse = calculateRampedDiffuse(_LightColor0.rgb, attenuation, angleDot); #else fixed3 lightDiffuse = _LightColor0.rgb * (attenuation * angleDot); #endif // _DIFFUSE_RAMP - + return lightDiffuse; } @@ -96,7 +96,7 @@ fixed3 calculateAmbientLight(half3 normalWorld) { #if defined(_SPHERICAL_HARMONICS) fixed3 ambient = ShadeSH9(half4(normalWorld, 1.0)); -#else +#else fixed3 ambient = unity_AmbientSky.rgb; #endif return ambient; @@ -129,124 +129,124 @@ fixed4 calculateSpecularLightAdditive(SpecularCommonData s, float3 viewDir, floa VertexOutput vert(VertexInput v) { VertexOutput output; - + UNITY_SETUP_INSTANCE_ID(input); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); - + output.pos = calculateLocalPos(v.vertex); output.color = calculateVertexColor(v.color); output.texcoord = calculateTextureCoord(v.texcoord); output.posWorld = calculateWorldPos(v.vertex); - + float backFaceSign = 1; -#if defined(FIXED_NORMALS_BACKFACE_RENDERING) +#if defined(FIXED_NORMALS_BACKFACE_RENDERING) backFaceSign = calculateBackfacingSign(output.posWorld.xyz); -#endif +#endif output.normalWorld = calculateSpriteWorldNormal(v, backFaceSign); output.vertexLighting = calculateVertexLighting(output.posWorld, output.normalWorld); - + #if defined(_NORMALMAP) output.tangentWorld = calculateWorldTangent(v.tangent); output.binormalWorld = calculateSpriteWorldBinormal(v, output.normalWorld, output.tangentWorld, backFaceSign); #endif TRANSFER_VERTEX_TO_FRAGMENT(output) - + #if defined(_FOG) UNITY_TRANSFER_FOG(output,output.pos); -#endif // _FOG - +#endif // _FOG + return output; } //////////////////////////////////////// // Fragment programs // + fixed4 fragBase(VertexOutput input) : SV_Target { fixed4 texureColor = calculateTexturePixel(input.texcoord); - RETURN_UNLIT_IF_ADDITIVE_SLOT(texureColor, input.color) // shall be called before ALPHA_CLIP ALPHA_CLIP(texureColor, input.color) - + //Get normal direction fixed3 normalWorld = calculateNormalWorld(input); //Get Ambient diffuse fixed3 ambient = calculateAmbientLight(normalWorld); - + #if defined(SPECULAR) - + //For directional lights _WorldSpaceLightPos0.w is set to zero float3 lightWorldDirection = normalize(_WorldSpaceLightPos0.xyz - input.posWorld.xyz * _WorldSpaceLightPos0.w); float attenuation = LIGHT_ATTENUATION(input); - + //Returns pixel lit by light, texture color should inlcluded alpha half3 viewDir = normalize(_WorldSpaceCameraPos - input.posWorld.xyz); fixed4 pixel = calculateSpecularLight(getSpecularData(input.texcoord.xy, texureColor, input.color), viewDir, normalWorld, lightWorldDirection, _LightColor0.rgb * attenuation, ambient + input.vertexLighting); - + APPLY_EMISSION_SPECULAR(pixel, input.texcoord) - + #else //Get primary pixel light diffuse fixed3 diffuse = calculateLightDiffuse(input, normalWorld, texureColor); - + //Combine along with vertex lighting for the base lighting pass fixed3 lighting = ambient + diffuse + input.vertexLighting; - + APPLY_EMISSION(lighting, input.texcoord) - + fixed4 pixel = calculateLitPixel(texureColor, input.color, lighting); - + #endif - + #if defined(_RIM_LIGHTING) pixel.rgb = applyRimLighting(input.posWorld, normalWorld, pixel); #endif - + COLORISE(pixel) APPLY_FOG(pixel, input) - + return pixel; } fixed4 fragAdd(VertexOutput input) : SV_Target { fixed4 texureColor = calculateTexturePixel(input.texcoord); - + #if defined(_COLOR_ADJUST) texureColor = adjustColor(texureColor); -#endif // _COLOR_ADJUST +#endif // _COLOR_ADJUST ALPHA_CLIP(texureColor, input.color) - + //Get normal direction fixed3 normalWorld = calculateNormalWorld(input); - + #if defined(SPECULAR) - + //For directional lights _WorldSpaceLightPos0.w is set to zero float3 lightWorldDirection = normalize(_WorldSpaceLightPos0.xyz - input.posWorld.xyz * _WorldSpaceLightPos0.w); float attenuation = LIGHT_ATTENUATION(input); - + half3 viewDir = normalize(_WorldSpaceCameraPos - input.posWorld.xyz); fixed4 pixel = calculateSpecularLightAdditive(getSpecularData(input.texcoord.xy, texureColor, input.color), viewDir, normalWorld, lightWorldDirection, _LightColor0.rgb * attenuation); - + #else - + //Get light diffuse fixed3 lighting = calculateLightDiffuse(input, normalWorld, texureColor); fixed4 pixel = calculateAdditiveLitPixel(texureColor, input.color, lighting); - + #endif - + COLORISE_ADDITIVE(pixel) APPLY_FOG_ADDITIVE(pixel, input) - + return pixel; } -#endif // SPRITE_PIXEL_LIGHTING_INCLUDED +#endif // SPRITE_PIXEL_LIGHTING_INCLUDED \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpritePixelLighting.cginc.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpritePixelLighting.cginc.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpritePixelLighting.cginc.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpritePixelLighting.cginc.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteShadows.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc similarity index 63% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteShadows.cginc rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc index 401ed899e..478f26bd2 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteShadows.cginc +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc @@ -16,20 +16,18 @@ struct vertexInput struct vertexOutput { V2F_SHADOW_CASTER; - float4 texcoordAndAlpha : TEXCOORD1; + float2 texcoord : TEXCOORD1; }; //////////////////////////////////////// // Vertex program // -vertexOutput vert(vertexInput v, float4 vertexColor : COLOR) +vertexOutput vert(vertexInput v) { vertexOutput o; TRANSFER_SHADOW_CASTER(o) - o.texcoordAndAlpha.xy = calculateTextureCoord(v.texcoord); - o.texcoordAndAlpha.z = 0; - o.texcoordAndAlpha.a = vertexColor.a; + o.texcoord = calculateTextureCoord(v.texcoord); return o; } @@ -42,8 +40,8 @@ uniform fixed _ShadowAlphaCutoff; fixed4 frag(vertexOutput IN) : SV_Target { - fixed4 texureColor = calculateTexturePixel(IN.texcoordAndAlpha.xy); - clip(texureColor.a * IN.texcoordAndAlpha.a - _ShadowAlphaCutoff); + fixed4 texureColor = calculateTexturePixel(IN.texcoord); + clip(texureColor.a - _ShadowAlphaCutoff); SHADOW_CASTER_FRAGMENT(IN) } diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteShadows.cginc.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteShadows.cginc.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteSpecular.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteSpecular.cginc similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteSpecular.cginc rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteSpecular.cginc diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteSpecular.cginc.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteSpecular.cginc.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteSpecular.cginc.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteSpecular.cginc.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteUnlit.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteUnlit.cginc similarity index 86% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteUnlit.cginc rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteUnlit.cginc index 60b37bbaa..4385ffcc5 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteUnlit.cginc +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteUnlit.cginc @@ -6,7 +6,7 @@ //////////////////////////////////////// // Vertex structs // - + struct VertexInput { float4 vertex : POSITION; @@ -22,7 +22,7 @@ struct VertexOutput fixed4 color : COLOR; #if defined(_FOG) UNITY_FOG_COORDS(1) -#endif // _FOG +#endif // _FOG UNITY_VERTEX_OUTPUT_STEREO }; @@ -34,35 +34,39 @@ struct VertexOutput VertexOutput vert(VertexInput input) { VertexOutput output; - + UNITY_SETUP_INSTANCE_ID(input); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); - - output.pos = calculateLocalPos(input.vertex); + + output.pos = calculateLocalPos(input.vertex); output.texcoord = calculateTextureCoord(input.texcoord); output.color = calculateVertexColor(input.color); #if defined(_FOG) UNITY_TRANSFER_FOG(output,output.pos); #endif // _FOG - + return output; } //////////////////////////////////////// // Fragment program // + + + + fixed4 frag(VertexOutput input) : SV_Target { fixed4 texureColor = calculateTexturePixel(input.texcoord.xy); - RETURN_UNLIT_IF_ADDITIVE_SLOT(texureColor, input.color) // shall be called before ALPHA_CLIP ALPHA_CLIP(texureColor, input.color) - fixed4 pixel = calculatePixel(texureColor, input.color); + fixed4 pixel = calculatePixel(texureColor, input.color); + COLORISE(pixel) APPLY_FOG(pixel, input) - + return pixel; } -#endif // SPRITE_UNLIT_INCLUDED +#endif // SPRITE_UNLIT_INCLUDED \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteUnlit.cginc.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteUnlit.cginc.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteUnlit.cginc.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteUnlit.cginc.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteVertexLighting.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteVertexLighting.cginc similarity index 93% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteVertexLighting.cginc rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteVertexLighting.cginc index 0fc7ad49d..0ffa2776b 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteVertexLighting.cginc +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteVertexLighting.cginc @@ -1,6 +1,6 @@ #ifndef SPRITE_VERTEX_LIGHTING_INCLUDED #define SPRITE_VERTEX_LIGHTING_INCLUDED - + #include "ShaderShared.cginc" #include "SpriteLighting.cginc" #include "SpriteSpecular.cginc" @@ -78,25 +78,25 @@ struct VertexOutput { - float4 pos : SV_POSITION; + float4 pos : SV_POSITION; fixed4 color : COLOR; float3 texcoord : TEXCOORD0; - + #if defined(PER_PIXEL_LIGHTING) - half4 VertexLightInfo0 : TEXCOORD1; + half4 VertexLightInfo0 : TEXCOORD1; half4 VertexLightInfo1 : TEXCOORD2; - half4 VertexLightInfo2 : TEXCOORD3; + half4 VertexLightInfo2 : TEXCOORD3; half4 VertexLightInfo3 : TEXCOORD4; half4 VertexLightInfo4 : TEXCOORD5; - + #if defined(_NORMALMAP) half4 normalWorld : TEXCOORD6; half4 tangentWorld : TEXCOORD7; half4 binormalWorld : TEXCOORD8; #else half3 normalWorld : TEXCOORD6; - half3 VertexLightInfo5 : TEXCOORD7; + half3 VertexLightInfo5 : TEXCOORD7; #endif #if defined(_DIFFUSE_RAMP) half4 LightAttenuations : ATTENUATIONS; @@ -107,8 +107,8 @@ struct VertexOutput #else //!PER_PIXEL_LIGHTING - half3 FullLighting : TEXCOORD1; - + half3 FullLighting : TEXCOORD1; + #endif // !PER_PIXEL_LIGHTING #if defined(_FOG) @@ -126,8 +126,8 @@ struct VertexLightInfo { half3 lightDirection; fixed3 lightColor; - -#if defined(_DIFFUSE_RAMP) + +#if defined(_DIFFUSE_RAMP) float attenuation; #endif // _DIFFUSE_RAMP }; @@ -135,18 +135,18 @@ struct VertexLightInfo inline VertexLightInfo getVertexLightAttenuatedInfo(int index, float3 viewPos) { VertexLightInfo lightInfo; - + //For directional lights unity_LightPosition.w is set to zero lightInfo.lightDirection = unity_LightPosition[index].xyz - viewPos.xyz * unity_LightPosition[index].w; float lengthSq = dot(lightInfo.lightDirection, lightInfo.lightDirection); - + // don't produce NaNs if some vertex position overlaps with the light lengthSq = max(lengthSq, 0.000001); - + lightInfo.lightDirection *= rsqrt(lengthSq); - - float attenuation = 1.0 / (1.0 + lengthSq * unity_LightAtten[index].z); - + + float attenuation = 1.0 / (1.0 + lengthSq * unity_LightAtten[index].z); + #if defined(SPOT_LIGHTS) //Spot light attenuation - for non-spot lights unity_LightAtten.x is set to -1 and y is set to 1 { @@ -155,45 +155,46 @@ inline VertexLightInfo getVertexLightAttenuatedInfo(int index, float3 viewPos) attenuation *= saturate(spotAtt); } #endif // SPOT_LIGHTS - + //If using a diffuse ramp texture then need to pass through the lights attenuation, otherwise premultiply the light color with it -#if defined(_DIFFUSE_RAMP) +#if defined(_DIFFUSE_RAMP) lightInfo.lightColor = unity_LightColor[index].rgb; lightInfo.attenuation = attenuation; #else lightInfo.lightColor = unity_LightColor[index].rgb * attenuation; #endif // _DIFFUSE_RAMP - + return lightInfo; } -//Magic constants used to tweak ambient to approximate pixel shader spherical harmonics -static const fixed3 worldUp = fixed3(0, 1, 0); -static const float skyGroundDotMul = 2.5; -static const float minEquatorMix = 0.5; -static const float equatorColorBlur = 0.33; - fixed3 calculateAmbientLight(half3 normalWorld) { -#if defined(_SPHERICAL_HARMONICS) - float upDot = dot(normalWorld, worldUp); +#if defined(_SPHERICAL_HARMONICS) + //Magic constants used to tweak ambient to approximate pixel shader spherical harmonics + static const fixed3 worldUp = fixed3(0,1,0); + static const float skyGroundDotMul = 2.5; + static const float minEquatorMix = 0.5; + static const float equatorColorBlur = 0.33; + + float upDot = dot(normalWorld, worldUp); + //Fade between a flat lerp from sky to ground and a 3 way lerp based on how bright the equator light is. //This simulates how directional lights get blurred using spherical harmonics - + //Work out color from ground and sky, ignoring equator float adjustedDot = upDot * skyGroundDotMul; fixed3 skyGroundColor = lerp(unity_AmbientGround, unity_AmbientSky, saturate((adjustedDot + 1.0) * 0.5)); - + //Work out equator lights brightness float equatorBright = saturate(dot(unity_AmbientEquator.rgb, unity_AmbientEquator.rgb)); - + //Blur equator color with sky and ground colors based on how bright it is. fixed3 equatorBlurredColor = lerp(unity_AmbientEquator, saturate(unity_AmbientEquator + unity_AmbientGround + unity_AmbientSky), equatorBright * equatorColorBlur); - + //Work out 3 way lerp inc equator light fixed3 equatorColor = lerp(equatorBlurredColor, unity_AmbientGround, -upDot) * step(upDot, 0) + lerp(equatorBlurredColor, unity_AmbientSky, upDot) * step(0, upDot); - + //Mix the two colors together based on how bright the equator light is return lerp(skyGroundColor, equatorColor, saturate(equatorBright + minEquatorMix)); @@ -201,8 +202,8 @@ fixed3 calculateAmbientLight(half3 normalWorld) //Flat ambient is just the sky color return unity_AmbientSky.rgb; - -#endif // !_SPHERICAL_HARMONICS + +#endif // !_SPHERICAL_HARMONICS } //////////////////////////////////////// @@ -224,7 +225,7 @@ inline fixed3 calculateLightDiffuse(fixed3 attenuatedLightColor, half3 viewNorma { float angleDot = max(0, dot(viewNormal, lightViewDir)); fixed3 lightDiffuse = attenuatedLightColor * angleDot; - + return lightDiffuse; } @@ -259,7 +260,7 @@ inline fixed3 calculateLightDiffuse(fixed3 attenuatedLightColor, half3 viewNorma #define VERTEX_LIGHT_3_G VertexLightInfo5.y #define VERTEX_LIGHT_3_B VertexLightInfo5.z #endif - + #if defined(_DIFFUSE_RAMP) #define LIGHT_DIFFUSE_ATTEN_0 LightAttenuations.x @@ -271,7 +272,7 @@ inline fixed3 calculateLightDiffuse(fixed3 attenuatedLightColor, half3 viewNorma { \ output.LIGHT_DIFFUSE_ATTEN_##index = lightInfo.attenuation; \ } - + #define ADD_VERTEX_LIGHT_DIFFUSE(index, diffuse, input, lightColor, viewNormal, lightViewDir) \ { \ diffuse += calculateLightDiffuse(lightColor, viewNormal, lightViewDir, input.LIGHT_DIFFUSE_ATTEN_##index); \ @@ -300,7 +301,7 @@ inline fixed3 calculateLightDiffuse(fixed3 attenuatedLightColor, half3 viewNorma fixed3 lightColor = fixed3(input.VERTEX_LIGHT_##index##_R, input.VERTEX_LIGHT_##index##_G, input.VERTEX_LIGHT_##index##_B); \ ADD_VERTEX_LIGHT_DIFFUSE(index, diffuse, input, lightColor, viewNormal, lightViewDir) \ } - + #if defined(SPECULAR) #define ADD_VERTEX_LIGHT_SPEC(index, input, viewNormal, specData, combinedLightData, indirectDiffuse, indirectSpecular) \ @@ -313,7 +314,7 @@ inline fixed3 calculateLightDiffuse(fixed3 attenuatedLightColor, half3 viewNorma } #endif - + #else //!PER_PIXEL_LIGHTING //////////////////////////////////////// @@ -328,7 +329,7 @@ inline fixed3 calculateLightDiffuse(int index, float3 viewPos, half3 viewNormal) } #endif // !PER_PIXEL_LIGHTING - + //////////////////////////////////////// // Vertex program // @@ -336,10 +337,10 @@ inline fixed3 calculateLightDiffuse(int index, float3 viewPos, half3 viewNormal) VertexOutput vert(VertexInput input) { VertexOutput output; - + UNITY_SETUP_INSTANCE_ID(input); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); - + output.pos = calculateLocalPos(input.vertex); output.color = calculateVertexColor(input.color); output.texcoord = float3(calculateTextureCoord(input.texcoord), 0); @@ -347,15 +348,15 @@ VertexOutput vert(VertexInput input) float3 viewPos = UnityObjectToViewPos(input.vertex); //float3 viewPos = mul(UNITY_MATRIX_MV, input.vertex); // #if defined(FIXED_NORMALS_BACKFACE_RENDERING) || defined(_RIM_LIGHTING) float4 powWorld = calculateWorldPos(input.vertex); -#endif +#endif float backFaceSign = 1; -#if defined(FIXED_NORMALS_BACKFACE_RENDERING) +#if defined(FIXED_NORMALS_BACKFACE_RENDERING) backFaceSign = calculateBackfacingSign(powWorld.xyz); -#endif +#endif #if defined(PER_PIXEL_LIGHTING) - + #if defined(_RIM_LIGHTING) output.posWorld = powWorld; #endif @@ -364,110 +365,110 @@ VertexOutput vert(VertexInput input) PACK_VERTEX_LIGHT(1, output, viewPos) PACK_VERTEX_LIGHT(2, output, viewPos) PACK_VERTEX_LIGHT(3, output, viewPos) - + output.normalWorld.xyz = calculateSpriteWorldNormal(input, backFaceSign); - + #if defined(_NORMALMAP) output.tangentWorld.xyz = calculateWorldTangent(input.tangent); - output.binormalWorld.xyz = calculateSpriteWorldBinormal(input, output.normalWorld, output.tangentWorld, backFaceSign); + output.binormalWorld.xyz = calculateSpriteWorldBinormal(input, output.normalWorld, output.tangentWorld, backFaceSign); #endif - + #else // !PER_PIXEL_LIGHTING - + //Just pack full lighting float3 viewNormal = calculateSpriteViewNormal(input, backFaceSign); //Get Ambient diffuse float3 normalWorld = calculateSpriteWorldNormal(input, backFaceSign); - fixed3 ambient = calculateAmbientLight(normalWorld); - + fixed3 ambient = calculateAmbientLight(normalWorld); + fixed3 diffuse = calculateLightDiffuse(0, viewPos, viewNormal); diffuse += calculateLightDiffuse(1, viewPos, viewNormal); diffuse += calculateLightDiffuse(2, viewPos, viewNormal); diffuse += calculateLightDiffuse(3, viewPos, viewNormal); - + output.FullLighting = ambient + diffuse; - + #endif // !PER_PIXEL_LIGHTING - + #if defined(_FOG) UNITY_TRANSFER_FOG(output, output.pos); -#endif // _FOG - +#endif // _FOG + return output; } //////////////////////////////////////// // Fragment program // + fixed4 frag(VertexOutput input) : SV_Target { fixed4 texureColor = calculateTexturePixel(input.texcoord.xy); - RETURN_UNLIT_IF_ADDITIVE_SLOT(texureColor, input.color) // shall be called before ALPHA_CLIP ALPHA_CLIP(texureColor, input.color) - + #if defined(PER_PIXEL_LIGHTING) - + #if defined(_NORMALMAP) half3 normalWorld = calculateNormalFromBumpMap(input.texcoord.xy, input.tangentWorld.xyz, input.binormalWorld.xyz, input.normalWorld.xyz); #else half3 normalWorld = input.normalWorld.xyz; #endif - + //Get Ambient diffuse fixed3 ambient = calculateAmbientLight(normalWorld); - + half3 normalView = normalize(mul((float3x3)UNITY_MATRIX_V, normalWorld)); - + #if defined(SPECULAR) SpecularCommonData specData = getSpecularData(input.texcoord.xy, texureColor, input.color); - + SpecularLightData combinedLightData = (SpecularLightData)0; ADD_VERTEX_LIGHT_SPEC(0, input, normalView, specData, combinedLightData, ambient, unity_IndirectSpecColor.rgb) ADD_VERTEX_LIGHT_SPEC(1, input, normalView, specData, combinedLightData, fixed3(0,0,0), fixed3(0,0,0)) ADD_VERTEX_LIGHT_SPEC(2, input, normalView, specData, combinedLightData, fixed3(0,0,0), fixed3(0,0,0)) ADD_VERTEX_LIGHT_SPEC(3, input, normalView, specData, combinedLightData, fixed3(0,0,0), fixed3(0,0,0)) - + fixed4 pixel = calculateLitPixel(fixed4(specData.diffColor, specData.alpha), combinedLightData.lighting); pixel.rgb += combinedLightData.specular * specData.alpha; - + APPLY_EMISSION_SPECULAR(pixel, input.texcoord) - + #else - + //Find vertex light diffuse fixed3 diffuse = fixed3(0,0,0); - + //Add each vertex light to diffuse ADD_VERTEX_LIGHT(0, input, normalView, diffuse) ADD_VERTEX_LIGHT(1, input, normalView, diffuse) ADD_VERTEX_LIGHT(2, input, normalView, diffuse) ADD_VERTEX_LIGHT(3, input, normalView, diffuse) - + fixed3 lighting = ambient + diffuse; - + APPLY_EMISSION(lighting, input.texcoord.xy) fixed4 pixel = calculateLitPixel(texureColor, input.color, lighting); - + #endif - + #if defined(_RIM_LIGHTING) pixel.rgb = applyRimLighting(input.posWorld, normalWorld, pixel); #endif - + #else // !PER_PIXEL_LIGHTING - + APPLY_EMISSION(input.FullLighting, input.texcoord.xy) - + fixed4 pixel = calculateLitPixel(texureColor, input.color, input.FullLighting); -#endif // !PER_PIXEL_LIGHTING - +#endif // !PER_PIXEL_LIGHTING + COLORISE(pixel) APPLY_FOG(pixel, input) - + return pixel; } -#endif // SPRITE_VERTEX_LIGHTING_INCLUDED +#endif // SPRITE_VERTEX_LIGHTING_INCLUDED \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteVertexLighting.cginc.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteVertexLighting.cginc.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteVertexLighting.cginc.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteVertexLighting.cginc.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CameraDepthNormalsTexture.shader b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CameraDepthNormalsTexture.shader similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CameraDepthNormalsTexture.shader rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CameraDepthNormalsTexture.shader diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CameraDepthNormalsTexture.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CameraDepthNormalsTexture.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CameraDepthNormalsTexture.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CameraDepthNormalsTexture.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CameraDepthTexture.shader b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CameraDepthTexture.shader similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CameraDepthTexture.shader rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CameraDepthTexture.shader diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CameraDepthTexture.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CameraDepthTexture.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CameraDepthTexture.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CameraDepthTexture.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CameraNormalsTexture.shader b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CameraNormalsTexture.shader similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CameraNormalsTexture.shader rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CameraNormalsTexture.shader diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CameraNormalsTexture.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CameraNormalsTexture.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CameraNormalsTexture.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CameraNormalsTexture.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/README.md b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/README.md similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/README.md rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/README.md diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/README.md.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/README.md.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/README.md.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/README.md.meta diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/ShaderShared.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/ShaderShared.cginc new file mode 100644 index 000000000..65d6f274d --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/ShaderShared.cginc @@ -0,0 +1,363 @@ +#ifndef SHADER_SHARED_INCLUDED +#define SHADER_SHARED_INCLUDED + +#include "UnityCG.cginc" + +//////////////////////////////////////// +// Space functions +// + +inline float4 calculateWorldPos(float4 vertex) +{ + return mul(unity_ObjectToWorld, vertex); +} + +inline float4 calculateLocalPos(float4 vertex) +{ + return UnityObjectToClipPos(vertex); +} + +inline half3 calculateWorldNormal(float3 normal) +{ + return UnityObjectToWorldNormal(normal); +} + +//////////////////////////////////////// +// Maths functions +// + +inline float dotClamped(float3 a, float3 b) +{ + #if (SHADER_TARGET < 30 || defined(SHADER_API_PS3)) + return saturate(dot(a, b)); + #else + return max(0.0h, dot(a, b)); + #endif +} + +inline float oneDividedBy(float value) +{ + //Catches NANs + float sign_value = sign(value); + float sign_value_squared = sign_value*sign_value; + return sign_value_squared / ( value + sign_value_squared - 1.0); +} + +inline float4 quat_from_axis_angle(float3 axis, float angleRadians) +{ + float4 qr; + float half_angle = (angleRadians * 0.5); + qr.x = axis.x * sin(half_angle); + qr.y = axis.y * sin(half_angle); + qr.z = axis.z * sin(half_angle); + qr.w = cos(half_angle); + return qr; +} + +inline float3 rotate_vertex_position(float3 position, float3 axis, float angleRadians) +{ + float4 q = quat_from_axis_angle(axis, angleRadians); + float3 v = position.xyz; + return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v); +} + +//////////////////////////////////////// +// Normal map functions +// + +#if defined(_NORMALMAP) + +uniform sampler2D _BumpMap; + +inline half3 calculateWorldTangent(float4 tangent) +{ + return UnityObjectToWorldDir(tangent); +} + +inline half3 calculateWorldBinormal(half3 normalWorld, half3 tangentWorld, float tangentW) +{ + // For odd-negative scale transforms we need to flip the binormal + return cross(normalWorld, tangentWorld.xyz) * tangentW * unity_WorldTransformParams.w; +} + +inline half3 calculateNormalFromBumpMap(float2 texUV, half3 tangentWorld, half3 binormalWorld, half3 normalWorld) +{ + half3 localNormal = UnpackNormal(tex2D(_BumpMap, texUV)); + half3x3 rotation = half3x3(tangentWorld, binormalWorld, normalWorld); + half3 normal = normalize(mul(localNormal, rotation)); + return normal; +} + +#endif // _NORMALMAP + +//////////////////////////////////////// +// Blending functions +// + +inline fixed4 calculateLitPixel(fixed4 texureColor, fixed4 color, fixed3 lighting) : SV_Target +{ + fixed4 finalPixel; + +#if defined(_ALPHAPREMULTIPLY_ON) + //Pre multiplied alpha + finalPixel = texureColor * color; + finalPixel.rgb *= lighting * color.a; +#elif defined(_MULTIPLYBLEND) + //Multiply + finalPixel = color * texureColor; + finalPixel.rgb *= lighting; + finalPixel = lerp(fixed4(1,1,1,1), finalPixel, finalPixel.a); +#elif defined(_MULTIPLYBLEND_X2) + //Multiply x2 + finalPixel.rgb = texureColor.rgb * color.rgb * lighting * 2.0f; + finalPixel.a = color.a * texureColor.a; + finalPixel = lerp(fixed4(0.5f,0.5f,0.5f,0.5f), finalPixel, finalPixel.a); +#elif defined(_ADDITIVEBLEND) + //Additive + finalPixel = texureColor * 2.0f * color; + finalPixel.rgb *= lighting * color.a; +#elif defined(_ADDITIVEBLEND_SOFT) + //Additive soft + finalPixel = texureColor * color; + finalPixel.rgb *= lighting * finalPixel.a; +#else + finalPixel.a = texureColor.a * color.a; + finalPixel.rgb = texureColor.rgb * color.rgb * (lighting * finalPixel.a); +#endif + + return finalPixel; +} + +inline fixed4 calculateLitPixel(fixed4 texureColor, fixed3 lighting) : SV_Target +{ + fixed4 finalPixel; + +#if defined(_ALPHAPREMULTIPLY_ON) + //Pre multiplied alpha + finalPixel = texureColor; + finalPixel.rgb *= lighting; +#elif defined(_MULTIPLYBLEND) + //Multiply + finalPixel = texureColor; + finalPixel.rgb *= lighting; + finalPixel = lerp(fixed4(1,1,1,1), finalPixel, finalPixel.a); +#elif defined(_MULTIPLYBLEND_X2) + //Multiply x2 + finalPixel.rgb = texureColor.rgb * lighting * 2.0f; + finalPixel.a = texureColor.a; + finalPixel = lerp(fixed4(0.5f,0.5f,0.5f,0.5f), finalPixel, finalPixel.a); +#elif defined(_ADDITIVEBLEND) + //Additive + finalPixel = texureColor * 2.0f; + finalPixel.rgb *= lighting; +#elif defined(_ADDITIVEBLEND_SOFT) + //Additive soft + finalPixel = texureColor; + finalPixel.rgb *= lighting * finalPixel.a; +#else + finalPixel.a = texureColor.a; + finalPixel.rgb = texureColor.rgb * (lighting * finalPixel.a); +#endif + + return finalPixel; +} + +inline fixed4 calculateAdditiveLitPixel(fixed4 texureColor, fixed4 color, fixed3 lighting) : SV_Target +{ + fixed4 finalPixel; + +#if defined(_ALPHAPREMULTIPLY_ON) + //Pre multiplied alpha + finalPixel.rgb = texureColor.rgb * lighting * color.rgb * color.a; + finalPixel.a = 1.0; +#else + //All other alpha + finalPixel.rgb = (texureColor.rgb * lighting * color.rgb) * (texureColor.a * color.a); + finalPixel.a = 1.0; +#endif + + return finalPixel; +} + +inline fixed4 calculatePixel(fixed4 texureColor, fixed4 color) : SV_Target +{ + fixed4 finalPixel; + +#if defined(_ALPHAPREMULTIPLY_ON) + //Pre multiplied alpha + finalPixel = texureColor * color; + finalPixel.rgb *= color.a; +#elif defined(_MULTIPLYBLEND) + //Multiply + finalPixel = color * texureColor; + finalPixel = lerp(fixed4(1,1,1,1), finalPixel, finalPixel.a); +#elif defined(_MULTIPLYBLEND_X2) + //Multiply x2 + finalPixel.rgb = texureColor.rgb * color.rgb * 2.0f; + finalPixel.a = color.a * texureColor.a; + finalPixel = lerp(fixed4(0.5f,0.5f,0.5f,0.5f), finalPixel, finalPixel.a); +#elif defined(_ADDITIVEBLEND) + //Additive + finalPixel = texureColor * 2.0f * color; +#elif defined(_ADDITIVEBLEND_SOFT) + //Additive soft + finalPixel = color * texureColor; + finalPixel.rgb *= finalPixel.a; +#else + //Standard alpha + finalPixel.a = texureColor.a * color.a; + finalPixel.rgb = (texureColor.rgb * color.rgb) * finalPixel.a; +#endif + + return finalPixel; +} + +inline fixed4 calculatePixel(fixed4 texureColor) : SV_Target +{ + fixed4 finalPixel; + +#if defined(_ALPHAPREMULTIPLY_ON) + //Pre multiplied alpha + finalPixel = texureColor; +#elif defined(_MULTIPLYBLEND) + //Multiply + finalPixel = texureColor; + finalPixel = lerp(fixed4(1,1,1,1), finalPixel, finalPixel.a); +#elif defined(_MULTIPLYBLEND_X2) + //Multiply x2 + finalPixel.rgb = texureColor.rgb * 2.0f; + finalPixel.a = texureColor.a; + finalPixel = lerp(fixed4(0.5f,0.5f,0.5f,0.5f), finalPixel, finalPixel.a); +#elif defined(_ADDITIVEBLEND) + //Additive + finalPixel = texureColor * 2.0f; +#elif defined(_ADDITIVEBLEND_SOFT) + //Additive soft + finalPixel = texureColor; + finalPixel.rgb *= finalPixel.a; +#else + //Standard alpha + finalPixel.a = texureColor.a; + finalPixel.rgb = texureColor.rgb * finalPixel.a; +#endif + + return finalPixel; +} + +//////////////////////////////////////// +// Alpha Clipping +// + +#if defined(_ALPHA_CLIP) + +uniform fixed _Cutoff; + +#define ALPHA_CLIP(pixel, color) clip((pixel.a * color.a) - _Cutoff); + +#else + +#define ALPHA_CLIP(pixel, color) + +#endif + +//////////////////////////////////////// +// Color functions +// + +uniform fixed4 _Color; + +inline fixed4 calculateVertexColor(fixed4 color) +{ + return color * _Color; +} + +#if defined(_COLOR_ADJUST) + +uniform float _Hue; +uniform float _Saturation; +uniform float _Brightness; +uniform fixed4 _OverlayColor; + +float3 rgb2hsv(float3 c) +{ + float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + float4 p = lerp(float4(c.bg, K.wz), float4(c.gb, K.xy), step(c.b, c.g)); + float4 q = lerp(float4(p.xyw, c.r), float4(c.r, p.yzx), step(p.x, c.r)); + + float d = q.x - min(q.w, q.y); + float e = 1.0e-10; + return float3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); +} + +float3 hsv2rgb(float3 c) +{ + c = float3(c.x, clamp(c.yz, 0.0, 1.0)); + float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + float3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * lerp(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} + +inline fixed4 adjustColor(fixed4 color) +{ + float3 hsv = rgb2hsv(color.rgb); + + hsv.x += _Hue; + hsv.y *= _Saturation; + hsv.z *= _Brightness; + + color.rgb = hsv2rgb(hsv); + + return color; +} + +#define COLORISE(pixel) pixel.rgb = lerp(pixel.rgb, _OverlayColor.rgb, _OverlayColor.a * pixel.a); +#define COLORISE_ADDITIVE(pixel) pixel.rgb = ((1.0-_OverlayColor.a) * pixel.rgb); + +#else // !_COLOR_ADJUST + +#define COLORISE(pixel) +#define COLORISE_ADDITIVE(pixel) + +#endif // !_COLOR_ADJUST + +//////////////////////////////////////// +// Texture functions +// + +uniform sampler2D _MainTex; + +#if _TEXTURE_BLEND +uniform sampler2D _BlendTex; +uniform float _BlendAmount; + +fixed4 calculateBlendedTexturePixel(float2 texcoord) +{ + return (1.0-_BlendAmount) * tex2D(_MainTex, texcoord) + _BlendAmount * tex2D(_BlendTex, texcoord); +} +#endif // _TEXTURE_BLEND + +inline fixed4 calculateTexturePixel(float2 texcoord) +{ + fixed4 pixel; + +#if _TEXTURE_BLEND + pixel = calculateBlendedTexturePixel(texcoord); +#else + pixel = tex2D(_MainTex, texcoord); +#endif // !_TEXTURE_BLEND + +#if defined(_COLOR_ADJUST) + pixel = adjustColor(pixel); +#endif // _COLOR_ADJUST + + return pixel; +} + +uniform fixed4 _MainTex_ST; + +inline float2 calculateTextureCoord(float4 texcoord) +{ + return TRANSFORM_TEX(texcoord, _MainTex); +} + +#endif // SHADER_SHARED_INCLUDED \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Additive-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/ShaderShared.cginc.meta similarity index 67% rename from Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Additive-Outline.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/ShaderShared.cginc.meta index 4e5f97b89..ad2f18c26 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Additive-Outline.shader.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/ShaderShared.cginc.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 0299ffae826705448b6c80ccc6a53b75 -timeCreated: 1573829476 +guid: ce9f78731d2f39c49a8688633f53a524 +timeCreated: 1479457856 licenseType: Free ShaderImporter: defaultTextures: [] diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpriteDepthNormalsTexture.shader b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteDepthNormalsTexture.shader similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpriteDepthNormalsTexture.shader rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteDepthNormalsTexture.shader diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpriteDepthNormalsTexture.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteDepthNormalsTexture.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpriteDepthNormalsTexture.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteDepthNormalsTexture.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteLighting.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteLighting.cginc new file mode 100644 index 000000000..45a8b01f6 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteLighting.cginc @@ -0,0 +1,162 @@ +#ifndef SPRITE_LIGHTING_INCLUDED +#define SPRITE_LIGHTING_INCLUDED + +//Check for using mesh normals +#if !defined(_FIXED_NORMALS) && !defined(_FIXED_NORMALS_BACK_RENDERING) +#define MESH_NORMALS +#endif // _FIXED_NORMALS || _FIXED_NORMALS_BACK_RENDERING + +//////////////////////////////////////// +// Vertex structs +// + +struct VertexInput +{ + float4 vertex : POSITION; + float4 texcoord : TEXCOORD0; + float4 color : COLOR; +#if defined(MESH_NORMALS) + float3 normal : NORMAL; +#endif // MESH_NORMALS +#if defined(_NORMALMAP) + float4 tangent : TANGENT; +#endif // _NORMALMAP + +}; + +//////////////////////////////////////// +// Normal functions +// + +//Fixed Normal defined in view space +uniform float4 _FixedNormal = float4(0, 0, -1, 1); + +inline half3 calculateSpriteWorldNormal(VertexInput vertex) +{ +#if defined(MESH_NORMALS) + return calculateWorldNormal(vertex.normal); +#else //MESH_NORMALS + //Rotate fixed normal by inverse camera matrix to convert the fixed normal into world space + float3x3 invView = transpose((float3x3)UNITY_MATRIX_VP); + float3 normal = _FixedNormal.xyz; +#if UNITY_REVERSED_Z + normal.z = -normal.z; +#endif + return normalize(mul(invView, normal)); +#endif // !MESH_NORMALS +} + +inline half3 calculateSpriteViewNormal(VertexInput vertex) +{ +#if defined(MESH_NORMALS) + return normalize(mul((float3x3)UNITY_MATRIX_IT_MV, vertex.normal)); +#else // !MESH_NORMALS + float3 normal = _FixedNormal.xyz; +#if UNITY_REVERSED_Z + normal.z = -normal.z; +#endif + return normal; +#endif // !MESH_NORMALS +} + +//////////////////////////////////////// +// Normal map functions +// + +#if defined(_NORMALMAP) + +inline half3 calculateSpriteWorldBinormal(half3 normalWorld, half3 tangentWorld, float tangentW) +{ +#if defined(_FIXED_NORMALS_BACK_RENDERING) + //If we're using fixed normals and sprite is facing away from camera, flip tangentW + float3 zAxis = float3(0.0, 0.0, 1.0); + float3 modelForward = mul((float3x3)unity_ObjectToWorld, zAxis); + float3 cameraForward = mul((float3x3)UNITY_MATRIX_VP, zAxis); + float directionDot = dot(modelForward, cameraForward); + //Don't worry if directionDot is zero, sprite will be side on to camera so invisible meaning it doesnt matter that tangentW will be zero too + tangentW *= sign(directionDot); +#endif // _FIXED_NORMALS_BACK_RENDERING + + return calculateWorldBinormal(normalWorld, tangentWorld, tangentW); +} + +#endif // _NORMALMAP + +#if defined(_DIFFUSE_RAMP) + + +//////////////////////////////////////// +// Diffuse ramp functions +// + +//Disable for softer, more traditional diffuse ramping +#define HARD_DIFFUSE_RAMP + +uniform sampler2D _DiffuseRamp; + +inline fixed3 calculateDiffuseRamp(float ramp) +{ + return tex2D(_DiffuseRamp, float2(ramp, ramp)).rgb; +} + +inline fixed3 calculateRampedDiffuse(fixed3 lightColor, float attenuation, float angleDot) +{ + float d = angleDot * 0.5 + 0.5; +#if defined(HARD_DIFFUSE_RAMP) + half3 ramp = calculateDiffuseRamp(d * attenuation * 2); + return lightColor * ramp; +#else + half3 ramp = calculateDiffuseRamp(d); + return lightColor * ramp * (attenuation * 2); +#endif +} +#endif // _DIFFUSE_RAMP + +//////////////////////////////////////// +// Rim Lighting functions +// + +#ifdef _RIM_LIGHTING + +uniform float _RimPower; +uniform fixed4 _RimColor; + +inline fixed3 applyRimLighting(fixed3 posWorld, fixed3 normalWorld, fixed4 pixel) : SV_Target +{ + fixed3 viewDir = normalize(_WorldSpaceCameraPos - posWorld); + float invDot = 1.0 - saturate(dot(normalWorld, viewDir)); + float rimPower = pow(invDot, _RimPower); + float rim = saturate(rimPower * _RimColor.a); + +#if defined(_DIFFUSE_RAMP) + rim = calculateDiffuseRamp(rim).r; +#endif + + return lerp(pixel.rgb, _RimColor.xyz * pixel.a, rim); +} + +#endif //_RIM_LIGHTING + +//////////////////////////////////////// +// Emission functions +// + +#ifdef _EMISSION + +uniform sampler2D _EmissionMap; +uniform fixed4 _EmissionColor; +uniform float _EmissionPower; + + +#define APPLY_EMISSION(diffuse, uv) \ + { \ + diffuse += tex2D(_EmissionMap, uv).rgb * _EmissionColor.rgb * _EmissionPower; \ + } + +#else //!_EMISSION + +#define APPLY_EMISSION(diffuse, uv) + +#endif //!_EMISSION + +#endif // SPRITE_LIGHTING_INCLUDED \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Multiply-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteLighting.cginc.meta similarity index 67% rename from Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Multiply-Outline.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteLighting.cginc.meta index 741a24ebe..279520a16 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Multiply-Outline.shader.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteLighting.cginc.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 4b3566a937643b8498d1ec6df5880b77 -timeCreated: 1573829476 +guid: 252dba02e84702448a0838ced241467d +timeCreated: 1479457856 licenseType: Free ShaderImporter: defaultTextures: [] diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritePixelLighting.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritePixelLighting.cginc new file mode 100644 index 000000000..f08b59a40 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritePixelLighting.cginc @@ -0,0 +1,198 @@ +#ifndef SPRITE_PIXEL_LIGHTING_INCLUDED +#define SPRITE_PIXEL_LIGHTING_INCLUDED + +#include "ShaderShared.cginc" +#include "SpriteLighting.cginc" +#include "AutoLight.cginc" + +//////////////////////////////////////// +// Defines +// + +//////////////////////////////////////// +// Vertex output struct +// + +#if defined(_NORMALMAP) + #define _VERTEX_LIGHTING_INDEX TEXCOORD5 + #define _LIGHT_COORD_INDEX_0 6 + #define _LIGHT_COORD_INDEX_1 7 + #define _FOG_COORD_INDEX 8 +#else + #define _VERTEX_LIGHTING_INDEX TEXCOORD3 + #define _LIGHT_COORD_INDEX_0 4 + #define _LIGHT_COORD_INDEX_1 5 + #define _FOG_COORD_INDEX 6 +#endif // _NORMALMAP + +struct VertexOutput +{ + float4 pos : SV_POSITION; + fixed4 color : COLOR; + float2 texcoord : TEXCOORD0; + float4 posWorld : TEXCOORD1; + half3 normalWorld : TEXCOORD2; +#if defined(_NORMALMAP) + half3 tangentWorld : TEXCOORD3; + half3 binormalWorld : TEXCOORD4; +#endif // _NORMALMAP + fixed3 vertexLighting : _VERTEX_LIGHTING_INDEX; + LIGHTING_COORDS(_LIGHT_COORD_INDEX_0, _LIGHT_COORD_INDEX_1) +#if defined(_FOG) + UNITY_FOG_COORDS(_FOG_COORD_INDEX) +#endif // _FOG +}; + +//////////////////////////////////////// +// Light calculations +// + +uniform fixed4 _LightColor0; + +inline fixed3 calculateLightDiffuse(VertexOutput input, float3 normalWorld) +{ + //For directional lights _WorldSpaceLightPos0.w is set to zero + float3 lightWorldDirection = normalize(_WorldSpaceLightPos0.xyz - input.posWorld.xyz * _WorldSpaceLightPos0.w); + + float attenuation = LIGHT_ATTENUATION(input); + float angleDot = max(0, dot(normalWorld, lightWorldDirection)); + +#if defined(_DIFFUSE_RAMP) + fixed3 lightDiffuse = calculateRampedDiffuse(_LightColor0.rgb, attenuation, angleDot); +#else + fixed3 lightDiffuse = _LightColor0.rgb * (attenuation * angleDot); +#endif // _DIFFUSE_RAMP + + return lightDiffuse; +} + +inline float3 calculateNormalWorld(VertexOutput input) +{ +#if defined(_NORMALMAP) + return calculateNormalFromBumpMap(input.texcoord, input.tangentWorld, input.binormalWorld, input.normalWorld); +#else + return input.normalWorld; +#endif +} + +fixed3 calculateVertexLighting(float3 posWorld, float3 normalWorld) +{ + fixed3 vertexLighting = fixed3(0,0,0); + +#ifdef VERTEXLIGHT_ON + //Get approximated illumination from non-important point lights + vertexLighting = Shade4PointLights ( unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, + unity_LightColor[0].rgb, unity_LightColor[1].rgb, unity_LightColor[2].rgb, unity_LightColor[3].rgb, + unity_4LightAtten0, posWorld, normalWorld) * 0.5; +#endif + + return vertexLighting; +} + +fixed3 calculateAmbientLight(half3 normalWorld) +{ +#if defined(_SPHERICAL_HARMONICS) + fixed3 ambient = ShadeSH9(half4(normalWorld, 1.0)) * 0.75f; +#else + fixed3 ambient = unity_AmbientSky.rgb * 0.75; +#endif + return ambient; +} + +//////////////////////////////////////// +// Vertex program +// + +VertexOutput vert(VertexInput v) +{ + VertexOutput output; + + output.pos = calculateLocalPos(v.vertex); + output.color = calculateVertexColor(v.color); + output.texcoord = calculateTextureCoord(v.texcoord); + output.posWorld = calculateWorldPos(v.vertex); + output.normalWorld = calculateSpriteWorldNormal(v); + output.vertexLighting = calculateVertexLighting(output.posWorld, output.normalWorld); + +#if defined(_NORMALMAP) + output.tangentWorld = calculateWorldTangent(v.tangent); + output.binormalWorld = calculateSpriteWorldBinormal(output.normalWorld, output.tangentWorld, v.tangent.w); +#endif + + TRANSFER_VERTEX_TO_FRAGMENT(output) + +#if defined(_FOG) + UNITY_TRANSFER_FOG(output,output.pos); +#endif // _FOG + + return output; +} + +//////////////////////////////////////// +// Fragment programs +// + +fixed4 fragBase(VertexOutput input) : SV_Target +{ + fixed4 texureColor = calculateTexturePixel(input.texcoord); + ALPHA_CLIP(texureColor, input.color) + + //Get normal direction + fixed3 normalWorld = calculateNormalWorld(input); + + //Get Ambient diffuse + fixed3 ambient = calculateAmbientLight(normalWorld); + + //Get primary pixel light diffuse + fixed3 diffuse = calculateLightDiffuse(input, normalWorld); + + //Combine along with vertex lighting for the base lighting pass + fixed3 lighting = ambient + diffuse + input.vertexLighting; + + APPLY_EMISSION(lighting, input.texcoord) + + fixed4 pixel = calculateLitPixel(texureColor, input.color, lighting); + +#if defined(_RIM_LIGHTING) + pixel.rgb = applyRimLighting(input.posWorld, normalWorld, pixel); +#endif + + COLORISE(pixel) + +#if defined(_FOG) + fixed4 fogColor = lerp(fixed4(0,0,0,0), unity_FogColor, pixel.a); + UNITY_APPLY_FOG_COLOR(input.fogCoord, pixel, fogColor); +#endif // _FOG + + return pixel; +} + +fixed4 fragAdd(VertexOutput input) : SV_Target +{ + fixed4 texureColor = calculateTexturePixel(input.texcoord); + +#if defined(_COLOR_ADJUST) + texureColor = adjustColor(texureColor); +#endif // _COLOR_ADJUST + + ALPHA_CLIP(texureColor, input.color) + + //Get normal direction + fixed3 normalWorld = calculateNormalWorld(input); + + //Get light diffuse + fixed3 lighting = calculateLightDiffuse(input, normalWorld); + + fixed4 pixel = calculateAdditiveLitPixel(texureColor, input.color, lighting); + + COLORISE_ADDITIVE(pixel) + +#if defined(_FOG) + UNITY_APPLY_FOG_COLOR(input.fogCoord, pixel.rgb, fixed4(0,0,0,0)); // fog towards black in additive pass +#endif // _FOG + + return pixel; +} + + +#endif // SPRITE_PIXEL_LIGHTING_INCLUDED \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Lit-Common-Shadow.cginc.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritePixelLighting.cginc.meta similarity index 67% rename from Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Lit-Common-Shadow.cginc.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritePixelLighting.cginc.meta index b325e2369..2759558df 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Lit-Common-Shadow.cginc.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritePixelLighting.cginc.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: c7297b25c81d2494e8e73b742e3c7345 -timeCreated: 1564083752 +guid: 38bcbfc10385d424c9cbac5b5b9ec1af +timeCreated: 1479457856 licenseType: Free ShaderImporter: defaultTextures: [] diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc new file mode 100644 index 000000000..95fb7b8d8 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc @@ -0,0 +1,52 @@ +#ifndef SPRITE_SHADOWS_INCLUDED +#define SPRITE_SHADOWS_INCLUDED + +#include "UnityCG.cginc" + +//////////////////////////////////////// +// Vertex structs +// + +struct vertexInput +{ + float4 vertex : POSITION; + float4 texcoord : TEXCOORD0; +}; + +struct vertexOutput +{ + V2F_SHADOW_CASTER; + float4 texcoord : TEXCOORD1; +}; + +//////////////////////////////////////// +// Vertex program +// + +uniform sampler2D _MainTex; +uniform fixed4 _MainTex_ST; + +vertexOutput vert(vertexInput v) +{ + vertexOutput o; + TRANSFER_SHADOW_CASTER(o) + o.texcoord = float4(TRANSFORM_TEX(v.texcoord, _MainTex), 0, 0); + return o; +} + +//////////////////////////////////////// +// Fragment program +// + + +uniform fixed _ShadowAlphaCutoff; + +fixed4 frag(vertexOutput IN) : SV_Target +{ + fixed4 texureColor = tex2D(_MainTex, IN.texcoord.xy); + clip(texureColor.a - _ShadowAlphaCutoff); + + SHADOW_CASTER_FRAGMENT(IN) +} + +#endif // SPRITE_SHADOWS_INCLUDED \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Lit-Common.cginc.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc.meta similarity index 67% rename from Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Lit-Common.cginc.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc.meta index ee3481036..610e02e1b 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Lit-Common.cginc.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 70c77c02aabd5e44f94aab48dd0be7b2 -timeCreated: 1564083752 +guid: 0f58b811a44f1b44cb9aac3ddfe24f37 +timeCreated: 1479457856 licenseType: Free ShaderImporter: defaultTextures: [] diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteUnlit.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteUnlit.cginc new file mode 100644 index 000000000..b58a50942 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteUnlit.cginc @@ -0,0 +1,67 @@ +#ifndef SPRITE_UNLIT_INCLUDED +#define SPRITE_UNLIT_INCLUDED + +#include "ShaderShared.cginc" + +//////////////////////////////////////// +// Vertex structs +// + +struct VertexInput +{ + float4 vertex : POSITION; + float4 texcoord : TEXCOORD0; + fixed4 color : COLOR; +}; + +struct VertexOutput +{ + float4 pos : SV_POSITION; + float2 texcoord : TEXCOORD0; + fixed4 color : COLOR; +#if defined(_FOG) + UNITY_FOG_COORDS(1) +#endif // _FOG +}; + +//////////////////////////////////////// +// Vertex program +// + +VertexOutput vert(VertexInput input) +{ + VertexOutput output; + + output.pos = calculateLocalPos(input.vertex); + output.texcoord = calculateTextureCoord(input.texcoord); + output.color = calculateVertexColor(input.color); + +#if defined(_FOG) + UNITY_TRANSFER_FOG(output,output.pos); +#endif // _FOG + + return output; +} + +//////////////////////////////////////// +// Fragment program +// + +fixed4 frag(VertexOutput input) : SV_Target +{ + fixed4 texureColor = calculateTexturePixel(input.texcoord.xy); + ALPHA_CLIP(texureColor, input.color) + + fixed4 pixel = calculatePixel(texureColor, input.color); + + COLORISE(pixel) + +#if defined(_FOG) + fixed4 fogColor = lerp(fixed4(0,0,0,0), unity_FogColor, pixel.a); + UNITY_APPLY_FOG_COLOR(input.fogCoord, pixel, fogColor); +#endif // _FOG + + return pixel; +} + +#endif // SPRITE_UNLIT_INCLUDED \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteUnlit.cginc.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteUnlit.cginc.meta new file mode 100644 index 000000000..684bd2457 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteUnlit.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e67832d6dd9dd914ca946fa7fcaa4a9e +timeCreated: 1479457856 +licenseType: Free +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteVertexLighting.cginc b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteVertexLighting.cginc new file mode 100644 index 000000000..aae3b2771 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteVertexLighting.cginc @@ -0,0 +1,430 @@ +#ifndef SPRITE_VERTEX_LIGHTING_INCLUDED +#define SPRITE_VERTEX_LIGHTING_INCLUDED + +#include "ShaderShared.cginc" +#include "SpriteLighting.cginc" +#include "UnityStandardUtils.cginc" + +//////////////////////////////////////// +// Defines +// + +//Define to use spot lights (more expensive) +#define SPOT_LIGHTS + +//Have to process lighting per pixel if using normal maps or a diffuse ramp or rim lighting +#if defined(_NORMALMAP) || defined(_DIFFUSE_RAMP) || defined(_RIM_LIGHTING) +#define PER_PIXEL_LIGHTING +#endif + +//Turn off bump mapping and diffuse ramping on older shader models as they dont support needed number of outputs +#if defined(PER_PIXEL_LIGHTING) && (SHADER_TARGET < 30) + #undef PER_PIXEL_LIGHTING + #undef _NORMALMAP + #undef _DIFFUSE_RAMP + #undef _RIM_LIGHTING +#endif + +//In D3D9 only have a max of 9 TEXCOORD so can't have diffuse ramping or fog or rim lighting if processing lights per pixel +#if defined(SHADER_API_D3D9) && defined(PER_PIXEL_LIGHTING) + #if defined(_NORMALMAP) + #undef _DIFFUSE_RAMP + #undef _FOG + #undef _RIM_LIGHTING + #elif defined(_DIFFUSE_RAMP) + #undef _FOG + #undef _RIM_LIGHTING + #elif defined(_RIM_LIGHTING) + #undef _FOG + #undef _DIFFUSE_RAMP + #else + #undef _DIFFUSE_RAMP + #undef _RIM_LIGHTING + #endif +#endif + +#if defined(PER_PIXEL_LIGHTING) + #if defined(_NORMALMAP) && defined(_DIFFUSE_RAMP) + #define ATTENUATIONS TEXCOORD9 + #if defined(_RIM_LIGHTING) + #define _POS_WORLD_INDEX TEXCOORD10 + #define _FOG_COORD_INDEX 11 + #else + #define _FOG_COORD_INDEX 10 + #endif + #elif defined(_NORMALMAP) != defined(_DIFFUSE_RAMP) + #define ATTENUATIONS TEXCOORD8 + #if defined(_RIM_LIGHTING) + #define _POS_WORLD_INDEX TEXCOORD9 + #define _FOG_COORD_INDEX 10 + #else + #define _FOG_COORD_INDEX 9 + #endif + #else //!_DIFFUSE_RAMP && !_NORMALMAP + #if defined(_RIM_LIGHTING) + #define _POS_WORLD_INDEX TEXCOORD8 + #define _FOG_COORD_INDEX 9 + #else + #define _FOG_COORD_INDEX 8 + #endif + #endif +#else //!PER_PIXEL_LIGHTING + #define _FOG_COORD_INDEX 2 +#endif + +//////////////////////////////////////// +// Vertex output struct +// + +struct VertexOutput +{ + float4 pos : SV_POSITION; + fixed4 color : COLOR; + float3 texcoord : TEXCOORD0; + +#if defined(PER_PIXEL_LIGHTING) + + half4 VertexLightInfo0 : TEXCOORD1; + half4 VertexLightInfo1 : TEXCOORD2; + half4 VertexLightInfo2 : TEXCOORD3; + half4 VertexLightInfo3 : TEXCOORD4; + half4 VertexLightInfo4 : TEXCOORD5; + + #if defined(_NORMALMAP) + half4 normalWorld : TEXCOORD6; + half4 tangentWorld : TEXCOORD7; + half4 binormalWorld : TEXCOORD8; + #else + half3 normalWorld : TEXCOORD6; + half3 VertexLightInfo5 : TEXCOORD7; + #endif + #if defined(_DIFFUSE_RAMP) + half4 LightAttenuations : ATTENUATIONS; + #endif + #if defined(_RIM_LIGHTING) + float4 posWorld : _POS_WORLD_INDEX; + #endif + +#else //!PER_PIXEL_LIGHTING + + half3 FullLighting : TEXCOORD1; + +#endif // !PER_PIXEL_LIGHTING + +#if defined(_FOG) + UNITY_FOG_COORDS(_FOG_COORD_INDEX) +#endif // _FOG +}; + +//////////////////////////////////////// +// Light calculations +// + +struct VertexLightInfo +{ + half3 lightDirection; + fixed3 lightColor; + +#if defined(_DIFFUSE_RAMP) + float attenuation; +#endif // _DIFFUSE_RAMP +}; + +inline VertexLightInfo getVertexLightAttenuatedInfo(int index, float3 viewPos) +{ + VertexLightInfo lightInfo; + + //For directional lights unity_LightPosition.w is set to zero + lightInfo.lightDirection = unity_LightPosition[index].xyz - viewPos.xyz * unity_LightPosition[index].w; + float lengthSq = dot(lightInfo.lightDirection, lightInfo.lightDirection); + + // don't produce NaNs if some vertex position overlaps with the light + lengthSq = max(lengthSq, 0.000001); + + lightInfo.lightDirection *= rsqrt(lengthSq); + + float attenuation = 1.0 / (1.0 + lengthSq * unity_LightAtten[index].z); + +#if defined(SPOT_LIGHTS) + //Spot light attenuation - for non-spot lights unity_LightAtten.x is set to -1 and y is set to 1 + { + float rho = max (0, dot(lightInfo.lightDirection, unity_SpotDirection[index].xyz)); + float spotAtt = (rho - unity_LightAtten[index].x) * unity_LightAtten[index].y; + attenuation *= saturate(spotAtt); + } +#endif // SPOT_LIGHTS + + //If using a diffuse ramp texture then need to pass through the lights attenuation, otherwise premultiply the light color with it +#if defined(_DIFFUSE_RAMP) + lightInfo.lightColor = unity_LightColor[index].rgb; + lightInfo.attenuation = attenuation; +#else + lightInfo.lightColor = unity_LightColor[index].rgb * attenuation; +#endif // _DIFFUSE_RAMP + + return lightInfo; +} + +fixed3 calculateAmbientLight(half3 normalWorld) +{ +#if defined(_SPHERICAL_HARMONICS) + + //Magic constants used to tweak ambient to approximate pixel shader spherical harmonics + static const fixed3 worldUp = fixed3(0,1,0); + static const float skyGroundDotMul = 2.5; + static const float minEquatorMix = 0.5; + static const float equatorColorBlur = 0.33; + + float upDot = dot(normalWorld, worldUp); + + //Fade between a flat lerp from sky to ground and a 3 way lerp based on how bright the equator light is. + //This simulates how directional lights get blurred using spherical harmonics + + //Work out color from ground and sky, ignoring equator + float adjustedDot = upDot * skyGroundDotMul; + fixed3 skyGroundColor = lerp(unity_AmbientGround, unity_AmbientSky, saturate((adjustedDot + 1.0) * 0.5)); + + //Work out equator lights brightness + float equatorBright = saturate(dot(unity_AmbientEquator.rgb, unity_AmbientEquator.rgb)); + + //Blur equator color with sky and ground colors based on how bright it is. + fixed3 equatorBlurredColor = lerp(unity_AmbientEquator, saturate(unity_AmbientEquator + unity_AmbientGround + unity_AmbientSky), equatorBright * equatorColorBlur); + + //Work out 3 way lerp inc equator light + fixed3 equatorColor = lerp(equatorBlurredColor, unity_AmbientGround, -upDot) * step(upDot, 0) + lerp(equatorBlurredColor, unity_AmbientSky, upDot) * step(0, upDot); + + //Mix the two colors together based on how bright the equator light is + return lerp(skyGroundColor, equatorColor, saturate(equatorBright + minEquatorMix)) * 0.75; + +#else // !_SPHERICAL_HARMONICS + + //Flat ambient is just the sky color + return unity_AmbientSky.rgb * 0.75; + +#endif // !_SPHERICAL_HARMONICS +} + +//////////////////////////////////////// +// Light Packing Functions +// + +#if defined(_DIFFUSE_RAMP) + +inline fixed3 calculateLightDiffuse(fixed3 lightColor, half3 viewNormal, half3 lightViewDir, float attenuation) +{ + float angleDot = max(0, dot(viewNormal, lightViewDir)); + return calculateRampedDiffuse(lightColor, attenuation, angleDot); +} + +#else + +inline fixed3 calculateLightDiffuse(fixed3 attenuatedLightColor, half3 viewNormal, half3 lightViewDir) +{ + float angleDot = max(0, dot(viewNormal, lightViewDir)); + return attenuatedLightColor * angleDot; +} + +#endif // _NORMALMAP + + +#if defined(PER_PIXEL_LIGHTING) + +#define VERTEX_LIGHT_0_DIR VertexLightInfo0.xyz +#define VERTEX_LIGHT_0_R VertexLightInfo4.x +#define VERTEX_LIGHT_0_G VertexLightInfo4.y +#define VERTEX_LIGHT_0_B VertexLightInfo4.z + +#define VERTEX_LIGHT_1_DIR VertexLightInfo1.xyz +#define VERTEX_LIGHT_1_R VertexLightInfo0.w +#define VERTEX_LIGHT_1_G VertexLightInfo1.w +#define VERTEX_LIGHT_1_B VertexLightInfo2.w + +#define VERTEX_LIGHT_2_DIR VertexLightInfo2.xyz +#define VERTEX_LIGHT_2_R VertexLightInfo3.w +#define VERTEX_LIGHT_2_G VertexLightInfo4.w +#define VERTEX_LIGHT_2_B texcoord.z + +#define VERTEX_LIGHT_3_DIR VertexLightInfo3.xyz + +#if defined(_NORMALMAP) + #define VERTEX_LIGHT_3_R normalWorld.w + #define VERTEX_LIGHT_3_G tangentWorld.w + #define VERTEX_LIGHT_3_B binormalWorld.w +#else + #define VERTEX_LIGHT_3_R VertexLightInfo5.x + #define VERTEX_LIGHT_3_G VertexLightInfo5.y + #define VERTEX_LIGHT_3_B VertexLightInfo5.z +#endif + +#if defined(_DIFFUSE_RAMP) + + #define LIGHT_DIFFUSE_ATTEN_0 LightAttenuations.x + #define LIGHT_DIFFUSE_ATTEN_1 LightAttenuations.y + #define LIGHT_DIFFUSE_ATTEN_2 LightAttenuations.z + #define LIGHT_DIFFUSE_ATTEN_3 LightAttenuations.w + + #define PACK_VERTEX_LIGHT_DIFFUSE(index, output, lightInfo) \ + { \ + output.LIGHT_DIFFUSE_ATTEN_##index = lightInfo.attenuation; \ + } + + #define ADD_VERTEX_LIGHT_DIFFUSE(index, diffuse, input, lightColor, viewNormal, lightViewDir) \ + { \ + diffuse += calculateLightDiffuse(lightColor, viewNormal, lightViewDir, input.LIGHT_DIFFUSE_ATTEN_##index); \ + } +#else + #define PACK_VERTEX_LIGHT_DIFFUSE(index, output, lightInfo) + #define ADD_VERTEX_LIGHT_DIFFUSE(index, diffuse, input, lightColor, viewNormal, lightViewDir) \ + { \ + diffuse += calculateLightDiffuse(lightColor, viewNormal, lightViewDir); \ + } +#endif + +#define PACK_VERTEX_LIGHT(index, output, viewPos) \ + { \ + VertexLightInfo lightInfo = getVertexLightAttenuatedInfo(index, viewPos); \ + output.VERTEX_LIGHT_##index##_DIR = lightInfo.lightDirection; \ + output.VERTEX_LIGHT_##index##_R = lightInfo.lightColor.r; \ + output.VERTEX_LIGHT_##index##_G = lightInfo.lightColor.g; \ + output.VERTEX_LIGHT_##index##_B = lightInfo.lightColor.b; \ + PACK_VERTEX_LIGHT_DIFFUSE(index, output, lightInfo); \ + } + +#define ADD_VERTEX_LIGHT(index, input, viewNormal, diffuse) \ + { \ + half3 lightViewDir = input.VERTEX_LIGHT_##index##_DIR; \ + fixed3 lightColor = fixed3(input.VERTEX_LIGHT_##index##_R, input.VERTEX_LIGHT_##index##_G, input.VERTEX_LIGHT_##index##_B); \ + ADD_VERTEX_LIGHT_DIFFUSE(index, diffuse, input, lightColor, viewNormal, lightViewDir) \ + } + +#else //!PER_PIXEL_LIGHTING + +//////////////////////////////////////// +// Vertex Only Functions +// + +inline fixed3 calculateLightDiffuse(int index, float3 viewPos, half3 viewNormal) +{ + VertexLightInfo lightInfo = getVertexLightAttenuatedInfo(index, viewPos); + float angleDot = max(0, dot(viewNormal, lightInfo.lightDirection)); + return lightInfo.lightColor * angleDot; +} + +#endif // !PER_PIXEL_LIGHTING + +//////////////////////////////////////// +// Vertex program +// + +VertexOutput vert(VertexInput input) +{ + VertexOutput output; + + output.pos = calculateLocalPos(input.vertex); + output.color = calculateVertexColor(input.color); + output.texcoord = float3(calculateTextureCoord(input.texcoord), 0); + + float3 viewPos = UnityObjectToViewPos(input.vertex); + +#if defined(PER_PIXEL_LIGHTING) + + #if defined(_RIM_LIGHTING) + output.posWorld = calculateWorldPos(input.vertex); + #endif + + PACK_VERTEX_LIGHT(0, output, viewPos) + PACK_VERTEX_LIGHT(1, output, viewPos) + PACK_VERTEX_LIGHT(2, output, viewPos) + PACK_VERTEX_LIGHT(3, output, viewPos) + + output.normalWorld.xyz = calculateSpriteWorldNormal(input); + + #if defined(_NORMALMAP) + output.tangentWorld.xyz = calculateWorldTangent(input.tangent); + output.binormalWorld.xyz = calculateSpriteWorldBinormal(output.normalWorld, output.tangentWorld, input.tangent.w); + #endif + +#else // !PER_PIXEL_LIGHTING + + //Just pack full lighting + float3 viewNormal = calculateSpriteViewNormal(input); + + //Get Ambient diffuse + float3 normalWorld = calculateSpriteWorldNormal(input); + fixed3 ambient = calculateAmbientLight(normalWorld); + + fixed3 diffuse = calculateLightDiffuse(0, viewPos, viewNormal); + diffuse += calculateLightDiffuse(1, viewPos, viewNormal); + diffuse += calculateLightDiffuse(2, viewPos, viewNormal); + diffuse += calculateLightDiffuse(3, viewPos, viewNormal); + + output.FullLighting = ambient + diffuse; + +#endif // !PER_PIXEL_LIGHTING + +#if defined(_FOG) + UNITY_TRANSFER_FOG(output, output.pos); +#endif // _FOG + + return output; +} + +//////////////////////////////////////// +// Fragment program +// + +fixed4 frag(VertexOutput input) : SV_Target +{ + fixed4 texureColor = calculateTexturePixel(input.texcoord.xy); + ALPHA_CLIP(texureColor, input.color) + +#if defined(PER_PIXEL_LIGHTING) + + #if defined(_NORMALMAP) + half3 normalWorld = calculateNormalFromBumpMap(input.texcoord.xy, input.tangentWorld.xyz, input.binormalWorld.xyz, input.normalWorld.xyz); + #else + half3 normalWorld = input.normalWorld.xyz; + #endif + + //Get Ambient diffuse + fixed3 ambient = calculateAmbientLight(normalWorld); + + //Find vertex light diffuse + fixed3 diffuse = fixed3(0,0,0); + + //Add each vertex light to diffuse + half3 normalView = normalize(mul((float3x3)UNITY_MATRIX_V, normalWorld)); + ADD_VERTEX_LIGHT(0, input, normalView, diffuse) + ADD_VERTEX_LIGHT(1, input, normalView, diffuse) + ADD_VERTEX_LIGHT(2, input, normalView, diffuse) + ADD_VERTEX_LIGHT(3, input, normalView, diffuse) + + fixed3 lighting = ambient + diffuse; + + APPLY_EMISSION(lighting, input.texcoord.xy) + + fixed4 pixel = calculateLitPixel(texureColor, input.color, lighting); + +#if defined(_RIM_LIGHTING) + pixel.rgb = applyRimLighting(input.posWorld, normalWorld, pixel); +#endif + +#else // !PER_PIXEL_LIGHTING + + APPLY_EMISSION(input.FullLighting, input.texcoord.xy) + + fixed4 pixel = calculateLitPixel(texureColor, input.color, input.FullLighting); + +#endif // !PER_PIXEL_LIGHTING + + COLORISE(pixel) + +#if defined(_FOG) + fixed4 fogColor = lerp(fixed4(0,0,0,0), unity_FogColor, pixel.a); + UNITY_APPLY_FOG_COLOR(input.fogCoord, pixel, fogColor); +#endif // _FOG + + return pixel; +} + +#endif // SPRITE_VERTEX_LIGHTING_INCLUDED \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteVertexLighting.cginc.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteVertexLighting.cginc.meta new file mode 100644 index 000000000..f206ccaf1 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteVertexLighting.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b256f9f092407414392d98f339173a2d +timeCreated: 1479457856 +licenseType: Free +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesPixelLit.shader b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesPixelLit.shader similarity index 72% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesPixelLit.shader rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesPixelLit.shader index 30b67655e..17117d679 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesPixelLit.shader +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesPixelLit.shader @@ -4,61 +4,55 @@ Shader "Spine/Sprite/Pixel Lit" { _MainTex ("Main Texture", 2D) = "white" {} _Color ("Color", Color) = (1,1,1,1) - + _BumpScale("Scale", Float) = 1.0 _BumpMap ("Normal Map", 2D) = "bump" {} - + [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 - - _EmissionColor("Color", Color) = (0,0,0,0) + [PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {} + [PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0 + + _EmissionColor("Color", Color) = (0,0,0,0) _EmissionMap("Emission", 2D) = "white" {} - _EmissionPower("Emission Power", Float) = 2.0 - + _EmissionPower("Emission Power", Float) = 2.0 + _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5 _GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0 [Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0 _MetallicGlossMap("Metallic", 2D) = "white" {} - + _DiffuseRamp ("Diffuse Ramp Texture", 2D) = "gray" {} - + _FixedNormal ("Fixed Normal", Vector) = (0,0,1,1) + _ZWrite ("Depth Write", Float) = 1.0 _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.5 _ShadowAlphaCutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 _CustomRenderQueue ("Custom Render Queue", Float) = 0.0 - + _OverlayColor ("Overlay Color", Color) = (0,0,0,0) - _Hue("Hue", Range(-0.5,0.5)) = 0.0 - _Saturation("Saturation", Range(0,2)) = 1.0 - _Brightness("Brightness", Range(0,2)) = 1.0 - - _RimPower("Rim Power", Float) = 2.0 + _Hue("Hue", Range(-0.5,0.5)) = 0.0 + _Saturation("Saturation", Range(0,2)) = 1.0 + _Brightness("Brightness", Range(0,2)) = 1.0 + + _RimPower("Rim Power", Float) = 2.0 _RimColor ("Rim Color", Color) = (1,1,1,1) - + _BlendTex ("Blend Texture", 2D) = "white" {} _BlendAmount ("Blend", Range(0,1)) = 0.0 - + [HideInInspector] _SrcBlend ("__src", Float) = 1.0 [HideInInspector] _DstBlend ("__dst", Float) = 0.0 [HideInInspector] _RenderQueue ("__queue", Float) = 0.0 [HideInInspector] _Cull ("__cull", Float) = 0.0 [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default } - + SubShader { Tags { "Queue"="Transparent" "RenderType"="Sprite" "AlphaDepth"="False" "CanUseSpriteAtlas"="True" "IgnoreProjector"="True" } LOD 200 - + Stencil { Ref[_StencilRef] Comp[_StencilComp] @@ -67,75 +61,72 @@ Shader "Spine/Sprite/Pixel Lit" Pass { - Name "FORWARD" + Name "FORWARD" Tags { "LightMode" = "ForwardBase" } Blend [_SrcBlend] [_DstBlend] - // Note: ZWrite needs to be enabled for following ForwardAdd pass, otherwise parts will look as if shining through by getting lit. - ZWrite On + ZWrite [_ZWrite] ZTest LEqual Cull [_Cull] - + CGPROGRAM #pragma target 3.0 - + #pragma shader_feature _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ADDITIVEBLEND _ADDITIVEBLEND_SOFT _MULTIPLYBLEND _MULTIPLYBLEND_X2 - #pragma shader_feature _ _FIXED_NORMALS_VIEWSPACE _FIXED_NORMALS_VIEWSPACE_BACKFACE _FIXED_NORMALS_MODELSPACE _FIXED_NORMALS_MODELSPACE_BACKFACE _FIXED_NORMALS_WORLDSPACE + #pragma shader_feature _ _FIXED_NORMALS_VIEWSPACE _FIXED_NORMALS_VIEWSPACE_BACKFACE _FIXED_NORMALS_MODELSPACE _FIXED_NORMALS_MODELSPACE_BACKFACE #pragma shader_feature _ _SPECULAR _SPECULAR_GLOSSMAP #pragma shader_feature _NORMALMAP #pragma shader_feature _ALPHA_CLIP #pragma shader_feature _EMISSION #pragma shader_feature _RIM_LIGHTING #pragma shader_feature _DIFFUSE_RAMP - #pragma shader_feature _ _FULLRANGE_HARD_RAMP _FULLRANGE_SOFT_RAMP _OLD_HARD_RAMP _OLD_SOFT_RAMP #pragma shader_feature _COLOR_ADJUST #pragma shader_feature _TEXTURE_BLEND #pragma shader_feature _SPHERICAL_HARMONICS #pragma shader_feature _FOG - + #pragma multi_compile_fwdbase #pragma fragmentoption ARB_precision_hint_fastest #pragma multi_compile_fog #pragma multi_compile _ PIXELSNAP_ON #pragma multi_compile _ ETC1_EXTERNAL_ALPHA - + #pragma vertex vert #pragma fragment fragBase - - #include "CGIncludes/SpritePixelLighting.cginc" + + #include "CGIncludes/SpritePixelLighting.cginc" ENDCG } Pass - { + { Name "FORWARD_DELTA" Tags { "LightMode" = "ForwardAdd" } Blend [_SrcBlend] One ZWrite Off ZTest LEqual Cull [_Cull] - + CGPROGRAM #pragma target 3.0 - + #pragma shader_feature _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ADDITIVEBLEND _ADDITIVEBLEND_SOFT _MULTIPLYBLEND _MULTIPLYBLEND_X2 - #pragma shader_feature _ _FIXED_NORMALS_VIEWSPACE _FIXED_NORMALS_VIEWSPACE_BACKFACE _FIXED_NORMALS_MODELSPACE _FIXED_NORMALS_MODELSPACE_BACKFACE _FIXED_NORMALS_WORLDSPACE + #pragma shader_feature _ _FIXED_NORMALS_VIEWSPACE _FIXED_NORMALS_VIEWSPACE_BACKFACE _FIXED_NORMALS_MODELSPACE _FIXED_NORMALS_MODELSPACE_BACKFACE #pragma shader_feature _ _SPECULAR _SPECULAR_GLOSSMAP #pragma shader_feature _NORMALMAP - #pragma shader_feature _ALPHA_CLIP + #pragma shader_feature _ALPHA_CLIP #pragma shader_feature _DIFFUSE_RAMP - #pragma shader_feature _ _FULLRANGE_HARD_RAMP _FULLRANGE_SOFT_RAMP _OLD_HARD_RAMP _OLD_SOFT_RAMP #pragma shader_feature _COLOR_ADJUST #pragma shader_feature _TEXTURE_BLEND #pragma shader_feature _FOG - + #pragma multi_compile_fwdadd_fullshadows #pragma fragmentoption ARB_precision_hint_fastest #pragma multi_compile_fog #pragma multi_compile _ PIXELSNAP_ON #pragma multi_compile _ ETC1_EXTERNAL_ALPHA - + #pragma vertex vert #pragma fragment fragAdd - + #include "CGIncludes/SpritePixelLighting.cginc" ENDCG } @@ -144,27 +135,27 @@ Shader "Spine/Sprite/Pixel Lit" Name "ShadowCaster" Tags { "LightMode"="ShadowCaster" } Offset 1, 1 - + Fog { Mode Off } ZWrite On ZTest LEqual Cull Off Lighting Off - - CGPROGRAM + + CGPROGRAM #pragma fragmentoption ARB_precision_hint_fastest #pragma multi_compile_shadowcaster #pragma multi_compile _ PIXELSNAP_ON #pragma multi_compile _ ETC1_EXTERNAL_ALPHA - + #pragma vertex vert #pragma fragment frag - + #include "CGIncludes/SpriteShadows.cginc" ENDCG } } - + FallBack "Spine/Sprite/Unlit" CustomEditor "SpineSpriteShaderGUI" -} +} \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesPixelLit.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesPixelLit.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesPixelLit.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesPixelLit.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesUnlit.shader b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesUnlit.shader similarity index 71% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesUnlit.shader rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesUnlit.shader index 39ae8d994..8bc8d902a 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesUnlit.shader +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesUnlit.shader @@ -4,44 +4,37 @@ Shader "Spine/Sprite/Unlit" { _MainTex ("Main Texture", 2D) = "white" {} _Color ("Color", Color) = (1,1,1,1) - + [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 - + [PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {} + [PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0 + _ZWrite ("Depth Write", Float) = 0.0 _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.0 _ShadowAlphaCutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 _CustomRenderQueue ("Custom Render Queue", Float) = 0.0 - + _OverlayColor ("Overlay Color", Color) = (0,0,0,0) _Hue("Hue", Range(-0.5,0.5)) = 0.0 - _Saturation("Saturation", Range(0,2)) = 1.0 - _Brightness("Brightness", Range(0,2)) = 1.0 - + _Saturation("Saturation", Range(0,2)) = 1.0 + _Brightness("Brightness", Range(0,2)) = 1.0 + _BlendTex ("Blend Texture", 2D) = "white" {} _BlendAmount ("Blend", Range(0,1)) = 0.0 - + [HideInInspector] _SrcBlend ("__src", Float) = 1.0 [HideInInspector] _DstBlend ("__dst", Float) = 0.0 [HideInInspector] _RenderQueue ("__queue", Float) = 0.0 [HideInInspector] _Cull ("__cull", Float) = 0.0 [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default } - + SubShader { Tags { "Queue"="Transparent" "RenderType"="Sprite" "AlphaDepth"="False" "CanUseSpriteAtlas"="True" "IgnoreProjector"="True" } LOD 100 - + Stencil { Ref[_StencilRef] Comp[_StencilComp] @@ -50,30 +43,28 @@ Shader "Spine/Sprite/Unlit" Pass { - Name "Normal" - Blend [_SrcBlend] [_DstBlend] Lighting Off ZWrite [_ZWrite] ZTest LEqual Cull [_Cull] Lighting Off - - CGPROGRAM + + CGPROGRAM #pragma shader_feature _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ADDITIVEBLEND _ADDITIVEBLEND_SOFT _MULTIPLYBLEND _MULTIPLYBLEND_X2 #pragma shader_feature _ALPHA_CLIP #pragma shader_feature _TEXTURE_BLEND #pragma shader_feature _COLOR_ADJUST #pragma shader_feature _FOG - + #pragma fragmentoption ARB_precision_hint_fastest #pragma multi_compile_fog #pragma multi_compile _ PIXELSNAP_ON #pragma multi_compile _ ETC1_EXTERNAL_ALPHA - + #pragma vertex vert #pragma fragment frag - + #include "CGIncludes/SpriteUnlit.cginc" ENDCG } @@ -82,26 +73,26 @@ Shader "Spine/Sprite/Unlit" Name "ShadowCaster" Tags { "LightMode"="ShadowCaster" } Offset 1, 1 - + Fog { Mode Off } ZWrite On ZTest LEqual Cull Off Lighting Off - - CGPROGRAM + + CGPROGRAM #pragma fragmentoption ARB_precision_hint_fastest #pragma multi_compile_shadowcaster #pragma multi_compile _ PIXELSNAP_ON #pragma multi_compile _ ETC1_EXTERNAL_ALPHA - + #pragma vertex vert #pragma fragment frag - + #include "CGIncludes/SpriteShadows.cginc" ENDCG } } - + CustomEditor "SpineSpriteShaderGUI" } diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesUnlit.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesUnlit.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesUnlit.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesUnlit.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesVertexLit.shader b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesVertexLit.shader similarity index 73% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesVertexLit.shader rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesVertexLit.shader index d1fd2dd99..2752efa86 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesVertexLit.shader +++ b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesVertexLit.shader @@ -4,57 +4,50 @@ Shader "Spine/Sprite/Vertex Lit" { _MainTex ("Main Texture", 2D) = "white" {} _Color ("Color", Color) = (1,1,1,1) - + _BumpScale("Scale", Float) = 1.0 _BumpMap ("Normal Map", 2D) = "bump" {} - + [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 - + [PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {} + [PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0 + _EmissionColor("Color", Color) = (0,0,0,0) _EmissionMap("Emission", 2D) = "white" {} - _EmissionPower("Emission Power", Float) = 2.0 - + _EmissionPower("Emission Power", Float) = 2.0 + _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5 _GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0 [Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0 _MetallicGlossMap("Metallic", 2D) = "white" {} - + _DiffuseRamp ("Diffuse Ramp Texture", 2D) = "gray" {} - + _FixedNormal ("Fixed Normal", Vector) = (0,0,1,1) _ZWrite ("Depth Write", Float) = 0.0 _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.0 _ShadowAlphaCutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 _CustomRenderQueue ("Custom Render Queue", Float) = 0.0 - + _OverlayColor ("Overlay Color", Color) = (0,0,0,0) _Hue("Hue", Range(-0.5,0.5)) = 0.0 - _Saturation("Saturation", Range(0,2)) = 1.0 - _Brightness("Brightness", Range(0,2)) = 1.0 - - _RimPower("Rim Power", Float) = 2.0 + _Saturation("Saturation", Range(0,2)) = 1.0 + _Brightness("Brightness", Range(0,2)) = 1.0 + + _RimPower("Rim Power", Float) = 2.0 _RimColor ("Rim Color", Color) = (1,1,1,1) - + _BlendTex ("Blend Texture", 2D) = "white" {} _BlendAmount ("Blend", Range(0,1)) = 0.0 - + [HideInInspector] _SrcBlend ("__src", Float) = 1.0 [HideInInspector] _DstBlend ("__dst", Float) = 0.0 [HideInInspector] _RenderQueue ("__queue", Float) = 0.0 [HideInInspector] _Cull ("__cull", Float) = 0.0 [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default } - + SubShader { Tags { "Queue"="Transparent" "RenderType"="Sprite" "AlphaDepth"="False" "CanUseSpriteAtlas"="True" "IgnoreProjector"="True" } @@ -65,44 +58,43 @@ Shader "Spine/Sprite/Vertex Lit" Comp[_StencilComp] Pass Keep } - + Pass { - Name "Vertex" + Name "Vertex" Tags { "LightMode" = "Vertex" } Blend [_SrcBlend] [_DstBlend] ZWrite [_ZWrite] ZTest LEqual Cull [_Cull] Lighting On - + CGPROGRAM #pragma target 3.0 - + #pragma shader_feature _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ADDITIVEBLEND _ADDITIVEBLEND_SOFT _MULTIPLYBLEND _MULTIPLYBLEND_X2 - #pragma shader_feature _ _FIXED_NORMALS_VIEWSPACE _FIXED_NORMALS_VIEWSPACE_BACKFACE _FIXED_NORMALS_MODELSPACE _FIXED_NORMALS_MODELSPACE_BACKFACE _FIXED_NORMALS_WORLDSPACE + #pragma shader_feature _ _FIXED_NORMALS_VIEWSPACE _FIXED_NORMALS_VIEWSPACE_BACKFACE _FIXED_NORMALS_MODELSPACE _FIXED_NORMALS_MODELSPACE_BACKFACE #pragma shader_feature _ _SPECULAR _SPECULAR_GLOSSMAP #pragma shader_feature _NORMALMAP #pragma shader_feature _ALPHA_CLIP #pragma shader_feature _EMISSION #pragma shader_feature _DIFFUSE_RAMP - #pragma shader_feature _ _FULLRANGE_HARD_RAMP _FULLRANGE_SOFT_RAMP _OLD_HARD_RAMP _OLD_SOFT_RAMP #pragma shader_feature _COLOR_ADJUST #pragma shader_feature _RIM_LIGHTING #pragma shader_feature _TEXTURE_BLEND #pragma shader_feature _SPHERICAL_HARMONICS #pragma shader_feature _FOG - - + + #pragma fragmentoption ARB_precision_hint_fastest #pragma multi_compile_fog #pragma multi_compile _ PIXELSNAP_ON #pragma multi_compile _ ETC1_EXTERNAL_ALPHA - + #pragma vertex vert #pragma fragment frag - - #include "CGIncludes/SpriteVertexLighting.cginc" + + #include "CGIncludes/SpriteVertexLighting.cginc" ENDCG } Pass @@ -110,27 +102,27 @@ Shader "Spine/Sprite/Vertex Lit" Name "ShadowCaster" Tags { "LightMode"="ShadowCaster" } Offset 1, 1 - + Fog { Mode Off } ZWrite On ZTest LEqual Cull Off Lighting Off - - CGPROGRAM + + CGPROGRAM #pragma fragmentoption ARB_precision_hint_fastest #pragma multi_compile_shadowcaster #pragma multi_compile _ PIXELSNAP_ON #pragma multi_compile _ ETC1_EXTERNAL_ALPHA - + #pragma vertex vert #pragma fragment frag - + #include "CGIncludes/SpriteShadows.cginc" ENDCG } } - + FallBack "Spine/Sprite/Unlit" CustomEditor "SpineSpriteShaderGUI" } diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesVertexLit.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesVertexLit.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Sprite/SpritesVertexLit.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpritesVertexLit.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic.meta similarity index 67% rename from Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic.meta index 0314067e8..dfa68ee1a 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 7a42d52714848d64f8ff99dddb93500e +guid: 6338355ec521d6848bb8ef1e10272b3e folderAsset: yes -timeCreated: 1563289150 +timeCreated: 1455493504 licenseType: Free DefaultImporter: userData: diff --git a/Assets/Spine/Runtime/spine-unity/Components/Following/BoneFollowerGraphic.cs b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/BoneFollowerGraphic.cs similarity index 60% rename from Assets/Spine/Runtime/spine-unity/Components/Following/BoneFollowerGraphic.cs rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/BoneFollowerGraphic.cs index 6d5ea7bef..47bdd4548 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/Following/BoneFollowerGraphic.cs +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/BoneFollowerGraphic.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -33,18 +33,15 @@ using UnityEngine; - namespace Spine.Unity { - using AxisOrientation = BoneFollower.AxisOrientation; - + #if NEW_PREFAB_SYSTEM [ExecuteAlways] #else [ExecuteInEditMode] #endif - [RequireComponent(typeof(RectTransform)), DisallowMultipleComponent] + [DisallowMultipleComponent] [AddComponentMenu("Spine/UI/BoneFollowerGraphic")] - [HelpURL("http://esotericsoftware.com/spine-unity#BoneFollowerGraphic")] public class BoneFollowerGraphic : MonoBehaviour { public SkeletonGraphic skeletonGraphic; public SkeletonGraphic SkeletonGraphic { @@ -59,20 +56,14 @@ namespace Spine.Unity { /// If a bone isn't set in code, boneName is used to find the bone at the beginning. For runtime switching by name, use SetBoneByName. You can also set the BoneFollower.bone field directly. [SpineBone(dataField: "skeletonGraphic")] - public string boneName; + [SerializeField] public string boneName; public bool followBoneRotation = true; [Tooltip("Follows the skeleton's flip state by controlling this Transform's local scale.")] public bool followSkeletonFlip = true; [Tooltip("Follows the target bone's local scale. BoneFollower cannot inherit world/skewed scale because of UnityEngine.Transform property limitations.")] public bool followLocalScale = false; - public bool followXYPosition = true; public bool followZPosition = true; - [Tooltip("Applies when 'Follow Skeleton Flip' is disabled but 'Follow Bone Rotation' is enabled." - + " When flipping the skeleton by scaling its Transform, this follower's rotation is adjusted" - + " instead of its scale to follow the bone orientation. When one of the axes is flipped, " - + " only one axis can be followed, either the X or the Y axis, which is selected here.")] - public AxisOrientation maintainedAxisOrientation = AxisOrientation.XAxis; [System.NonSerialized] public Bone bone; @@ -139,56 +130,36 @@ namespace Spine.Unity { var canvas = skeletonGraphic.canvas; if (canvas == null) canvas = skeletonGraphic.GetComponentInParent(); - float scale = canvas != null ? canvas.referencePixelsPerUnit : 100.0f; + float scale = canvas.referencePixelsPerUnit; - float additionalFlipScale = 1; if (skeletonTransformIsParent) { // Recommended setup: Use local transform properties if Spine GameObject is the immediate parent - thisTransform.localPosition = new Vector3(followXYPosition ? bone.worldX * scale : thisTransform.localPosition.x, - followXYPosition ? bone.worldY * scale : thisTransform.localPosition.y, - followZPosition ? 0f : thisTransform.localPosition.z); + thisTransform.localPosition = new Vector3(bone.worldX * scale, bone.worldY * scale, followZPosition ? 0f : thisTransform.localPosition.z); if (followBoneRotation) thisTransform.localRotation = bone.GetQuaternion(); } else { // For special cases: Use transform world properties if transform relationship is complicated Vector3 targetWorldPosition = skeletonTransform.TransformPoint(new Vector3(bone.worldX * scale, bone.worldY * scale, 0f)); if (!followZPosition) targetWorldPosition.z = thisTransform.position.z; - if (!followXYPosition) { - targetWorldPosition.x = thisTransform.position.x; - targetWorldPosition.y = thisTransform.position.y; + + float boneWorldRotation = bone.WorldRotationX; + + Transform transformParent = thisTransform.parent; + if (transformParent != null) { + Matrix4x4 m = transformParent.localToWorldMatrix; + if (m.m00 * m.m11 - m.m01 * m.m10 < 0) // Determinant2D is negative + boneWorldRotation = -boneWorldRotation; } - Vector3 skeletonLossyScale = skeletonTransform.lossyScale; - Transform transformParent = thisTransform.parent; - Vector3 parentLossyScale = transformParent != null ? transformParent.lossyScale : Vector3.one; if (followBoneRotation) { - float boneWorldRotation = bone.WorldRotationX; - - if ((skeletonLossyScale.x * skeletonLossyScale.y) < 0) - boneWorldRotation = -boneWorldRotation; - - if (followSkeletonFlip || maintainedAxisOrientation == AxisOrientation.XAxis) { - if ((skeletonLossyScale.x * parentLossyScale.x < 0)) - boneWorldRotation += 180f; - } - else { - if ((skeletonLossyScale.y * parentLossyScale.y < 0)) - boneWorldRotation += 180f; - } - Vector3 worldRotation = skeletonTransform.rotation.eulerAngles; - if (followLocalScale && bone.scaleX < 0) boneWorldRotation += 180f; - thisTransform.SetPositionAndRotation(targetWorldPosition, Quaternion.Euler(worldRotation.x, worldRotation.y, worldRotation.z + boneWorldRotation)); + thisTransform.SetPositionAndRotation(targetWorldPosition, Quaternion.Euler(worldRotation.x, worldRotation.y, skeletonTransform.rotation.eulerAngles.z + boneWorldRotation)); } else { thisTransform.position = targetWorldPosition; } - - additionalFlipScale = Mathf.Sign(skeletonLossyScale.x * parentLossyScale.x - * skeletonLossyScale.y * parentLossyScale.y); } Vector3 localScale = followLocalScale ? new Vector3(bone.scaleX, bone.scaleY, 1f) : new Vector3(1f, 1f, 1f); - if (followSkeletonFlip) - localScale.y *= Mathf.Sign(bone.skeleton.ScaleX * bone.skeleton.ScaleY) * additionalFlipScale; + if (followSkeletonFlip) localScale.y *= Mathf.Sign(bone.skeleton.scaleX * bone.skeleton.scaleY); thisTransform.localScale = localScale; } diff --git a/Assets/Spine/Runtime/spine-unity/Components/Following/BoneFollowerGraphic.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/BoneFollowerGraphic.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/Following/BoneFollowerGraphic.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/BoneFollowerGraphic.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Materials.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Materials.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders.meta diff --git a/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicDefault.mat b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/SkeletonGraphicDefault.mat similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicDefault.mat rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/SkeletonGraphicDefault.mat diff --git a/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicDefault.mat.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/SkeletonGraphicDefault.mat.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicDefault.mat.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/SkeletonGraphicDefault.mat.meta diff --git a/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicTintBlack.mat b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/SkeletonGraphicTintBlack.mat similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicTintBlack.mat rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/SkeletonGraphicTintBlack.mat diff --git a/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicTintBlack.mat.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/SkeletonGraphicTintBlack.mat.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicTintBlack.mat.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/SkeletonGraphicTintBlack.mat.meta diff --git a/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/Spine-SkeletonGraphic-TintBlack.shader b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/Spine-SkeletonGraphic-TintBlack.shader new file mode 100644 index 000000000..f31d0a20e --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/Spine-SkeletonGraphic-TintBlack.shader @@ -0,0 +1,125 @@ +// This is a premultiply-alpha adaptation of the built-in Unity shader "UI/Default" to allow Unity UI stencil masking. + +Shader "Spine/SkeletonGraphic Tint Black" +{ + Properties + { + [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} + [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 + + _Color ("Tint", Color) = (1,1,1,1) + _Black ("Black Point", Color) = (0,0,0,0) + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + + _ColorMask ("Color Mask", Float) = 15 + + [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 + } + + SubShader + { + Tags + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" + "PreviewType"="Plane" + "CanUseSpriteAtlas"="True" + } + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Cull Off + Lighting Off + ZWrite Off + ZTest [unity_GUIZTestMode] + Fog { Mode Off } + Blend One OneMinusSrcAlpha + ColorMask [_ColorMask] + + Pass + { + CGPROGRAM + #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + #include "UnityUI.cginc" + + #pragma multi_compile __ UNITY_UI_ALPHACLIP + + struct VertexInput { + float4 vertex : POSITION; + float4 color : COLOR; + float2 texcoord : TEXCOORD0; + float2 uv1 : TEXCOORD1; + float2 uv2 : TEXCOORD2; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct VertexOutput { + float4 vertex : SV_POSITION; + fixed4 color : COLOR; + half2 texcoord : TEXCOORD0; + float2 uv1 : TEXCOORD1; + float2 uv2 : TEXCOORD2; + float4 worldPosition : TEXCOORD3; + UNITY_VERTEX_OUTPUT_STEREO + }; + + fixed4 _Color; + fixed4 _Black; + fixed4 _TextureSampleAdd; + float4 _ClipRect; + + VertexOutput vert (VertexInput IN) { + VertexOutput OUT; + + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); + + OUT.worldPosition = IN.vertex; + OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); + OUT.texcoord = IN.texcoord; + + OUT.color = IN.color * float4(_Color.rgb * _Color.a, _Color.a); // Combine a PMA version of _Color with vertexColor. + OUT.uv1 = IN.uv1; + OUT.uv2 = IN.uv2; + return OUT; + } + + sampler2D _MainTex; + + fixed4 frag (VertexOutput IN) : SV_Target + { + half4 texColor = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd); + + #if defined(_STRAIGHT_ALPHA_INPUT) + texColor.rgb *= texColor.a; + #endif + + texColor *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); + + #ifdef UNITY_UI_ALPHACLIP + clip (texColor.a - 0.001); + #endif + + return (texColor * IN.color) + float4(((1-texColor.rgb) * (_Black.rgb + float3(IN.uv1.r, IN.uv1.g, IN.uv2.r)) * texColor.a * _Color.a * IN.color.a), 0); + } + ENDCG + } + } +} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic/Spine-SkeletonGraphic-TintBlack.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/Spine-SkeletonGraphic-TintBlack.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic/Spine-SkeletonGraphic-TintBlack.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/Spine-SkeletonGraphic-TintBlack.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic/Spine-SkeletonGraphic.shader b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/Spine-SkeletonGraphic.shader similarity index 60% rename from Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic/Spine-SkeletonGraphic.shader rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/Spine-SkeletonGraphic.shader index d01657b0c..c570c6585 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic/Spine-SkeletonGraphic.shader +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/Spine-SkeletonGraphic.shader @@ -6,45 +6,35 @@ Shader "Spine/SkeletonGraphic" { [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - [Toggle(_CANVAS_GROUP_COMPATIBLE)] _CanvasGroupCompatible("CanvasGroup Compatible", Int) = 0 _Color ("Tint", Color) = (1,1,1,1) + + _StencilComp ("Stencil Comparison", Float) = 8 + _Stencil ("Stencil ID", Float) = 0 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Float) = 8 - [HideInInspector] _Stencil ("Stencil ID", Float) = 0 - [HideInInspector][Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Float) = 0 - [HideInInspector] _StencilWriteMask ("Stencil Write Mask", Float) = 255 - [HideInInspector] _StencilReadMask ("Stencil Read Mask", Float) = 255 - - [HideInInspector] _ColorMask ("Color Mask", Float) = 15 + _ColorMask ("Color Mask", Float) = 15 [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 } SubShader { Tags - { - "Queue"="Transparent" - "IgnoreProjector"="True" - "RenderType"="Transparent" + { + "Queue"="Transparent" + "IgnoreProjector"="True" + "RenderType"="Transparent" "PreviewType"="Plane" "CanUseSpriteAtlas"="True" } - + Stencil { Ref [_Stencil] Comp [_StencilComp] - Pass [_StencilOp] + Pass [_StencilOp] ReadMask [_StencilReadMask] WriteMask [_StencilWriteMask] } @@ -59,11 +49,8 @@ Shader "Spine/SkeletonGraphic" Pass { - Name "Normal" - CGPROGRAM #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT - #pragma shader_feature _ _CANVAS_GROUP_COMPATIBLE #pragma vertex vert #pragma fragment frag #pragma target 2.0 @@ -121,10 +108,6 @@ Shader "Spine/SkeletonGraphic" #endif half4 color = (texColor + _TextureSampleAdd) * IN.color; - #ifdef _CANVAS_GROUP_COMPATIBLE - // CanvasGroup alpha sets vertex color alpha, but does not premultiply it to rgb components. - color.rgb *= IN.color.a; - #endif color *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); @@ -137,5 +120,4 @@ Shader "Spine/SkeletonGraphic" ENDCG } } - CustomEditor "SpineShaderWithOutlineGUI" -} +} \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic/Spine-SkeletonGraphic.shader.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/Spine-SkeletonGraphic.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic/Spine-SkeletonGraphic.shader.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/Shaders/Spine-SkeletonGraphic.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphic.cs b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphic.cs new file mode 100644 index 000000000..75dc49e7e --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphic.cs @@ -0,0 +1,327 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER +#define NEW_PREFAB_SYSTEM +#endif + +using UnityEngine; +using UnityEngine.UI; + +namespace Spine.Unity { + #if NEW_PREFAB_SYSTEM + [ExecuteAlways] + #else + [ExecuteInEditMode] + #endif + [RequireComponent(typeof(CanvasRenderer), typeof(RectTransform)), DisallowMultipleComponent] + [AddComponentMenu("Spine/SkeletonGraphic (Unity UI Canvas)")] + public class SkeletonGraphic : MaskableGraphic, ISkeletonComponent, IAnimationStateComponent, ISkeletonAnimation, IHasSkeletonDataAsset { + + #region Inspector + public SkeletonDataAsset skeletonDataAsset; + public SkeletonDataAsset SkeletonDataAsset { get { return skeletonDataAsset; } } + + [SpineSkin(dataField:"skeletonDataAsset", defaultAsEmptyString:true)] + public string initialSkinName; + public bool initialFlipX, initialFlipY; + + [SpineAnimation(dataField:"skeletonDataAsset")] + public string startingAnimation; + public bool startingLoop; + public float timeScale = 1f; + public bool freeze; + public bool unscaledTime; + + #if UNITY_EDITOR + protected override void OnValidate () { + // This handles Scene View preview. + base.OnValidate (); + if (this.IsValid) { + if (skeletonDataAsset == null) { + Clear(); + } else if (skeletonDataAsset.skeletonJSON == null) { + Clear(); + } else if (skeletonDataAsset.GetSkeletonData(true) != skeleton.data) { + Clear(); + Initialize(true); + if (skeletonDataAsset.atlasAssets.Length > 1 || skeletonDataAsset.atlasAssets[0].MaterialCount > 1) + Debug.LogError("Unity UI does not support multiple textures per Renderer. Your skeleton will not be rendered correctly. Recommend using SkeletonAnimation instead. This requires the use of a Screen space camera canvas."); + } else { + if (freeze) return; + + if (!string.IsNullOrEmpty(initialSkinName)) { + var skin = skeleton.data.FindSkin(initialSkinName); + if (skin != null) { + if (skin == skeleton.data.defaultSkin) + skeleton.SetSkin((Skin)null); + else + skeleton.SetSkin(skin); + } + + } + + // Only provide visual feedback to inspector changes in Unity Editor Edit mode. + if (!Application.isPlaying) { + skeleton.scaleX = this.initialFlipX ? -1 : 1; + skeleton.scaleY = this.initialFlipY ? -1 : 1; + + skeleton.SetToSetupPose(); + if (!string.IsNullOrEmpty(startingAnimation)) + skeleton.PoseWithAnimation(startingAnimation, 0f, false); + } + + } + } else { + // Under some circumstances (e.g. sometimes on the first import) OnValidate is called + // before SpineEditorUtilities.ImportSpineContent, causing an unnecessary exception. + // The (skeletonDataAsset.skeletonJSON != null) condition serves to prevent this exception. + if (skeletonDataAsset != null && skeletonDataAsset.skeletonJSON != null) + Initialize(true); + } + } + + protected override void Reset () { + + base.Reset(); + if (material == null || material.shader != Shader.Find("Spine/SkeletonGraphic")) + Debug.LogWarning("SkeletonGraphic works best with the SkeletonGraphic material."); + } + #endif + #endregion + + #region Runtime Instantiation + /// Create a new GameObject with a SkeletonGraphic component. + /// Material for the canvas renderer to use. Usually, the default SkeletonGraphic material will work. + public static SkeletonGraphic NewSkeletonGraphicGameObject (SkeletonDataAsset skeletonDataAsset, Transform parent, Material material) { + var sg = SkeletonGraphic.AddSkeletonGraphicComponent(new GameObject("New Spine GameObject"), skeletonDataAsset, material); + if (parent != null) sg.transform.SetParent(parent, false); + return sg; + } + + /// Add a SkeletonGraphic component to a GameObject. + /// Material for the canvas renderer to use. Usually, the default SkeletonGraphic material will work. + public static SkeletonGraphic AddSkeletonGraphicComponent (GameObject gameObject, SkeletonDataAsset skeletonDataAsset, Material material) { + var c = gameObject.AddComponent(); + if (skeletonDataAsset != null) { + c.material = material; + c.skeletonDataAsset = skeletonDataAsset; + c.Initialize(false); + } + return c; + } + #endregion + + #region Internals + // This is used by the UI system to determine what to put in the MaterialPropertyBlock. + Texture overrideTexture; + public Texture OverrideTexture { + get { return overrideTexture; } + set { + overrideTexture = value; + canvasRenderer.SetTexture(this.mainTexture); // Refresh canvasRenderer's texture. Make sure it handles null. + } + } + public override Texture mainTexture { + get { + // Fail loudly when incorrectly set up. + if (overrideTexture != null) return overrideTexture; + return skeletonDataAsset == null ? null : skeletonDataAsset.atlasAssets[0].PrimaryMaterial.mainTexture; + } + } + + protected override void Awake () { + + base.Awake (); + if (!this.IsValid) { +#if UNITY_EDITOR + // workaround for special import case of open scene where OnValidate and Awake are + // called in wrong order, before setup of Spine assets. + if (!Application.isPlaying) { + if (this.skeletonDataAsset != null && this.skeletonDataAsset.skeletonJSON == null) + return; + } +#endif + Initialize(false); + Rebuild(CanvasUpdate.PreRender); + } + } + + public override void Rebuild (CanvasUpdate update) { + base.Rebuild(update); + if (canvasRenderer.cull) return; + if (update == CanvasUpdate.PreRender) UpdateMesh(); + } + + public virtual void Update () { + if (freeze) return; + Update(unscaledTime ? Time.unscaledDeltaTime : Time.deltaTime); + } + + public virtual void Update (float deltaTime) { + if (!this.IsValid) return; + + deltaTime *= timeScale; + skeleton.Update(deltaTime); + state.Update(deltaTime); + state.Apply(skeleton); + + if (UpdateLocal != null) UpdateLocal(this); + + skeleton.UpdateWorldTransform(); + + if (UpdateWorld != null) { + UpdateWorld(this); + skeleton.UpdateWorldTransform(); + } + + if (UpdateComplete != null) UpdateComplete(this); + } + + public void LateUpdate () { + if (freeze) return; + //this.SetVerticesDirty(); // Which is better? + UpdateMesh(); + } + #endregion + + #region API + protected Skeleton skeleton; + public Skeleton Skeleton { get { return skeleton; } internal set { skeleton = value; } } + public SkeletonData SkeletonData { get { return skeleton == null ? null : skeleton.data; } } + public bool IsValid { get { return skeleton != null; } } + + protected Spine.AnimationState state; + public Spine.AnimationState AnimationState { get { return state; } } + + [SerializeField] protected Spine.Unity.MeshGenerator meshGenerator = new MeshGenerator(); + public Spine.Unity.MeshGenerator MeshGenerator { get { return this.meshGenerator; } } + DoubleBuffered meshBuffers; + SkeletonRendererInstruction currentInstructions = new SkeletonRendererInstruction(); + + public Mesh GetLastMesh () { + return meshBuffers.GetCurrent().mesh; + } + + public event UpdateBonesDelegate UpdateLocal; + public event UpdateBonesDelegate UpdateWorld; + public event UpdateBonesDelegate UpdateComplete; + + /// Occurs after the vertex data populated every frame, before the vertices are pushed into the mesh. + public event Spine.Unity.MeshGeneratorDelegate OnPostProcessVertices; + + public void Clear () { + skeleton = null; + canvasRenderer.Clear(); + } + + public void Initialize (bool overwrite) { + if (this.IsValid && !overwrite) return; + + // Make sure none of the stuff is null + if (this.skeletonDataAsset == null) return; + var skeletonData = this.skeletonDataAsset.GetSkeletonData(false); + if (skeletonData == null) return; + + if (skeletonDataAsset.atlasAssets.Length <= 0 || skeletonDataAsset.atlasAssets[0].MaterialCount <= 0) return; + + this.state = new Spine.AnimationState(skeletonDataAsset.GetAnimationStateData()); + if (state == null) { + Clear(); + return; + } + + this.skeleton = new Skeleton(skeletonData) { + scaleX = this.initialFlipX ? -1 : 1, + scaleY = this.initialFlipY ? -1 : 1 + }; + + meshBuffers = new DoubleBuffered(); + canvasRenderer.SetTexture(this.mainTexture); // Needed for overwriting initializations. + + // Set the initial Skin and Animation + if (!string.IsNullOrEmpty(initialSkinName)) + skeleton.SetSkin(initialSkinName); + + if (!string.IsNullOrEmpty(startingAnimation)) { + var animationObject = skeletonDataAsset.GetSkeletonData(false).FindAnimation(startingAnimation); + if (animationObject != null) { + animationObject.PoseSkeleton(skeleton, 0f); + skeleton.UpdateWorldTransform(); + + #if UNITY_EDITOR + if (Application.isPlaying) { + #endif + + // Make this block not run in Unity Editor edit mode. + state.SetAnimation(0, animationObject, startingLoop); + + #if UNITY_EDITOR + } + #endif + } + else { + startingAnimation = string.Empty; + } + } + } + + public void UpdateMesh () { + if (!this.IsValid) return; + + skeleton.SetColor(this.color); + var smartMesh = meshBuffers.GetNext(); + var currentInstructions = this.currentInstructions; + + MeshGenerator.GenerateSingleSubmeshInstruction(currentInstructions, skeleton, this.material); + bool updateTriangles = SkeletonRendererInstruction.GeometryNotEqual(currentInstructions, smartMesh.instructionUsed); + + meshGenerator.Begin(); + if (currentInstructions.hasActiveClipping) { + meshGenerator.AddSubmesh(currentInstructions.submeshInstructions.Items[0], updateTriangles); + } else { + meshGenerator.BuildMeshWithArrays(currentInstructions, updateTriangles); + } + + if (canvas != null) meshGenerator.ScaleVertexData(canvas.referencePixelsPerUnit); + if (OnPostProcessVertices != null) OnPostProcessVertices.Invoke(this.meshGenerator.Buffers); + + var mesh = smartMesh.mesh; + meshGenerator.FillVertexData(mesh); + if (updateTriangles) meshGenerator.FillTrianglesSingle(mesh); + meshGenerator.FillLateVertexData(mesh); + + canvasRenderer.SetMesh(mesh); + smartMesh.instructionUsed.Set(currentInstructions); + + //this.UpdateMaterial(); // TODO: This allocates memory. + } + #endregion + } +} diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphic.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphic.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphicMirror.cs b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphicMirror.cs new file mode 100644 index 000000000..8e59a72f4 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphicMirror.cs @@ -0,0 +1,104 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Spine.Unity.Modules { + public class SkeletonGraphicMirror : MonoBehaviour { + + public SkeletonRenderer source; + public bool mirrorOnStart = true; + public bool restoreOnDisable = true; + SkeletonGraphic skeletonGraphic; + + Skeleton originalSkeleton; + bool originalFreeze; + Texture2D overrideTexture; + + private void Awake () { + skeletonGraphic = GetComponent(); + } + + void Start () { + if (mirrorOnStart) + StartMirroring(); + } + + void LateUpdate () { + skeletonGraphic.UpdateMesh(); + } + + void OnDisable () { + if (restoreOnDisable) + RestoreIndependentSkeleton(); + } + + /// Freeze the SkeletonGraphic on this GameObject, and use the source as the Skeleton to be rendered by the SkeletonGraphic. + public void StartMirroring () { + if (source == null) + return; + if (skeletonGraphic == null) + return; + + skeletonGraphic.startingAnimation = string.Empty; + + if (originalSkeleton == null) { + originalSkeleton = skeletonGraphic.Skeleton; + originalFreeze = skeletonGraphic.freeze; + } + + skeletonGraphic.Skeleton = source.skeleton; + skeletonGraphic.freeze = true; + if (overrideTexture != null) + skeletonGraphic.OverrideTexture = overrideTexture; + } + + /// Use a new texture for the SkeletonGraphic. Use this if your source skeleton uses a repacked atlas. + public void UpdateTexture (Texture2D newOverrideTexture) { + overrideTexture = newOverrideTexture; + if (newOverrideTexture != null) + skeletonGraphic.OverrideTexture = overrideTexture; + } + + /// Stops mirroring the source SkeletonRenderer and allows the SkeletonGraphic to become an independent Skeleton component again. + public void RestoreIndependentSkeleton () { + if (originalSkeleton == null) + return; + + skeletonGraphic.Skeleton = originalSkeleton; + skeletonGraphic.freeze = originalFreeze; + skeletonGraphic.OverrideTexture = null; + + originalSkeleton = null; + } + } + +} diff --git a/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphicMirror.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphicMirror.cs.meta new file mode 100644 index 000000000..3e0f6bc55 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphicMirror.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: dbeb0b9949e46754eb0e0b61021b4f1c +timeCreated: 1532024358 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator.meta diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonPartsRenderer.cs b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonPartsRenderer.cs similarity index 74% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonPartsRenderer.cs rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonPartsRenderer.cs index cb3479aa8..6843f96d9 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonPartsRenderer.cs +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonPartsRenderer.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,23 +15,22 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEngine; -namespace Spine.Unity { +namespace Spine.Unity.Modules { [RequireComponent(typeof(MeshRenderer), typeof(MeshFilter))] - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonRenderSeparator")] public class SkeletonPartsRenderer : MonoBehaviour { #region Properties @@ -60,14 +59,6 @@ namespace Spine.Unity { } #endregion - #region Callback Delegates - public delegate void SkeletonPartsRendererDelegate (SkeletonPartsRenderer skeletonPartsRenderer); - - /// OnMeshAndMaterialsUpdated is called at the end of LateUpdate after the Mesh and - /// all materials have been updated. - public event SkeletonPartsRendererDelegate OnMeshAndMaterialsUpdated; - #endregion - MeshRendererBuffers buffers; SkeletonRendererInstruction currentInstructions = new SkeletonRendererInstruction(); @@ -129,9 +120,6 @@ namespace Spine.Unity { meshFilter.sharedMesh = mesh; smartMesh.instructionUsed.Set(currentInstructions); - - if (OnMeshAndMaterialsUpdated != null) - OnMeshAndMaterialsUpdated(this); } public void SetPropertyBlock (MaterialPropertyBlock block) { diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonPartsRenderer.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonPartsRenderer.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonPartsRenderer.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonPartsRenderer.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonRenderSeparator.cs b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.cs similarity index 82% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonRenderSeparator.cs rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.cs index d2d187ef2..e2c37647b 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonRenderSeparator.cs +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -35,14 +35,14 @@ using UnityEngine; using System.Collections.Generic; -namespace Spine.Unity { +namespace Spine.Unity.Modules { #if NEW_PREFAB_SYSTEM [ExecuteAlways] #else [ExecuteInEditMode] #endif - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonRenderSeparator")] + [HelpURL("http://esotericsoftware.com/spine-unity-skeletonrenderseparator")] public class SkeletonRenderSeparator : MonoBehaviour { public const int DefaultSortingOrderIncrement = 5; @@ -56,7 +56,7 @@ namespace Spine.Unity { if (skeletonRenderer != null) skeletonRenderer.GenerateMeshOverride -= HandleRender; #endif - + skeletonRenderer = value; if (value == null) this.enabled = false; @@ -67,7 +67,7 @@ namespace Spine.Unity { public bool copyPropertyBlock = true; [Tooltip("Copies MeshRenderer flags into each parts renderer")] public bool copyMeshRendererFlags = true; - public List partsRenderers = new List(); + public List partsRenderers = new List(); #if UNITY_EDITOR void Reset () { @@ -77,12 +77,6 @@ namespace Spine.Unity { #endif #endregion - #region Callback Delegates - /// OnMeshAndMaterialsUpdated is called at the end of LateUpdate after the Mesh and - /// all materials have been updated. - public event SkeletonRenderer.SkeletonRendererDelegate OnMeshAndMaterialsUpdated; - #endregion - #region Runtime Instantiation /// Adds a SkeletonRenderSeparator and child SkeletonPartsRenderer GameObjects to a given SkeletonRenderer. /// The to skeleton renderer. @@ -158,7 +152,7 @@ namespace Spine.Unity { public void OnEnable () { if (skeletonRenderer == null) return; - if (copiedBlock == null) copiedBlock = new MaterialPropertyBlock(); + if (copiedBlock == null) copiedBlock = new MaterialPropertyBlock(); mainMeshRenderer = skeletonRenderer.GetComponent(); #if SPINE_OPTIONAL_RENDEROVERRIDE @@ -197,10 +191,8 @@ namespace Spine.Unity { skeletonRenderer.LateUpdate(); - foreach (var partsRenderer in partsRenderers) { - if (partsRenderer != null) - partsRenderer.ClearMesh(); - } + foreach (var s in partsRenderers) + s.ClearMesh(); } MaterialPropertyBlock copiedBlock; @@ -229,8 +221,6 @@ namespace Spine.Unity { int rendererIndex = 0; var currentRenderer = partsRenderers[rendererIndex]; for (int si = 0, start = 0; si <= lastSubmeshInstruction; si++) { - if (currentRenderer == null) - continue; if (submeshInstructionsItems[si].forceSeparate || si == lastSubmeshInstruction) { // Apply properties var meshGenerator = currentRenderer.MeshGenerator; @@ -252,15 +242,10 @@ namespace Spine.Unity { } } } - - if (OnMeshAndMaterialsUpdated != null) - OnMeshAndMaterialsUpdated(this.skeletonRenderer); - + // Clear extra renderers if they exist. for (; rendererIndex < rendererCount; rendererIndex++) { - currentRenderer = partsRenderers[rendererIndex]; - if (currentRenderer != null) - partsRenderers[rendererIndex].ClearMesh(); + partsRenderers[rendererIndex].ClearMesh(); } } diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonRenderSeparator.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonRenderSeparator.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.txt b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.txt new file mode 100644 index 000000000..c42f929ac --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.txt @@ -0,0 +1,6 @@ +SkeletonRenderSeparator +======================= + +Dependencies: +- SkeletonPartsRenderer uses the `ArraysMeshGenerator` class in `Spine.Unity.MeshGeneration` +- It requires `SPINE_OPTIONAL_RENDEROVERRIDE` to be #defined in `SkeletonRenderer.cs`. diff --git a/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicTintBlackOutline.mat.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.txt.meta similarity index 52% rename from Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicTintBlackOutline.mat.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.txt.meta index a884c7e35..5dd3c994d 100644 --- a/Assets/Spine/Runtime/spine-unity/Materials/SkeletonGraphicTintBlackOutline.mat.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.txt.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: 94fe565c79b0aeb418cd05e4f1f8343c -timeCreated: 1455140322 +guid: f0e413eeb00eabc46bde6dbd7aaaa76c +timeCreated: 1469110129 licenseType: Free -NativeFormatImporter: +TextScriptImporter: userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules.meta new file mode 100644 index 000000000..4f84211da --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d81fbd54cb5cab844900eaa11c48a907 +folderAsset: yes +timeCreated: 1455489575 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityEyeConstraint.cs b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityEyeConstraint.cs new file mode 100644 index 000000000..888e17fa6 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityEyeConstraint.cs @@ -0,0 +1,79 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +using UnityEngine; +using System.Collections; + +namespace Spine.Unity.Modules { + public class SkeletonUtilityEyeConstraint : SkeletonUtilityConstraint { + public Transform[] eyes; + public float radius = 0.5f; + public Transform target; + public Vector3 targetPosition; + public float speed = 10; + Vector3[] origins; + Vector3 centerPoint; + + protected override void OnEnable () { + if (!Application.isPlaying) return; + base.OnEnable(); + + Bounds centerBounds = new Bounds(eyes[0].localPosition, Vector3.zero); + origins = new Vector3[eyes.Length]; + for (int i = 0; i < eyes.Length; i++) { + origins[i] = eyes[i].localPosition; + centerBounds.Encapsulate(origins[i]); + } + + centerPoint = centerBounds.center; + } + + protected override void OnDisable () { + if (!Application.isPlaying) return; + base.OnDisable(); + } + + public override void DoUpdate () { + if (target != null) targetPosition = target.position; + + Vector3 goal = targetPosition; + Vector3 center = transform.TransformPoint(centerPoint); + Vector3 dir = goal - center; + + if (dir.magnitude > 1) + dir.Normalize(); + + for (int i = 0; i < eyes.Length; i++) { + center = transform.TransformPoint(origins[i]); + eyes[i].position = Vector3.MoveTowards(eyes[i].position, center + (dir * radius), speed * Time.deltaTime); + } + + } + } +} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerGraphicInspector.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityEyeConstraint.cs.meta similarity index 74% rename from Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerGraphicInspector.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityEyeConstraint.cs.meta index 159606951..18e153cf2 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Components/BoundingBoxFollowerGraphicInspector.cs.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityEyeConstraint.cs.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 -guid: 7c4f5b276299bc048ad00f3cd2d1ea09 +guid: 0d994c65b6daec64f80ae2ae04e9d999 MonoImporter: - externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityGroundConstraint.cs b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityGroundConstraint.cs new file mode 100644 index 000000000..238db6a5c --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityGroundConstraint.cs @@ -0,0 +1,138 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER +#define NEW_PREFAB_SYSTEM +#endif + +using UnityEngine; + +namespace Spine.Unity.Modules { + + #if NEW_PREFAB_SYSTEM + [ExecuteAlways] + #else + [ExecuteInEditMode] + #endif + [RequireComponent(typeof(SkeletonUtilityBone))] + public class SkeletonUtilityGroundConstraint : SkeletonUtilityConstraint { + + [Tooltip("LayerMask for what objects to raycast against")] + public LayerMask groundMask; + [Tooltip("Use 2D")] + public bool use2D = false; + [Tooltip("Uses SphereCast for 3D mode and CircleCast for 2D mode")] + public bool useRadius = false; + [Tooltip("The Radius")] + public float castRadius = 0.1f; + [Tooltip("How high above the target bone to begin casting from")] + public float castDistance = 5f; + [Tooltip("X-Axis adjustment")] + public float castOffset = 0; + [Tooltip("Y-Axis adjustment")] + public float groundOffset = 0; + [Tooltip("How fast the target IK position adjusts to the ground. Use smaller values to prevent snapping")] + public float adjustSpeed = 5; + + Vector3 rayOrigin; + Vector3 rayDir = new Vector3(0, -1, 0); + float hitY; + float lastHitY; + + protected override void OnEnable () { + base.OnEnable(); + lastHitY = transform.position.y; + } + + public override void DoUpdate () { + rayOrigin = transform.position + new Vector3(castOffset, castDistance, 0); + + hitY = float.MinValue; + if (use2D) { + RaycastHit2D hit; + + if (useRadius) + hit = Physics2D.CircleCast(rayOrigin, castRadius, rayDir, castDistance + groundOffset, groundMask); + else + hit = Physics2D.Raycast(rayOrigin, rayDir, castDistance + groundOffset, groundMask); + + if (hit.collider != null) { + hitY = hit.point.y + groundOffset; + if (Application.isPlaying) + hitY = Mathf.MoveTowards(lastHitY, hitY, adjustSpeed * Time.deltaTime); + } else { + if (Application.isPlaying) + hitY = Mathf.MoveTowards(lastHitY, transform.position.y, adjustSpeed * Time.deltaTime); + } + } else { + RaycastHit hit; + bool validHit = false; + + if (useRadius) + validHit = Physics.SphereCast(rayOrigin, castRadius, rayDir, out hit, castDistance + groundOffset, groundMask); + else + validHit = Physics.Raycast(rayOrigin, rayDir, out hit, castDistance + groundOffset, groundMask); + + if (validHit) { + hitY = hit.point.y + groundOffset; + if (Application.isPlaying) + hitY = Mathf.MoveTowards(lastHitY, hitY, adjustSpeed * Time.deltaTime); + + } else { + if (Application.isPlaying) + hitY = Mathf.MoveTowards(lastHitY, transform.position.y, adjustSpeed * Time.deltaTime); + } + } + + Vector3 v = transform.position; + v.y = Mathf.Clamp(v.y, Mathf.Min(lastHitY, hitY), float.MaxValue); + transform.position = v; + + bone.bone.X = transform.localPosition.x; + bone.bone.Y = transform.localPosition.y; + + lastHitY = hitY; + } + + void OnDrawGizmos () { + Vector3 hitEnd = rayOrigin + (rayDir * Mathf.Min(castDistance, rayOrigin.y - hitY)); + Vector3 clearEnd = rayOrigin + (rayDir * castDistance); + Gizmos.DrawLine(rayOrigin, hitEnd); + + if (useRadius) { + Gizmos.DrawLine(new Vector3(hitEnd.x - castRadius, hitEnd.y - groundOffset, hitEnd.z), new Vector3(hitEnd.x + castRadius, hitEnd.y - groundOffset, hitEnd.z)); + Gizmos.DrawLine(new Vector3(clearEnd.x - castRadius, clearEnd.y, clearEnd.z), new Vector3(clearEnd.x + castRadius, clearEnd.y, clearEnd.z)); + } + + Gizmos.color = Color.red; + Gizmos.DrawLine(hitEnd, clearEnd); + } + } + +} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineSpriteAtlasAssetInspector.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityGroundConstraint.cs.meta similarity index 74% rename from Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineSpriteAtlasAssetInspector.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityGroundConstraint.cs.meta index 238789e90..e5474edbc 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Asset Types/SpineSpriteAtlasAssetInspector.cs.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityGroundConstraint.cs.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 -guid: f063dc5ff6881db4a9ee2e059812cba2 +guid: 3662334b99de5fe4396ab24e30c4fd12 MonoImporter: - externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityKinematicShadow.cs b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityKinematicShadow.cs new file mode 100644 index 000000000..85f922f1f --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityKinematicShadow.cs @@ -0,0 +1,137 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +using UnityEngine; +using System.Collections.Generic; + +namespace Spine.Unity.Modules { + + // SkeletonUtilityKinematicShadow allows hinge chains to inherit a velocity interpreted from changes in parent transform position or from unrelated rigidbodies. + // Note: Uncheck "useRootTransformIfNull + public class SkeletonUtilityKinematicShadow : MonoBehaviour { + #region Inspector + [Tooltip("If checked, the hinge chain can inherit your root transform's velocity or position/rotation changes.")] + public bool detachedShadow = false; + public Transform parent; + public bool hideShadow = true; + public PhysicsSystem physicsSystem = PhysicsSystem.Physics3D; + #endregion + + GameObject shadowRoot; + readonly List shadowTable = new List(); + struct TransformPair { + public Transform dest, src; + } + + public enum PhysicsSystem { + Physics2D, + Physics3D + }; + + void Start () { + // Duplicate this gameObject as the "shadow" with a different parent. + shadowRoot = Instantiate(this.gameObject); + Destroy(shadowRoot.GetComponent()); + + // Prepare shadow gameObject's properties. + var shadowRootTransform = shadowRoot.transform; + shadowRootTransform.position = transform.position; + shadowRootTransform.rotation = transform.rotation; + + Vector3 scaleRef = transform.TransformPoint(Vector3.right); + float scale = Vector3.Distance(transform.position, scaleRef); + shadowRootTransform.localScale = Vector3.one; + + if (!detachedShadow) { + // Do not change to null coalescing operator (??). Unity overloads null checks for UnityEngine.Objects but not the ?? operator. + if (parent == null) + shadowRootTransform.parent = transform.root; + else + shadowRootTransform.parent = parent; + } + + if (hideShadow) + shadowRoot.hideFlags = HideFlags.HideInHierarchy; + + var shadowJoints = shadowRoot.GetComponentsInChildren(); + foreach (Joint j in shadowJoints) + j.connectedAnchor *= scale; + + // Build list of bone pairs (matches shadow transforms with bone transforms) + var bones = GetComponentsInChildren(); + var shadowBones = shadowRoot.GetComponentsInChildren(); + foreach (var b in bones) { + if (b.gameObject == this.gameObject) + continue; + + System.Type checkType = (physicsSystem == PhysicsSystem.Physics2D) ? typeof(Rigidbody2D) : typeof(Rigidbody); + foreach (var sb in shadowBones) { + if (sb.GetComponent(checkType) != null && sb.boneName == b.boneName) { + shadowTable.Add(new TransformPair { + dest = b.transform, + src = sb.transform + }); + break; + } + } + + } + + // Destroy conflicting and unneeded components + DestroyComponents(shadowBones); + + DestroyComponents(GetComponentsInChildren()); + DestroyComponents(GetComponentsInChildren()); + DestroyComponents(GetComponentsInChildren()); + } + + static void DestroyComponents (Component[] components) { + for (int i = 0, n = components.Length; i < n; i++) + Destroy(components[i]); + } + + void FixedUpdate () { + if (physicsSystem == PhysicsSystem.Physics2D) { + var shadowRootRigidbody = shadowRoot.GetComponent(); + shadowRootRigidbody.MovePosition(transform.position); + shadowRootRigidbody.MoveRotation(transform.rotation.eulerAngles.z); + } else { + var shadowRootRigidbody = shadowRoot.GetComponent(); + shadowRootRigidbody.MovePosition(transform.position); + shadowRootRigidbody.MoveRotation(transform.rotation); + } + + for (int i = 0, n = shadowTable.Count; i < n; i++) { + var pair = shadowTable[i]; + pair.dest.localPosition = pair.src.localPosition; + pair.dest.localRotation = pair.src.localRotation; + } + } + } +} diff --git a/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityKinematicShadow.cs.meta similarity index 74% rename from Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityKinematicShadow.cs.meta index b473afef6..2b071f36f 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/Windows/SpinePreferences.cs.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/SkeletonUtility Modules/SkeletonUtilityKinematicShadow.cs.meta @@ -1,7 +1,6 @@ fileFormatVersion: 2 -guid: b29e98153ec2fbd44b8f7da1b41194e8 +guid: cfeac06b8a6aa1645813700e3e4c0863 MonoImporter: - externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Spine/Runtime/spine-unity/Deprecated/SlotBlendModes.meta b/Assets/Spine/Runtime/spine-unity/Modules/SlotBlendModes.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Deprecated/SlotBlendModes.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SlotBlendModes.meta diff --git a/Assets/Spine/Runtime/spine-unity/Deprecated/SlotBlendModes/SlotBlendModes.cs b/Assets/Spine/Runtime/spine-unity/Modules/SlotBlendModes/SlotBlendModes.cs similarity index 80% rename from Assets/Spine/Runtime/spine-unity/Deprecated/SlotBlendModes/SlotBlendModes.cs rename to Assets/Spine/Runtime/spine-unity/Modules/SlotBlendModes/SlotBlendModes.cs index 69b01b62a..ff617f3f9 100644 --- a/Assets/Spine/Runtime/spine-unity/Deprecated/SlotBlendModes/SlotBlendModes.cs +++ b/Assets/Spine/Runtime/spine-unity/Modules/SlotBlendModes/SlotBlendModes.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,31 +15,23 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using System.Collections.Generic; using UnityEngine; -using System; -namespace Spine.Unity.Deprecated { +namespace Spine.Unity.Modules { - /// - /// Deprecated. The spine-unity 3.7 runtime introduced SkeletonDataModifierAssets BlendModeMaterials which replaced SlotBlendModes. See the - /// SkeletonDataModifierAssets BlendModeMaterials documentation page and - /// this forum thread for further information. - /// This class will be removed in the spine-unity 3.9 runtime. - /// - [Obsolete("The spine-unity 3.7 runtime introduced SkeletonDataModifierAssets BlendModeMaterials which replaced SlotBlendModes. Will be removed in spine-unity 3.9.", false)] [DisallowMultipleComponent] public class SlotBlendModes : MonoBehaviour { @@ -76,7 +68,7 @@ namespace Spine.Unity.Deprecated { this.texture2D = texture; } } - + internal static Material GetOrAddMaterialFor(Material materialSource, Texture2D texture) { if (materialSource == null || texture == null) return null; @@ -211,7 +203,7 @@ namespace Spine.Unity.Deprecated { } } slotsWithCustomMaterial = null; - + Applied = false; if (skeletonRenderer.valid) skeletonRenderer.LateUpdate(); } diff --git a/Assets/Spine/Runtime/spine-unity/Deprecated/SlotBlendModes/SlotBlendModes.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/SlotBlendModes/SlotBlendModes.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Deprecated/SlotBlendModes/SlotBlendModes.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/SlotBlendModes/SlotBlendModes.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Modules/TK2D/SpriteCollectionAttachmentLoader.cs b/Assets/Spine/Runtime/spine-unity/Modules/TK2D/SpriteCollectionAttachmentLoader.cs index a3ce3de2c..037c49c4b 100644 --- a/Assets/Spine/Runtime/spine-unity/Modules/TK2D/SpriteCollectionAttachmentLoader.cs +++ b/Assets/Spine/Runtime/spine-unity/Modules/TK2D/SpriteCollectionAttachmentLoader.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if SPINE_TK2D diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline.meta new file mode 100644 index 000000000..9dd425c6e --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9192f99585e00e2468a2e2592cfce807 +folderAsset: yes +timeCreated: 1505434717 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation.meta new file mode 100644 index 000000000..d6cf5f6df --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a363511f60be37a4199a1a4ad0188b40 +folderAsset: yes +timeCreated: 1511505394 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/README.md b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/README.md new file mode 100644 index 000000000..e611aa20c --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/README.md @@ -0,0 +1,59 @@ +This Documentation is for the Spine Timeline features. +If this documentation contains mistakes or doesn't cover some questions, please feel to comment below, open an issue or post in the official [Spine-Unity forums](http://esotericsoftware.com/forum/viewforum.php?f=3). + +# Spine-Unity Timeline Playables + +![](add-menu.png) + +## Spine AnimationState Track +![](animationstate-clip-inspector.png) +Sets animations on the target SkeletonAnimation's AnimationState. + +**Status:** +- Currently only SkeletonAnimation (directly) + +**To use:** +1. Add `SkeletonAnimationPlayableHandle` component to your SkeletonAnimation GameObject. +2. With an existing Unity Playable Director, and in the Unity Timeline window, right-click on an empty space on the left and choose **Spine.Unity.Playables** > **Spine Animation State Track**. +3. Drag the SkeletonAnimation GameObject onto the empty reference property of the new Spine AnimationState Track. +4. Right-click on the row in an empty space in the Timeline dopesheet and choose **Add Spine Animation State Clip Clip**. +5. Adjust the start and end times of the new clip, name it appropriately at the top of the Inspector. +6. Click on the clip inspector's SkeletonDataAsset field and choose your target skeleton's SkeletonDataAsset. This will enable the animation name dropdown to appear. +7. Choose the appropriate animation name, loop, and mix settings. +- For easier readability, rename your clip to the animation name or something descriptive. +- To avoid having to do steps 4-6 repeatedly, use the Duplicate function (`CTRL`/`CMD` + `D`) + +**Track Behavior** +- `AnimationState.SetAnimation` will be called at the beginning of every clip based on the animationName. +- Clip durations don't matter. Animations won't be cleared where there is no active clip at certain slices of time. +- **EMPTY ANIMATION**: If a clip has no name specified, it will call SetEmptyAnimation instead. +- **ERROR HANDLING**: If the animation with the provided animationName is not found, it will do nothing (the previous animation will continue playing normally). +- Animations playing before the timeline starts playing will not be interrupted until the first clip starts playing. +- At the end of the last clip and at the end of the timeline, nothing happens. This means the effect of the last clip's SetAnimation call will persist until you give other commands to that AnimationState. +- If "custom duration" is unchecked, it will do a normal lookup of the AnimationState data's specified transition-pair mix setting, or the default mix. +- Edit mode preview mixing may look different from Play Mode mixing. Please check in actual Play Mode to see the real results. + +## Spine Skeleton Flip Track +![](skeleton-flip-clip-inspector.png) +Controls skeleton flip at a given Spine component. + +**Status:** +- Currently only SkeletonAnimation (via SkeletonAnimationPlayableHandle) + +**To use:** +1. Add `SkeletonAnimationPlayableHandle` component to your SkeletonAnimation GameObject. +2. With an existing Unity Playable Director, and in the Unity Timeline window, right-click on an empty space on the left and choose **Spine.Unity.Playables** > **Spine Skeleton Flip Track**. +3. Drag the SkeletonAnimation GameObject onto the empty reference property of the new Spine Skeleton Flip Track. +4. Right-click on the row in an empty space in the Timeline dopesheet and choose **Add Spine Skeleton Flip Clip Clip**. +5. Adjust the start and end times of the new clip, name it appropriately at the top of the Inspector, and choose the desired FlipX and FlipY values. + +**Track Behavior** +- The specified skeleton flip values will be applied for every frame within the duration of each track. +- At the end of the timeline, the track will revert the skeleton flip to the flip values it captures when it starts playing that timeline. + +## Known Issues +Spine Timeline support is currently experimental and has some known issues and inconveniences. +- The Console logs an incorrect/harmless error `DrivenPropertyManager has failed to register property "m_Script" of object "Spine GameObject (spineboy-pro)" with driver "" because the property doesn't exist.`. This is a known issue on Unity's end. See more here: https://forum.unity.com/threads/default-playables-text-switcher-track-error.502903/ +- These Spine Tracks (like other custom Unity Timeline Playable types) do not have labels on them. Unity currently doesn't have API to specify their labels yet. +- Each track clip currently requires you to specify a reference to SkeletonData so its inspector can show you a convenient list of animation names. This is because track clips are agnostic of its track and target component/track binding, and provides no way of automatically finding it while in the editor. The clips will still function correctly without the SkeletonDataAsset references; you just won't get the dropdown of animation names in the editor. +- Each track clip cannot be automatically named based on the chosen animationName. The Timeline object editors currently doesn't provide access to the clip names to do this automatically. \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/README.md.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/README.md.meta new file mode 100644 index 000000000..d0bfc37de --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/README.md.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 970f0962a0a79bf42bdedfc9ed439f56 +timeCreated: 1511505255 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/add-menu.png b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/add-menu.png new file mode 100644 index 000000000..f2277f2fb Binary files /dev/null and b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/add-menu.png differ diff --git a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/StraightAlphaPresetTemplate.png.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/add-menu.png.meta similarity index 62% rename from Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/StraightAlphaPresetTemplate.png.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/add-menu.png.meta index 721d7ca30..b5247a70c 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/StraightAlphaPresetTemplate.png.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/add-menu.png.meta @@ -1,13 +1,14 @@ fileFormatVersion: 2 -guid: ade885c25e49d7740b5c00d4e10a6197 -timeCreated: 1580402818 -licenseType: Pro +guid: ab296920a52d8204ea35ed4385481be3 +timeCreated: 1511505440 +licenseType: Free TextureImporter: fileIDToRecycleName: {} + externalObjects: {} serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 0 + enableMipMap: 1 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -33,13 +34,13 @@ TextureImporter: filterMode: -1 aniso: -1 mipBias: -1 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 lightmap: 0 compressionQuality: 50 - spriteMode: 0 + spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 @@ -57,16 +58,45 @@ TextureImporter: platformSettings: - buildTarget: DefaultTexturePlatform maxTextureSize: 2048 + resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 + textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - buildTarget: Standalone maxTextureSize: 2048 + resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Windows Store Apps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/animationstate-clip-inspector.png b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/animationstate-clip-inspector.png new file mode 100644 index 000000000..c13b9d4f8 Binary files /dev/null and b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/animationstate-clip-inspector.png differ diff --git a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMAPresetTemplate.png.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/animationstate-clip-inspector.png.meta similarity index 61% rename from Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMAPresetTemplate.png.meta rename to Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/animationstate-clip-inspector.png.meta index 8153700c4..d43a3b734 100644 --- a/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMAPresetTemplate.png.meta +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/animationstate-clip-inspector.png.meta @@ -1,13 +1,14 @@ fileFormatVersion: 2 -guid: 77f055f38c1115f42a2df16b0428c4e6 -timeCreated: 1580402818 -licenseType: Pro +guid: ca162358b7b05034cae4e25bfb8b98f8 +timeCreated: 1511508127 +licenseType: Free TextureImporter: fileIDToRecycleName: {} + externalObjects: {} serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 0 + enableMipMap: 1 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -33,13 +34,13 @@ TextureImporter: filterMode: -1 aniso: -1 mipBias: -1 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 lightmap: 0 compressionQuality: 50 - spriteMode: 0 + spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 @@ -47,7 +48,7 @@ TextureImporter: spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaUsage: 1 - alphaIsTransparency: 0 + alphaIsTransparency: 1 spriteTessellationDetail: -1 textureType: 0 textureShape: 1 @@ -57,16 +58,45 @@ TextureImporter: platformSettings: - buildTarget: DefaultTexturePlatform maxTextureSize: 2048 + resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 + textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - buildTarget: Standalone maxTextureSize: 2048 + resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Windows Store Apps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/skeleton-flip-clip-inspector.png b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/skeleton-flip-clip-inspector.png new file mode 100644 index 000000000..d13e74670 Binary files /dev/null and b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/skeleton-flip-clip-inspector.png differ diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/skeleton-flip-clip-inspector.png.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/skeleton-flip-clip-inspector.png.meta new file mode 100644 index 000000000..599bc9573 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/Documentation/skeleton-flip-clip-inspector.png.meta @@ -0,0 +1,112 @@ +fileFormatVersion: 2 +guid: 80e301d4353d83640bb50224021a8379 +timeCreated: 1511506555 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Windows Store Apps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component.meta new file mode 100644 index 000000000..083282b56 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ff79ab0c89530f24d8f60162bd4c1009 +folderAsset: yes +timeCreated: 1507311562 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SkeletonAnimationPlayableHandle.cs b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SkeletonAnimationPlayableHandle.cs new file mode 100644 index 000000000..a16737d34 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SkeletonAnimationPlayableHandle.cs @@ -0,0 +1,113 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +//using UnityEngine.Playables; + +using Spine; +using Spine.Unity; +using Spine.Unity.Playables; + +namespace Spine.Unity.Playables { + + [AddComponentMenu("Spine/Playables/SkeletonAnimation Playable Handle (Playables)")] + public class SkeletonAnimationPlayableHandle : SpinePlayableHandleBase { + #region Inspector + public SkeletonAnimation skeletonAnimation; + //public float fadeOutDuration = 0.5f; + + #if UNITY_EDITOR + void OnValidate () { + if (this.skeletonAnimation == null) + skeletonAnimation = GetComponent(); + } + #endif + + #endregion + + //readonly HashSet frameAppliedProperties = new HashSet(); + + public override Skeleton Skeleton { get { return skeletonAnimation.Skeleton; } } + public override SkeletonData SkeletonData { get { return skeletonAnimation.Skeleton.data; } } + + #if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED) + void Awake () { + if (skeletonAnimation == null) + skeletonAnimation = GetComponent(); + + //frameAppliedProperties.Clear(); + } + + //Skeleton skeleton; + //int frameTrackCount = 0; + //int frameCurrentInputs = 0; + //bool firstCleared = false; + //int lastApplyFrame = 0; + //public override void ProcessFrame (Playable playable, FrameData info, SpineAnimationMixerBehaviour mixer) { + // if (skeletonAnimation == null) return; + // if (skeleton == null) skeleton = skeletonAnimation.Skeleton; + + // // New frame. + // if (lastApplyFrame != Time.frameCount) { + // if (frameTrackCount > 0) + // frameAppliedProperties.Clear(); + + // frameCurrentInputs = 0; + // frameTrackCount = 0; + // } + // lastApplyFrame = Time.frameCount; + + // int currentInputs = mixer.ApplyPlayableFrame(playable, skeleton, frameAppliedProperties, frameTrackCount); + // frameCurrentInputs += currentInputs; + + // // EXPERIMENTAL: Handle overriding SkeletonAnimation.AnimationState. + // if (frameCurrentInputs > 0) { + // var state = skeletonAnimation.AnimationState; + + // if (!firstCleared) { + // firstCleared = true; + // for (int i = 0; i < 4; i++) { + // if (state.GetCurrent(i) != null) state.SetEmptyAnimation(i, fadeOutDuration); + // } + // } + + // // Update again whenever an animation is playing in the AnimationState. Quite wasteful. + // //if (state.GetCurrent(0) != null) { + // skeleton.UpdateWorldTransform(); + // //} + // } + + // frameTrackCount++; + //} +#endif + } + +} diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SkeletonAnimationPlayableHandle.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SkeletonAnimationPlayableHandle.cs.meta new file mode 100644 index 000000000..8075d1e09 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SkeletonAnimationPlayableHandle.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bd5f4cbc0a51cc24b86e5f70151bc0c3 +timeCreated: 1507311603 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SpinePlayableHandleBase.cs b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SpinePlayableHandleBase.cs new file mode 100644 index 000000000..691b2e3d4 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SpinePlayableHandleBase.cs @@ -0,0 +1,62 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +//using UnityEngine.Playables; + +namespace Spine.Unity.Playables { + + public delegate void SpineEventDelegate (Spine.Event e); + + /// Base class for Spine Playable Handle components, commonly for integrating with UnityEngine Timeline. + public abstract class SpinePlayableHandleBase : MonoBehaviour { + + /// Gets the SkeletonData of the targeted Spine component. + public abstract SkeletonData SkeletonData { get; } + + public abstract Skeleton Skeleton { get; } + + /// MixerBehaviour ProcessFrame method handler. + /// Returns true if a playable was applied previously + //public abstract void ProcessFrame (Playable playable, FrameData info, SpineAnimationMixerBehaviour mixer); + + /// Subscribe to this to handle user events played by the Unity playable + public event SpineEventDelegate AnimationEvents; + + public virtual void HandleEvents (ExposedList eventBuffer) { + if (eventBuffer == null || AnimationEvents == null) return; + for (int i = 0, n = eventBuffer.Count; i < n; i++) + AnimationEvents.Invoke(eventBuffer.Items[i]); + } + + } +} diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SpinePlayableHandleBase.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SpinePlayableHandleBase.cs.meta new file mode 100644 index 000000000..cb575e799 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/PlayableHandle Component/SpinePlayableHandleBase.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2dfbb56974b17984ca2534bc8185f665 +timeCreated: 1507311422 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState.meta new file mode 100644 index 000000000..a5b1d9d65 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 47adfa0aa094be548be25e178c1435d2 +folderAsset: yes +timeCreated: 1510816616 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateBehaviour.cs b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateBehaviour.cs new file mode 100644 index 000000000..8bafb2118 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateBehaviour.cs @@ -0,0 +1,63 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED) +using System; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; +using Spine; +using Spine.Unity; +using System.Collections.Generic; + +namespace Spine.Unity.Playables { + + using Animation = Spine.Animation; + + [Serializable] + public class SpineAnimationStateBehaviour : PlayableBehaviour { + public AnimationReferenceAsset animationReference; + public bool loop; + + [Header("Mix Properties")] + public bool customDuration = false; + public float mixDuration = 0.1f; + + [Range(0, 1f)] + public float attachmentThreshold = 0.5f; + + [Range(0, 1f)] + public float eventThreshold = 0.5f; + + [Range(0, 1f)] + public float drawOrderThreshold = 0.5f; + } + +} +#endif diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateBehaviour.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateBehaviour.cs.meta new file mode 100644 index 000000000..d46810303 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateBehaviour.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 82bd6e7ec1121b5428c447b7bd16b042 +timeCreated: 1510816616 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateClip.cs b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateClip.cs new file mode 100644 index 000000000..f3b6c175d --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateClip.cs @@ -0,0 +1,51 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED) +using System; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +namespace Spine.Unity.Playables { + [Serializable] + public class SpineAnimationStateClip : PlayableAsset, ITimelineClipAsset { + public SpineAnimationStateBehaviour template = new SpineAnimationStateBehaviour(); + + public ClipCaps clipCaps { get { return ClipCaps.None; } } + + public override Playable CreatePlayable (PlayableGraph graph, GameObject owner) { + var playable = ScriptPlayable.Create(graph, template); + playable.GetBehaviour(); //SpineAnimationStateBehaviour clone = playable.GetBehaviour(); + return playable; + } + } + +} +#endif diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateClip.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateClip.cs.meta new file mode 100644 index 000000000..d9a7bf48b --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateClip.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 585e20c924ba86a44926c850aa8e1d84 +timeCreated: 1510816616 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs new file mode 100644 index 000000000..5b12f920a --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs @@ -0,0 +1,195 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#define SPINE_EDITMODEPOSE + +#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED) +using System; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +namespace Spine.Unity.Playables { + public class SpineAnimationStateMixerBehaviour : PlayableBehaviour { + + float[] lastInputWeights; + public int trackIndex; + + // NOTE: This function is called at runtime and edit time. Keep that in mind when setting the values of properties. + public override void ProcessFrame (Playable playable, FrameData info, object playerData) { + var spineComponent = playerData as SkeletonAnimation; + if (spineComponent == null) return; + + var skeleton = spineComponent.Skeleton; + var state = spineComponent.AnimationState; + + if (!Application.isPlaying) { + #if SPINE_EDITMODEPOSE + PreviewEditModePose(playable, spineComponent); + #endif + return; + } + + int inputCount = playable.GetInputCount(); + + // Ensure correct buffer size. + if (this.lastInputWeights == null || this.lastInputWeights.Length < inputCount) { + this.lastInputWeights = new float[inputCount]; + + for (int i = 0; i < inputCount; i++) + this.lastInputWeights[i] = default(float); + } + var lastInputWeights = this.lastInputWeights; + + // Check all clips. If a clip that was weight 0 turned into weight 1, call SetAnimation. + for (int i = 0; i < inputCount; i++) { + float lastInputWeight = lastInputWeights[i]; + float inputWeight = playable.GetInputWeight(i); + bool trackStarted = inputWeight > lastInputWeight; + lastInputWeights[i] = inputWeight; + + if (trackStarted) { + ScriptPlayable inputPlayable = (ScriptPlayable)playable.GetInput(i); + SpineAnimationStateBehaviour clipData = inputPlayable.GetBehaviour(); + + if (clipData.animationReference == null) { + float mixDuration = clipData.customDuration ? clipData.mixDuration : state.Data.DefaultMix; + state.SetEmptyAnimation(trackIndex, mixDuration); + } else { + if (clipData.animationReference.Animation != null) { + Spine.TrackEntry trackEntry = state.SetAnimation(trackIndex, clipData.animationReference.Animation, clipData.loop); + + //trackEntry.TrackTime = (float)inputPlayable.GetTime(); // More accurate time-start? + trackEntry.EventThreshold = clipData.eventThreshold; + trackEntry.DrawOrderThreshold = clipData.drawOrderThreshold; + trackEntry.AttachmentThreshold = clipData.attachmentThreshold; + + if (clipData.customDuration) + trackEntry.MixDuration = clipData.mixDuration; + } + //else Debug.LogWarningFormat("Animation named '{0}' not found", clipData.animationName); + } + + // Ensure that the first frame ends with an updated mesh. + spineComponent.Update(0); + spineComponent.LateUpdate(); + } + } + } + + #if SPINE_EDITMODEPOSE + + AnimationState dummyAnimationState; + + public void PreviewEditModePose (Playable playable, SkeletonAnimation spineComponent) { + if (Application.isPlaying) return; + if (spineComponent == null) return; + + int inputCount = playable.GetInputCount(); + int lastOneWeight = -1; + + for (int i = 0; i < inputCount; i++) { + float inputWeight = playable.GetInputWeight(i); + if (inputWeight >= 1) lastOneWeight = i; + } + + if (lastOneWeight != -1) { + ScriptPlayable inputPlayableClip = (ScriptPlayable)playable.GetInput(lastOneWeight); + SpineAnimationStateBehaviour clipData = inputPlayableClip.GetBehaviour(); + + var skeleton = spineComponent.Skeleton; + + bool skeletonDataMismatch = clipData.animationReference != null && spineComponent.SkeletonDataAsset.GetSkeletonData(true) != clipData.animationReference.SkeletonDataAsset.GetSkeletonData(true); + if (skeletonDataMismatch) { + Debug.LogWarningFormat("SpineAnimationStateMixerBehaviour tried to apply an animation for the wrong skeleton. Expected {0}. Was {1}", spineComponent.SkeletonDataAsset, clipData.animationReference.SkeletonDataAsset); + } + + // Getting the from-animation here because it's required to get the mix information from AnimationStateData. + Animation fromAnimation = null; + float fromClipTime = 0; + bool fromClipLoop = false; + if (lastOneWeight != 0 && inputCount > 1) { + var fromClip = (ScriptPlayable)playable.GetInput(lastOneWeight - 1); + var fromClipData = fromClip.GetBehaviour(); + fromAnimation = fromClipData.animationReference != null ? fromClipData.animationReference.Animation : null; + fromClipTime = (float)fromClip.GetTime(); + fromClipLoop = fromClipData.loop; + } + + Animation toAnimation = clipData.animationReference != null ? clipData.animationReference.Animation : null; + float toClipTime = (float)inputPlayableClip.GetTime(); + float mixDuration = clipData.mixDuration; + + if (!clipData.customDuration && fromAnimation != null && toAnimation != null) { + mixDuration = spineComponent.AnimationState.Data.GetMix(fromAnimation, toAnimation); + } + + // Approximate what AnimationState might do at runtime. + if (fromAnimation != null && mixDuration > 0 && toClipTime < mixDuration) { + dummyAnimationState = dummyAnimationState ?? new AnimationState(spineComponent.skeletonDataAsset.GetAnimationStateData()); + + var toTrack = dummyAnimationState.GetCurrent(0); + var fromTrack = toTrack != null ? toTrack.mixingFrom : null; + bool isAnimationTransitionMatch = (toTrack != null && toTrack.animation == toAnimation && fromTrack != null && fromTrack.animation == fromAnimation); + + if (!isAnimationTransitionMatch) { + dummyAnimationState.ClearTracks(); + fromTrack = dummyAnimationState.SetAnimation(0, fromAnimation, fromClipLoop); + fromTrack.AllowImmediateQueue(); + if (toAnimation != null) + toTrack = dummyAnimationState.SetAnimation(0, toAnimation, clipData.loop); + } + + // Update track times. + fromTrack.trackTime = fromClipTime; + if (toTrack != null) { + toTrack.trackTime = toClipTime; + toTrack.mixTime = toClipTime; + } + + // Apply Pose + skeleton.SetToSetupPose(); + dummyAnimationState.Update(0); + dummyAnimationState.Apply(skeleton); + } else { + skeleton.SetToSetupPose(); + if (toAnimation != null) + toAnimation.PoseSkeleton(skeleton, toClipTime, clipData.loop); + } + + } + // Do nothing outside of the first clip and the last clip. + + } + #endif + + } + +} +#endif diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs.meta new file mode 100644 index 000000000..ad4f2ea42 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateMixerBehaviour.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: f61d2f4ac1c4ad044bf4ae6e63b0eca8 +timeCreated: 1510816616 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateTrack.cs b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateTrack.cs new file mode 100644 index 000000000..a3d282227 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateTrack.cs @@ -0,0 +1,50 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED) +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +namespace Spine.Unity.Playables { + [TrackColor(0.9960785f, 0.2509804f, 0.003921569f)] + [TrackClipType(typeof(SpineAnimationStateClip))] + [TrackBindingType(typeof(SkeletonAnimation))] + public class SpineAnimationStateTrack : TrackAsset { + public int trackIndex = 0; + + public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) { + var scriptPlayable = ScriptPlayable.Create(graph, inputCount); + var mixerBehaviour = scriptPlayable.GetBehaviour(); + mixerBehaviour.trackIndex = this.trackIndex; + return scriptPlayable; + } + } +} +#endif diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateTrack.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateTrack.cs.meta new file mode 100644 index 000000000..379c2a275 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineAnimationState/SpineAnimationStateTrack.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: dfabb056a779ae34b9ebd7de425c868b +timeCreated: 1510816616 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip.meta new file mode 100644 index 000000000..39ab9b4ba --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3099d730dd2a9e349b3d918960cb42fa +folderAsset: yes +timeCreated: 1500876410 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipBehaviour.cs b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipBehaviour.cs new file mode 100644 index 000000000..a4eaae0ea --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipBehaviour.cs @@ -0,0 +1,40 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED) +using System; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +[Serializable] +public class SpineSkeletonFlipBehaviour : PlayableBehaviour { + public bool flipX, flipY; +} +#endif \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipBehaviour.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipBehaviour.cs.meta new file mode 100644 index 000000000..efa92e52f --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3740378c8a8da8042991fbbe4b4a2094 +timeCreated: 1500876411 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipClip.cs b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipClip.cs new file mode 100644 index 000000000..a570758e9 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipClip.cs @@ -0,0 +1,49 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED) +using System; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +[Serializable] +public class SpineSkeletonFlipClip : PlayableAsset, ITimelineClipAsset { + public SpineSkeletonFlipBehaviour template = new SpineSkeletonFlipBehaviour(); + + public ClipCaps clipCaps { + get { return ClipCaps.None; } + } + + public override Playable CreatePlayable (PlayableGraph graph, GameObject owner) { + var playable = ScriptPlayable.Create(graph, template); + return playable; + } +} +#endif diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipClip.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipClip.cs.meta new file mode 100644 index 000000000..cfc9eeee6 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipClip.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 0a29ac408b701f84c93882fb506759d1 +timeCreated: 1500876411 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipMixerBehaviour.cs b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipMixerBehaviour.cs new file mode 100644 index 000000000..33e42f3b4 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipMixerBehaviour.cs @@ -0,0 +1,108 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED) + using System; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +using Spine.Unity; + +namespace Spine.Unity.Playables { + public class SpineSkeletonFlipMixerBehaviour : PlayableBehaviour { + float originalScaleX, originalScaleY; + float baseScaleX, baseScaleY; + + SpinePlayableHandleBase playableHandle; + bool m_FirstFrameHappened; + + public override void ProcessFrame (Playable playable, FrameData info, object playerData) { + playableHandle = playerData as SpinePlayableHandleBase; + + if (playableHandle == null) + return; + + var skeleton = playableHandle.Skeleton; + + if (!m_FirstFrameHappened) { + originalScaleX = skeleton.ScaleX; + originalScaleY = skeleton.ScaleY; + baseScaleX = Mathf.Abs(originalScaleX); + baseScaleY = Mathf.Abs(originalScaleY); + m_FirstFrameHappened = true; + } + + int inputCount = playable.GetInputCount(); + + float totalWeight = 0f; + float greatestWeight = 0f; + int currentInputs = 0; + + for (int i = 0; i < inputCount; i++) { + float inputWeight = playable.GetInputWeight(i); + ScriptPlayable inputPlayable = (ScriptPlayable)playable.GetInput(i); + SpineSkeletonFlipBehaviour input = inputPlayable.GetBehaviour(); + + totalWeight += inputWeight; + + if (inputWeight > greatestWeight) { + SetSkeletonScaleFromFlip(skeleton, input.flipX, input.flipY); + greatestWeight = inputWeight; + } + + if (!Mathf.Approximately(inputWeight, 0f)) + currentInputs++; + } + + if (currentInputs != 1 && 1f - totalWeight > greatestWeight) { + skeleton.scaleX = originalScaleX; + skeleton.scaleY = originalScaleY; + } + } + + public void SetSkeletonScaleFromFlip (Skeleton skeleton, bool flipX, bool flipY) { + skeleton.scaleX = flipX ? -baseScaleX : baseScaleX; + skeleton.scaleY = flipY ? -baseScaleY : baseScaleY; + } + + public override void OnGraphStop (Playable playable) { + m_FirstFrameHappened = false; + + if (playableHandle == null) + return; + + var skeleton = playableHandle.Skeleton; + skeleton.scaleX = originalScaleX; + skeleton.scaleY = originalScaleY; + } + } + +} +#endif diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipMixerBehaviour.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipMixerBehaviour.cs.meta new file mode 100644 index 000000000..737c38678 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipMixerBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f25dcf1fb34ab8643ac8734e57a9540f +timeCreated: 1500876411 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipTrack.cs b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipTrack.cs new file mode 100644 index 000000000..efa2a5fd1 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipTrack.cs @@ -0,0 +1,67 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#if UNITY_2017 || UNITY_2018 || (UNITY_2019_1_OR_NEWER && SPINE_TIMELINE_PACKAGE_DOWNLOADED) + using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; +using System.Collections.Generic; + +using Spine.Unity; + +namespace Spine.Unity.Playables { + + [TrackColor(0.855f, 0.8623f, 0.87f)] + [TrackClipType(typeof(SpineSkeletonFlipClip))] + [TrackBindingType(typeof(SpinePlayableHandleBase))] + public class SpineSkeletonFlipTrack : TrackAsset { + public override Playable CreateTrackMixer (PlayableGraph graph, GameObject go, int inputCount) { + return ScriptPlayable.Create(graph, inputCount); + } + + public override void GatherProperties (PlayableDirector director, IPropertyCollector driver) { +#if UNITY_EDITOR + SpinePlayableHandleBase trackBinding = director.GetGenericBinding(this) as SpinePlayableHandleBase; + if (trackBinding == null) + return; + + var serializedObject = new UnityEditor.SerializedObject(trackBinding); + var iterator = serializedObject.GetIterator(); + while (iterator.NextVisible(true)) { + if (iterator.hasVisibleChildren) + continue; + + driver.AddFromName(trackBinding.gameObject, iterator.propertyPath); + } +#endif + base.GatherProperties(director, driver); + } + } +} +#endif diff --git a/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipTrack.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipTrack.cs.meta new file mode 100644 index 000000000..b819b3408 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/Timeline/SpineSkeletonFlip/SpineSkeletonFlipTrack.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 82ac803eb1878814bba380a18b6b5d9d +timeCreated: 1500876411 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions.meta b/Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions.meta rename to Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions.meta diff --git a/Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineAnimationComplete.cs b/Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineAnimationComplete.cs new file mode 100644 index 000000000..8f15a2f7e --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineAnimationComplete.cs @@ -0,0 +1,85 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated May 1, 2019. Replaces all prior versions. + * + * Copyright (c) 2013-2019, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +using UnityEngine; +using System.Collections; +using Spine; + +namespace Spine.Unity { + /// + /// Use this as a condition-blocking yield instruction for Unity Coroutines. + /// The routine will pause until the AnimationState.TrackEntry fires its Complete event. + public class WaitForSpineAnimationComplete : IEnumerator { + + bool m_WasFired = false; + + public WaitForSpineAnimationComplete (Spine.TrackEntry trackEntry) { + SafeSubscribe(trackEntry); + } + + void HandleComplete (TrackEntry trackEntry) { + m_WasFired = true; + } + + void SafeSubscribe (Spine.TrackEntry trackEntry) { + if (trackEntry == null) { + // Break immediately if trackEntry is null. + Debug.LogWarning("TrackEntry was null. Coroutine will continue immediately."); + m_WasFired = true; + } else { + trackEntry.Complete += HandleComplete; + } + } + + #region Reuse + /// + /// One optimization high-frequency YieldInstruction returns is to cache instances to minimize GC pressure. + /// Use NowWaitFor to reuse the same instance of WaitForSpineAnimationComplete. + public WaitForSpineAnimationComplete NowWaitFor (Spine.TrackEntry trackEntry) { + SafeSubscribe(trackEntry); + return this; + } + #endregion + + #region IEnumerator + bool IEnumerator.MoveNext () { + if (m_WasFired) { + ((IEnumerator)this).Reset(); // auto-reset for YieldInstruction reuse + return false; + } + + return true; + } + void IEnumerator.Reset () { m_WasFired = false; } + object IEnumerator.Current { get { return null; } } + #endregion + + } + +} diff --git a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimationComplete.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineAnimationComplete.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimationComplete.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineAnimationComplete.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineEvent.cs b/Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineEvent.cs similarity index 85% rename from Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineEvent.cs rename to Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineEvent.cs index 1da2bcb6a..97c1ccfb3 100644 --- a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineEvent.cs +++ b/Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineEvent.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEngine; @@ -33,7 +33,7 @@ using Spine; namespace Spine.Unity { /// - /// Use this as a condition-blocking yield instruction for Unity Coroutines. + /// Use this as a condition-blocking yield instruction for Unity Coroutines. /// The routine will pause until the AnimationState fires an event matching the given event name or EventData reference. public class WaitForSpineEvent : IEnumerator { @@ -74,7 +74,7 @@ namespace Spine.Unity { m_WasFired = true; return; } - + m_AnimationState = state; m_EventName = eventName; state.Event += HandleAnimationStateEventByName; @@ -86,11 +86,11 @@ namespace Spine.Unity { Subscribe(state, eventDataReference, unsubscribeAfterFiring); } - public WaitForSpineEvent (SkeletonAnimation skeletonAnimation, Spine.EventData eventDataReference, bool unsubscribeAfterFiring = true) { + public WaitForSpineEvent (SkeletonAnimation skeletonAnimation, Spine.EventData eventDataReference, bool unsubscribeAfterFiring = true) { // If skeletonAnimation is invalid, its state will be null. Subscribe handles null states just fine. Subscribe(skeletonAnimation.state, eventDataReference, unsubscribeAfterFiring); } - + public WaitForSpineEvent (Spine.AnimationState state, string eventName, bool unsubscribeAfterFiring = true) { SubscribeByName(state, eventName, unsubscribeAfterFiring); } @@ -117,7 +117,7 @@ namespace Spine.Unity { #region Reuse /// - /// By default, WaitForSpineEvent will unsubscribe from the event immediately after it fires a correct matching event. + /// By default, WaitForSpineEvent will unsubscribe from the event immediately after it fires a correct matching event. /// If you want to reuse this WaitForSpineEvent instance on the same event, you can set this to false. public bool WillUnsubscribeAfterFiring { get { return m_unsubscribeAfterFiring; } set { m_unsubscribeAfterFiring = value; } } diff --git a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineEvent.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineEvent.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineEvent.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineEvent.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineTrackEntryEnd.cs b/Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineTrackEntryEnd.cs similarity index 70% rename from Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineTrackEntryEnd.cs rename to Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineTrackEntryEnd.cs index dc62d4354..e8ce89d9b 100644 --- a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineTrackEntryEnd.cs +++ b/Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineTrackEntryEnd.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEngine; @@ -33,7 +33,7 @@ using Spine; namespace Spine.Unity { /// - /// Use this as a condition-blocking yield instruction for Unity Coroutines. + /// Use this as a condition-blocking yield instruction for Unity Coroutines. /// The routine will pause until the AnimationState.TrackEntry fires its End event. public class WaitForSpineTrackEntryEnd : IEnumerator { @@ -59,7 +59,7 @@ namespace Spine.Unity { #region Reuse /// - /// One optimization high-frequency YieldInstruction returns is to cache instances to minimize GC pressure. + /// One optimization high-frequency YieldInstruction returns is to cache instances to minimize GC pressure. /// Use NowWaitFor to reuse the same instance of WaitForSpineAnimationEnd. public WaitForSpineTrackEntryEnd NowWaitFor (Spine.TrackEntry trackEntry) { SafeSubscribe(trackEntry); diff --git a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineTrackEntryEnd.cs.meta b/Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineTrackEntryEnd.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineTrackEntryEnd.cs.meta rename to Assets/Spine/Runtime/spine-unity/Modules/YieldInstructions/WaitForSpineTrackEntryEnd.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/Default BlendModeMaterials.asset b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Default BlendModeMaterials.asset similarity index 96% rename from Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/Default BlendModeMaterials.asset rename to Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Default BlendModeMaterials.asset index 4e4446fc5..c6bf0a16d 100644 --- a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/Default BlendModeMaterials.asset +++ b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Default BlendModeMaterials.asset @@ -17,4 +17,4 @@ MonoBehaviour: type: 2} additiveMaterialTemplate: {fileID: 2100000, guid: 4deba332d47209e4780b3c5fcf0e3745, type: 2} - applyAdditiveMaterial: 1 + applyAdditiveMaterial: 0 diff --git a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/Default BlendModeMaterials.asset.meta b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Default BlendModeMaterials.asset.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/Default BlendModeMaterials.asset.meta rename to Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Default BlendModeMaterials.asset.meta diff --git a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/SkeletonPMAAdditive.mat b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/SkeletonPMAAdditive.mat similarity index 100% rename from Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/SkeletonPMAAdditive.mat rename to Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/SkeletonPMAAdditive.mat diff --git a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/SkeletonPMAAdditive.mat.meta b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/SkeletonPMAAdditive.mat.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/SkeletonPMAAdditive.mat.meta rename to Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/SkeletonPMAAdditive.mat.meta diff --git a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/SkeletonPMAMultiply.mat b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/SkeletonPMAMultiply.mat similarity index 100% rename from Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/SkeletonPMAMultiply.mat rename to Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/SkeletonPMAMultiply.mat diff --git a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/SkeletonPMAMultiply.mat.meta b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/SkeletonPMAMultiply.mat.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/SkeletonPMAMultiply.mat.meta rename to Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/SkeletonPMAMultiply.mat.meta diff --git a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/SkeletonPMAScreen.mat b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/SkeletonPMAScreen.mat similarity index 100% rename from Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/SkeletonPMAScreen.mat rename to Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/SkeletonPMAScreen.mat diff --git a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/SkeletonPMAScreen.mat.meta b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/SkeletonPMAScreen.mat.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials/SkeletonPMAScreen.mat.meta rename to Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/SkeletonPMAScreen.mat.meta diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader index 322c9a45b..779b2a21f 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader +++ b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader @@ -12,16 +12,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Additive" { [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default } SubShader { @@ -41,8 +32,6 @@ Shader "Spine/Blend Modes/Skeleton PMA Additive" { } Pass { - Name "Normal" - CGPROGRAM #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT #pragma vertex vert @@ -97,19 +86,17 @@ Shader "Spine/Blend Modes/Skeleton PMA Additive" { #pragma multi_compile_shadowcaster #pragma fragmentoption ARB_precision_hint_fastest #include "UnityCG.cginc" - struct v2f { + struct v2f { V2F_SHADOW_CASTER; - float4 uvAndAlpha : TEXCOORD1; + float2 uv : TEXCOORD1; }; uniform float4 _MainTex_ST; - v2f vert (appdata_base v, float4 vertexColor : COLOR) { + v2f vert (appdata_base v) { v2f o; TRANSFER_SHADOW_CASTER(o) - o.uvAndAlpha.xy = TRANSFORM_TEX(v.texcoord, _MainTex); - o.uvAndAlpha.z = 0; - o.uvAndAlpha.a = vertexColor.a; + o.uv = TRANSFORM_TEX(v.texcoord, _MainTex); return o; } @@ -117,12 +104,11 @@ Shader "Spine/Blend Modes/Skeleton PMA Additive" { uniform fixed _Cutoff; float4 frag (v2f i) : SV_Target { - fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); - clip(texcol.a * i.uvAndAlpha.a - _Cutoff); + fixed4 texcol = tex2D(_MainTex, i.uv); + clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) } ENDCG } } - CustomEditor "SpineShaderWithOutlineGUI" -} +} \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader index 7b35130b7..0e4e61de6 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader +++ b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader @@ -12,16 +12,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Multiply" { [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default } SubShader { @@ -41,8 +32,6 @@ Shader "Spine/Blend Modes/Skeleton PMA Multiply" { } Pass { - Name "Normal" - CGPROGRAM #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT #pragma vertex vert @@ -73,7 +62,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Multiply" { float4 frag (VertexOutput i) : SV_Target { float4 texColor = tex2D(_MainTex, i.uv); - + #if defined(_STRAIGHT_ALPHA_INPUT) texColor.rgb *= texColor.a; #endif @@ -97,32 +86,29 @@ Shader "Spine/Blend Modes/Skeleton PMA Multiply" { #pragma multi_compile_shadowcaster #pragma fragmentoption ARB_precision_hint_fastest #include "UnityCG.cginc" - struct v2f { + struct v2f { V2F_SHADOW_CASTER; - float4 uvAndAlpha : TEXCOORD1; + float2 uv : TEXCOORD1; }; uniform float4 _MainTex_ST; - v2f vert (appdata_base v, float4 vertexColor : COLOR) { + v2f vert (appdata_base v) { v2f o; TRANSFER_SHADOW_CASTER(o) - o.uvAndAlpha.xy = TRANSFORM_TEX(v.texcoord, _MainTex); - o.uvAndAlpha.z = 0; - o.uvAndAlpha.a = vertexColor.a; + o.uv = TRANSFORM_TEX(v.texcoord, _MainTex); return o; } uniform sampler2D _MainTex; uniform fixed _Cutoff; - float4 frag (v2f i) : SV_Target { - fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); - clip(texcol.a * i.uvAndAlpha.a - _Cutoff); + float4 frag (v2f i) : COLOR { + fixed4 texcol = tex2D(_MainTex, i.uv); + clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) } ENDCG } } - CustomEditor "SpineShaderWithOutlineGUI" -} +} \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader index 3f0220c3b..54efdb440 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader +++ b/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader @@ -12,16 +12,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Screen" { [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default } SubShader { @@ -41,8 +32,6 @@ Shader "Spine/Blend Modes/Skeleton PMA Screen" { } Pass { - Name "Normal" - CGPROGRAM #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT #pragma vertex vert @@ -97,19 +86,17 @@ Shader "Spine/Blend Modes/Skeleton PMA Screen" { #pragma multi_compile_shadowcaster #pragma fragmentoption ARB_precision_hint_fastest #include "UnityCG.cginc" - struct v2f { + struct v2f { V2F_SHADOW_CASTER; - float4 uvAndAlpha : TEXCOORD1; + float2 uv : TEXCOORD1; }; uniform float4 _MainTex_ST; - v2f vert (appdata_base v, float4 vertexColor : COLOR) { + v2f vert (appdata_base v) { v2f o; TRANSFER_SHADOW_CASTER(o) - o.uvAndAlpha.xy = TRANSFORM_TEX(v.texcoord, _MainTex); - o.uvAndAlpha.z = 0; - o.uvAndAlpha.a = vertexColor.a; + o.uv = TRANSFORM_TEX(v.texcoord, _MainTex); return o; } @@ -117,12 +104,11 @@ Shader "Spine/Blend Modes/Skeleton PMA Screen" { uniform fixed _Cutoff; float4 frag (v2f i) : SV_Target { - fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); - clip(texcol.a * i.uvAndAlpha.a - _Cutoff); + fixed4 texcol = tex2D(_MainTex, i.uv); + clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) } ENDCG } } - CustomEditor "SpineShaderWithOutlineGUI" -} +} \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes.meta b/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes.meta deleted file mode 100644 index c8804508f..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 511f90ee1fe01c146836d5ed23f2e70f -folderAsset: yes -timeCreated: 1564083752 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-DepthOnlyPass.cginc b/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-DepthOnlyPass.cginc deleted file mode 100644 index 9a7e1402e..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-DepthOnlyPass.cginc +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef SPRITES_DEPTH_ONLY_PASS_INCLUDED -#define SPRITES_DEPTH_ONLY_PASS_INCLUDED - -#include "UnityCG.cginc" - -sampler2D _MainTex; -float _Cutoff; -float _ZWriteOffset; - -struct VertexInput { - float4 positionOS : POSITION; - float2 texcoord : TEXCOORD0; - float4 vertexColor : COLOR; -}; - -struct VertexOutput { - float4 positionCS : SV_POSITION; - float4 texcoordAndAlpha: TEXCOORD0; -}; - -VertexOutput DepthOnlyVertex (VertexInput v) { - VertexOutput o; - o.positionCS = UnityObjectToClipPos(v.positionOS - float4(0, 0, _ZWriteOffset, 0)); - o.texcoordAndAlpha.xy = v.texcoord; - o.texcoordAndAlpha.z = 0; - o.texcoordAndAlpha.a = v.vertexColor.a; - return o; -} - -float4 DepthOnlyFragment (VertexOutput input) : SV_Target{ - float4 texColor = tex2D(_MainTex, input.texcoordAndAlpha.rg); - - #if defined(_STRAIGHT_ALPHA_INPUT) - texColor.rgb *= texColor.a; - #endif - - clip(texColor.a * input.texcoordAndAlpha.a - _Cutoff); - return 0; -} - -#endif diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-DepthOnlyPass.cginc.meta b/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-DepthOnlyPass.cginc.meta deleted file mode 100644 index eb8386bbc..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-DepthOnlyPass.cginc.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 27351ce55d3beb643ae8d9385db21941 -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Outline-Common.cginc b/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Outline-Common.cginc deleted file mode 100644 index ca5b10517..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Outline-Common.cginc +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef SPINE_OUTLINE_COMMON_INCLUDED -#define SPINE_OUTLINE_COMMON_INCLUDED - -float4 computeOutlinePixel(sampler2D mainTexture, float2 mainTextureTexelSize, - float2 uv, float vertexColorAlpha, - float OutlineWidth, float OutlineReferenceTexWidth, float OutlineMipLevel, - float OutlineSmoothness, float ThresholdEnd, float4 OutlineColor) { - - float4 texColor = fixed4(0, 0, 0, 0); - - float outlineWidthCompensated = OutlineWidth / (OutlineReferenceTexWidth * mainTextureTexelSize.x); - float xOffset = mainTextureTexelSize.x * outlineWidthCompensated; - float yOffset = mainTextureTexelSize.y * outlineWidthCompensated; - float xOffsetDiagonal = mainTextureTexelSize.x * outlineWidthCompensated * 0.7; - float yOffsetDiagonal = mainTextureTexelSize.y * outlineWidthCompensated * 0.7; - - float pixelCenter = tex2D(mainTexture, uv).a; - - float4 uvCenterWithLod = float4(uv, 0, OutlineMipLevel); - float pixelTop = tex2Dlod(mainTexture, uvCenterWithLod + float4(0, yOffset, 0, 0)).a; - float pixelBottom = tex2Dlod(mainTexture, uvCenterWithLod + float4(0, -yOffset, 0, 0)).a; - float pixelLeft = tex2Dlod(mainTexture, uvCenterWithLod + float4(-xOffset, 0, 0, 0)).a; - float pixelRight = tex2Dlod(mainTexture, uvCenterWithLod + float4(xOffset, 0, 0, 0)).a; -#if _USE8NEIGHBOURHOOD_ON - float numSamples = 8; - float pixelTopLeft = tex2Dlod(mainTexture, uvCenterWithLod + float4(-xOffsetDiagonal, yOffsetDiagonal, 0, 0)).a; - float pixelTopRight = tex2Dlod(mainTexture, uvCenterWithLod + float4(xOffsetDiagonal, yOffsetDiagonal, 0, 0)).a; - float pixelBottomLeft = tex2Dlod(mainTexture, uvCenterWithLod + float4(-xOffsetDiagonal, -yOffsetDiagonal, 0, 0)).a; - float pixelBottomRight = tex2Dlod(mainTexture, uvCenterWithLod + float4(xOffsetDiagonal, -yOffsetDiagonal, 0, 0)).a; - float average = (pixelTop + pixelBottom + pixelLeft + pixelRight + - pixelTopLeft + pixelTopRight + pixelBottomLeft + pixelBottomRight) - * vertexColorAlpha / numSamples; -#else // 4 neighbourhood - float numSamples = 1; - float average = (pixelTop + pixelBottom + pixelLeft + pixelRight) * vertexColorAlpha / numSamples; -#endif - float thresholdStart = ThresholdEnd * (1.0 - OutlineSmoothness); - float outlineAlpha = saturate((average - thresholdStart) / (ThresholdEnd - thresholdStart)) - pixelCenter; - return lerp(texColor, OutlineColor, outlineAlpha); -} - -#endif diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Outline-Common.cginc.meta b/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Outline-Common.cginc.meta deleted file mode 100644 index add934092..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Outline-Common.cginc.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a8d610b87be4e82409e18a63a930d335 -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Lit-Common-Shadow.cginc b/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Lit-Common-Shadow.cginc deleted file mode 100644 index f5150ab62..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Lit-Common-Shadow.cginc +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef SKELETON_LIT_COMMON_SHADOW_INCLUDED -#define SKELETON_LIT_COMMON_SHADOW_INCLUDED - -#include "UnityCG.cginc" -struct v2f { - V2F_SHADOW_CASTER; - float4 uvAndAlpha : TEXCOORD1; -}; - -uniform float4 _MainTex_ST; - -v2f vertShadow(appdata_base v, float4 vertexColor : COLOR) { - v2f o; - TRANSFER_SHADOW_CASTER(o) - o.uvAndAlpha.xy = TRANSFORM_TEX(v.texcoord, _MainTex); - o.uvAndAlpha.z = 0; - o.uvAndAlpha.a = vertexColor.a; - return o; -} - -uniform sampler2D _MainTex; -uniform fixed SHADOW_CUTOFF; - -float4 fragShadow (v2f i) : SV_Target { - fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); - clip(texcol.a * i.uvAndAlpha.a - SHADOW_CUTOFF); - SHADOW_CASTER_FRAGMENT(i) -} - -#endif diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Lit-Common.cginc b/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Lit-Common.cginc deleted file mode 100644 index 10fbbf08a..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Lit-Common.cginc +++ /dev/null @@ -1,120 +0,0 @@ -#ifndef SKELETON_LIT_COMMON_INCLUDED -#define SKELETON_LIT_COMMON_INCLUDED - -#include "UnityCG.cginc" - -// ES2.0/WebGL/3DS can not do loops with non-constant-expression iteration counts :( -#if defined(SHADER_API_GLES) -#define LIGHT_LOOP_LIMIT 8 -#elif defined(SHADER_API_N3DS) -#define LIGHT_LOOP_LIMIT 4 -#else -#define LIGHT_LOOP_LIMIT unity_VertexLightParams.x -#endif - - -//////////////////////////////////////// -// Alpha Clipping -// - -#if defined(_ALPHA_CLIP) - uniform fixed _Cutoff; - #define ALPHA_CLIP(pixel, color) clip((pixel.a * color.a) - _Cutoff); -#else - #define ALPHA_CLIP(pixel, color) -#endif - -half3 computeLighting (int idx, half3 dirToLight, half3 eyeNormal, half4 diffuseColor, half atten) { - half NdotL = max(dot(eyeNormal, dirToLight), 0.0); - // diffuse - half3 color = NdotL * diffuseColor.rgb * unity_LightColor[idx].rgb; - return color * atten; -} - -half3 computeOneLight (int idx, float3 eyePosition, half3 eyeNormal, half4 diffuseColor) { - float3 dirToLight = unity_LightPosition[idx].xyz; - half att = 1.0; - - #if defined(POINT) || defined(SPOT) - dirToLight -= eyePosition * unity_LightPosition[idx].w; - - // distance attenuation - float distSqr = dot(dirToLight, dirToLight); - att /= (1.0 + unity_LightAtten[idx].z * distSqr); - if (unity_LightPosition[idx].w != 0 && distSqr > unity_LightAtten[idx].w) att = 0.0; // set to 0 if outside of range - distSqr = max(distSqr, 0.000001); // don't produce NaNs if some vertex position overlaps with the light - dirToLight *= rsqrt(distSqr); - #if defined(SPOT) - - // spot angle attenuation - half rho = max(dot(dirToLight, unity_SpotDirection[idx].xyz), 0.0); - half spotAtt = (rho - unity_LightAtten[idx].x) * unity_LightAtten[idx].y; - att *= saturate(spotAtt); - #endif - #endif - - att *= 0.5; // passed in light colors are 2x brighter than what used to be in FFP - return min (computeLighting (idx, dirToLight, eyeNormal, diffuseColor, att), 1.0); -} - -int4 unity_VertexLightParams; // x: light count, y: zero, z: one (y/z needed by d3d9 vs loop instruction) - -struct appdata { - float3 pos : POSITION; - float3 normal : NORMAL; - half4 color : COLOR; - float2 uv0 : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID -}; - -struct VertexOutput { - fixed4 color : COLOR0; - float2 uv0 : TEXCOORD0; - float4 pos : SV_POSITION; - UNITY_VERTEX_OUTPUT_STEREO -}; - -VertexOutput vert (appdata v) { - VertexOutput o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - half4 color = v.color; - float3 eyePos = UnityObjectToViewPos(float4(v.pos, 1)).xyz; //mul(UNITY_MATRIX_MV, float4(v.pos,1)).xyz; - half3 fixedNormal = half3(0,0,-1); - half3 eyeNormal = normalize(mul((float3x3)UNITY_MATRIX_IT_MV, fixedNormal)); - -#ifdef _DOUBLE_SIDED_LIGHTING - // unfortunately we have to compute the sign here in the vertex shader - // instead of using VFACE in fragment shader stage. - half faceSign = sign(eyeNormal.z); - eyeNormal *= faceSign; -#endif - - // Lights - half3 lcolor = half4(0,0,0,1).rgb + color.rgb * glstate_lightmodel_ambient.rgb; - for (int il = 0; il < LIGHT_LOOP_LIMIT; ++il) { - lcolor += computeOneLight(il, eyePos, eyeNormal, color); - } - - color.rgb = lcolor.rgb; - o.color = saturate(color); - o.uv0 = v.uv0; - o.pos = UnityObjectToClipPos(v.pos); - return o; -} - -sampler2D _MainTex; - -fixed4 frag (VertexOutput i) : SV_Target { - fixed4 tex = tex2D(_MainTex, i.uv0); - ALPHA_CLIP(tex, i.color); -#if defined(_STRAIGHT_ALPHA_INPUT) - tex.rgb *= tex.a; -#endif - fixed4 col = tex * i.color; - col.rgb *= 2; - return col; -} - -#endif diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Tint-Common.cginc b/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Tint-Common.cginc deleted file mode 100644 index acff8bf8a..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Tint-Common.cginc +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef SKELETON_TINT_COMMON_INCLUDED -#define SKELETON_TINT_COMMON_INCLUDED - -float4 fragTintedColor(float4 texColor, float3 darkTintColor, float4 lightTintColorPMA, float lightColorAlpha, float darkColorAlpha) { - - float a = texColor.a * lightTintColorPMA.a; - -#if !defined(_STRAIGHT_ALPHA_INPUT) - float3 texDarkColor = (texColor.a - texColor.rgb); -#else - float3 texDarkColor = (1 - texColor.rgb); -#endif - float3 darkColor = texDarkColor * darkTintColor.rgb * lightColorAlpha; - float3 lightColor = texColor.rgb * lightTintColorPMA.rgb; - - float4 fragColor = float4(darkColor + lightColor, a); -#if defined(_STRAIGHT_ALPHA_INPUT) - fragColor.rgb *= texColor.a; -#endif - -#if defined(_DARK_COLOR_ALPHA_ADDITIVE) - fragColor.a = a * (1 - darkColorAlpha); -#endif - return fragColor; -} - -#endif diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Tint-Common.cginc.meta b/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Tint-Common.cginc.meta deleted file mode 100644 index 333f4c1fc..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Skeleton-Tint-Common.cginc.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: cc9439c8e75fb7e4c82ad725b649b047 -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline.meta deleted file mode 100644 index a058eebc0..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e8c87a44b93daed4383ca2ca5dfb3c43 -folderAsset: yes -timeCreated: 1573827942 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes.meta deleted file mode 100644 index cf3eaf420..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 6a7bd28c2cf2e41499693d9f8f9e2e1a -folderAsset: yes -timeCreated: 1573829102 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Additive-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Additive-Outline.shader deleted file mode 100644 index ded84bb8f..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Additive-Outline.shader +++ /dev/null @@ -1,46 +0,0 @@ -// Outline shader variant of "Spine/Blend Modes/Skeleton PMA Additive" - -Shader "Spine/Outline/Blend Modes/Skeleton PMA Additive" { - Properties { - _Color ("Tint Color", Color) = (1,1,1,1) - [NoScaleOffset] _MainTex ("MainTex", 2D) = "black" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } - LOD 100 - - Fog { Mode Off } - Cull Off - ZWrite Off - Blend One One - Lighting Off - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - UsePass "Spine/Outline/Skeleton/OUTLINE" - - UsePass "Spine/Blend Modes/Skeleton PMA Additive/NORMAL" - - UsePass "Spine/Blend Modes/Skeleton PMA Additive/CASTER" - } - FallBack "Spine/Blend Modes/Skeleton PMA Additive" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Multiply-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Multiply-Outline.shader deleted file mode 100644 index 3ef828f28..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Multiply-Outline.shader +++ /dev/null @@ -1,46 +0,0 @@ -// Outline shader variant of "Spine/Blend Modes/Skeleton PMA Multiply" - -Shader "Spine/Outline/Blend Modes/Skeleton PMA Multiply" { - Properties { - _Color ("Tint Color", Color) = (1,1,1,1) - [NoScaleOffset] _MainTex ("MainTex", 2D) = "black" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } - LOD 100 - - Fog { Mode Off } - Cull Off - ZWrite Off - Blend DstColor OneMinusSrcAlpha - Lighting Off - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - UsePass "Spine/Outline/Skeleton/OUTLINE" - - UsePass "Spine/Blend Modes/Skeleton PMA Multiply/NORMAL" - - UsePass "Spine/Blend Modes/Skeleton PMA Multiply/CASTER" - } - FallBack "Spine/Blend Modes/Skeleton PMA Multiply" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Screen-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Screen-Outline.shader deleted file mode 100644 index 9a935604d..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Screen-Outline.shader +++ /dev/null @@ -1,46 +0,0 @@ -// Outline shader variant of "Spine/Blend Modes/Skeleton PMA Screen" - -Shader "Spine/Outline/Blend Modes/Skeleton PMA Screen" { - Properties { - _Color ("Tint Color", Color) = (1,1,1,1) - [NoScaleOffset] _MainTex ("MainTex", 2D) = "black" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } - LOD 100 - - Fog { Mode Off } - Cull Off - ZWrite Off - Blend One OneMinusSrcColor - Lighting Off - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - UsePass "Spine/Outline/Skeleton/OUTLINE" - - UsePass "Spine/Blend Modes/Skeleton PMA Screen/NORMAL" - - UsePass "Spine/Blend Modes/Skeleton PMA Screen/CASTER" - } - FallBack "Spine/Blend Modes/Skeleton PMA Screen" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Screen-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Screen-Outline.shader.meta deleted file mode 100644 index bfb5ad6c3..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/BlendModes/Spine-Skeleton-PMA-Screen-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e61a8d94e453ff641a7e39c4b11cac95 -timeCreated: 1573829476 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/CGIncludes.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/CGIncludes.meta deleted file mode 100644 index 42c978667..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/CGIncludes.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 329bda94bce571446a1a149b53ccf45c -folderAsset: yes -timeCreated: 1574096529 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/CGIncludes/Spine-Outline-Pass.cginc b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/CGIncludes/Spine-Outline-Pass.cginc deleted file mode 100644 index 3ffdbf42d..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/CGIncludes/Spine-Outline-Pass.cginc +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef SPINE_OUTLINE_PASS_INCLUDED -#define SPINE_OUTLINE_PASS_INCLUDED - -#include "UnityCG.cginc" - -#ifdef SKELETON_GRAPHIC -#include "UnityUI.cginc" -#endif - -#include "../../CGIncludes/Spine-Outline-Common.cginc" - -sampler2D _MainTex; - -float _OutlineWidth; -float4 _OutlineColor; -float4 _MainTex_TexelSize; -float _ThresholdEnd; -float _OutlineSmoothness; -float _OutlineMipLevel; -int _OutlineReferenceTexWidth; - -#ifdef SKELETON_GRAPHIC -float4 _ClipRect; -#endif - -struct VertexInput { - float4 vertex : POSITION; - float2 uv : TEXCOORD0; - float4 vertexColor : COLOR; - UNITY_VERTEX_INPUT_INSTANCE_ID -}; - -struct VertexOutput { - float4 pos : SV_POSITION; - float2 uv : TEXCOORD0; - float vertexColorAlpha : COLOR; -#ifdef SKELETON_GRAPHIC - float4 worldPosition : TEXCOORD1; -#endif - UNITY_VERTEX_OUTPUT_STEREO -}; - - -#ifdef SKELETON_GRAPHIC - -VertexOutput vertOutlineGraphic(VertexInput v) { - VertexOutput o; - - UNITY_SETUP_INSTANCE_ID(v); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.worldPosition = v.vertex; - o.pos = UnityObjectToClipPos(o.worldPosition); - o.uv = v.uv; - -#ifdef UNITY_HALF_TEXEL_OFFSET - o.pos.xy += (_ScreenParams.zw - 1.0) * float2(-1, 1); -#endif - - o.vertexColorAlpha = v.vertexColor.a; - return o; -} - -#else // !SKELETON_GRAPHIC - -VertexOutput vertOutline(VertexInput v) { - VertexOutput o; - - UNITY_SETUP_INSTANCE_ID(v); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.pos = UnityObjectToClipPos(v.vertex); - o.uv = v.uv; - o.vertexColorAlpha = v.vertexColor.a; - return o; -} -#endif - -float4 fragOutline(VertexOutput i) : SV_Target { - - float4 texColor = computeOutlinePixel(_MainTex, _MainTex_TexelSize.xy, i.uv, i.vertexColorAlpha, - _OutlineWidth, _OutlineReferenceTexWidth, _OutlineMipLevel, - _OutlineSmoothness, _ThresholdEnd, _OutlineColor); - -#ifdef SKELETON_GRAPHIC - texColor *= UnityGet2DClipping(i.worldPosition.xy, _ClipRect); -#endif - - return texColor; -} - -#endif // SPINE_OUTLINE_PASS_INCLUDED diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/CGIncludes/Spine-Outline-Pass.cginc.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/CGIncludes/Spine-Outline-Pass.cginc.meta deleted file mode 100644 index f67e757c0..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/CGIncludes/Spine-Outline-Pass.cginc.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 2ec781e799f97504c8a418e168759f70 -timeCreated: 1574096529 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic/Spine-SkeletonGraphic-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic/Spine-SkeletonGraphic-Outline.shader deleted file mode 100644 index 05f279ea5..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic/Spine-SkeletonGraphic-Outline.shader +++ /dev/null @@ -1,75 +0,0 @@ -// Outline shader variant of "Spine/SkeletonGraphic" - -Shader "Spine/Outline/SkeletonGraphic" -{ - Properties - { - [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - [Toggle(_CANVAS_GROUP_COMPATIBLE)] _CanvasGroupCompatible("CanvasGroup Compatible", Int) = 0 - _Color ("Tint", Color) = (1,1,1,1) - - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Float) = 8 - [HideInInspector] _Stencil ("Stencil ID", Float) = 0 - [HideInInspector][Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Float) = 0 - [HideInInspector] _StencilWriteMask ("Stencil Write Mask", Float) = 255 - [HideInInspector] _StencilReadMask ("Stencil Read Mask", Float) = 255 - - [HideInInspector] _ColorMask ("Color Mask", Float) = 15 - - [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader - { - Tags - { - "Queue"="Transparent" - "IgnoreProjector"="True" - "RenderType"="Transparent" - "PreviewType"="Plane" - "CanUseSpriteAtlas"="True" - } - - Stencil - { - Ref [_Stencil] - Comp [_StencilComp] - Pass [_StencilOp] - ReadMask [_StencilReadMask] - WriteMask [_StencilWriteMask] - } - - Cull Off - Lighting Off - ZWrite Off - ZTest [unity_GUIZTestMode] - Fog { Mode Off } - Blend One OneMinusSrcAlpha - ColorMask [_ColorMask] - - Pass { - Name "Outline" - CGPROGRAM - #pragma vertex vertOutlineGraphic - #pragma fragment fragOutline - #define SKELETON_GRAPHIC - #pragma shader_feature _ _USE8NEIGHBOURHOOD_ON - #include "../CGIncludes/Spine-Outline-Pass.cginc" - ENDCG - } - - UsePass "Spine/SkeletonGraphic/NORMAL" - } - FallBack "Spine/SkeletonGraphic" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic/Spine-SkeletonGraphic-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic/Spine-SkeletonGraphic-Outline.shader.meta deleted file mode 100644 index 2968808eb..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic/Spine-SkeletonGraphic-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 8f5d14d2a7fedb84998c50eb96c8b748 -timeCreated: 1573829873 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic/Spine-SkeletonGraphic-TintBlack-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic/Spine-SkeletonGraphic-TintBlack-Outline.shader deleted file mode 100644 index f739f1145..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic/Spine-SkeletonGraphic-TintBlack-Outline.shader +++ /dev/null @@ -1,68 +0,0 @@ -// Outline shader variant of "Spine/SkeletonGraphic Tint Black" - -Shader "Spine/Outline/SkeletonGraphic Tint Black" -{ - Properties - { - [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - [Toggle(_CANVAS_GROUP_COMPATIBLE)] _CanvasGroupCompatible("CanvasGroup Compatible", Int) = 0 - - _Color ("Tint", Color) = (1,1,1,1) - _Black ("Black Point", Color) = (0,0,0,0) - - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Float) = 8 - [HideInInspector] _Stencil ("Stencil ID", Float) = 0 - [HideInInspector][Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Float) = 0 - [HideInInspector] _StencilWriteMask ("Stencil Write Mask", Float) = 255 - [HideInInspector] _StencilReadMask ("Stencil Read Mask", Float) = 255 - - [HideInInspector] _ColorMask ("Color Mask", Float) = 15 - - [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader - { - Tags - { - "Queue"="Transparent" - "IgnoreProjector"="True" - "RenderType"="Transparent" - "PreviewType"="Plane" - "CanUseSpriteAtlas"="True" - } - - Stencil - { - Ref [_Stencil] - Comp [_StencilComp] - Pass [_StencilOp] - ReadMask [_StencilReadMask] - WriteMask [_StencilWriteMask] - } - - Cull Off - Lighting Off - ZWrite Off - ZTest [unity_GUIZTestMode] - Fog { Mode Off } - Blend One OneMinusSrcAlpha - ColorMask [_ColorMask] - - UsePass "Spine/Outline/SkeletonGraphic/OUTLINE" - - UsePass "Spine/SkeletonGraphic Tint Black/NORMAL" - } - FallBack "Spine/SkeletonGraphic Tint Black" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic/Spine-SkeletonGraphic-TintBlack-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic/Spine-SkeletonGraphic-TintBlack-Outline.shader.meta deleted file mode 100644 index a35c5b2e8..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/SkeletonGraphic/Spine-SkeletonGraphic-TintBlack-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: d55d64dd09c46af40a319933a62fa1b2 -timeCreated: 1573830121 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Fill-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Fill-Outline.shader deleted file mode 100644 index fc2545172..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Fill-Outline.shader +++ /dev/null @@ -1,43 +0,0 @@ -// Outline shader variant of "Spine/Skeleton Fill" - -Shader "Spine/Outline/Skeleton Fill" { - Properties { - _FillColor ("FillColor", Color) = (1,1,1,1) - _FillPhase ("FillPhase", Range(0, 1)) = 0 - [NoScaleOffset] _MainTex ("MainTex", 2D) = "white" {} - _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } - Blend One OneMinusSrcAlpha - Cull Off - ZWrite Off - Lighting Off - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - UsePass "Spine/Outline/Skeleton/OUTLINE" - - UsePass "Spine/Skeleton Fill/NORMAL" - - UsePass "Spine/Skeleton Fill/CASTER" - } - FallBack "Spine/Skeleton Fill" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Fill-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Fill-Outline.shader.meta deleted file mode 100644 index 3793896de..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Fill-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e158cbe58baa093438feb3d691f3daba -timeCreated: 1573817434 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Lit-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Lit-Outline.shader deleted file mode 100644 index 75c0a9f5a..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Lit-Outline.shader +++ /dev/null @@ -1,40 +0,0 @@ -// Outline shader variant of "Spine/Skeleton Lit" - -Shader "Spine/Outline/Skeleton Lit" { - Properties { - _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - [NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - [Toggle(_DOUBLE_SIDED_LIGHTING)] _DoubleSidedLighting("Double-Sided Lighting", Int) = 0 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } - LOD 100 - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - UsePass "Spine/Outline/Skeleton/OUTLINE" - - UsePass "Spine/Skeleton Lit/NORMAL" - - UsePass "Spine/Skeleton Lit/CASTER" - } - FallBack "Spine/Skeleton Lit" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Lit-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Lit-Outline.shader.meta deleted file mode 100644 index 4dd9501b7..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Lit-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 10fab3f69a099be4391fe8a1ad880c65 -timeCreated: 1573828963 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Lit-ZWrite-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Lit-ZWrite-Outline.shader deleted file mode 100644 index 044308562..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Lit-ZWrite-Outline.shader +++ /dev/null @@ -1,41 +0,0 @@ -// Outline shader variant of "Spine/Skeleton Lit ZWrite" - -Shader "Spine/Outline/Skeleton Lit ZWrite" { - Properties { - _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.1 - _ShadowAlphaCutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - [NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - [Toggle(_DOUBLE_SIDED_LIGHTING)] _DoubleSidedLighting("Double-Sided Lighting", Int) = 0 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } - LOD 100 - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - UsePass "Spine/Outline/Skeleton/OUTLINE" - - UsePass "Spine/Skeleton Lit ZWrite/NORMAL" - - UsePass "Spine/Skeleton Lit ZWrite/CASTER" - } - FallBack "Spine/Skeleton Lit ZWrite" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Lit-ZWrite-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Lit-ZWrite-Outline.shader.meta deleted file mode 100644 index e772ed452..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Lit-ZWrite-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 756be4f2f738f6c4583bb1c90e16bf0b -timeCreated: 1573828964 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Outline.shader deleted file mode 100644 index e60ef0681..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Outline.shader +++ /dev/null @@ -1,52 +0,0 @@ -// Outline shader variant of "Spine/Skeleton" - -Shader "Spine/Outline/Skeleton" { - Properties { - _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - [NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } - - Fog { Mode Off } - Cull Off - ZWrite Off - Blend One OneMinusSrcAlpha - Lighting Off - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - Pass { - Name "Outline" - CGPROGRAM - #pragma vertex vertOutline - #pragma fragment fragOutline - #pragma shader_feature _ _USE8NEIGHBOURHOOD_ON - #include "CGIncludes/Spine-Outline-Pass.cginc" - ENDCG - } - - UsePass "Spine/Skeleton/NORMAL" - - UsePass "Spine/Skeleton/CASTER" - } - FallBack "Spine/Skeleton" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Outline.shader.meta deleted file mode 100644 index e7dcd76e9..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 28b5cf4804845fe4b868531fd0bb81d5 -timeCreated: 1573817434 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-OutlineOnly-ZWrite.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-OutlineOnly-ZWrite.shader deleted file mode 100644 index 82dc8cf72..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-OutlineOnly-ZWrite.shader +++ /dev/null @@ -1,62 +0,0 @@ -Shader "Spine/Outline/OutlineOnly-ZWrite" { - Properties { - _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.1 - _ZWriteOffset ("Depth offset", Range(0,1)) = 0.01 - [NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } - - Fog { Mode Off } - Cull Off - ZWrite Off - Blend One OneMinusSrcAlpha - Lighting Off - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - Pass - { - Name "DepthOnly" - - ZWrite On - ColorMask 0 - Cull Off - - CGPROGRAM - #pragma vertex DepthOnlyVertex - #pragma fragment DepthOnlyFragment - #include "../CGIncludes/Spine-DepthOnlyPass.cginc" - ENDCG - } - - Pass { - Name "Outline" - CGPROGRAM - #pragma vertex vertOutline - #pragma fragment fragOutline - #pragma shader_feature _ _USE8NEIGHBOURHOOD_ON - #include "CGIncludes/Spine-Outline-Pass.cginc" - ENDCG - } - } - FallBack "Spine/Skeleton" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-OutlineOnly-ZWrite.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-OutlineOnly-ZWrite.shader.meta deleted file mode 100644 index 9e2895589..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-OutlineOnly-ZWrite.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 177da18c3d2e0aa4cb39990ea011973c -ShaderImporter: - externalObjects: {} - defaultTextures: [] - nonModifiableTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Tint-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Tint-Outline.shader deleted file mode 100644 index 2b385f880..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Tint-Outline.shader +++ /dev/null @@ -1,46 +0,0 @@ -// Outline shader variant of "Spine/Skeleton Tint" - -Shader "Spine/Outline/Skeleton Tint" { - Properties { - _Color ("Tint Color", Color) = (1,1,1,1) - _Black ("Black Point", Color) = (0,0,0,0) - [NoScaleOffset] _MainTex ("MainTex", 2D) = "black" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - _Cutoff("Shadow alpha cutoff", Range(0,1)) = 0.1 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } - - Fog { Mode Off } - Cull Off - ZWrite Off - Blend One OneMinusSrcAlpha - Lighting Off - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - UsePass "Spine/Outline/Skeleton/OUTLINE" - - UsePass "Spine/Skeleton Tint/NORMAL" - - UsePass "Spine/Skeleton Tint/CASTER" - } - FallBack "Spine/Skeleton Tint" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Tint-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Tint-Outline.shader.meta deleted file mode 100644 index e5d5456d9..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-Tint-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 4f1fdc166fed03649835949d3b79cba3 -timeCreated: 1573817434 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-TintBlack-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-TintBlack-Outline.shader deleted file mode 100644 index 64afad4e2..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-TintBlack-Outline.shader +++ /dev/null @@ -1,47 +0,0 @@ -// Outline shader variant of "Spine/Skeleton Tint Black" - -Shader "Spine/Outline/Skeleton Tint Black" { - Properties { - _Color ("Tint Color", Color) = (1,1,1,1) - _Black ("Black Point", Color) = (0,0,0,0) - [NoScaleOffset] _MainTex ("MainTex", 2D) = "black" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } - LOD 100 - - Fog { Mode Off } - Cull Off - ZWrite Off - Blend One OneMinusSrcAlpha - Lighting Off - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - UsePass "Spine/Outline/Skeleton/OUTLINE" - - UsePass "Spine/Skeleton Tint Black/NORMAL" - - UsePass "Spine/Skeleton Tint Black/CASTER" - } - FallBack "Spine/Special/Skeleton Grayscale" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-TintBlack-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-TintBlack-Outline.shader.meta deleted file mode 100644 index 8bbce16a1..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Skeleton-TintBlack-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 49cf725a1e40e7742be92917f83946c3 -timeCreated: 1573828963 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Special-Skeleton-Grayscale-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Special-Skeleton-Grayscale-Outline.shader deleted file mode 100644 index 722ed75ba..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Special-Skeleton-Grayscale-Outline.shader +++ /dev/null @@ -1,43 +0,0 @@ -// Outline shader variant of "Spine/Special/Skeleton Grayscale" - -Shader "Spine/Outline/Special/Skeleton Grayscale" { - Properties { - _GrayPhase ("Phase", Range(0, 1)) = 1 - [NoScaleOffset] _MainTex ("MainTex", 2D) = "white" {} - _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" } - Blend One OneMinusSrcAlpha - Cull Off - ZWrite Off - Lighting Off - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - UsePass "Spine/Outline/Skeleton/OUTLINE" - - UsePass "Spine/Special/Skeleton Grayscale/NORMAL" - - UsePass "Spine/Special/Skeleton Grayscale/CASTER" - } - FallBack "Spine/Special/Skeleton Grayscale" - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Special-Skeleton-Grayscale-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Special-Skeleton-Grayscale-Outline.shader.meta deleted file mode 100644 index 5f17b0bbe..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Spine-Special-Skeleton-Grayscale-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1d3e1518ae643a749b086bc7972893d2 -timeCreated: 1573828963 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesPixelLit-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesPixelLit-Outline.shader deleted file mode 100644 index 844a990e4..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesPixelLit-Outline.shader +++ /dev/null @@ -1,81 +0,0 @@ -// Outline shader variant of "Spine/Sprite/Pixel Lit" - -Shader "Spine/Outline/Sprite/Pixel Lit" -{ - Properties - { - _MainTex ("Main Texture", 2D) = "white" {} - _Color ("Color", Color) = (1,1,1,1) - - _BumpScale("Scale", Float) = 1.0 - _BumpMap ("Normal Map", 2D) = "bump" {} - - [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 - - _EmissionColor("Color", Color) = (0,0,0,0) - _EmissionMap("Emission", 2D) = "white" {} - _EmissionPower("Emission Power", Float) = 2.0 - - _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5 - _GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0 - [Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0 - _MetallicGlossMap("Metallic", 2D) = "white" {} - - _DiffuseRamp ("Diffuse Ramp Texture", 2D) = "gray" {} - - _FixedNormal ("Fixed Normal", Vector) = (0,0,1,1) - _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.5 - _ShadowAlphaCutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - _CustomRenderQueue ("Custom Render Queue", Float) = 0.0 - - _OverlayColor ("Overlay Color", Color) = (0,0,0,0) - _Hue("Hue", Range(-0.5,0.5)) = 0.0 - _Saturation("Saturation", Range(0,2)) = 1.0 - _Brightness("Brightness", Range(0,2)) = 1.0 - - _RimPower("Rim Power", Float) = 2.0 - _RimColor ("Rim Color", Color) = (1,1,1,1) - - _BlendTex ("Blend Texture", 2D) = "white" {} - _BlendAmount ("Blend", Range(0,1)) = 0.0 - - [HideInInspector] _SrcBlend ("__src", Float) = 1.0 - [HideInInspector] _DstBlend ("__dst", Float) = 0.0 - [HideInInspector] _RenderQueue ("__queue", Float) = 0.0 - [HideInInspector] _Cull ("__cull", Float) = 0.0 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader - { - Tags { "Queue"="Transparent" "RenderType"="Sprite" "AlphaDepth"="False" "CanUseSpriteAtlas"="True" "IgnoreProjector"="True" } - LOD 200 - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - UsePass "Spine/Outline/Skeleton/OUTLINE" - - UsePass "Spine/Sprite/Pixel Lit/FORWARD" - - UsePass "Spine/Sprite/Pixel Lit/FORWARD_DELTA" - - UsePass "Spine/Sprite/Pixel Lit/SHADOWCASTER" - } - - FallBack "Spine/Sprite/Pixel Lit" - CustomEditor "SpineSpriteShaderGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesPixelLit-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesPixelLit-Outline.shader.meta deleted file mode 100644 index 963554e07..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesPixelLit-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a27d4b27c8ecd9840a03558ccc5ad8a3 -timeCreated: 1573830741 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesUnlit-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesUnlit-Outline.shader deleted file mode 100644 index 756f7da33..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesUnlit-Outline.shader +++ /dev/null @@ -1,61 +0,0 @@ -// Outline shader variant of "Spine/Sprite/Unlit" - -Shader "Spine/Outline/Sprite/Unlit" -{ - Properties - { - _MainTex ("Main Texture", 2D) = "white" {} - _Color ("Color", Color) = (1,1,1,1) - - [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 - - _ZWrite ("Depth Write", Float) = 0.0 - _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.0 - _ShadowAlphaCutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - _CustomRenderQueue ("Custom Render Queue", Float) = 0.0 - - _OverlayColor ("Overlay Color", Color) = (0,0,0,0) - _Hue("Hue", Range(-0.5,0.5)) = 0.0 - _Saturation("Saturation", Range(0,2)) = 1.0 - _Brightness("Brightness", Range(0,2)) = 1.0 - - _BlendTex ("Blend Texture", 2D) = "white" {} - _BlendAmount ("Blend", Range(0,1)) = 0.0 - - [HideInInspector] _SrcBlend ("__src", Float) = 1.0 - [HideInInspector] _DstBlend ("__dst", Float) = 0.0 - [HideInInspector] _RenderQueue ("__queue", Float) = 0.0 - [HideInInspector] _Cull ("__cull", Float) = 0.0 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader - { - Tags { "Queue"="Transparent" "RenderType"="Sprite" "AlphaDepth"="False" "CanUseSpriteAtlas"="True" "IgnoreProjector"="True" } - LOD 100 - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - UsePass "Spine/Outline/Skeleton/OUTLINE" - - UsePass "Spine/Sprite/Unlit/NORMAL" - - UsePass "Spine/Sprite/Unlit/SHADOWCASTER" - } - FallBack "Spine/Sprite/Unlit" - CustomEditor "SpineSpriteShaderGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesUnlit-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesUnlit-Outline.shader.meta deleted file mode 100644 index 0ab753455..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesUnlit-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 276c07e3bdd5719458187a5823e9d96a -timeCreated: 1573830740 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesVertexLit-Outline.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesVertexLit-Outline.shader deleted file mode 100644 index 6e087dd04..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesVertexLit-Outline.shader +++ /dev/null @@ -1,80 +0,0 @@ -// Outline shader variant of "Spine/Sprite/Vertex Lit" - -Shader "Spine/Outline/Sprite/Vertex Lit" -{ - Properties - { - _MainTex ("Main Texture", 2D) = "white" {} - _Color ("Color", Color) = (1,1,1,1) - - _BumpScale("Scale", Float) = 1.0 - _BumpMap ("Normal Map", 2D) = "bump" {} - - [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 - - _EmissionColor("Color", Color) = (0,0,0,0) - _EmissionMap("Emission", 2D) = "white" {} - _EmissionPower("Emission Power", Float) = 2.0 - - _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5 - _GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0 - [Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0 - _MetallicGlossMap("Metallic", 2D) = "white" {} - - _DiffuseRamp ("Diffuse Ramp Texture", 2D) = "gray" {} - - _FixedNormal ("Fixed Normal", Vector) = (0,0,1,1) - _ZWrite ("Depth Write", Float) = 0.0 - _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.0 - _ShadowAlphaCutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - _CustomRenderQueue ("Custom Render Queue", Float) = 0.0 - - _OverlayColor ("Overlay Color", Color) = (0,0,0,0) - _Hue("Hue", Range(-0.5,0.5)) = 0.0 - _Saturation("Saturation", Range(0,2)) = 1.0 - _Brightness("Brightness", Range(0,2)) = 1.0 - - _RimPower("Rim Power", Float) = 2.0 - _RimColor ("Rim Color", Color) = (1,1,1,1) - - _BlendTex ("Blend Texture", 2D) = "white" {} - _BlendAmount ("Blend", Range(0,1)) = 0.0 - - [HideInInspector] _SrcBlend ("__src", Float) = 1.0 - [HideInInspector] _DstBlend ("__dst", Float) = 0.0 - [HideInInspector] _RenderQueue ("__queue", Float) = 0.0 - [HideInInspector] _Cull ("__cull", Float) = 0.0 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader - { - Tags { "Queue"="Transparent" "RenderType"="Sprite" "AlphaDepth"="False" "CanUseSpriteAtlas"="True" "IgnoreProjector"="True" } - LOD 150 - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - UsePass "Spine/Outline/Skeleton/OUTLINE" - - UsePass "Spine/Sprite/Vertex Lit/VERTEX" - - UsePass "Spine/Sprite/Vertex Lit/SHADOWCASTER" - } - - FallBack "Spine/Sprite/Vertex Lit" - CustomEditor "SpineSpriteShaderGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesVertexLit-Outline.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesVertexLit-Outline.shader.meta deleted file mode 100644 index baa2bcfa8..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Outline/Sprite/SpritesVertexLit-Outline.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 30ef5dd318033004588a6481c092416a -timeCreated: 1573830740 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic/Spine-SkeletonGraphic-TintBlack.shader b/Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic/Spine-SkeletonGraphic-TintBlack.shader deleted file mode 100644 index ccf24f53a..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/SkeletonGraphic/Spine-SkeletonGraphic-TintBlack.shader +++ /dev/null @@ -1,148 +0,0 @@ -// This is a premultiply-alpha adaptation of the built-in Unity shader "UI/Default" to allow Unity UI stencil masking. - -Shader "Spine/SkeletonGraphic Tint Black" -{ - Properties - { - [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - [Toggle(_CANVAS_GROUP_COMPATIBLE)] _CanvasGroupCompatible("CanvasGroup Compatible", Int) = 0 - - _Color ("Tint Color", Color) = (1,1,1,1) - _Black ("Dark Color", Color) = (0,0,0,0) - [Toggle(_DARK_COLOR_ALPHA_ADDITIVE)] _DarkColorAlphaAdditive("Additive DarkColor.A", Int) = 0 - - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Float) = 8 - [HideInInspector] _Stencil ("Stencil ID", Float) = 0 - [HideInInspector][Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Float) = 0 - [HideInInspector] _StencilWriteMask ("Stencil Write Mask", Float) = 255 - [HideInInspector] _StencilReadMask ("Stencil Read Mask", Float) = 255 - - [HideInInspector] _ColorMask ("Color Mask", Float) = 15 - - [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader - { - Tags - { - "Queue"="Transparent" - "IgnoreProjector"="True" - "RenderType"="Transparent" - "PreviewType"="Plane" - "CanUseSpriteAtlas"="True" - } - - Stencil - { - Ref [_Stencil] - Comp [_StencilComp] - Pass [_StencilOp] - ReadMask [_StencilReadMask] - WriteMask [_StencilWriteMask] - } - - Cull Off - Lighting Off - ZWrite Off - ZTest [unity_GUIZTestMode] - Fog { Mode Off } - Blend One OneMinusSrcAlpha - ColorMask [_ColorMask] - - Pass - { - Name "Normal" - - CGPROGRAM - #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT - #pragma shader_feature _ _CANVAS_GROUP_COMPATIBLE - #pragma shader_feature _ _DARK_COLOR_ALPHA_ADDITIVE - #pragma vertex vert - #pragma fragment frag - - #include "UnityCG.cginc" - #include "UnityUI.cginc" - - #pragma multi_compile __ UNITY_UI_ALPHACLIP - - struct VertexInput { - float4 vertex : POSITION; - float4 color : COLOR; - float2 texcoord : TEXCOORD0; - float2 uv1 : TEXCOORD1; - float2 uv2 : TEXCOORD2; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct VertexOutput { - float4 vertex : SV_POSITION; - fixed4 color : COLOR; - half2 texcoord : TEXCOORD0; - float4 darkColor : TEXCOORD1; - float4 worldPosition : TEXCOORD2; - UNITY_VERTEX_OUTPUT_STEREO - }; - - fixed4 _Color; - fixed4 _Black; - fixed4 _TextureSampleAdd; - float4 _ClipRect; - - VertexOutput vert (VertexInput IN) { - VertexOutput OUT; - - UNITY_SETUP_INSTANCE_ID(IN); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); - - OUT.worldPosition = IN.vertex; - OUT.vertex = UnityObjectToClipPos(OUT.worldPosition); - OUT.texcoord = IN.texcoord; - - OUT.color = IN.color; - OUT.darkColor = float4(IN.uv1.r, IN.uv1.g, IN.uv2.r, IN.uv2.g); - return OUT; - } - - sampler2D _MainTex; - #include "../CGIncludes/Spine-Skeleton-Tint-Common.cginc" - - fixed4 frag (VertexOutput IN) : SV_Target - { - half4 texColor = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd); - texColor *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect); - #ifdef UNITY_UI_ALPHACLIP - clip(texColor.a - 0.001); - #endif - - float4 vertexColor = IN.color * float4(_Color.rgb * _Color.a, _Color.a); - #ifdef _CANVAS_GROUP_COMPATIBLE - // CanvasGroup alpha multiplies existing vertex color alpha, but - // does not premultiply it to rgb components. This causes problems - // with additive blending (alpha = 0), which is why we store the - // alpha value in uv2.g (darkColor.a). - float originalAlpha = IN.darkColor.a; - float canvasAlpha = (originalAlpha == 0) ? IN.color.a : IN.color.a / originalAlpha; - vertexColor.a = originalAlpha * _Color.a; - #endif - float4 fragColor = fragTintedColor(texColor, _Black.rgb + IN.darkColor, vertexColor, _Color.a, _Black.a); - #ifdef _CANVAS_GROUP_COMPATIBLE - fragColor.rgba *= canvasAlpha; - #endif - return fragColor; - } - ENDCG - } - } - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Lit-ZWrite.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Lit-ZWrite.shader deleted file mode 100644 index 95f77b77f..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Lit-ZWrite.shader +++ /dev/null @@ -1,82 +0,0 @@ -// - Vertex Lit + ShadowCaster -// - Premultiplied Alpha Blending (Optional straight alpha input) -// - Double-sided, ZWrite - -Shader "Spine/Skeleton Lit ZWrite" { - Properties { - _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.1 - _ShadowAlphaCutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - [NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - [Toggle(_DOUBLE_SIDED_LIGHTING)] _DoubleSidedLighting("Double-Sided Lighting", Int) = 0 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } - LOD 100 - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - Pass { - Name "Normal" - - Tags { "LightMode"="Vertex" "Queue"="Transparent" "IgnoreProjector"="true" "RenderType"="Transparent" } - - ZWrite On - Cull Off - Blend One OneMinusSrcAlpha - - CGPROGRAM - #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT - #pragma shader_feature _ _DOUBLE_SIDED_LIGHTING - #pragma vertex vert - #pragma fragment frag - #pragma target 2.0 - - #define _ALPHA_CLIP - #pragma multi_compile __ POINT SPOT - #include "CGIncludes/Spine-Skeleton-Lit-Common.cginc" - ENDCG - - } - - Pass { - Name "Caster" - Tags { "LightMode"="ShadowCaster" } - Offset 1, 1 - - Fog { Mode Off } - ZWrite On - ZTest LEqual - Cull Off - Lighting Off - - CGPROGRAM - #pragma vertex vertShadow - #pragma fragment fragShadow - #pragma multi_compile_shadowcaster - #pragma fragmentoption ARB_precision_hint_fastest - - #define SHADOW_CUTOFF _ShadowAlphaCutoff - #include "CGIncludes/Spine-Skeleton-Lit-Common-Shadow.cginc" - - ENDCG - } - } - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Lit-ZWrite.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Lit-ZWrite.shader.meta deleted file mode 100644 index 28243a0f2..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Lit-ZWrite.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: fde05abf1f7be4b4da1caf8c8de1823a -timeCreated: 1564082883 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Lit.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Lit.shader deleted file mode 100644 index f10c478fa..000000000 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Lit.shader +++ /dev/null @@ -1,80 +0,0 @@ -// - Vertex Lit + ShadowCaster -// - Premultiplied Alpha Blending (Optional straight alpha input) -// - Double-sided, no depth - -Shader "Spine/Skeleton Lit" { - Properties { - _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - [NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {} - [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 - [Toggle(_DOUBLE_SIDED_LIGHTING)] _DoubleSidedLighting("Double-Sided Lighting", Int) = 0 - [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 - } - - SubShader { - Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } - LOD 100 - - Stencil { - Ref[_StencilRef] - Comp[_StencilComp] - Pass Keep - } - - Pass { - Name "Normal" - - Tags { "LightMode"="Vertex" "Queue"="Transparent" "IgnoreProjector"="true" "RenderType"="Transparent" } - - ZWrite Off - Cull Off - Blend One OneMinusSrcAlpha - - CGPROGRAM - #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT - #pragma shader_feature _ _DOUBLE_SIDED_LIGHTING - #pragma vertex vert - #pragma fragment frag - #pragma target 2.0 - - #pragma multi_compile __ POINT SPOT - #include "CGIncludes/Spine-Skeleton-Lit-Common.cginc" - ENDCG - - } - - Pass { - Name "Caster" - Tags { "LightMode"="ShadowCaster" } - Offset 1, 1 - - Fog { Mode Off } - ZWrite On - ZTest LEqual - Cull Off - Lighting Off - - CGPROGRAM - #pragma vertex vertShadow - #pragma fragment fragShadow - #pragma multi_compile_shadowcaster - #pragma fragmentoption ARB_precision_hint_fastest - - #define SHADOW_CUTOFF _Cutoff - #include "CGIncludes/Spine-Skeleton-Lit-Common-Shadow.cginc" - - ENDCG - } - } - CustomEditor "SpineShaderWithOutlineGUI" -} diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader index df562da45..d5870249e 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader +++ b/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader @@ -9,22 +9,12 @@ Shader "Spine/Skeleton Tint Black" { Properties { _Color ("Tint Color", Color) = (1,1,1,1) - _Black ("Dark Color", Color) = (0,0,0,0) + _Black ("Black Point", Color) = (0,0,0,0) [NoScaleOffset] _MainTex ("MainTex", 2D) = "black" {} [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 - [Toggle(_DARK_COLOR_ALPHA_ADDITIVE)] _DarkColorAlphaAdditive("Additive DarkColor.A", Int) = 0 [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default } SubShader { @@ -44,11 +34,8 @@ Shader "Spine/Skeleton Tint Black" { } Pass { - Name "Normal" - CGPROGRAM #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT - #pragma shader_feature _ _DARK_COLOR_ALPHA_ADDITIVE #pragma vertex vert #pragma fragment frag #include "UnityCG.cginc" @@ -67,7 +54,8 @@ Shader "Spine/Skeleton Tint Black" { struct VertexOutput { float4 pos : SV_POSITION; float2 uv : TEXCOORD0; - float3 darkColor : TEXCOORD1; + float2 uv1 : TEXCOORD1; + float2 uv2 : TEXCOORD2; float4 vertexColor : COLOR; }; @@ -76,15 +64,19 @@ Shader "Spine/Skeleton Tint Black" { o.pos = UnityObjectToClipPos(v.vertex); // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' o.uv = v.uv; o.vertexColor = v.vertexColor * float4(_Color.rgb * _Color.a, _Color.a); // Combine a PMA version of _Color with vertexColor. - o.darkColor = float3(v.uv1.r, v.uv1.g, v.uv2.r); + o.uv1 = v.uv1; + o.uv2 = v.uv2; return o; } - #include "CGIncludes/Spine-Skeleton-Tint-Common.cginc" - float4 frag (VertexOutput i) : SV_Target { float4 texColor = tex2D(_MainTex, i.uv); - return fragTintedColor(texColor, _Black.rgb + i.darkColor, i.vertexColor, _Color.a, _Black.a); + + #if defined(_STRAIGHT_ALPHA_INPUT) + texColor.rgb *= texColor.a; + #endif + + return (texColor * i.vertexColor) + float4(((1-texColor.rgb) * (_Black.rgb + float3(i.uv1.r, i.uv1.g, i.uv2.r)) * texColor.a*_Color.a*i.vertexColor.a), 0); } ENDCG } @@ -106,26 +98,24 @@ Shader "Spine/Skeleton Tint Black" { sampler2D _MainTex; fixed _Cutoff; - struct v2f { + struct v2f { V2F_SHADOW_CASTER; - float4 uvAndAlpha : TEXCOORD1; + float2 uv : TEXCOORD1; }; - v2f vert (appdata_base v, float4 vertexColor : COLOR) { + v2f vert (appdata_base v) { v2f o; TRANSFER_SHADOW_CASTER(o) - o.uvAndAlpha = v.texcoord; - o.uvAndAlpha.a = vertexColor.a; + o.uv = v.texcoord; return o; } float4 frag (v2f i) : SV_Target { - fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); - clip(texcol.a * i.uvAndAlpha.a - _Cutoff); + fixed4 texcol = tex2D(_MainTex, i.uv); + clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) } ENDCG } } - CustomEditor "SpineShaderWithOutlineGUI" } diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader index 10edd6c4a..e75e44a09 100644 --- a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader +++ b/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader @@ -4,16 +4,7 @@ Shader "Spine/Skeleton" { [NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {} [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 - [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default - - // Outline properties are drawn via custom editor. - [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0 - [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1) - [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024 - [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25 - [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0 - [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1 - [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default } SubShader { @@ -32,8 +23,6 @@ Shader "Spine/Skeleton" { } Pass { - Name "Normal" - CGPROGRAM #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT #pragma vertex vert @@ -93,26 +82,24 @@ Shader "Spine/Skeleton" { sampler2D _MainTex; fixed _Cutoff; - struct VertexOutput { + struct VertexOutput { V2F_SHADOW_CASTER; - float4 uvAndAlpha : TEXCOORD1; + float2 uv : TEXCOORD1; }; - VertexOutput vert (appdata_base v, float4 vertexColor : COLOR) { + VertexOutput vert (appdata_base v) { VertexOutput o; - o.uvAndAlpha = v.texcoord; - o.uvAndAlpha.a = vertexColor.a; + o.uv = v.texcoord; TRANSFER_SHADOW_CASTER(o) return o; } float4 frag (VertexOutput i) : SV_Target { - fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy); - clip(texcol.a * i.uvAndAlpha.a - _Cutoff); + fixed4 texcol = tex2D(_MainTex, i.uv); + clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) } ENDCG } } - CustomEditor "SpineShaderWithOutlineGUI" } diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader b/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader new file mode 100644 index 000000000..2041c8199 --- /dev/null +++ b/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader @@ -0,0 +1,205 @@ +// - Vertex Lit + ShadowCaster +// - Premultiplied Alpha Blending (Optional straight alpha input) +// - Double-sided, no depth + +Shader "Spine/Skeleton Lit" { + Properties { + _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1 + [NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {} + [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0 + [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default + } + + SubShader { + Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } + LOD 100 + + Cull Off + ZWrite Off + Blend One OneMinusSrcAlpha + + Stencil { + Ref[_StencilRef] + Comp[_StencilComp] + Pass Keep + } + +// Pass { +// Tags { "LightMode"="Vertex" } +// ColorMaterial AmbientAndDiffuse +// Lighting On +// SetTexture [_MainTex] { +// Combine texture * primary DOUBLE, texture * primary +// } +// } + + Pass { + Tags { + "LIGHTMODE"="Vertex" + "QUEUE"="Transparent" + "IGNOREPROJECTOR"="true" + "RenderType"="Transparent" + } + + ZWrite Off + Cull Off + Blend One OneMinusSrcAlpha + + CGPROGRAM + #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + #include "UnityCG.cginc" + + // ES2.0/WebGL/3DS can not do loops with non-constant-expression iteration counts :( + #if defined(SHADER_API_GLES) + #define LIGHT_LOOP_LIMIT 8 + #elif defined(SHADER_API_N3DS) + #define LIGHT_LOOP_LIMIT 4 + #else + #define LIGHT_LOOP_LIMIT unity_VertexLightParams.x + #endif + + #pragma multi_compile __ POINT SPOT + + half3 computeLighting (int idx, half3 dirToLight, half3 eyeNormal, half3 viewDir, half4 diffuseColor, half atten) { + half NdotL = max(dot(eyeNormal, dirToLight), 0.0); + // diffuse + half3 color = NdotL * diffuseColor.rgb * unity_LightColor[idx].rgb; + return color * atten; + } + + half3 computeOneLight (int idx, float3 eyePosition, half3 eyeNormal, half3 viewDir, half4 diffuseColor) { + float3 dirToLight = unity_LightPosition[idx].xyz; + half att = 1.0; + + #if defined(POINT) || defined(SPOT) + dirToLight -= eyePosition * unity_LightPosition[idx].w; + + // distance attenuation + float distSqr = dot(dirToLight, dirToLight); + att /= (1.0 + unity_LightAtten[idx].z * distSqr); + if (unity_LightPosition[idx].w != 0 && distSqr > unity_LightAtten[idx].w) att = 0.0; // set to 0 if outside of range + distSqr = max(distSqr, 0.000001); // don't produce NaNs if some vertex position overlaps with the light + dirToLight *= rsqrt(distSqr); + #if defined(SPOT) + + // spot angle attenuation + half rho = max(dot(dirToLight, unity_SpotDirection[idx].xyz), 0.0); + half spotAtt = (rho - unity_LightAtten[idx].x) * unity_LightAtten[idx].y; + att *= saturate(spotAtt); + #endif + #endif + + att *= 0.5; // passed in light colors are 2x brighter than what used to be in FFP + return min (computeLighting (idx, dirToLight, eyeNormal, viewDir, diffuseColor, att), 1.0); + } + + int4 unity_VertexLightParams; // x: light count, y: zero, z: one (y/z needed by d3d9 vs loop instruction) + + struct appdata { + float3 pos : POSITION; + float3 normal : NORMAL; + half4 color : COLOR; + float3 uv0 : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct VertexOutput { + fixed4 color : COLOR0; + float2 uv0 : TEXCOORD0; + float4 pos : SV_POSITION; + UNITY_VERTEX_OUTPUT_STEREO + }; + + VertexOutput vert (appdata v) { + VertexOutput o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + half4 color = v.color; + float3 eyePos = UnityObjectToViewPos(float4(v.pos, 1)).xyz; //mul(UNITY_MATRIX_MV, float4(v.pos,1)).xyz; + half3 fixedNormal = half3(0,0,-1); + half3 eyeNormal = normalize(mul((float3x3)UNITY_MATRIX_IT_MV, fixedNormal)); + //half3 eyeNormal = half3(0,0,1); + half3 viewDir = 0.0; + + // Lights + half3 lcolor = half4(0,0,0,1).rgb + color.rgb * glstate_lightmodel_ambient.rgb; + for (int il = 0; il < LIGHT_LOOP_LIMIT; ++il) { + lcolor += computeOneLight(il, eyePos, eyeNormal, viewDir, color); + } + + color.rgb = lcolor.rgb; + o.color = saturate(color); + o.uv0 = v.uv0; + o.pos = UnityObjectToClipPos(v.pos); + return o; + } + + sampler2D _MainTex; + + fixed4 frag (VertexOutput i) : SV_Target { + fixed4 tex = tex2D(_MainTex, i.uv0); + + fixed4 col; + + #if defined(_STRAIGHT_ALPHA_INPUT) + col.rgb = tex * i.color * tex.a; + #else + col.rgb = tex * i.color; + #endif + + col *= 2; + col.a = tex.a * i.color.a; + return col; + } + ENDCG + + } + + Pass { + Name "Caster" + Tags { "LightMode"="ShadowCaster" } + Offset 1, 1 + + Fog { Mode Off } + ZWrite On + ZTest LEqual + Cull Off + Lighting Off + + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile_shadowcaster + #pragma fragmentoption ARB_precision_hint_fastest + #include "UnityCG.cginc" + struct v2f { + V2F_SHADOW_CASTER; + float2 uv : TEXCOORD1; + }; + + uniform float4 _MainTex_ST; + + v2f vert (appdata_base v) { + v2f o; + TRANSFER_SHADOW_CASTER(o) + o.uv = TRANSFORM_TEX(v.texcoord, _MainTex); + return o; + } + + uniform sampler2D _MainTex; + uniform fixed _Cutoff; + + float4 frag (v2f i) : SV_Target { + fixed4 texcol = tex2D(_MainTex, i.uv); + clip(texcol.a - _Cutoff); + SHADOW_CASTER_FRAGMENT(i) + } + ENDCG + } + } +} \ No newline at end of file diff --git a/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Lit.shader.meta b/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-Lit.shader.meta rename to Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader.meta diff --git a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets.meta b/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets.meta deleted file mode 100644 index 0c464666f..000000000 --- a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 5d7322e83d799d849bea71dbd6f1c24e -folderAsset: yes -timeCreated: 1563297885 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials.meta b/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials.meta deleted file mode 100644 index 642bab4ba..000000000 --- a/Assets/Spine/Runtime/spine-unity/SkeletonDataModifierAssets/BlendModeMaterials.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 16fbcfb5e341ff44bb99593fff04539d -folderAsset: yes -timeCreated: 1563298958 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Utility/SkeletonExtensions.cs b/Assets/Spine/Runtime/spine-unity/SkeletonExtensions.cs similarity index 87% rename from Assets/Spine/Runtime/spine-unity/Utility/SkeletonExtensions.cs rename to Assets/Spine/Runtime/spine-unity/SkeletonExtensions.cs index 4ca34defb..db46ad687 100644 --- a/Assets/Spine/Runtime/spine-unity/Utility/SkeletonExtensions.cs +++ b/Assets/Spine/Runtime/spine-unity/SkeletonExtensions.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEngine; @@ -100,8 +100,8 @@ namespace Spine.Unity { #region Skeleton /// Sets the Skeleton's local scale using a UnityEngine.Vector2. If only individual components need to be set, set Skeleton.ScaleX or Skeleton.ScaleY. public static void SetLocalScale (this Skeleton skeleton, Vector2 scale) { - skeleton.ScaleX = scale.x; - skeleton.ScaleY = scale.y; + skeleton.scaleX = scale.x; + skeleton.scaleY = scale.y; } /// Gets the internal bone matrix as a Unity bonespace-to-skeletonspace transformation matrix. @@ -149,7 +149,7 @@ namespace Spine.Unity { } /// Gets the bone's Unity World position using its Spine GameObject Transform. UpdateWorldTransform needs to have been called for this to return the correct, updated value. - public static Vector3 GetWorldPosition (this Bone bone, UnityEngine.Transform spineGameObjectTransform) { + public static Vector3 GetWorldPosition (this Bone bone, UnityEngine.Transform spineGameObjectTransform) { return spineGameObjectTransform.TransformPoint(new Vector3(bone.worldX, bone.worldY)); } @@ -171,7 +171,7 @@ namespace Spine.Unity { /// Returns the Skeleton's local scale as a UnityEngine.Vector2. If only individual components are needed, use Skeleton.ScaleX or Skeleton.ScaleY. public static Vector2 GetLocalScale (this Skeleton skeleton) { - return new Vector2(skeleton.ScaleX, skeleton.ScaleY); + return new Vector2(skeleton.scaleX, skeleton.scaleY); } /// Calculates a 2x2 Transformation Matrix that can convert a skeleton-space position to a bone-local position. @@ -211,11 +211,11 @@ namespace Spine.Unity { object rendererObject = null; var renderableAttachment = a as IHasRendererObject; if (renderableAttachment != null) - rendererObject = renderableAttachment.RendererObject; - + rendererObject = renderableAttachment.RendererObject; + if (rendererObject == null) return null; - + #if SPINE_TK2D return (rendererObject.GetType() == typeof(Material)) ? (Material)rendererObject : (Material)((AtlasRegion)rendererObject).page.rendererObject; #else @@ -442,7 +442,7 @@ namespace Spine { } } - public static class SpineSkeletonExtensions { + public static class SkeletonExtensions { public static bool IsWeighted (this VertexAttachment va) { return va.bones != null && va.bones.Length > 0; } @@ -494,7 +494,7 @@ namespace Spine { bone.shearX = bone.data.shearX; bone.shearY = bone.data.shearY; break; - + // Slot case TimelineType.Attachment: skeleton.SetSlotAttachmentToSetupPose(i); @@ -506,9 +506,9 @@ namespace Spine { skeleton.slots.Items[i].SetColorToSetupPose(); break; case TimelineType.Deform: - skeleton.slots.Items[i].Deform.Clear(); + skeleton.slots.Items[i].attachmentVertices.Clear(); break; - + // Skeleton case TimelineType.DrawOrder: skeleton.SetDrawOrderToSetupPose(); @@ -518,7 +518,6 @@ namespace Spine { case TimelineType.IkConstraint: ikc = skeleton.ikConstraints.Items[i]; ikc.mix = ikc.data.mix; - ikc.softness = ikc.data.softness; ikc.bendDirection = ikc.data.bendDirection; ikc.stretch = ikc.data.stretch; break; @@ -601,6 +600,25 @@ namespace Spine { } } + /// + /// Shortcut for posing a skeleton at a specific time. Time is in seconds. (frameNumber / 30f) will give you seconds. + /// If you need to do this often, you should get the Animation object yourself using skeleton.data.FindAnimation. and call Apply on that. + /// The skeleton to pose. + /// The name of the animation to use. + /// The time of the pose within the animation. + /// Wraps the time around if it is longer than the duration of the animation. + public static void PoseWithAnimation (this Skeleton skeleton, string animationName, float time, bool loop = false) { + // Fail loud when skeleton.data is null. + Spine.Animation animation = skeleton.data.FindAnimation(animationName); + if (animation == null) return; + animation.Apply(skeleton, 0, time, loop, null, 1f, MixBlend.Setup, MixDirection.In); + } + + /// Pose a skeleton according to a given time in an animation. This is the simplified version of Animation.Apply(skeleton). + public static void PoseSkeleton (this Animation animation, Skeleton skeleton, float time, bool loop = false) { + animation.Apply(skeleton, 0, time, loop, null, 1f, MixBlend.Setup, MixDirection.In); + } + /// Resets Skeleton parts to Setup Pose according to a Spine.Animation's keyed items. public static void SetKeyedItemsToSetupPose (this Animation animation, Skeleton skeleton) { animation.Apply(skeleton, 0, 0, false, null, 0, MixBlend.Setup, MixDirection.Out); @@ -609,6 +627,21 @@ namespace Spine { public static void AllowImmediateQueue (this TrackEntry trackEntry) { if (trackEntry.nextTrackLast < 0) trackEntry.nextTrackLast = 0; } + + #endregion + + #region Skins + /// + public static void FindNamesForSlot (this Skin skin, string slotName, SkeletonData skeletonData, List results) { + int slotIndex = skeletonData.FindSlotIndex(slotName); + skin.FindNamesForSlot(slotIndex, results); + } + + /// + public static void FindAttachmentsForSlot (this Skin skin, string slotName, SkeletonData skeletonData, List results) { + int slotIndex = skeletonData.FindSlotIndex(slotName); + skin.FindAttachmentsForSlot(slotIndex, results); + } #endregion } } diff --git a/Assets/Spine/Runtime/spine-unity/Utility/SkeletonExtensions.cs.meta b/Assets/Spine/Runtime/spine-unity/SkeletonExtensions.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Utility/SkeletonExtensions.cs.meta rename to Assets/Spine/Runtime/spine-unity/SkeletonExtensions.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility.meta b/Assets/Spine/Runtime/spine-unity/SkeletonUtility.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility.meta rename to Assets/Spine/Runtime/spine-unity/SkeletonUtility.meta diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtility.cs b/Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtility.cs similarity index 64% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtility.cs rename to Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtility.cs index 632b85d7c..5696e2337 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtility.cs +++ b/Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtility.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -42,7 +42,6 @@ namespace Spine.Unity { [ExecuteInEditMode] #endif [RequireComponent(typeof(ISkeletonAnimation))] - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonUtility")] public sealed class SkeletonUtility : MonoBehaviour { #region BoundingBoxAttachment @@ -71,10 +70,6 @@ namespace Spine.Unity { public static PolygonCollider2D AddBoundingBoxGameObject (string name, BoundingBoxAttachment box, Slot slot, Transform parent, bool isTrigger = true) { var go = new GameObject("[BoundingBox]" + (string.IsNullOrEmpty(name) ? box.Name : name)); -#if UNITY_EDITOR - if (!Application.isPlaying) - UnityEditor.Undo.RegisterCreatedObjectUndo(go, "Spawn BoundingBox"); -# endif var got = go.transform; got.parent = parent; got.localPosition = Vector3.zero; @@ -91,14 +86,10 @@ namespace Spine.Unity { return collider; } - public static void SetColliderPointsLocal (PolygonCollider2D collider, Slot slot, BoundingBoxAttachment box, float scale = 1.0f) { + public static void SetColliderPointsLocal (PolygonCollider2D collider, Slot slot, BoundingBoxAttachment box) { if (box == null) return; if (box.IsWeighted()) Debug.LogWarning("UnityEngine.PolygonCollider2D does not support weighted or animated points. Collider points will not be animated and may have incorrect orientation. If you want to use it as a collider, please remove weights and animations from the bounding box in Spine editor."); var verts = box.GetLocalVertices(slot, null); - if (scale != 1.0f) { - for (int i = 0, n = verts.Length; i < n; ++i) - verts[i] *= scale; - } collider.SetPath(0, verts); } @@ -133,74 +124,19 @@ namespace Spine.Unity { public delegate void SkeletonUtilityDelegate (); public event SkeletonUtilityDelegate OnReset; public Transform boneRoot; - /// - /// If true, and are followed - /// by 180 degree rotation. If false, negative Transform scale is used. - /// Note that using negative scale is consistent with previous behaviour (hence the default), - /// however causes serious problems with rigidbodies and physics. Therefore, it is recommended to - /// enable this parameter where possible. When creating hinge chains for a chain of skeleton bones - /// via , it is mandatory to have flipBy180DegreeRotation enabled. - /// - public bool flipBy180DegreeRotation = false; void Update () { - var skeleton = skeletonComponent.Skeleton; + var skeleton = skeletonRenderer.skeleton; if (skeleton != null && boneRoot != null) { - - if (flipBy180DegreeRotation) { - boneRoot.localScale = new Vector3(Mathf.Abs(skeleton.ScaleX), Mathf.Abs(skeleton.ScaleY), 1f); - boneRoot.eulerAngles = new Vector3(skeleton.ScaleY > 0 ? 0 : 180, - skeleton.ScaleX > 0 ? 0 : 180, - 0); - } - else { - boneRoot.localScale = new Vector3(skeleton.ScaleX, skeleton.ScaleY, 1f); - } - } - - if (canvas != null) { - positionScale = canvas.referencePixelsPerUnit; + boneRoot.localScale = new Vector3(skeleton.scaleX, skeleton.scaleY, 1f); } } [HideInInspector] public SkeletonRenderer skeletonRenderer; - [HideInInspector] public SkeletonGraphic skeletonGraphic; - private Canvas canvas; - [System.NonSerialized] public ISkeletonAnimation skeletonAnimation; - - private ISkeletonComponent skeletonComponent; + [HideInInspector] public ISkeletonAnimation skeletonAnimation; [System.NonSerialized] public List boneComponents = new List(); [System.NonSerialized] public List constraintComponents = new List(); - - public ISkeletonComponent SkeletonComponent { - get { - if (skeletonComponent == null) { - skeletonComponent = skeletonRenderer != null ? skeletonRenderer.GetComponent() : - skeletonGraphic != null ? skeletonGraphic.GetComponent() : - GetComponent(); - } - return skeletonComponent; - } - } - public Skeleton Skeleton { - get { - if (SkeletonComponent == null) - return null; - return skeletonComponent.Skeleton; - } - } - - public bool IsValid { - get { - return (skeletonRenderer != null && skeletonRenderer.valid) || - (skeletonGraphic != null && skeletonGraphic.IsValid); - } - } - - public float PositionScale { get { return positionScale; } } - - float positionScale = 1.0f; bool hasOverrideBones; bool hasConstraints; bool needToReprocessBones; @@ -209,38 +145,18 @@ namespace Spine.Unity { OnDisable(); OnEnable(); } - + void OnEnable () { if (skeletonRenderer == null) { skeletonRenderer = GetComponent(); } - if (skeletonGraphic == null) { - skeletonGraphic = GetComponent(); - } + if (skeletonAnimation == null) { - skeletonAnimation = skeletonRenderer != null ? skeletonRenderer.GetComponent() : - skeletonGraphic != null ? skeletonGraphic.GetComponent() : - GetComponent(); - } - if (skeletonComponent == null) { - skeletonComponent = skeletonRenderer != null ? skeletonRenderer.GetComponent() : - skeletonGraphic != null ? skeletonGraphic.GetComponent() : - GetComponent(); + skeletonAnimation = GetComponent(typeof(ISkeletonAnimation)) as ISkeletonAnimation; } - if (skeletonRenderer != null) { - skeletonRenderer.OnRebuild -= HandleRendererReset; - skeletonRenderer.OnRebuild += HandleRendererReset; - } - else if (skeletonGraphic != null) { - skeletonGraphic.OnRebuild -= HandleRendererReset; - skeletonGraphic.OnRebuild += HandleRendererReset; - canvas = skeletonGraphic.canvas; - if (canvas == null) - canvas = skeletonGraphic.GetComponentInParent(); - if (canvas == null) - positionScale = 100.0f; - } + skeletonRenderer.OnRebuild -= HandleRendererReset; + skeletonRenderer.OnRebuild += HandleRendererReset; if (skeletonAnimation != null) { skeletonAnimation.UpdateLocal -= UpdateLocal; @@ -256,10 +172,7 @@ namespace Spine.Unity { } void OnDisable () { - if (skeletonRenderer != null) - skeletonRenderer.OnRebuild -= HandleRendererReset; - if (skeletonGraphic != null) - skeletonGraphic.OnRebuild -= HandleRendererReset; + skeletonRenderer.OnRebuild -= HandleRendererReset; if (skeletonAnimation != null) { skeletonAnimation.UpdateLocal -= UpdateLocal; @@ -273,11 +186,6 @@ namespace Spine.Unity { CollectBones(); } - void HandleRendererReset (SkeletonGraphic g) { - if (OnReset != null) OnReset(); - CollectBones(); - } - public void RegisterBone (SkeletonUtilityBone bone) { if (boneComponents.Contains(bone)) { return; @@ -305,7 +213,7 @@ namespace Spine.Unity { } public void CollectBones () { - var skeleton = skeletonComponent.Skeleton; + var skeleton = skeletonRenderer.skeleton; if (skeleton == null) return; if (boneRoot != null) { @@ -321,10 +229,7 @@ namespace Spine.Unity { var boneComponents = this.boneComponents; for (int i = 0, n = boneComponents.Count; i < n; i++) { var b = boneComponents[i]; - if (b.bone == null) { - b.DoUpdate(SkeletonUtilityBone.UpdatePhase.Local); - if (b.bone == null) continue; - } + if (b.bone == null) continue; hasOverrideBones |= (b.mode == SkeletonUtilityBone.Mode.Override); hasConstraints |= constraintTargets.Contains(b.bone); } @@ -385,16 +290,8 @@ namespace Spine.Unity { if (boneRoot != null) return boneRoot; - var boneRootObject = new GameObject("SkeletonUtility-SkeletonRoot"); -#if UNITY_EDITOR - if (!Application.isPlaying) - UnityEditor.Undo.RegisterCreatedObjectUndo(boneRootObject, "Spawn Bone"); -#endif - if (skeletonGraphic != null) - boneRootObject.AddComponent(); - - boneRoot = boneRootObject.transform; - boneRoot.SetParent(transform); + boneRoot = new GameObject("SkeletonUtility-SkeletonRoot").transform; + boneRoot.parent = transform; boneRoot.localPosition = Vector3.zero; boneRoot.localRotation = Quaternion.identity; boneRoot.localScale = Vector3.one; @@ -404,7 +301,7 @@ namespace Spine.Unity { public GameObject SpawnRoot (SkeletonUtilityBone.Mode mode, bool pos, bool rot, bool sca) { GetBoneRoot(); - Skeleton skeleton = this.skeletonComponent.Skeleton; + Skeleton skeleton = this.skeletonRenderer.skeleton; GameObject go = SpawnBone(skeleton.RootBone, boneRoot, mode, pos, rot, sca); CollectBones(); @@ -413,7 +310,7 @@ namespace Spine.Unity { public GameObject SpawnHierarchy (SkeletonUtilityBone.Mode mode, bool pos, bool rot, bool sca) { GetBoneRoot(); - Skeleton skeleton = this.skeletonComponent.Skeleton; + Skeleton skeleton = this.skeletonRenderer.skeleton; GameObject go = SpawnBoneRecursively(skeleton.RootBone, boneRoot, mode, pos, rot, sca); CollectBones(); return go; @@ -433,15 +330,8 @@ namespace Spine.Unity { public GameObject SpawnBone (Bone bone, Transform parent, SkeletonUtilityBone.Mode mode, bool pos, bool rot, bool sca) { GameObject go = new GameObject(bone.Data.Name); - #if UNITY_EDITOR - if (!Application.isPlaying) - UnityEditor.Undo.RegisterCreatedObjectUndo(go, "Spawn Bone"); - #endif - if (skeletonGraphic != null) - go.AddComponent(); - var goTransform = go.transform; - goTransform.SetParent(parent); + goTransform.parent = parent; SkeletonUtilityBone b = go.AddComponent(); b.hierarchy = this; @@ -457,7 +347,7 @@ namespace Spine.Unity { if (mode == SkeletonUtilityBone.Mode.Override) { if (rot) goTransform.localRotation = Quaternion.Euler(0, 0, b.bone.AppliedRotation); - if (pos) goTransform.localPosition = new Vector3(b.bone.X * positionScale, b.bone.Y * positionScale, 0); + if (pos) goTransform.localPosition = new Vector3(b.bone.X, b.bone.Y, 0); goTransform.localScale = new Vector3(b.bone.scaleX, b.bone.scaleY, 0); } diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtility.cs.meta b/Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtility.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtility.cs.meta rename to Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtility.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtilityBone.cs b/Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtilityBone.cs similarity index 78% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtilityBone.cs rename to Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtilityBone.cs index c3e16f283..d949a7808 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtilityBone.cs +++ b/Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtilityBone.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -40,8 +40,7 @@ namespace Spine.Unity { #else [ExecuteInEditMode] #endif - [AddComponentMenu("Spine/SkeletonUtilityBone")] - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonUtilityBone")] + [AddComponentMenu("Spine/SkeletonGameObjectsBone")] public class SkeletonUtilityBone : MonoBehaviour { public enum Mode { Follow, @@ -64,7 +63,7 @@ namespace Spine.Unity { public float overrideAlpha = 1; #endregion - public SkeletonUtility hierarchy; + [System.NonSerialized] public SkeletonUtility hierarchy; [System.NonSerialized] public Bone bone; [System.NonSerialized] public bool transformLerpComplete; [System.NonSerialized] public bool valid; @@ -76,7 +75,7 @@ namespace Spine.Unity { public void Reset () { bone = null; cachedTransform = transform; - valid = hierarchy != null && hierarchy.IsValid; + valid = hierarchy != null && hierarchy.skeletonRenderer != null && hierarchy.skeletonRenderer.valid; if (!valid) return; skeletonTransform = hierarchy.transform; @@ -86,7 +85,7 @@ namespace Spine.Unity { } void OnEnable () { - if (hierarchy == null) hierarchy = transform.GetComponentInParent(); + hierarchy = transform.GetComponentInParent(); if (hierarchy == null) return; hierarchy.RegisterBone(this); @@ -110,7 +109,7 @@ namespace Spine.Unity { return; } - var skeleton = hierarchy.Skeleton; + var skeleton = hierarchy.skeletonRenderer.skeleton; if (bone == null) { if (string.IsNullOrEmpty(boneName)) return; @@ -120,17 +119,14 @@ namespace Spine.Unity { return; } } - if (!bone.Active) return; - - float positionScale = hierarchy.PositionScale; var thisTransform = cachedTransform; - float skeletonFlipRotation = Mathf.Sign(skeleton.ScaleX * skeleton.ScaleY); + float skeletonFlipRotation = Mathf.Sign(skeleton.scaleX * skeleton.scaleY); if (mode == Mode.Follow) { switch (phase) { case UpdatePhase.Local: if (position) - thisTransform.localPosition = new Vector3(bone.x * positionScale, bone.y * positionScale, 0); + thisTransform.localPosition = new Vector3(bone.x, bone.y, 0); if (rotation) { if (bone.data.transformMode.InheritsRotation()) { @@ -154,7 +150,7 @@ namespace Spine.Unity { } if (position) - thisTransform.localPosition = new Vector3(bone.ax * positionScale, bone.ay * positionScale, 0); + thisTransform.localPosition = new Vector3(bone.ax, bone.ay, 0); if (rotation) { if (bone.data.transformMode.InheritsRotation()) { @@ -171,14 +167,14 @@ namespace Spine.Unity { } break; } - + } else if (mode == Mode.Override) { if (transformLerpComplete) return; if (parentReference == null) { if (position) { - Vector3 clp = thisTransform.localPosition / positionScale; + Vector3 clp = thisTransform.localPosition; bone.x = Mathf.Lerp(bone.x, clp.x, overrideAlpha); bone.y = Mathf.Lerp(bone.y, clp.y, overrideAlpha); } @@ -200,7 +196,7 @@ namespace Spine.Unity { return; if (position) { - Vector3 pos = parentReference.InverseTransformPoint(thisTransform.position) / positionScale; + Vector3 pos = parentReference.InverseTransformPoint(thisTransform.position); bone.x = Mathf.Lerp(bone.x, pos.x, overrideAlpha); bone.y = Mathf.Lerp(bone.y, pos.y, overrideAlpha); } @@ -233,10 +229,10 @@ namespace Spine.Unity { SkeletonUtility.AddBoundingBoxGameObject(bone.skeleton, skinName, slotName, attachmentName, transform); } -#if UNITY_EDITOR + #if UNITY_EDITOR void OnDrawGizmos () { if (IncompatibleTransformMode) - Gizmos.DrawIcon(transform.position + new Vector3(0, 0.128f, 0), "icon-warning"); + Gizmos.DrawIcon(transform.position + new Vector3(0, 0.128f, 0), "icon-warning"); } #endif } diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtilityBone.cs.meta b/Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtilityBone.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtilityBone.cs.meta rename to Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtilityBone.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtilityConstraint.cs b/Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtilityConstraint.cs similarity index 61% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtilityConstraint.cs rename to Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtilityConstraint.cs index f549afaa7..536dc7d7a 100644 --- a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtilityConstraint.cs +++ b/Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtilityConstraint.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER @@ -41,7 +41,6 @@ namespace Spine.Unity { [ExecuteInEditMode] #endif [RequireComponent(typeof(SkeletonUtilityBone))] - [HelpURL("http://esotericsoftware.com/spine-unity#SkeletonUtilityConstraint")] public abstract class SkeletonUtilityConstraint : MonoBehaviour { protected SkeletonUtilityBone bone; diff --git a/Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtilityConstraint.cs.meta b/Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtilityConstraint.cs.meta similarity index 100% rename from Assets/Spine/Runtime/spine-unity/Components/SkeletonUtility/SkeletonUtilityConstraint.cs.meta rename to Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtilityConstraint.cs.meta diff --git a/Assets/Spine/Runtime/spine-unity/SpineAttributes.cs b/Assets/Spine/Runtime/spine-unity/SpineAttributes.cs index a0dd2e276..968552c5d 100644 --- a/Assets/Spine/Runtime/spine-unity/SpineAttributes.cs +++ b/Assets/Spine/Runtime/spine-unity/SpineAttributes.cs @@ -1,8 +1,8 @@ /****************************************************************************** * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. + * Last updated May 1, 2019. Replaces all prior versions. * - * Copyright (c) 2013-2020, Esoteric Software LLC + * Copyright (c) 2013-2019, Esoteric Software LLC * * Integration of the Spine Runtimes into software or otherwise creating * derivative works of the Spine Runtimes is permitted under the terms and @@ -15,16 +15,16 @@ * Spine Editor license and redistribution of the Products in any form must * include this license and copyright notice. * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS + * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ using UnityEngine; @@ -224,7 +224,7 @@ namespace Spine.Unity { /// /// Smart popup menu for Spine Attachments /// - /// Filters popup results to only include the current Skin. Only valid when a SkeletonRenderer is the data source. + /// Filters popup results to only include the current Skin. Only valid when a SkeletonRenderer is the data source. /// Returns a fully qualified path for an Attachment in the format "Skin/Slot/AttachmentName". This path format is only used by the SpineAttachment helper methods like SpineAttachment.GetAttachment and .GetHierarchy. Do not use full path anywhere else in Spine's system. /// Filters popup results to exclude attachments that are not children of Skin Placeholders /// If specified, a locally scoped field with the name supplied by in slotField will be used to limit the popup results to children of a named slot diff --git a/Assets/Spine/Runtime/spine-unity/Utility/AtlasUtilities.cs b/Assets/Spine/Runtime/spine-unity/Utility/AtlasUtilities.cs deleted file mode 100644 index be9317076..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/AtlasUtilities.cs +++ /dev/null @@ -1,808 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#if UNITY_2019_3_OR_NEWER -#define CONFIGURABLE_ENTER_PLAY_MODE -#endif - - -using UnityEngine; -using System.Collections.Generic; -using System; - - -namespace Spine.Unity.AttachmentTools { - - public static class AtlasUtilities { - internal const TextureFormat SpineTextureFormat = TextureFormat.RGBA32; - internal const float DefaultMipmapBias = -0.5f; - internal const bool UseMipMaps = false; - internal const float DefaultScale = 0.01f; - - const int NonrenderingRegion = -1; - - #if CONFIGURABLE_ENTER_PLAY_MODE - [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] - static void Init () { - // handle disabled domain reload - AtlasUtilities.ClearCache(); - } - #endif - - public static AtlasRegion ToAtlasRegion (this Texture2D t, Material materialPropertySource, float scale = DefaultScale) { - return t.ToAtlasRegion(materialPropertySource.shader, scale, materialPropertySource); - } - - public static AtlasRegion ToAtlasRegion (this Texture2D t, Shader shader, float scale = DefaultScale, Material materialPropertySource = null) { - var material = new Material(shader); - if (materialPropertySource != null) { - material.CopyPropertiesFromMaterial(materialPropertySource); - material.shaderKeywords = materialPropertySource.shaderKeywords; - } - - material.mainTexture = t; - var page = material.ToSpineAtlasPage(); - - float width = t.width; - float height = t.height; - - var region = new AtlasRegion(); - region.name = t.name; - region.index = -1; - region.rotate = false; - - // World space units - Vector2 boundsMin = Vector2.zero, boundsMax = new Vector2(width, height) * scale; - - // Texture space/pixel units - region.width = (int)width; - region.originalWidth = (int)width; - region.height = (int)height; - region.originalHeight = (int)height; - region.offsetX = width * (0.5f - InverseLerp(boundsMin.x, boundsMax.x, 0)); - region.offsetY = height * (0.5f - InverseLerp(boundsMin.y, boundsMax.y, 0)); - - // Use the full area of the texture. - region.u = 0; - region.v = 1; - region.u2 = 1; - region.v2 = 0; - region.x = 0; - region.y = 0; - - region.page = page; - - return region; - } - - /// - /// Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate of the Sprite's texture data. - public static AtlasRegion ToAtlasRegionPMAClone (this Texture2D t, Material materialPropertySource, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps) { - return t.ToAtlasRegionPMAClone(materialPropertySource.shader, textureFormat, mipmaps, materialPropertySource); - } - - /// - /// Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate of the Sprite's texture data. - public static AtlasRegion ToAtlasRegionPMAClone (this Texture2D t, Shader shader, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, Material materialPropertySource = null) { - var material = new Material(shader); - if (materialPropertySource != null) { - material.CopyPropertiesFromMaterial(materialPropertySource); - material.shaderKeywords = materialPropertySource.shaderKeywords; - } - var newTexture = t.GetClone(textureFormat, mipmaps, applyPMA : true); - - newTexture.name = t.name + "-pma-"; - material.name = t.name + shader.name; - - material.mainTexture = newTexture; - var page = material.ToSpineAtlasPage(); - - var region = newTexture.ToAtlasRegion(shader); - region.page = page; - - return region; - } - - /// - /// Creates a new Spine.AtlasPage from a UnityEngine.Material. If the material has a preassigned texture, the page width and height will be set. - public static AtlasPage ToSpineAtlasPage (this Material m) { - var newPage = new AtlasPage { - rendererObject = m, - name = m.name - }; - - var t = m.mainTexture; - if (t != null) { - newPage.width = t.width; - newPage.height = t.height; - } - - return newPage; - } - - /// - /// Creates a Spine.AtlasRegion from a UnityEngine.Sprite. - public static AtlasRegion ToAtlasRegion (this Sprite s, AtlasPage page) { - if (page == null) throw new System.ArgumentNullException("page", "page cannot be null. AtlasPage determines which texture region belongs and how it should be rendered. You can use material.ToSpineAtlasPage() to get a shareable AtlasPage from a Material, or use the sprite.ToAtlasRegion(material) overload."); - var region = s.ToAtlasRegion(); - region.page = page; - return region; - } - - /// - /// Creates a Spine.AtlasRegion from a UnityEngine.Sprite. This creates a new AtlasPage object for every AtlasRegion you create. You can centralize Material control by creating a shared atlas page using Material.ToSpineAtlasPage and using the sprite.ToAtlasRegion(AtlasPage) overload. - public static AtlasRegion ToAtlasRegion (this Sprite s, Material material) { - var region = s.ToAtlasRegion(); - region.page = material.ToSpineAtlasPage(); - return region; - } - - public static AtlasRegion ToAtlasRegionPMAClone (this Sprite s, Material materialPropertySource, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps) { - return s.ToAtlasRegionPMAClone(materialPropertySource.shader, textureFormat, mipmaps, materialPropertySource); - } - - /// - /// Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate of the Sprite's texture data. - public static AtlasRegion ToAtlasRegionPMAClone (this Sprite s, Shader shader, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, Material materialPropertySource = null) { - var material = new Material(shader); - if (materialPropertySource != null) { - material.CopyPropertiesFromMaterial(materialPropertySource); - material.shaderKeywords = materialPropertySource.shaderKeywords; - } - - var tex = s.ToTexture(textureFormat, mipmaps, applyPMA : true); - tex.name = s.name + "-pma-"; - material.name = tex.name + shader.name; - - material.mainTexture = tex; - var page = material.ToSpineAtlasPage(); - - var region = s.ToAtlasRegion(true); - region.page = page; - - return region; - } - - internal static AtlasRegion ToAtlasRegion (this Sprite s, bool isolatedTexture = false) { - var region = new AtlasRegion(); - region.name = s.name; - region.index = -1; - region.rotate = s.packed && s.packingRotation != SpritePackingRotation.None; - - // World space units - Bounds bounds = s.bounds; - Vector2 boundsMin = bounds.min, boundsMax = bounds.max; - - // Texture space/pixel units - Rect spineRect = s.rect.SpineUnityFlipRect(s.texture.height); - region.width = (int)spineRect.width; - region.originalWidth = (int)spineRect.width; - region.height = (int)spineRect.height; - region.originalHeight = (int)spineRect.height; - region.offsetX = spineRect.width * (0.5f - InverseLerp(boundsMin.x, boundsMax.x, 0)); - region.offsetY = spineRect.height * (0.5f - InverseLerp(boundsMin.y, boundsMax.y, 0)); - - if (isolatedTexture) { - region.u = 0; - region.v = 1; - region.u2 = 1; - region.v2 = 0; - region.x = 0; - region.y = 0; - } else { - Texture2D tex = s.texture; - Rect uvRect = TextureRectToUVRect(s.textureRect, tex.width, tex.height); - region.u = uvRect.xMin; - region.v = uvRect.yMax; - region.u2 = uvRect.xMax; - region.v2 = uvRect.yMin; - region.x = (int)spineRect.x; - region.y = (int)spineRect.y; - } - - return region; - } - - #region Runtime Repacking - static readonly Dictionary existingRegions = new Dictionary(); - static readonly List regionIndices = new List(); - static readonly List texturesToPack = new List(); - static readonly List originalRegions = new List(); - static readonly List repackedRegions = new List(); - static readonly List repackedAttachments = new List(); - static List[] texturesToPackAtParam = new List[1]; - - /// - /// Fills the outputAttachments list with new attachment objects based on the attachments in sourceAttachments, - /// but mapped to a new single texture using the same material. - /// Returned Material and Texture behave like new Texture2D(), thus you need to call Destroy() - /// to free resources. - /// This method caches necessary Texture copies for later re-use, which might steadily increase the texture memory - /// footprint when used excessively. Set to true - /// or call to clear this texture cache. - /// You may want to call Resources.UnloadUnusedAssets() after that. - /// - /// The list of attachments to be repacked. - /// The List(Attachment) to populate with the newly created Attachment objects. - /// May be null. If no Material property source is provided, no special - /// When set to true, is called after - /// repacking to clear the texture cache. See remarks for additional info. - public static void GetRepackedAttachments (List sourceAttachments, List outputAttachments, Material materialPropertySource, out Material outputMaterial, out Texture2D outputTexture, int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, string newAssetName = "Repacked Attachments", bool clearCache = false, bool useOriginalNonrenderables = true) { - if (sourceAttachments == null) throw new System.ArgumentNullException("sourceAttachments"); - if (outputAttachments == null) throw new System.ArgumentNullException("outputAttachments"); - - // Use shared lists to detect and use shared regions. - existingRegions.Clear(); - regionIndices.Clear(); - texturesToPack.Clear(); - originalRegions.Clear(); - - outputAttachments.Clear(); - outputAttachments.AddRange(sourceAttachments); - - int newRegionIndex = 0; - for (int i = 0, n = sourceAttachments.Count; i < n; i++) { - var originalAttachment = sourceAttachments[i]; - - if (IsRenderable(originalAttachment)) { - var newAttachment = originalAttachment.GetCopy(true); - var region = newAttachment.GetRegion(); - int existingIndex; - if (existingRegions.TryGetValue(region, out existingIndex)) { - regionIndices.Add(existingIndex); // Store the region index for the eventual new attachment. - } else { - originalRegions.Add(region); - texturesToPack.Add(region.ToTexture(textureFormat, mipmaps)); // Add the texture to the PackTextures argument - existingRegions.Add(region, newRegionIndex); // Add the region to the dictionary of known regions - regionIndices.Add(newRegionIndex); // Store the region index for the eventual new attachment. - newRegionIndex++; - } - - outputAttachments[i] = newAttachment; - } else { - outputAttachments[i] = useOriginalNonrenderables ? originalAttachment : originalAttachment.GetCopy(true); - regionIndices.Add(NonrenderingRegion); // Output attachments pairs with regionIndexes list 1:1. Pad with a sentinel if the attachment doesn't have a region. - } - } - - // Fill a new texture with the collected attachment textures. - var newTexture = new Texture2D(maxAtlasSize, maxAtlasSize, textureFormat, mipmaps); - newTexture.mipMapBias = AtlasUtilities.DefaultMipmapBias; - newTexture.name = newAssetName; - // Copy settings - if (texturesToPack.Count > 0) { - var sourceTexture = texturesToPack[0]; - newTexture.CopyTextureAttributesFrom(sourceTexture); - } - var rects = newTexture.PackTextures(texturesToPack.ToArray(), padding, maxAtlasSize); - - // Rehydrate the repacked textures as a Material, Spine atlas and Spine.AtlasAttachments - Shader shader = materialPropertySource == null ? Shader.Find("Spine/Skeleton") : materialPropertySource.shader; - var newMaterial = new Material(shader); - if (materialPropertySource != null) { - newMaterial.CopyPropertiesFromMaterial(materialPropertySource); - newMaterial.shaderKeywords = materialPropertySource.shaderKeywords; - } - - newMaterial.name = newAssetName; - newMaterial.mainTexture = newTexture; - var page = newMaterial.ToSpineAtlasPage(); - page.name = newAssetName; - - repackedRegions.Clear(); - for (int i = 0, n = originalRegions.Count; i < n; i++) { - var oldRegion = originalRegions[i]; - var newRegion = UVRectToAtlasRegion(rects[i], oldRegion, page); - repackedRegions.Add(newRegion); - } - - // Map the cloned attachments to the repacked atlas. - for (int i = 0, n = outputAttachments.Count; i < n; i++) { - var a = outputAttachments[i]; - if (IsRenderable(a)) - a.SetRegion(repackedRegions[regionIndices[i]]); - } - - // Clean up. - if (clearCache) - AtlasUtilities.ClearCache(); - - outputTexture = newTexture; - outputMaterial = newMaterial; - } - - /// - /// Creates and populates a duplicate skin with cloned attachments that are backed by a new packed texture atlas - /// comprised of all the regions from the original skin. - /// GetRepackedSkin is an expensive operation, preferably call it at level load time. - /// No Spine.Atlas object is created so there is no way to find AtlasRegions except through the Attachments using them. - /// Returned Material and Texture behave like new Texture2D(), thus you need to call Destroy() - /// to free resources. - /// This method caches necessary Texture copies for later re-use, which might steadily increase the texture memory - /// footprint when used excessively. Set to true - /// or call to clear this texture cache. - /// You may want to call Resources.UnloadUnusedAssets() after that. - /// - /// When set to true, is called after - /// repacking to clear the texture cache. See remarks for additional info. - /// Optional additional textures (such as normal maps) to copy while repacking. - /// To copy e.g. the main texture and normal maps, pass 'new int[] { Shader.PropertyToID("_BumpMap") }' at this parameter. - /// When additionalTexturePropertyIDsToCopy is non-null, - /// this array will be filled with the resulting repacked texture for every property, - /// just as the main repacked texture is assigned to outputTexture. - /// When additionalTexturePropertyIDsToCopy is non-null, - /// this array will be used as TextureFormat at the Texture at the respective property. - /// When additionalTextureFormats is null or when its array size is smaller, - /// textureFormat is used where there exists no corresponding array item. - /// When additionalTexturePropertyIDsToCopy is non-null, - /// this array will be used to determine whether linear or sRGB color space is used at the - /// Texture at the respective property. When additionalTextureIsLinear is null, linear color space - /// is assumed at every additional Texture element. - /// When e.g. packing the main texture and normal maps, pass 'new bool[] { true }' at this parameter, because normal maps use - /// linear color space. - public static Skin GetRepackedSkin (this Skin o, string newName, Material materialPropertySource, out Material outputMaterial, out Texture2D outputTexture, - int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, - bool useOriginalNonrenderables = true, bool clearCache = false, - int[] additionalTexturePropertyIDsToCopy = null, Texture2D[] additionalOutputTextures = null, - TextureFormat[] additionalTextureFormats = null, bool[] additionalTextureIsLinear = null) { - - return GetRepackedSkin(o, newName, materialPropertySource.shader, out outputMaterial, out outputTexture, - maxAtlasSize, padding, textureFormat, mipmaps, materialPropertySource, - clearCache, useOriginalNonrenderables, additionalTexturePropertyIDsToCopy, additionalOutputTextures, - additionalTextureFormats, additionalTextureIsLinear); - } - - /// - /// Creates and populates a duplicate skin with cloned attachments that are backed by a new packed texture atlas - /// comprised of all the regions from the original skin. - /// See documentation of for details. - public static Skin GetRepackedSkin (this Skin o, string newName, Shader shader, out Material outputMaterial, out Texture2D outputTexture, - int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, - Material materialPropertySource = null, bool clearCache = false, bool useOriginalNonrenderables = true, - int[] additionalTexturePropertyIDsToCopy = null, Texture2D[] additionalOutputTextures = null, - TextureFormat[] additionalTextureFormats = null, bool[] additionalTextureIsLinear = null) { - - outputTexture = null; - if (additionalTexturePropertyIDsToCopy != null && additionalTextureIsLinear == null) { - additionalTextureIsLinear = new bool[additionalTexturePropertyIDsToCopy.Length]; - for (int i = 0; i < additionalTextureIsLinear.Length; ++i) { - additionalTextureIsLinear[i] = true; - } - } - - if (o == null) throw new System.NullReferenceException("Skin was null"); - var skinAttachments = o.Attachments; - var newSkin = new Skin(newName); - - newSkin.bones.AddRange(o.bones); - newSkin.constraints.AddRange(o.constraints); - - // Use these to detect and use shared regions. - existingRegions.Clear(); - regionIndices.Clear(); - - // Collect all textures from the attachments of the original skin. - repackedAttachments.Clear(); - int numTextureParamsToRepack = 1 + (additionalTexturePropertyIDsToCopy == null ? 0 : additionalTexturePropertyIDsToCopy.Length); - additionalOutputTextures = (additionalTexturePropertyIDsToCopy == null ? null : new Texture2D[additionalTexturePropertyIDsToCopy.Length]); - if (texturesToPackAtParam.Length < numTextureParamsToRepack) - Array.Resize(ref texturesToPackAtParam, numTextureParamsToRepack); - for (int i = 0; i < numTextureParamsToRepack; ++i) { - if (texturesToPackAtParam[i] != null) - texturesToPackAtParam[i].Clear(); - else - texturesToPackAtParam[i] = new List(); - } - originalRegions.Clear(); - int newRegionIndex = 0; - - foreach (var skinEntry in skinAttachments) { - var originalKey = skinEntry.Key; - var originalAttachment = skinEntry.Value; - - Attachment newAttachment; - if (IsRenderable(originalAttachment)) { - newAttachment = originalAttachment.GetCopy(true); - var region = newAttachment.GetRegion(); - int existingIndex; - if (existingRegions.TryGetValue(region, out existingIndex)) { - regionIndices.Add(existingIndex); // Store the region index for the eventual new attachment. - } else { - originalRegions.Add(region); - for (int i = 0; i < numTextureParamsToRepack; ++i) { - Texture2D regionTexture = (i == 0 ? - region.ToTexture(textureFormat, mipmaps) : - region.ToTexture((additionalTextureFormats != null && i - 1 < additionalTextureFormats.Length) ? - additionalTextureFormats[i - 1] : textureFormat, - mipmaps, additionalTexturePropertyIDsToCopy[i - 1], additionalTextureIsLinear[i - 1])); - texturesToPackAtParam[i].Add(regionTexture); // Add the texture to the PackTextures argument - } - existingRegions.Add(region, newRegionIndex); // Add the region to the dictionary of known regions - regionIndices.Add(newRegionIndex); // Store the region index for the eventual new attachment. - newRegionIndex++; - } - - repackedAttachments.Add(newAttachment); - newSkin.SetAttachment(originalKey.SlotIndex, originalKey.Name, newAttachment); - } else { - newSkin.SetAttachment(originalKey.SlotIndex, originalKey.Name, useOriginalNonrenderables ? originalAttachment : originalAttachment.GetCopy(true)); - } - } - - // Rehydrate the repacked textures as a Material, Spine atlas and Spine.AtlasAttachments - var newMaterial = new Material(shader); - if (materialPropertySource != null) { - newMaterial.CopyPropertiesFromMaterial(materialPropertySource); - newMaterial.shaderKeywords = materialPropertySource.shaderKeywords; - } - newMaterial.name = newName; - - Rect[] rects = null; - for (int i = 0; i < numTextureParamsToRepack; ++i) { - // Fill a new texture with the collected attachment textures. - var newTexture = new Texture2D(maxAtlasSize, maxAtlasSize, - (i > 0 && additionalTextureFormats != null && i - 1 < additionalTextureFormats.Length) ? - additionalTextureFormats[i - 1] : textureFormat, - mipmaps, - (i > 0) ? additionalTextureIsLinear[i - 1] : false); - newTexture.mipMapBias = AtlasUtilities.DefaultMipmapBias; - var texturesToPack = texturesToPackAtParam[i]; - if (texturesToPack.Count > 0) { - var sourceTexture = texturesToPack[0]; - newTexture.CopyTextureAttributesFrom(sourceTexture); - } - newTexture.name = newName; - var rectsForTexParam = newTexture.PackTextures(texturesToPack.ToArray(), padding, maxAtlasSize); - if (i == 0) { - rects = rectsForTexParam; - newMaterial.mainTexture = newTexture; - outputTexture = newTexture; - } - else { - newMaterial.SetTexture(additionalTexturePropertyIDsToCopy[i - 1], newTexture); - additionalOutputTextures[i - 1] = newTexture; - } - } - - var page = newMaterial.ToSpineAtlasPage(); - page.name = newName; - - repackedRegions.Clear(); - for (int i = 0, n = originalRegions.Count; i < n; i++) { - var oldRegion = originalRegions[i]; - var newRegion = UVRectToAtlasRegion(rects[i], oldRegion, page); - repackedRegions.Add(newRegion); - } - - // Map the cloned attachments to the repacked atlas. - for (int i = 0, n = repackedAttachments.Count; i < n; i++) { - var a = repackedAttachments[i]; - if (IsRenderable(a)) - a.SetRegion(repackedRegions[regionIndices[i]]); - } - - // Clean up. - if (clearCache) - AtlasUtilities.ClearCache(); - - outputMaterial = newMaterial; - return newSkin; - } - - public static Sprite ToSprite (this AtlasRegion ar, float pixelsPerUnit = 100) { - return Sprite.Create(ar.GetMainTexture(), ar.GetUnityRect(), new Vector2(0.5f, 0.5f), pixelsPerUnit); - } - - struct IntAndAtlasRegionKey { - int i; - AtlasRegion region; - - public IntAndAtlasRegionKey(int i, AtlasRegion region) { - this.i = i; - this.region = region; - } - - public override int GetHashCode () { - return i.GetHashCode() * 23 ^ region.GetHashCode(); - } - } - static Dictionary CachedRegionTextures = new Dictionary(); - static List CachedRegionTexturesList = new List(); - - /// - /// Frees up textures cached by repacking and remapping operations. - /// - /// Calling with parameter premultiplyAlpha=true, - /// or will cache textures for later re-use, - /// which might steadily increase the texture memory footprint when used excessively. - /// You can clear this Texture cache by calling . - /// You may also want to call Resources.UnloadUnusedAssets() after that. Be aware that while this cleanup - /// frees up memory, it is also a costly operation and will likely cause a spike in the framerate. - /// Thus it is recommended to perform costly repacking and cleanup operations after e.g. a character customization - /// screen has been exited, and if required additionally after a certain number of GetRemappedClone() calls. - /// - public static void ClearCache () { - foreach (var t in CachedRegionTexturesList) { - UnityEngine.Object.Destroy(t); - } - CachedRegionTextures.Clear(); - CachedRegionTexturesList.Clear(); - } - - /// Creates a new Texture2D object based on an AtlasRegion. - /// If applyImmediately is true, Texture2D.Apply is called immediately after the Texture2D is filled with data. - public static Texture2D ToTexture (this AtlasRegion ar, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, - int texturePropertyId = 0, bool linear = false, bool applyPMA = false) { - - Texture2D output; - - IntAndAtlasRegionKey cacheKey = new IntAndAtlasRegionKey(texturePropertyId, ar); - CachedRegionTextures.TryGetValue(cacheKey, out output); - if (output == null) { - Texture2D sourceTexture = texturePropertyId == 0 ? ar.GetMainTexture() : ar.GetTexture(texturePropertyId); - Rect r = ar.GetUnityRect(); - // Compensate any image resizing due to Texture 'Max Size' import settings. - // sourceTexture.width returns the resized image dimensions, at least in newer Unity versions. - if (sourceTexture.width < ar.page.width) { - float scaleX = (float)(sourceTexture.width) / (float)(ar.page.width); - float scaleY = (float)(sourceTexture.height) / (float)(ar.page.height); - var scale = new Vector2(scaleX, scaleY); - r = new Rect(Vector2.Scale(r.position, scale), Vector2.Scale(r.size, scale)); - } - - int width = (int)r.width; - int height = (int)r.height; - output = new Texture2D(width, height, textureFormat, mipmaps, linear) { name = ar.name }; - output.CopyTextureAttributesFrom(sourceTexture); - if (applyPMA) - AtlasUtilities.CopyTextureApplyPMA(sourceTexture, r, output); - else - AtlasUtilities.CopyTexture(sourceTexture, r, output); - CachedRegionTextures.Add(cacheKey, output); - CachedRegionTexturesList.Add(output); - } - - return output; - } - - static Texture2D ToTexture (this Sprite s, TextureFormat textureFormat = SpineTextureFormat, - bool mipmaps = UseMipMaps, bool linear = false, bool applyPMA = false) { - - var spriteTexture = s.texture; - Rect r; - if (!s.packed || s.packingMode == SpritePackingMode.Rectangle) { - r = s.textureRect; - } - else { - r = new Rect(); - r.xMin = Math.Min(s.uv[0].x, s.uv[1].x) * spriteTexture.width; - r.xMax = Math.Max(s.uv[0].x, s.uv[1].x) * spriteTexture.width; - r.yMin = Math.Min(s.uv[0].y, s.uv[2].y) * spriteTexture.height; - r.yMax = Math.Max(s.uv[0].y, s.uv[2].y) * spriteTexture.height; - #if UNITY_EDITOR - if (s.uv.Length > 4) { - Debug.LogError("When using a tightly packed SpriteAtlas with Spine, you may only access Sprites that are packed as 'FullRect' from it! " + - "You can either disable 'Tight Packing' at the whole SpriteAtlas, or change the single Sprite's TextureImporter Setting 'MeshType' to 'Full Rect'." + - "Sprite Asset: " + s.name, s); - } - #endif - } - var newTexture = new Texture2D((int)r.width, (int)r.height, textureFormat, mipmaps, linear); - newTexture.CopyTextureAttributesFrom(spriteTexture); - if (applyPMA) - AtlasUtilities.CopyTextureApplyPMA(spriteTexture, r, newTexture); - else - AtlasUtilities.CopyTexture(spriteTexture, r, newTexture); - return newTexture; - } - - static Texture2D GetClone (this Texture2D t, TextureFormat textureFormat = SpineTextureFormat, - bool mipmaps = UseMipMaps, bool linear = false, bool applyPMA = false) { - - var newTexture = new Texture2D((int)t.width, (int)t.height, textureFormat, mipmaps, linear); - newTexture.CopyTextureAttributesFrom(t); - if (applyPMA) - AtlasUtilities.CopyTextureApplyPMA(t, new Rect(0, 0, t.width, t.height), newTexture); - else - AtlasUtilities.CopyTexture(t, new Rect(0, 0, t.width, t.height), newTexture); - return newTexture; - } - - static void CopyTexture (Texture2D source, Rect sourceRect, Texture2D destination) { - if (SystemInfo.copyTextureSupport == UnityEngine.Rendering.CopyTextureSupport.None) { - // GetPixels fallback for old devices. - Color[] pixelBuffer = source.GetPixels((int)sourceRect.x, (int)sourceRect.y, (int)sourceRect.width, (int)sourceRect.height); - destination.SetPixels(pixelBuffer); - destination.Apply(); - } else { - Graphics.CopyTexture(source, 0, 0, (int)sourceRect.x, (int)sourceRect.y, (int)sourceRect.width, (int)sourceRect.height, destination, 0, 0, 0, 0); - } - } - - static void CopyTextureApplyPMA (Texture2D source, Rect sourceRect, Texture2D destination) { - Color[] pixelBuffer = source.GetPixels((int)sourceRect.x, (int)sourceRect.y, (int)sourceRect.width, (int)sourceRect.height); - for (int i = 0, n = pixelBuffer.Length; i < n; i++) { - Color p = pixelBuffer[i]; - float a = p.a; - p.r = p.r * a; - p.g = p.g * a; - p.b = p.b * a; - pixelBuffer[i] = p; - } - destination.SetPixels(pixelBuffer); - destination.Apply(); - } - - static bool IsRenderable (Attachment a) { - return a is IHasRendererObject; - } - - /// - /// Get a rect with flipped Y so that a Spine atlas rect gets converted to a Unity Sprite rect and vice versa. - static Rect SpineUnityFlipRect (this Rect rect, int textureHeight) { - rect.y = textureHeight - rect.y - rect.height; - return rect; - } - - /// - /// Gets the Rect of an AtlasRegion according to Unity texture coordinates (x-right, y-up). - /// This overload relies on region.page.height being correctly set. - static Rect GetUnityRect (this AtlasRegion region) { - return region.GetSpineAtlasRect().SpineUnityFlipRect(region.page.height); - } - - /// - /// Gets the Rect of an AtlasRegion according to Unity texture coordinates (x-right, y-up). - static Rect GetUnityRect (this AtlasRegion region, int textureHeight) { - return region.GetSpineAtlasRect().SpineUnityFlipRect(textureHeight); - } - - /// - /// Returns a Rect of the AtlasRegion according to Spine texture coordinates. (x-right, y-down) - static Rect GetSpineAtlasRect (this AtlasRegion region, bool includeRotate = true) { - if (includeRotate && (region.degrees == 90 || region.degrees == 270)) - return new Rect(region.x, region.y, region.height, region.width); - else - return new Rect(region.x, region.y, region.width, region.height); - } - - /// - /// Denormalize a uvRect into a texture-space Rect. - static Rect UVRectToTextureRect (Rect uvRect, int texWidth, int texHeight) { - uvRect.x *= texWidth; - uvRect.width *= texWidth; - uvRect.y *= texHeight; - uvRect.height *= texHeight; - return uvRect; - } - - /// - /// Normalize a texture Rect into UV coordinates. - static Rect TextureRectToUVRect (Rect textureRect, int texWidth, int texHeight) { - textureRect.x = Mathf.InverseLerp(0, texWidth, textureRect.x); - textureRect.y = Mathf.InverseLerp(0, texHeight, textureRect.y); - textureRect.width = Mathf.InverseLerp(0, texWidth, textureRect.width); - textureRect.height = Mathf.InverseLerp(0, texHeight, textureRect.height); - return textureRect; - } - - /// - /// Creates a new Spine AtlasRegion according to a Unity UV Rect (x-right, y-up, uv-normalized). - static AtlasRegion UVRectToAtlasRegion (Rect uvRect, AtlasRegion referenceRegion, AtlasPage page) { - var tr = UVRectToTextureRect(uvRect, page.width, page.height); - var rr = tr.SpineUnityFlipRect(page.height); - - int x = (int)rr.x, y = (int)rr.y; - int w, h; - if (referenceRegion.degrees == 90 || referenceRegion.degrees == 270) { - w = (int)rr.height; - h = (int)rr.width; - } else { - w = (int)rr.width; - h = (int)rr.height; - } - - int originalW = Mathf.RoundToInt((float)w * ((float)referenceRegion.originalWidth / (float)referenceRegion.width)); - int originalH = Mathf.RoundToInt((float)h * ((float)referenceRegion.originalHeight / (float)referenceRegion.height)); - int offsetX = Mathf.RoundToInt((float)referenceRegion.offsetX * ((float)w / (float)referenceRegion.width)); - int offsetY = Mathf.RoundToInt((float)referenceRegion.offsetY * ((float)h / (float)referenceRegion.height)); - - if (referenceRegion.degrees == 270) { - w = (int)rr.width; - h = (int)rr.height; - } - - float u = uvRect.xMin; - float u2 = uvRect.xMax; - float v = uvRect.yMax; - float v2 = uvRect.yMin; - - return new AtlasRegion { - page = page, - name = referenceRegion.name, - - u = u, - u2 = u2, - v = v, - v2 = v2, - - index = -1, - - width = w, - originalWidth = originalW, - height = h, - originalHeight = originalH, - offsetX = offsetX, - offsetY = offsetY, - x = x, - y = y, - - rotate = referenceRegion.rotate, - degrees = referenceRegion.degrees - }; - } - - /// - /// Convenience method for getting the main texture of the material of the page of the region. - static Texture2D GetMainTexture (this AtlasRegion region) { - var material = (region.page.rendererObject as Material); - return material.mainTexture as Texture2D; - } - - /// - /// Convenience method for getting any texture of the material of the page of the region by texture property name. - static Texture2D GetTexture (this AtlasRegion region, string texturePropertyName) { - var material = (region.page.rendererObject as Material); - return material.GetTexture(texturePropertyName) as Texture2D; - } - - /// - /// Convenience method for getting any texture of the material of the page of the region by texture property id. - static Texture2D GetTexture (this AtlasRegion region, int texturePropertyId) { - var material = (region.page.rendererObject as Material); - return material.GetTexture(texturePropertyId) as Texture2D; - } - - static void CopyTextureAttributesFrom(this Texture2D destination, Texture2D source) { - destination.filterMode = source.filterMode; - destination.anisoLevel = source.anisoLevel; - #if UNITY_EDITOR - destination.alphaIsTransparency = source.alphaIsTransparency; - #endif - destination.wrapModeU = source.wrapModeU; - destination.wrapModeV = source.wrapModeV; - destination.wrapModeW = source.wrapModeW; - } - #endregion - - static float InverseLerp (float a, float b, float value) { - return (value - a) / (b - a); - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Utility/AtlasUtilities.cs.meta b/Assets/Spine/Runtime/spine-unity/Utility/AtlasUtilities.cs.meta deleted file mode 100644 index 32d291e25..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/AtlasUtilities.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 25ceef568a3dad448bf8a14fcc326964 -timeCreated: 1563321428 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Utility/AttachmentCloneExtensions.cs b/Assets/Spine/Runtime/spine-unity/Utility/AttachmentCloneExtensions.cs deleted file mode 100644 index 218156213..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/AttachmentCloneExtensions.cs +++ /dev/null @@ -1,147 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; -using System.Collections.Generic; -using System.Collections; - -namespace Spine.Unity.AttachmentTools { - - public static class AttachmentCloneExtensions { - /// - /// Clones the attachment. - public static Attachment GetCopy (this Attachment o, bool cloneMeshesAsLinked) { - var meshAttachment = o as MeshAttachment; - if (meshAttachment != null && cloneMeshesAsLinked) - return meshAttachment.NewLinkedMesh(); - return o.Copy(); - } - - #region Runtime Linked MeshAttachments - /// - /// Returns a new linked mesh linked to this MeshAttachment. It will be mapped to the AtlasRegion provided. - public static MeshAttachment GetLinkedMesh (this MeshAttachment o, string newLinkedMeshName, AtlasRegion region) { - if (region == null) throw new System.ArgumentNullException("region"); - MeshAttachment mesh = o.NewLinkedMesh(); - mesh.SetRegion(region, false); - return mesh; - } - - /// - /// Returns a new linked mesh linked to this MeshAttachment. It will be mapped to an AtlasRegion generated from a Sprite. The AtlasRegion will be mapped to a new Material based on the shader. - /// For better caching and batching, use GetLinkedMesh(string, AtlasRegion, bool) - public static MeshAttachment GetLinkedMesh (this MeshAttachment o, Sprite sprite, Shader shader, Material materialPropertySource = null) { - var m = new Material(shader); - if (materialPropertySource != null) { - m.CopyPropertiesFromMaterial(materialPropertySource); - m.shaderKeywords = materialPropertySource.shaderKeywords; - } - return o.GetLinkedMesh(sprite.name, sprite.ToAtlasRegion()); - } - - /// - /// Returns a new linked mesh linked to this MeshAttachment. It will be mapped to an AtlasRegion generated from a Sprite. The AtlasRegion will be mapped to a new Material based on the shader. - /// For better caching and batching, use GetLinkedMesh(string, AtlasRegion, bool) - public static MeshAttachment GetLinkedMesh (this MeshAttachment o, Sprite sprite, Material materialPropertySource) { - return o.GetLinkedMesh(sprite, materialPropertySource.shader, materialPropertySource); - } - #endregion - - #region RemappedClone Convenience Methods - /// - /// Gets a clone of the attachment remapped with a sprite image. - /// The remapped clone. - /// The original attachment. - /// The sprite whose texture to use. - /// The source material used to copy the shader and material properties from. - /// If true, a premultiply alpha clone of the original texture will be created. - /// See remarks below for additional info. - /// If true MeshAttachments will be cloned as linked meshes and will inherit animation from the original attachment. - /// If true the size of the original attachment will be followed, instead of using the Sprite size. - /// If true and the original Attachment is a MeshAttachment, then - /// a non-central sprite pivot will shift uv coords in the opposite direction. Vertices will not be offset in - /// any case when the original Attachment is a MeshAttachment. - /// If true and the original Attachment is a RegionAttachment, then - /// the original region's scale value is used instead of the Sprite's pixels per unit property. Since uniform scale is used, - /// x scale of the original attachment (width scale) is used, scale in y direction (height scale) is ignored. - /// When parameter premultiplyAlpha is set to true, a premultiply alpha clone of the - /// original texture will be created. Additionally, this PMA Texture clone is cached for later re-use, - /// which might steadily increase the Texture memory footprint when used excessively. - /// See on how to clear these cached textures. - public static Attachment GetRemappedClone (this Attachment o, Sprite sprite, Material sourceMaterial, - bool premultiplyAlpha = true, bool cloneMeshAsLinked = true, bool useOriginalRegionSize = false, - bool pivotShiftsMeshUVCoords = true, bool useOriginalRegionScale = false) { - var atlasRegion = premultiplyAlpha ? sprite.ToAtlasRegionPMAClone(sourceMaterial) : sprite.ToAtlasRegion(new Material(sourceMaterial) { mainTexture = sprite.texture } ); - if (!pivotShiftsMeshUVCoords && o is MeshAttachment) { - // prevent non-central sprite pivot setting offsetX/Y and shifting uv coords out of mesh bounds - atlasRegion.offsetX = 0; - atlasRegion.offsetY = 0; - } - float scale = 1f / sprite.pixelsPerUnit; - if (useOriginalRegionScale) { - var regionAttachment = o as RegionAttachment; - if (regionAttachment != null) - scale = regionAttachment.width / regionAttachment.regionOriginalWidth; - } - return o.GetRemappedClone(atlasRegion, cloneMeshAsLinked, useOriginalRegionSize, scale); - } - - /// - /// Gets a clone of the attachment remapped with an atlasRegion image. - /// The remapped clone. - /// The original attachment. - /// Atlas region. - /// If true MeshAttachments will be cloned as linked meshes and will inherit animation from the original attachment. - /// If true the size of the original attachment will be followed, instead of using the Sprite size. - /// Unity units per pixel scale used to scale the atlas region size when not using the original region size. - public static Attachment GetRemappedClone (this Attachment o, AtlasRegion atlasRegion, bool cloneMeshAsLinked = true, bool useOriginalRegionSize = false, float scale = 0.01f) { - var regionAttachment = o as RegionAttachment; - if (regionAttachment != null) { - RegionAttachment newAttachment = (RegionAttachment)regionAttachment.Copy(); - newAttachment.SetRegion(atlasRegion, false); - if (!useOriginalRegionSize) { - newAttachment.width = atlasRegion.width * scale; - newAttachment.height = atlasRegion.height * scale; - } - newAttachment.UpdateOffset(); - return newAttachment; - } else { - var meshAttachment = o as MeshAttachment; - if (meshAttachment != null) { - MeshAttachment newAttachment = cloneMeshAsLinked ? meshAttachment.NewLinkedMesh() : (MeshAttachment)meshAttachment.Copy(); - newAttachment.SetRegion(atlasRegion); - return newAttachment; - } - } - - return o.GetCopy(true); // Non-renderable Attachments will return as normal cloned attachments. - } - #endregion - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Utility/AttachmentCloneExtensions.cs.meta b/Assets/Spine/Runtime/spine-unity/Utility/AttachmentCloneExtensions.cs.meta deleted file mode 100644 index 4d6580e62..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/AttachmentCloneExtensions.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3431ed563b2c62f4c8c974a99365ba52 -timeCreated: 1563321428 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Utility/AttachmentRegionExtensions.cs b/Assets/Spine/Runtime/spine-unity/Utility/AttachmentRegionExtensions.cs deleted file mode 100644 index 600538748..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/AttachmentRegionExtensions.cs +++ /dev/null @@ -1,211 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; -using System.Collections.Generic; -using System.Collections; - -namespace Spine.Unity.AttachmentTools { - public static class AttachmentRegionExtensions { - #region GetRegion - /// - /// Tries to get the region (image) of a renderable attachment. If the attachment is not renderable, it returns null. - public static AtlasRegion GetRegion (this Attachment attachment) { - var renderableAttachment = attachment as IHasRendererObject; - if (renderableAttachment != null) - return renderableAttachment.RendererObject as AtlasRegion; - - return null; - } - - /// Gets the region (image) of a RegionAttachment - public static AtlasRegion GetRegion (this RegionAttachment regionAttachment) { - return regionAttachment.RendererObject as AtlasRegion; - } - - /// Gets the region (image) of a MeshAttachment - public static AtlasRegion GetRegion (this MeshAttachment meshAttachment) { - return meshAttachment.RendererObject as AtlasRegion; - } - #endregion - #region SetRegion - /// - /// Tries to set the region (image) of a renderable attachment. If the attachment is not renderable, nothing is applied. - public static void SetRegion (this Attachment attachment, AtlasRegion region, bool updateOffset = true) { - var regionAttachment = attachment as RegionAttachment; - if (regionAttachment != null) - regionAttachment.SetRegion(region, updateOffset); - - var meshAttachment = attachment as MeshAttachment; - if (meshAttachment != null) - meshAttachment.SetRegion(region, updateOffset); - } - - /// Sets the region (image) of a RegionAttachment - public static void SetRegion (this RegionAttachment attachment, AtlasRegion region, bool updateOffset = true) { - if (region == null) throw new System.ArgumentNullException("region"); - - // (AtlasAttachmentLoader.cs) - attachment.RendererObject = region; - attachment.SetUVs(region.u, region.v, region.u2, region.v2, region.rotate); - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - - if (updateOffset) attachment.UpdateOffset(); - } - - /// Sets the region (image) of a MeshAttachment - public static void SetRegion (this MeshAttachment attachment, AtlasRegion region, bool updateUVs = true) { - if (region == null) throw new System.ArgumentNullException("region"); - - // (AtlasAttachmentLoader.cs) - attachment.RendererObject = region; - attachment.RegionU = region.u; - attachment.RegionV = region.v; - attachment.RegionU2 = region.u2; - attachment.RegionV2 = region.v2; - attachment.RegionRotate = region.rotate; - attachment.RegionDegrees = region.degrees; - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - - if (updateUVs) attachment.UpdateUVs(); - } - #endregion - - #region Runtime RegionAttachments - /// - /// Creates a RegionAttachment based on a sprite. This method creates a real, usable AtlasRegion. That AtlasRegion uses a new AtlasPage with the Material provided./// - public static RegionAttachment ToRegionAttachment (this Sprite sprite, Material material, float rotation = 0f) { - return sprite.ToRegionAttachment(material.ToSpineAtlasPage(), rotation); - } - - /// - /// Creates a RegionAttachment based on a sprite. This method creates a real, usable AtlasRegion. That AtlasRegion uses the AtlasPage provided./// - public static RegionAttachment ToRegionAttachment (this Sprite sprite, AtlasPage page, float rotation = 0f) { - if (sprite == null) throw new System.ArgumentNullException("sprite"); - if (page == null) throw new System.ArgumentNullException("page"); - var region = sprite.ToAtlasRegion(page); - var unitsPerPixel = 1f / sprite.pixelsPerUnit; - return region.ToRegionAttachment(sprite.name, unitsPerPixel, rotation); - } - - /// - /// Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate texture of the Sprite's texture data. - /// Returns a RegionAttachment that uses it. Use this if you plan to use a premultiply alpha shader such as "Spine/Skeleton". - /// The duplicate texture is cached for later re-use. See documentation of - /// for additional details. - public static RegionAttachment ToRegionAttachmentPMAClone (this Sprite sprite, Shader shader, TextureFormat textureFormat = AtlasUtilities.SpineTextureFormat, bool mipmaps = AtlasUtilities.UseMipMaps, Material materialPropertySource = null, float rotation = 0f) { - if (sprite == null) throw new System.ArgumentNullException("sprite"); - if (shader == null) throw new System.ArgumentNullException("shader"); - var region = sprite.ToAtlasRegionPMAClone(shader, textureFormat, mipmaps, materialPropertySource); - var unitsPerPixel = 1f / sprite.pixelsPerUnit; - return region.ToRegionAttachment(sprite.name, unitsPerPixel, rotation); - } - - public static RegionAttachment ToRegionAttachmentPMAClone (this Sprite sprite, Material materialPropertySource, TextureFormat textureFormat = AtlasUtilities.SpineTextureFormat, bool mipmaps = AtlasUtilities.UseMipMaps, float rotation = 0f) { - return sprite.ToRegionAttachmentPMAClone(materialPropertySource.shader, textureFormat, mipmaps, materialPropertySource, rotation); - } - - /// - /// Creates a new RegionAttachment from a given AtlasRegion. - public static RegionAttachment ToRegionAttachment (this AtlasRegion region, string attachmentName, float scale = 0.01f, float rotation = 0f) { - if (string.IsNullOrEmpty(attachmentName)) throw new System.ArgumentException("attachmentName can't be null or empty.", "attachmentName"); - if (region == null) throw new System.ArgumentNullException("region"); - - // (AtlasAttachmentLoader.cs) - var attachment = new RegionAttachment(attachmentName); - - attachment.RendererObject = region; - attachment.SetUVs(region.u, region.v, region.u2, region.v2, region.rotate); - attachment.regionOffsetX = region.offsetX; - attachment.regionOffsetY = region.offsetY; - attachment.regionWidth = region.width; - attachment.regionHeight = region.height; - attachment.regionOriginalWidth = region.originalWidth; - attachment.regionOriginalHeight = region.originalHeight; - - attachment.Path = region.name; - attachment.scaleX = 1; - attachment.scaleY = 1; - attachment.rotation = rotation; - - attachment.r = 1; - attachment.g = 1; - attachment.b = 1; - attachment.a = 1; - - // pass OriginalWidth and OriginalHeight because UpdateOffset uses it in its calculation. - attachment.width = attachment.regionOriginalWidth * scale; - attachment.height = attachment.regionOriginalHeight * scale; - - attachment.SetColor(Color.white); - attachment.UpdateOffset(); - return attachment; - } - - /// Sets the scale. Call regionAttachment.UpdateOffset to apply the change. - public static void SetScale (this RegionAttachment regionAttachment, Vector2 scale) { - regionAttachment.scaleX = scale.x; - regionAttachment.scaleY = scale.y; - } - - /// Sets the scale. Call regionAttachment.UpdateOffset to apply the change. - public static void SetScale (this RegionAttachment regionAttachment, float x, float y) { - regionAttachment.scaleX = x; - regionAttachment.scaleY = y; - } - - /// Sets the position offset. Call regionAttachment.UpdateOffset to apply the change. - public static void SetPositionOffset (this RegionAttachment regionAttachment, Vector2 offset) { - regionAttachment.x = offset.x; - regionAttachment.y = offset.y; - } - - /// Sets the position offset. Call regionAttachment.UpdateOffset to apply the change. - public static void SetPositionOffset (this RegionAttachment regionAttachment, float x, float y) { - regionAttachment.x = x; - regionAttachment.y = y; - } - - /// Sets the rotation. Call regionAttachment.UpdateOffset to apply the change. - public static void SetRotation (this RegionAttachment regionAttachment, float rotation) { - regionAttachment.rotation = rotation; - } - #endregion - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Utility/AttachmentRegionExtensions.cs.meta b/Assets/Spine/Runtime/spine-unity/Utility/AttachmentRegionExtensions.cs.meta deleted file mode 100644 index 58262113b..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/AttachmentRegionExtensions.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7e7eac783deea004e9bc403eca68a7dc -timeCreated: 1563321428 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Utility/MaterialChecks.cs b/Assets/Spine/Runtime/spine-unity/Utility/MaterialChecks.cs deleted file mode 100644 index 68ec0d9f4..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/MaterialChecks.cs +++ /dev/null @@ -1,324 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using System.Collections.Generic; -using UnityEngine; - -#if UNITY_EDITOR - -namespace Spine.Unity { - /// Utility class providing methods to check material settings for incorrect combinations. - public class MaterialChecks { - - static readonly int STRAIGHT_ALPHA_PARAM_ID = Shader.PropertyToID("_StraightAlphaInput"); - static readonly string ALPHAPREMULTIPLY_ON_KEYWORD = "_ALPHAPREMULTIPLY_ON"; - static readonly string STRAIGHT_ALPHA_KEYWORD = "_STRAIGHT_ALPHA_INPUT"; - static readonly string[] FIXED_NORMALS_KEYWORDS = { - "_FIXED_NORMALS_VIEWSPACE", - "_FIXED_NORMALS_VIEWSPACE_BACKFACE", - "_FIXED_NORMALS_MODELSPACE", - "_FIXED_NORMALS_MODELSPACE_BACKFACE", - "_FIXED_NORMALS_WORLDSPACE" - }; - static readonly string NORMALMAP_KEYWORD = "_NORMALMAP"; - static readonly string CANVAS_GROUP_COMPATIBLE_KEYWORD = "_CANVAS_GROUP_COMPATIBLE"; - - public static readonly string kPMANotSupportedLinearMessage = - "\nWarning: Premultiply-alpha atlas textures not supported in Linear color space!\n\nPlease\n" - + "a) re-export atlas as straight alpha texture with 'premultiply alpha' unchecked\n" - + " (if you have already done this, please set the 'Straight Alpha Texture' Material parameter to 'true') or\n" - + "b) switch to Gamma color space via\nProject Settings - Player - Other Settings - Color Space.\n"; - public static readonly string kZSpacingRequiredMessage = - "\nWarning: Z Spacing required on selected shader! Otherwise you will receive incorrect results.\n\nPlease\n" - + "1) make sure at least minimal 'Z Spacing' is set at the SkeletonRenderer/SkeletonAnimation component under 'Advanced' and\n" - + "2) ensure that the skeleton has overlapping parts on different Z depth. You can adjust this in Spine via draw order.\n"; - public static readonly string kZSpacingRecommendedMessage = - "\nWarning: Z Spacing recommended on selected shader configuration!\n\nPlease\n" - + "1) make sure at least minimal 'Z Spacing' is set at the SkeletonRenderer/SkeletonAnimation component under 'Advanced' and\n" - + "2) ensure that the skeleton has overlapping parts on different Z depth. You can adjust this in Spine via draw order.\n"; - public static readonly string kAddNormalsMessage = - "\nWarning: 'Add Normals' required when not using 'Fixed Normals'!\n\nPlease\n" - + "a) enable 'Add Normals' at the SkeletonRenderer/SkeletonAnimation component under 'Advanced' or\n" - + "b) enable 'Fixed Normals' at the Material.\n"; - public static readonly string kSolveTangentsMessage = - "\nWarning: 'Solve Tangents' required when using a Normal Map!\n\nPlease\n" - + "a) enable 'Solve Tangents' at the SkeletonRenderer/SkeletonAnimation component under 'Advanced' or\n" - + "b) clear the 'Normal Map' parameter at the Material.\n"; - public static readonly string kNoSkeletonGraphicMaterialMessage = - "\nWarning: Normal non-UI shaders other than 'Spine/SkeletonGraphic *' are not compatible with 'SkeletonGraphic' components! " - + "This will lead to incorrect rendering on some devices.\n\n" - + "Please change the assigned Material to e.g. 'SkeletonGraphicDefault' or change the used shader to one of the 'Spine/SkeletonGraphic *' shaders.\n\n" - + "Note that 'Spine/SkeletonGraphic *' shall still be used when using URP.\n"; - public static readonly string kNoSkeletonGraphicTintBlackMaterialMessage = - "\nWarning: Only enable 'Canvas Group Tint Black' when using a 'SkeletonGraphic Tint Black' shader!\n" - + "This will lead to incorrect rendering.\n\nPlease\n" - + "a) disable 'Canvas Group Tint Black' under 'Advanced' or\n" - + "b) use a 'SkeletonGraphic Tint Black' Material if you need Tint Black on a CanvasGroup.\n"; - - public static readonly string kTintBlackMessage = - "\nWarning: 'Advanced - Tint Black' required when using any 'Tint Black' shader!\n\nPlease\n" - + "a) enable 'Tint Black' at the SkeletonRenderer/SkeletonGraphic component under 'Advanced' or\n" - + "b) use a different shader at the Material.\n"; - public static readonly string kCanvasTintBlackMessage = - "\nWarning: Canvas 'Additional Shader Channels' 'uv1' and 'uv2' are required when 'Advanced - Tint Black' is enabled!\n\n" - + "Please enable both 'uv1' and 'uv2' channels at the parent Canvas component parameter 'Additional Shader Channels'.\n"; - public static readonly string kCanvasGroupCompatibleMessage = - "\nWarning: 'Canvas Group Tint Black' is enabled at SkeletonGraphic but not 'CanvasGroup Compatible' at the Material!\n\nPlease\n" - + "a) enable 'CanvasGroup Compatible' at the Material or\n" - + "b) disable 'Canvas Group Tint Black' at the SkeletonGraphic component under 'Advanced'.\n" - + "You may want to duplicate the 'SkeletonGraphicDefault' material and change settings at the duplicate to not affect all instances."; - - public static bool IsMaterialSetupProblematic (SkeletonRenderer renderer, ref string errorMessage) { - var materials = renderer.GetComponent().sharedMaterials; - bool isProblematic = false; - foreach (var material in materials) { - if (material == null) continue; - isProblematic |= IsMaterialSetupProblematic(material, ref errorMessage); - if (renderer.zSpacing == 0) { - isProblematic |= IsZSpacingRequired(material, ref errorMessage); - } - if (renderer.addNormals == false && RequiresMeshNormals(material)) { - isProblematic = true; - errorMessage += kAddNormalsMessage; - } - if (renderer.calculateTangents == false && RequiresTangents(material)) { - isProblematic = true; - errorMessage += kSolveTangentsMessage; - } - if (renderer.tintBlack == false && RequiresTintBlack(material)) { - isProblematic = true; - errorMessage += kTintBlackMessage; - } - } - return isProblematic; - } - - public static bool IsMaterialSetupProblematic(SkeletonGraphic skeletonGraphic, ref string errorMessage) - { - var material = skeletonGraphic.material; - bool isProblematic = false; - if (material) { - isProblematic |= IsMaterialSetupProblematic(material, ref errorMessage); - var settings = skeletonGraphic.MeshGenerator.settings; - if (settings.zSpacing == 0) { - isProblematic |= IsZSpacingRequired(material, ref errorMessage); - } - if (IsSpineNonSkeletonGraphicMaterial(material)) { - isProblematic = true; - errorMessage += kNoSkeletonGraphicMaterialMessage; - } - if (settings.tintBlack == false && RequiresTintBlack(material)) { - isProblematic = true; - errorMessage += kTintBlackMessage; - } - if (settings.tintBlack == true && CanvasNotSetupForTintBlack(skeletonGraphic)) { - isProblematic = true; - errorMessage += kCanvasTintBlackMessage; - } - if (settings.canvasGroupTintBlack == true && !IsSkeletonGraphicTintBlackMaterial(material)) { - isProblematic = true; - errorMessage += kNoSkeletonGraphicTintBlackMaterialMessage; - } - if (settings.canvasGroupTintBlack == true && !IsCanvasGroupCompatible(material)) { - isProblematic = true; - errorMessage += kCanvasGroupCompatibleMessage; - } - } - return isProblematic; - } - - public static bool IsMaterialSetupProblematic(Material material, ref string errorMessage) { - return !IsColorSpaceSupported(material, ref errorMessage); - } - - public static bool IsZSpacingRequired(Material material, ref string errorMessage) { - bool hasForwardAddPass = material.FindPass("FORWARD_DELTA") >= 0; - if (hasForwardAddPass) { - errorMessage += kZSpacingRequiredMessage; - return true; - } - bool zWrite = material.HasProperty("_ZWrite") && material.GetFloat("_ZWrite") > 0.0f; - if (zWrite) { - errorMessage += kZSpacingRecommendedMessage; - return true; - } - return false; - } - - public static bool IsColorSpaceSupported (Material material, ref string errorMessage) { - if (QualitySettings.activeColorSpace == ColorSpace.Linear) { - if (IsPMAMaterial(material)) { - errorMessage += kPMANotSupportedLinearMessage; - return false; - } - } - return true; - } - - - public static bool UsesSpineShader (Material material) { - return material.shader.name.Contains("Spine/"); - } - - public static bool IsTextureSetupProblematic (Material material, ColorSpace colorSpace, - bool sRGBTexture, bool mipmapEnabled, bool alphaIsTransparency, - string texturePath, string materialPath, - ref string errorMessage) { - - if (material == null || !UsesSpineShader(material)) { - return false; - } - - bool isProblematic = false; - if (IsPMAMaterial(material)) { - // 'sRGBTexture = true' generates incorrectly weighted mipmaps at PMA textures, - // causing white borders due to undesired custom weighting. - if (sRGBTexture && mipmapEnabled && colorSpace == ColorSpace.Gamma) { - errorMessage += string.Format("`{0}` : Problematic Texture Settings found: " + - "When enabling `Generate Mip Maps` in Gamma color space, it is recommended " + - "to disable `sRGB (Color Texture)` on `Premultiply alpha` textures. Otherwise " + - "you will receive white border artifacts on an atlas exported with default " + - "`Premultiply alpha` settings.\n" + - "(You can disable this warning in `Edit - Preferences - Spine`)\n", texturePath); - isProblematic = true; - } - if (alphaIsTransparency) { - string materialName = System.IO.Path.GetFileName(materialPath); - errorMessage += string.Format("`{0}` and material `{1}` : Problematic " + - "Texture / Material Settings found: It is recommended to disable " + - "`Alpha Is Transparency` on `Premultiply alpha` textures.\n" + - "Assuming `Premultiply alpha` texture because `Straight Alpha Texture` " + - "is disabled at material). " + - "(You can disable this warning in `Edit - Preferences - Spine`)\n", texturePath, materialName); - isProblematic = true; - } - } - else { // straight alpha texture - if (!alphaIsTransparency) { - string materialName = System.IO.Path.GetFileName(materialPath); - errorMessage += string.Format("`{0}` and material `{1}` : Incorrect" + - "Texture / Material Settings found: It is strongly recommended " + - "to enable `Alpha Is Transparency` on `Straight alpha` textures.\n" + - "Assuming `Straight alpha` texture because `Straight Alpha Texture` " + - "is enabled at material). " + - "(You can disable this warning in `Edit - Preferences - Spine`)\n", texturePath, materialName); - isProblematic = true; - } - } - return isProblematic; - } - - public static void EnablePMAAtMaterial (Material material, bool enablePMA) { - if (material.HasProperty(STRAIGHT_ALPHA_PARAM_ID)) { - material.SetInt(STRAIGHT_ALPHA_PARAM_ID, enablePMA ? 0 : 1); - if (enablePMA) - material.DisableKeyword(STRAIGHT_ALPHA_KEYWORD); - else - material.EnableKeyword(STRAIGHT_ALPHA_KEYWORD); - } - else { - if (enablePMA) - material.EnableKeyword(ALPHAPREMULTIPLY_ON_KEYWORD); - else - material.DisableKeyword(ALPHAPREMULTIPLY_ON_KEYWORD); - } - } - - static bool IsPMAMaterial (Material material) { - bool usesAlphaPremultiplyKeyword = IsSpriteShader(material); - if (usesAlphaPremultiplyKeyword) - return material.IsKeywordEnabled(ALPHAPREMULTIPLY_ON_KEYWORD); - else - return material.HasProperty(STRAIGHT_ALPHA_PARAM_ID) && material.GetInt(STRAIGHT_ALPHA_PARAM_ID) == 0; - } - - static bool IsURP3DMaterial (Material material) { - return material.shader.name.Contains("Universal Render Pipeline/Spine"); - } - - static bool IsSpineNonSkeletonGraphicMaterial (Material material) { - return material.shader.name.Contains("Spine") && !material.shader.name.Contains("SkeletonGraphic"); - } - - static bool IsSkeletonGraphicTintBlackMaterial (Material material) { - return material.shader.name.Contains("Spine") && material.shader.name.Contains("SkeletonGraphic") - && material.shader.name.Contains("Black"); - } - - static bool AreShadowsDisabled (Material material) { - return material.IsKeywordEnabled("_RECEIVE_SHADOWS_OFF"); - } - - static bool RequiresMeshNormals (Material material) { - bool anyFixedNormalSet = false; - foreach (string fixedNormalKeyword in FIXED_NORMALS_KEYWORDS) { - if (material.IsKeywordEnabled(fixedNormalKeyword)) { - anyFixedNormalSet = true; - break; - } - } - bool isShaderWithMeshNormals = IsSpriteShader(material); - return isShaderWithMeshNormals && !anyFixedNormalSet; - } - - static bool IsSpriteShader (Material material) { - string shaderName = material.shader.name; - return shaderName.Contains("Spine/Sprite/Pixel Lit") || - shaderName.Contains("Spine/Sprite/Vertex Lit") || - shaderName.Contains("2D/Spine/Sprite") || // covers both URP and LWRP - shaderName.Contains("Pipeline/Spine/Sprite"); // covers both URP and LWRP - } - - static bool RequiresTintBlack (Material material) { - bool isTintBlackShader = - material.shader.name.Contains("Spine") && - material.shader.name.Contains("Tint Black"); - return isTintBlackShader; - } - - static bool RequiresTangents (Material material) { - return material.IsKeywordEnabled(NORMALMAP_KEYWORD); - } - static bool IsCanvasGroupCompatible (Material material) { - return material.IsKeywordEnabled(CANVAS_GROUP_COMPATIBLE_KEYWORD); - } - - static bool CanvasNotSetupForTintBlack (SkeletonGraphic skeletonGraphic) { - Canvas canvas = skeletonGraphic.canvas; - if (!canvas) - return false; - var requiredChannels = - AdditionalCanvasShaderChannels.TexCoord1 | - AdditionalCanvasShaderChannels.TexCoord2; - return (canvas.additionalShaderChannels & requiredChannels) != requiredChannels; - } - } -} - -#endif // UNITY_EDITOR diff --git a/Assets/Spine/Runtime/spine-unity/Utility/MaterialChecks.cs.meta b/Assets/Spine/Runtime/spine-unity/Utility/MaterialChecks.cs.meta deleted file mode 100644 index 7535c40d9..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/MaterialChecks.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e68fa8db689084946adce454b83e6d4a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Utility/SkinUtilities.cs b/Assets/Spine/Runtime/spine-unity/Utility/SkinUtilities.cs deleted file mode 100644 index 7da118298..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/SkinUtilities.cs +++ /dev/null @@ -1,168 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; -using System.Collections.Generic; -using System.Collections; - -namespace Spine.Unity.AttachmentTools { - - public static class SkinUtilities { - - #region Skeleton Skin Extensions - /// - /// Convenience method for duplicating a skeleton's current active skin so changes to it will not affect other skeleton instances. . - public static Skin UnshareSkin (this Skeleton skeleton, bool includeDefaultSkin, bool unshareAttachments, AnimationState state = null) { - // 1. Copy the current skin and set the skeleton's skin to the new one. - var newSkin = skeleton.GetClonedSkin("cloned skin", includeDefaultSkin, unshareAttachments, true); - skeleton.SetSkin(newSkin); - - // 2. Apply correct attachments: skeleton.SetToSetupPose + animationState.Apply - if (state != null) { - skeleton.SetToSetupPose(); - state.Apply(skeleton); - } - - // 3. Return unshared skin. - return newSkin; - } - - public static Skin GetClonedSkin (this Skeleton skeleton, string newSkinName, bool includeDefaultSkin = false, bool cloneAttachments = false, bool cloneMeshesAsLinked = true) { - var newSkin = new Skin(newSkinName); // may have null name. Harmless. - var defaultSkin = skeleton.data.DefaultSkin; - var activeSkin = skeleton.skin; - - if (includeDefaultSkin) - defaultSkin.CopyTo(newSkin, true, cloneAttachments, cloneMeshesAsLinked); - - if (activeSkin != null) - activeSkin.CopyTo(newSkin, true, cloneAttachments, cloneMeshesAsLinked); - - return newSkin; - } - #endregion - - /// - /// Gets a shallow copy of the skin. The cloned skin's attachments are shared with the original skin. - public static Skin GetClone (this Skin original) { - var newSkin = new Skin(original.name + " clone"); - var newSkinAttachments = newSkin.Attachments; - var newSkinBones = newSkin.Bones; - var newSkinConstraints = newSkin.Constraints; - - foreach (var a in original.Attachments) - newSkinAttachments[a.Key] = a.Value; - - newSkinBones.AddRange(original.bones); - newSkinConstraints.AddRange(original.constraints); - return newSkin; - } - - /// Adds an attachment to the skin for the specified slot index and name. If the name already exists for the slot, the previous value is replaced. - public static void SetAttachment (this Skin skin, string slotName, string keyName, Attachment attachment, Skeleton skeleton) { - int slotIndex = skeleton.FindSlotIndex(slotName); - if (skeleton == null) throw new System.ArgumentNullException("skeleton", "skeleton cannot be null."); - if (slotIndex == -1) throw new System.ArgumentException(string.Format("Slot '{0}' does not exist in skeleton.", slotName), "slotName"); - skin.SetAttachment(slotIndex, keyName, attachment); - } - - /// Adds skin items from another skin. For items that already exist, the previous values are replaced. - public static void AddAttachments (this Skin skin, Skin otherSkin) { - if (otherSkin == null) return; - otherSkin.CopyTo(skin, true, false); - } - - /// Gets an attachment from the skin for the specified slot index and name. - public static Attachment GetAttachment (this Skin skin, string slotName, string keyName, Skeleton skeleton) { - int slotIndex = skeleton.FindSlotIndex(slotName); - if (skeleton == null) throw new System.ArgumentNullException("skeleton", "skeleton cannot be null."); - if (slotIndex == -1) throw new System.ArgumentException(string.Format("Slot '{0}' does not exist in skeleton.", slotName), "slotName"); - return skin.GetAttachment(slotIndex, keyName); - } - - /// Adds an attachment to the skin for the specified slot index and name. If the name already exists for the slot, the previous value is replaced. - public static void SetAttachment (this Skin skin, int slotIndex, string keyName, Attachment attachment) { - skin.SetAttachment(slotIndex, keyName, attachment); - } - - public static void RemoveAttachment (this Skin skin, string slotName, string keyName, SkeletonData skeletonData) { - int slotIndex = skeletonData.FindSlotIndex(slotName); - if (skeletonData == null) throw new System.ArgumentNullException("skeletonData", "skeletonData cannot be null."); - if (slotIndex == -1) throw new System.ArgumentException(string.Format("Slot '{0}' does not exist in skeleton.", slotName), "slotName"); - skin.RemoveAttachment(slotIndex, keyName); - } - - public static void Clear (this Skin skin) { - skin.Attachments.Clear(); - } - - //[System.Obsolete] - public static void Append (this Skin destination, Skin source) { - source.CopyTo(destination, true, false); - } - - public static void CopyTo (this Skin source, Skin destination, bool overwrite, bool cloneAttachments, bool cloneMeshesAsLinked = true) { - var sourceAttachments = source.Attachments; - var destinationAttachments = destination.Attachments; - var destinationBones = destination.Bones; - var destinationConstraints = destination.Constraints; - - if (cloneAttachments) { - if (overwrite) { - foreach (var e in sourceAttachments) { - Attachment clonedAttachment = e.Value.GetCopy(cloneMeshesAsLinked); - destinationAttachments[new Skin.SkinEntry(e.Key.SlotIndex, e.Key.Name, clonedAttachment)] = clonedAttachment; - } - } else { - foreach (var e in sourceAttachments) { - if (destinationAttachments.ContainsKey(e.Key)) continue; - Attachment clonedAttachment = e.Value.GetCopy(cloneMeshesAsLinked); - destinationAttachments.Add(new Skin.SkinEntry(e.Key.SlotIndex, e.Key.Name, clonedAttachment), clonedAttachment); - } - } - } else { - if (overwrite) { - foreach (var e in sourceAttachments) - destinationAttachments[e.Key] = e.Value; - } else { - foreach (var e in sourceAttachments) { - if (destinationAttachments.ContainsKey(e.Key)) continue; - destinationAttachments.Add(e.Key, e.Value); - } - } - } - - foreach (BoneData data in source.bones) - if (!destinationBones.Contains(data)) destinationBones.Add(data); - - foreach (ConstraintData data in source.constraints) - if (!destinationConstraints.Contains(data)) destinationConstraints.Add(data); - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Utility/SkinUtilities.cs.meta b/Assets/Spine/Runtime/spine-unity/Utility/SkinUtilities.cs.meta deleted file mode 100644 index 5ac1f297b..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/SkinUtilities.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f4692b9527684d048862210ba3f9834e -timeCreated: 1563321428 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Utility/TimelineExtensions.cs b/Assets/Spine/Runtime/spine-unity/Utility/TimelineExtensions.cs deleted file mode 100644 index 03f14aa55..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/TimelineExtensions.cs +++ /dev/null @@ -1,91 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; -using System.Collections.Generic; -using System.Collections; - -namespace Spine.Unity.AnimationTools { - public static class TimelineExtensions { - - /// Evaluates the resulting value of a TranslateTimeline at a given time. - /// SkeletonData can be accessed from Skeleton.Data or from SkeletonDataAsset.GetSkeletonData. - /// If no SkeletonData is given, values are computed relative to setup pose instead of local-absolute. - public static Vector2 Evaluate (this TranslateTimeline timeline, float time, SkeletonData skeletonData = null) { - const int PREV_TIME = -3, PREV_X = -2, PREV_Y = -1; - const int X = 1, Y = 2; - - var frames = timeline.frames; - if (time < frames[0]) return Vector2.zero; - - float x, y; - if (time >= frames[frames.Length - TranslateTimeline.ENTRIES]) { // Time is after last frame. - x = frames[frames.Length + PREV_X]; - y = frames[frames.Length + PREV_Y]; - } - else { - // Interpolate between the previous frame and the current frame. - int frame = Animation.BinarySearch(frames, time, TranslateTimeline.ENTRIES); - x = frames[frame + PREV_X]; - y = frames[frame + PREV_Y]; - float frameTime = frames[frame]; - float percent = timeline.GetCurvePercent(frame / TranslateTimeline.ENTRIES - 1, - 1 - (time - frameTime) / (frames[frame + PREV_TIME] - frameTime)); - - x += (frames[frame + X] - x) * percent; - y += (frames[frame + Y] - y) * percent; - } - - Vector2 xy = new Vector2(x, y); - if (skeletonData == null) { - return xy; - } - else { - var boneData = skeletonData.bones.Items[timeline.boneIndex]; - return xy + new Vector2(boneData.x, boneData.y); - } - } - - /// Gets the translate timeline for a given boneIndex. - /// You can get the boneIndex using SkeletonData.FindBoneIndex. - /// The root bone is always boneIndex 0. - /// This will return null if a TranslateTimeline is not found. - public static TranslateTimeline FindTranslateTimelineForBone (this Animation a, int boneIndex) { - foreach (var timeline in a.timelines) { - if (timeline.GetType().IsSubclassOf(typeof(TranslateTimeline))) - continue; - - var translateTimeline = timeline as TranslateTimeline; - if (translateTimeline != null && translateTimeline.boneIndex == boneIndex) - return translateTimeline; - } - return null; - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Utility/TimelineExtensions.cs.meta b/Assets/Spine/Runtime/spine-unity/Utility/TimelineExtensions.cs.meta deleted file mode 100644 index 6198f84aa..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/TimelineExtensions.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 07807fefbff25484ba41b1d16911fb0e -timeCreated: 1591974498 -licenseType: Pro -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimation.cs b/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimation.cs deleted file mode 100644 index 644ceed9f..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimation.cs +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; -using System.Collections; -using System; - -namespace Spine.Unity { - /// - /// Use this as a condition-blocking yield instruction for Unity Coroutines. - /// The routine will pause until the AnimationState.TrackEntry fires any of the - /// configured events. - ///

- /// See the Spine Unity Events documentation page - /// and - /// for more information on when track events will be triggered.

- public class WaitForSpineAnimation : IEnumerator { - - [Flags] - public enum AnimationEventTypes - { - Start = 1, - Interrupt = 2, - End = 4, - Dispose = 8, - Complete = 16 - } - - bool m_WasFired = false; - - public WaitForSpineAnimation (Spine.TrackEntry trackEntry, AnimationEventTypes eventsToWaitFor) { - SafeSubscribe(trackEntry, eventsToWaitFor); - } - - #region Reuse - /// - /// One optimization high-frequency YieldInstruction returns is to cache instances to minimize GC pressure. - /// Use NowWaitFor to reuse the same instance of WaitForSpineAnimationComplete. - public WaitForSpineAnimation NowWaitFor (Spine.TrackEntry trackEntry, AnimationEventTypes eventsToWaitFor) { - SafeSubscribe(trackEntry, eventsToWaitFor); - return this; - } - #endregion - - #region IEnumerator - bool IEnumerator.MoveNext () { - if (m_WasFired) { - ((IEnumerator)this).Reset(); // auto-reset for YieldInstruction reuse - return false; - } - - return true; - } - void IEnumerator.Reset () { m_WasFired = false; } - object IEnumerator.Current { get { return null; } } - #endregion - - protected void SafeSubscribe (Spine.TrackEntry trackEntry, AnimationEventTypes eventsToWaitFor) { - if (trackEntry == null) { - // Break immediately if trackEntry is null. - Debug.LogWarning("TrackEntry was null. Coroutine will continue immediately."); - m_WasFired = true; - } - else { - if ((eventsToWaitFor & AnimationEventTypes.Start) != 0) - trackEntry.Start += HandleComplete; - if ((eventsToWaitFor & AnimationEventTypes.Interrupt) != 0) - trackEntry.Interrupt += HandleComplete; - if ((eventsToWaitFor & AnimationEventTypes.End) != 0) - trackEntry.End += HandleComplete; - if ((eventsToWaitFor & AnimationEventTypes.Dispose) != 0) - trackEntry.Dispose += HandleComplete; - if ((eventsToWaitFor & AnimationEventTypes.Complete) != 0) - trackEntry.Complete += HandleComplete; - } - } - - void HandleComplete (TrackEntry trackEntry) { - m_WasFired = true; - } - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimation.cs.meta b/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimation.cs.meta deleted file mode 100644 index ac946e63f..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimation.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d9be5adcaf0003849a1d181173c19635 -timeCreated: 1566289729 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimationComplete.cs b/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimationComplete.cs deleted file mode 100644 index 39cf16a95..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimationComplete.cs +++ /dev/null @@ -1,62 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; -using System.Collections; -using Spine; - -namespace Spine.Unity { - /// - /// Use this as a condition-blocking yield instruction for Unity Coroutines. - /// The routine will pause until the AnimationState.TrackEntry fires its Complete event. - /// It can be configured to trigger on the End event as well to cover interruption. - ///

- /// See the Spine Unity Events documentation page - /// and - /// for more information on when track events will be triggered.

- public class WaitForSpineAnimationComplete : WaitForSpineAnimation, IEnumerator { - - public WaitForSpineAnimationComplete (Spine.TrackEntry trackEntry, bool includeEndEvent = false) : - base(trackEntry, - includeEndEvent ? (AnimationEventTypes.Complete | AnimationEventTypes.End) : AnimationEventTypes.Complete) - { - } - - #region Reuse - /// - /// One optimization high-frequency YieldInstruction returns is to cache instances to minimize GC pressure. - /// Use NowWaitFor to reuse the same instance of WaitForSpineAnimationComplete. - public WaitForSpineAnimationComplete NowWaitFor (Spine.TrackEntry trackEntry, bool includeEndEvent = false) { - SafeSubscribe(trackEntry, - includeEndEvent ? (AnimationEventTypes.Complete | AnimationEventTypes.End) : AnimationEventTypes.Complete); - return this; - } - #endregion - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimationEnd.cs b/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimationEnd.cs deleted file mode 100644 index dbafcc6c0..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimationEnd.cs +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated January 1, 2020. Replaces all prior versions. - * - * Copyright (c) 2013-2020, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -using UnityEngine; -using System.Collections; -using Spine; - -namespace Spine.Unity { - /// - /// Use this as a condition-blocking yield instruction for Unity Coroutines. - /// The routine will pause until the AnimationState.TrackEntry fires its End event. - ///

- /// See the Spine Unity Events documentation page - /// and - /// for more information on when track events will be triggered.

- public class WaitForSpineAnimationEnd : WaitForSpineAnimation, IEnumerator { - - public WaitForSpineAnimationEnd (Spine.TrackEntry trackEntry) : - base(trackEntry, AnimationEventTypes.End) - { - } - - #region Reuse - /// - /// One optimization high-frequency YieldInstruction returns is to cache instances to minimize GC pressure. - /// Use NowWaitFor to reuse the same instance of WaitForSpineAnimationComplete. - public WaitForSpineAnimationEnd NowWaitFor (Spine.TrackEntry trackEntry) { - SafeSubscribe(trackEntry, AnimationEventTypes.End); - return this; - } - #endregion - } -} diff --git a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimationEnd.cs.meta b/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimationEnd.cs.meta deleted file mode 100644 index 472b1f96a..000000000 --- a/Assets/Spine/Runtime/spine-unity/Utility/YieldInstructions/WaitForSpineAnimationEnd.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3c5a5fe930d1ab24da154d76b24c2747 -timeCreated: 1566288961 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/package.json b/Assets/Spine/package.json deleted file mode 100644 index 6fac1264d..000000000 --- a/Assets/Spine/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "com.esotericsoftware.spine.spine-unity", - "displayName": "spine-unity Runtime", - "description": "This plugin provides the spine-unity runtime core.", - "version": "3.8.0", - "unity": "2018.3", - "author": { - "name": "Esoteric Software", - "email": "contact@esotericsoftware.com", - "url": "http://esotericsoftware.com/" - }, - "dependencies": { - }, - "keywords": [ - "spine", - "spine-unity", - "core" - ] -} diff --git a/Assets/Spine/package.json.meta b/Assets/Spine/package.json.meta deleted file mode 100644 index d0000ccae..000000000 --- a/Assets/Spine/package.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 09478c42aa0375347898d942d287a819 -PackageManifestImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Spine/version.txt b/Assets/Spine/version.txt index b0193b16a..02374add1 100644 --- a/Assets/Spine/version.txt +++ b/Assets/Spine/version.txt @@ -1,2 +1,2 @@ -This Spine-Unity runtime works with data exported from Spine Editor version: 3.8.xx -Package version: spine-unity-3.8-2021-11-10.unitypackage +This Spine-Unity runtime works with data exported from Spine Editor version: 3.7.xx +Package version: spine-unity-3_7-2019-08-05.unitypackage diff --git a/UserSettings/Layouts/default-2022.dwlt b/UserSettings/Layouts/default-2022.dwlt index bf6974373..ad0b6572f 100644 --- a/UserSettings/Layouts/default-2022.dwlt +++ b/UserSettings/Layouts/default-2022.dwlt @@ -14,14 +14,14 @@ MonoBehaviour: m_EditorClassIdentifier: m_PixelRect: serializedVersion: 2 - x: 2646 - y: 459 - width: 926 - height: 584 + x: 518 + y: 813 + width: 802 + height: 491 m_ShowMode: 0 - m_Title: Addressables Groups + m_Title: Animation m_RootView: {fileID: 5} - m_MinSize: {x: 430, y: 271} + m_MinSize: {x: 100, y: 121} m_MaxSize: {x: 4000, y: 4021} m_Maximized: 0 --- !u!114 &2 @@ -38,14 +38,14 @@ MonoBehaviour: m_EditorClassIdentifier: m_PixelRect: serializedVersion: 2 - x: 763 - y: 656 - width: 802 - height: 491 + x: 1325 + y: 785 + width: 926 + height: 559 m_ShowMode: 0 - m_Title: Animation + m_Title: Addressables Groups m_RootView: {fileID: 7} - m_MinSize: {x: 100, y: 121} + m_MinSize: {x: 430, y: 271} m_MaxSize: {x: 4000, y: 4021} m_Maximized: 0 --- !u!114 &3 @@ -67,7 +67,7 @@ MonoBehaviour: width: 2560 height: 1357 m_ShowMode: 4 - m_Title: Inspector + m_Title: Hierarchy m_RootView: {fileID: 8} m_MinSize: {x: 875, y: 300} m_MaxSize: {x: 10000, y: 10000} @@ -82,17 +82,17 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} - m_Name: AddressableAssetsWindow + m_Name: AnimationWindow m_EditorClassIdentifier: m_Children: [] m_Position: serializedVersion: 2 x: 0 y: 0 - width: 926 - height: 584 - m_MinSize: {x: 430, y: 250} - m_MaxSize: {x: 4000, y: 4000} + width: 802 + height: 491 + m_MinSize: {x: 100, y: 121} + m_MaxSize: {x: 4000, y: 4021} m_ActualView: {fileID: 22} m_Panes: - {fileID: 22} @@ -116,12 +116,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 926 - height: 584 - m_MinSize: {x: 430, y: 271} + width: 802 + height: 491 + m_MinSize: {x: 100, y: 121} m_MaxSize: {x: 4000, y: 4021} vertical: 0 - controlID: 48 + controlID: 110 draggingID: 0 --- !u!114 &6 MonoBehaviour: @@ -133,16 +133,16 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} - m_Name: AnimationWindow + m_Name: AddressableAssetsWindow m_EditorClassIdentifier: m_Children: [] m_Position: serializedVersion: 2 x: 0 y: 0 - width: 802 - height: 491 - m_MinSize: {x: 100, y: 121} + width: 926 + height: 559 + m_MinSize: {x: 430, y: 271} m_MaxSize: {x: 4000, y: 4021} m_ActualView: {fileID: 23} m_Panes: @@ -167,12 +167,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 802 - height: 491 - m_MinSize: {x: 100, y: 121} + width: 926 + height: 559 + m_MinSize: {x: 430, y: 271} m_MaxSize: {x: 4000, y: 4021} vertical: 0 - controlID: 16 + controlID: 15 draggingID: 0 --- !u!114 &8 MonoBehaviour: @@ -269,7 +269,7 @@ MonoBehaviour: m_MinSize: {x: 400, y: 100} m_MaxSize: {x: 32384, y: 16192} vertical: 0 - controlID: 144 + controlID: 188 draggingID: 0 --- !u!114 &12 MonoBehaviour: @@ -295,7 +295,7 @@ MonoBehaviour: m_MinSize: {x: 300, y: 100} m_MaxSize: {x: 24288, y: 16192} vertical: 1 - controlID: 145 + controlID: 189 draggingID: 0 --- !u!114 &13 MonoBehaviour: @@ -322,7 +322,7 @@ MonoBehaviour: m_MinSize: {x: 300, y: 50} m_MaxSize: {x: 24288, y: 8096} vertical: 0 - controlID: 146 + controlID: 190 draggingID: 0 --- !u!114 &14 MonoBehaviour: @@ -428,7 +428,7 @@ MonoBehaviour: m_MinSize: {x: 300, y: 50} m_MaxSize: {x: 24288, y: 8096} vertical: 0 - controlID: 294 + controlID: 227 draggingID: 0 --- !u!114 &18 MonoBehaviour: @@ -440,7 +440,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 1 m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} - m_Name: ConsoleWindow + m_Name: ProjectBrowser m_EditorClassIdentifier: m_Children: [] m_Position: @@ -449,16 +449,16 @@ MonoBehaviour: y: 0 width: 1313 height: 749 - m_MinSize: {x: 101, y: 121} - m_MaxSize: {x: 4001, y: 4021} - m_ActualView: {fileID: 30} + m_MinSize: {x: 231, y: 271} + m_MaxSize: {x: 10001, y: 10021} + m_ActualView: {fileID: 29} m_Panes: - {fileID: 30} - {fileID: 31} - {fileID: 29} - {fileID: 24} - m_Selected: 0 - m_LastSelected: 2 + m_Selected: 2 + m_LastSelected: 0 --- !u!114 &19 MonoBehaviour: m_ObjectHideFlags: 52 @@ -530,14 +530,52 @@ MonoBehaviour: y: 0 width: 491 height: 1307 - m_MinSize: {x: 275, y: 50} - m_MaxSize: {x: 4000, y: 4000} + m_MinSize: {x: 276, y: 71} + m_MaxSize: {x: 4001, y: 4021} m_ActualView: {fileID: 33} m_Panes: - {fileID: 33} m_Selected: 0 m_LastSelected: 0 --- !u!114 &22 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 12071, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_MinSize: {x: 100, y: 100} + m_MaxSize: {x: 4000, y: 4000} + m_TitleContent: + m_Text: Animation + m_Image: {fileID: -8166618308981325432, guid: 0000000000000000d000000000000000, + type: 0} + m_Tooltip: + m_Pos: + serializedVersion: 2 + x: 518 + y: 813 + width: 802 + height: 470 + m_SerializedDataModeController: + m_DataMode: 0 + m_PreferredDataMode: 0 + m_SupportedDataModes: + isAutomatic: 1 + m_ViewDataDictionary: {fileID: 0} + m_OverlayCanvas: + m_LastAppliedPresetName: Default + m_SaveData: [] + m_OverlaysVisible: 1 + m_LockTracker: + m_IsLocked: 0 + m_LastSelectedObjectID: -26598 +--- !u!114 &23 MonoBehaviour: m_ObjectHideFlags: 52 m_CorrespondingSourceObject: {fileID: 0} @@ -557,10 +595,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 2646 - y: 459 + x: 1325 + y: 785 width: 926 - height: 563 + height: 538 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -574,8 +612,8 @@ MonoBehaviour: m_GroupEditor: m_TreeState: scrollPos: {x: 0, y: 0} - m_SelectedIDs: - m_LastClickedID: 0 + m_SelectedIDs: f40afecf + m_LastClickedID: -805434636 m_ExpandedIDs: 54117794ffffffff m_RenameOverlay: m_UserAcceptedRename: 0 @@ -592,7 +630,7 @@ MonoBehaviour: m_IsRenaming: 0 m_OriginalEventType: 0 m_IsRenamingFilename: 0 - m_ClientGUIView: {fileID: 4} + m_ClientGUIView: {fileID: 6} m_SearchString: m_Mchs: m_Columns: @@ -675,46 +713,8 @@ MonoBehaviour: userData: 0 m_VisibleColumns: 0000000001000000020000000300000004000000 m_SortedColumns: - window: {fileID: 22} + window: {fileID: 23} m_VerticalSplitterPercent: 0.8 ---- !u!114 &23 -MonoBehaviour: - m_ObjectHideFlags: 52 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 12071, guid: 0000000000000000e000000000000000, type: 0} - m_Name: - m_EditorClassIdentifier: - m_MinSize: {x: 100, y: 100} - m_MaxSize: {x: 4000, y: 4000} - m_TitleContent: - m_Text: Animation - m_Image: {fileID: -8166618308981325432, guid: 0000000000000000d000000000000000, - type: 0} - m_Tooltip: - m_Pos: - serializedVersion: 2 - x: 763 - y: 656 - width: 802 - height: 470 - m_SerializedDataModeController: - m_DataMode: 0 - m_PreferredDataMode: 0 - m_SupportedDataModes: - isAutomatic: 1 - m_ViewDataDictionary: {fileID: 0} - m_OverlayCanvas: - m_LastAppliedPresetName: Default - m_SaveData: [] - m_OverlaysVisible: 1 - m_LockTracker: - m_IsLocked: 0 - m_LastSelectedObjectID: -636020 --- !u!114 &24 MonoBehaviour: m_ObjectHideFlags: 52 @@ -959,9 +959,9 @@ MonoBehaviour: m_IsLocked: 1 m_FolderTreeState: scrollPos: {x: 0, y: 2658} - m_SelectedIDs: 14020100 - m_LastClickedID: 66068 - m_ExpandedIDs: 00000000f2000100f4000100f6000100f8000100fa000100fc000100fe00010000010100020101000401010006010100080101000a0101000c0101000e01010010010100120101001401010016010100180101001a0101001c0101001e01010020010100220101002401010026010100280101002a0101002c0101002e01010030010100320101003401010036010100380101003a0101003c0101003e01010040010100420101004401010046010100480101004a0101004c0101004e01010050010100520101005401010056010100580101005a0101005c0101005e01010060010100620101006401010066010100680101006a0101006c0101006e01010070010100720101007401010076010100780101007a0101007c0101007e01010080010100820101008401010086010100880101008a0101008c0101008e01010090010100920101009401010096010100980101009a0101009c0101009e010100a0010100a2010100a4010100a6010100a8010100aa010100ac010100ae010100b0010100b2010100b4010100b6010100b8010100ba010100bc010100be010100c0010100c2010100c4010100c6010100c8010100ca010100cc010100ce010100d0010100d2010100d4010100d6010100d8010100da010100dc010100de010100e0010100e2010100e4010100e6010100e8010100f0010100f2010100f4010100fa0101000202010006020100080201000a0201000c02010012020100180201001a0201001c0201001e02010000ca9a3bffffff7f + m_SelectedIDs: 2a170100 + m_LastClickedID: 71466 + m_ExpandedIDs: 000000000c1601000e16010010160100121601001416010016160100181601001a1601001c1601001e16010020160100221601002416010026160100281601002a1601002c1601002e16010030160100321601003416010036160100381601003a1601003c1601003e16010040160100421601004416010046160100481601004a1601004c1601004e16010050160100521601005416010056160100581601005a1601005c1601005e16010060160100621601006416010066160100681601006a1601006c1601006e16010070160100721601007416010076160100781601007a1601007c1601007e16010080160100821601008416010086160100881601008a1601008c1601008e16010090160100921601009416010096160100981601009a1601009c1601009e160100a0160100a2160100a4160100a6160100a8160100aa160100ac160100ae160100b0160100b2160100b4160100b6160100b8160100ba160100bc160100be160100c0160100c2160100c4160100c6160100c8160100ca160100cc160100ce160100d0160100d2160100d4160100d6160100d8160100da160100dc160100de160100e0160100e2160100e4160100e6160100e8160100ea160100ec160100ee160100f0160100f2160100f4160100f6160100f8160100fa160100fc160100fe16010000170100081701000a1701000c170100121701001a1701001c1701001e1701002017010022170100281701002e17010030170100321701003417010000ca9a3bffffff7f m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -989,7 +989,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: 00000000f2000100f4000100f6000100f8000100fa000100fc000100fe00010000010100020101000401010006010100080101000a0101000c0101000e01010010010100120101001401010016010100180101001a0101001c0101001e01010020010100220101002401010026010100280101002a0101002c0101002e01010030010100320101003401010036010100380101003a0101003c0101003e01010040010100420101004401010046010100480101004a0101004c0101004e01010050010100520101005401010056010100580101005a0101005c0101005e01010060010100620101006401010066010100680101006a0101006c0101006e01010070010100720101007401010076010100780101007a0101007c0101007e01010080010100820101008401010086010100880101008a0101008c0101008e01010090010100920101009401010096010100980101009a0101009c0101009e010100a0010100a2010100a4010100a6010100a8010100aa010100ac010100ae010100b0010100b2010100b4010100b6010100b8010100ba010100bc010100be010100c0010100c2010100c4010100c6010100c8010100ca010100cc010100ce010100d0010100d2010100d4010100d6010100d8010100da010100dc010100de010100e0010100e2010100e4010100e6010100e8010100ea010100ec010100ee010100f0010100f2010100f4010100f6010100f8010100fa010100fc010100fe01010000020100020201000402010006020100080201000a0201000c0201000e02010010020100120201001402010016020100180201001a0201001c0201001e020100 + m_ExpandedIDs: 000000000c1601000e16010010160100121601001416010016160100181601001a1601001c1601001e16010020160100221601002416010026160100281601002a1601002c1601002e16010030160100321601003416010036160100381601003a1601003c1601003e16010040160100421601004416010046160100481601004a1601004c1601004e16010050160100521601005416010056160100581601005a1601005c1601005e16010060160100621601006416010066160100681601006a1601006c1601006e16010070160100721601007416010076160100781601007a1601007c1601007e16010080160100821601008416010086160100881601008a1601008c1601008e16010090160100921601009416010096160100981601009a1601009c1601009e160100a0160100a2160100a4160100a6160100a8160100aa160100ac160100ae160100b0160100b2160100b4160100b6160100b8160100ba160100bc160100be160100c0160100c2160100c4160100c6160100c8160100ca160100cc160100ce160100d0160100d2160100d4160100d6160100d8160100da160100dc160100de160100e0160100e2160100e4160100e6160100e8160100ea160100ec160100ee160100f0160100f2160100f4160100f6160100f8160100fa160100fc160100fe16010000170100021701000417010006170100081701000a1701000c1701000e17010010170100121701001417010016170100181701001a1701001c1701001e17010020170100221701002417010026170100281701002a1701002c1701002e17010030170100321701003417010036170100 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -1016,7 +1016,7 @@ MonoBehaviour: m_ListAreaState: m_SelectedInstanceIDs: m_LastClickedInstanceID: 0 - m_HadKeyboardFocusLastEvent: 1 + m_HadKeyboardFocusLastEvent: 0 m_ExpandedInstanceIDs: 4675000052970000469700008696000074960000987e0000c8630100c4ec0000e2ef0000dcef0000beef000098da00009cda000020a30000c6a200000eab000036c10000 m_RenameOverlay: m_UserAcceptedRename: 0 @@ -1083,9 +1083,9 @@ MonoBehaviour: m_SceneHierarchy: m_TreeViewState: scrollPos: {x: 0, y: 0} - m_SelectedIDs: + m_SelectedIDs: 16960000 m_LastClickedID: 0 - m_ExpandedIDs: 2256f6ffda59f6ffd062f6ff8266f6ff8866f6ff80bdf6ff38c1f6ff2aeef6ff1013f7ffc816f7ff5c37f7ffe499f7fffaa3f7ff12ccf7ff8002f8ffcc6cf8ffd26cf8ffbc85f8ff18d4f8ffee38fafff438faff3474faff76c1fdff2cc5fdff9cd0fdff8cf8feff6e3bffff6c5cffff50f7ffff04fbffff0afbffff7ebe0000 + m_ExpandedIDs: 0afbffff m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -1615,14 +1615,14 @@ MonoBehaviour: m_OverrideSceneCullingMask: 6917529027641081856 m_SceneIsLit: 1 m_SceneLighting: 1 - m_2DMode: 0 + m_2DMode: 1 m_isRotationLocked: 0 m_PlayAudio: 0 m_AudioPlay: 0 m_Position: - m_Target: {x: 94.92476, y: 11.841325, z: 36.124866} + m_Target: {x: 1619.5625, y: 683.69073, z: 3.5033584} speed: 2 - m_Value: {x: 94.92476, y: 11.841325, z: 36.124866} + m_Value: {x: 1619.5625, y: 683.69073, z: 3.5033584} m_RenderMode: 0 m_CameraMode: drawMode: 0 @@ -1650,15 +1650,15 @@ MonoBehaviour: m_Size: {x: 0, y: 0} yGrid: m_Fade: - m_Target: 1 + m_Target: 0 speed: 2 - m_Value: 1 + m_Value: 0 m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4} m_Pivot: {x: 0, y: 0, z: 0} m_Size: {x: 1, y: 1} zGrid: m_Fade: - m_Target: 0 + m_Target: 1 speed: 2 m_Value: 1 m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4} @@ -1668,17 +1668,17 @@ MonoBehaviour: m_GridAxis: 1 m_gridOpacity: 0.5 m_Rotation: - m_Target: {x: -0.014622384, y: -0.674453, z: 0.0133624, w: -0.7380515} + m_Target: {x: 0, y: 0, z: 0, w: 1} speed: 2 - m_Value: {x: -0.014662412, y: -0.6722361, z: 0.013318479, w: -0.74007183} + m_Value: {x: 0, y: 0, z: 0, w: 1} m_Size: - m_Target: 85.43723 + m_Target: 1353.2894 speed: 2 - m_Value: 81.75812 + m_Value: 1353.2894 m_Ortho: - m_Target: 0 + m_Target: 1 speed: 2 - m_Value: 0 + m_Value: 1 m_CameraSettings: m_Speed: 1 m_SpeedNormalized: 0.5 @@ -1720,10 +1720,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 2560 - y: 477 - width: 557 - height: 522 + x: 0 + y: 631 + width: 1312 + height: 728 m_SerializedDataModeController: m_DataMode: 0 m_PreferredDataMode: 0 @@ -1745,7 +1745,7 @@ MonoBehaviour: m_SkipHidden: 0 m_SearchArea: 1 m_Folders: - - Assets + - Assets/Art/HHWK/prefab/fish m_Globs: [] m_OriginalText: m_ImportLogFlags: 0 @@ -1762,7 +1762,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 523} m_SelectedIDs: 30b90200 m_LastClickedID: 178480 - m_ExpandedIDs: 00000000f2000100f4000100f6000100f8000100fa000100fc000100fe00010000010100020101000401010006010100080101000a0101000c0101000e01010010010100120101001401010016010100180101001a0101001c0101001e01010020010100220101002401010026010100280101002a0101002c0101002e01010030010100320101003401010036010100380101003a0101003c0101003e01010040010100420101004401010046010100480101004a0101004c0101004e01010050010100520101005401010056010100580101005a0101005c0101005e01010060010100620101006401010066010100680101006a0101006c0101006e01010070010100720101007401010076010100780101007a0101007c0101007e01010080010100820101008401010086010100880101008a0101008c0101008e01010090010100920101009401010096010100980101009a0101009c0101009e010100a0010100a2010100a4010100a6010100a8010100aa010100ac010100ae010100b0010100b2010100b4010100b6010100b8010100ba010100bc010100be010100c0010100c2010100c4010100c6010100c8010100ca010100cc010100ce010100d0010100d2010100d4010100d6010100d8010100da010100dc010100de010100e0010100e2010100e4010100e6010100e8010100ea010100ec010100ee010100f0010100f2010100f4010100f6010100f8010100fa010100fc010100fe01010000020100020201000402010006020100080201000a0201000c0201000e02010010020100120201001402010016020100180201001a0201001c0201001e020100 + m_ExpandedIDs: 000000000c1601000e16010010160100121601001416010016160100181601001a1601001c1601001e16010020160100221601002416010026160100281601002a1601002c1601002e16010030160100321601003416010036160100381601003a1601003c1601003e16010040160100421601004416010046160100481601004a1601004c1601004e16010050160100521601005416010056160100581601005a1601005c1601005e16010060160100621601006416010066160100681601006a1601006c1601006e16010070160100721601007416010076160100781601007a1601007c1601007e16010080160100821601008416010086160100881601008a1601008c1601008e16010090160100921601009416010096160100981601009a1601009c1601009e160100a0160100a2160100a4160100a6160100a8160100aa160100ac160100ae160100b0160100b2160100b4160100b6160100b8160100ba160100bc160100be160100c0160100c2160100c4160100c6160100c8160100ca160100cc160100ce160100d0160100d2160100d4160100d6160100d8160100da160100dc160100de160100e0160100e2160100e4160100e6160100e8160100ea160100ec160100ee160100f0160100f2160100f4160100f6160100f8160100fa160100fc160100fe16010000170100021701000417010006170100081701000a1701000c1701000e17010010170100121701001417010016170100181701001a1701001c1701001e17010020170100221701002417010026170100281701002a1701002c1701002e17010030170100321701003417010036170100 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -1787,10 +1787,10 @@ MonoBehaviour: m_Icon: {fileID: 0} m_ResourceFile: m_AssetTreeState: - scrollPos: {x: 0, y: 6308} + scrollPos: {x: 0, y: 1292} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: ffffffff00000000f2000100f4000100f6000100f8000100fa000100fc000100fe00010000010100020101000401010006010100080101000a0101000c0101000e01010010010100120101001401010016010100180101001a0101001c0101001e01010020010100220101002401010026010100280101002a0101002c0101002e01010030010100320101003401010036010100380101003a0101003c0101003e01010040010100420101004401010046010100480101004a0101004c0101004e01010050010100520101005401010056010100580101005a0101005c0101005e01010060010100620101006401010066010100680101006a0101006c0101006e01010070010100720101007401010076010100780101007a0101007c0101007e01010080010100820101008401010086010100880101008a0101008c0101008e010100900101009201010094010100960101009a0101009c0101009e010100a0010100a2010100a4010100a6010100a8010100aa010100ac010100ae010100b0010100b2010100b4010100b6010100b8010100ba010100bc010100be010100c0010100c2010100c4010100c6010100c8010100ca010100cc010100ce010100d0010100d2010100d4010100d6010100d8010100da010100dc010100de010100e0010100e2010100e4010100e6010100e8010100ea010100ec010100ee010100f0010100f2010100f4010100f6010100f8010100fa010100fc010100fe010100000201000402010006020100080201000a0201000c0201000e02010010020100120201001402010016020100180201001a0201001c0201001e0201006a060100 + m_ExpandedIDs: ffffffff000000000c1601000e16010010160100121601001416010016160100181601001a1601001c1601001e16010020160100221601002416010026160100281601002a1601002c1601002e16010030160100321601003416010036160100381601003a1601003c1601003e16010040160100421601004416010046160100481601004a1601004c1601004e16010050160100521601005416010056160100581601005a1601005c1601005e16010060160100621601006416010066160100681601006a1601006c1601006e16010070160100721601007416010076160100781601007a1601007c1601007e16010080160100821601008416010086160100881601008a1601008c1601008e16010090160100921601009416010096160100981601009a1601009c1601009e160100a0160100a2160100a4160100a6160100a8160100aa160100ac160100ae160100b0160100b2160100b4160100b6160100b8160100ba160100bc160100be160100c0160100c2160100c4160100c6160100c8160100ca160100cc160100ce160100d0160100d2160100d4160100d6160100d8160100da160100dc160100de160100e0160100e2160100e4160100e6160100e8160100ea160100ec160100ee160100f0160100f2160100f4160100f6160100f8160100fa160100fc160100fe16010000170100021701000417010006170100081701000a1701000c1701000e17010010170100121701001417010016170100181701001a1701001c1701001e17010020170100221701002417010026170100281701002a1701002c1701002e17010030170100321701003417010036170100 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -1977,9 +1977,9 @@ MonoBehaviour: m_IsLocked: 1 m_FolderTreeState: scrollPos: {x: 0, y: 0} - m_SelectedIDs: f4000100 - m_LastClickedID: 65780 - m_ExpandedIDs: 00000000f2000100f4000100f6000100f8000100fa000100fc000100fe00010000010100020101000401010006010100080101000a0101000c0101000e01010010010100120101001401010016010100180101001a0101001c0101001e01010020010100220101002401010026010100280101002a0101002c0101002e01010030010100320101003401010036010100380101003a0101003c0101003e01010040010100420101004401010046010100480101004a0101004c0101004e01010050010100520101005401010056010100580101005a0101005c0101005e01010060010100620101006401010066010100680101006a0101006c0101006e01010070010100720101007401010076010100780101007a0101007c0101007e01010080010100820101008401010086010100880101008a0101008c0101008e01010090010100920101009401010096010100980101009a0101009c0101009e010100a0010100a2010100a4010100a6010100a8010100aa010100ac010100ae010100b0010100b2010100b4010100b6010100b8010100ba010100bc010100be010100c0010100c2010100c4010100c6010100c8010100ca010100cc010100ce010100d0010100d2010100d4010100d6010100d8010100da010100dc010100de010100e0010100e2010100e4010100e6010100e8010100f0010100f2010100f4010100fa0101000202010006020100080201000a0201000c02010012020100180201001a0201001c0201001e02010000ca9a3bffffff7f + m_SelectedIDs: 0e160100 + m_LastClickedID: 71182 + m_ExpandedIDs: 000000000c1601000e16010010160100121601001416010016160100181601001a1601001c1601001e16010020160100221601002416010026160100281601002a1601002c1601002e16010030160100321601003416010036160100381601003a1601003c1601003e16010040160100421601004416010046160100481601004a1601004c1601004e16010050160100521601005416010056160100581601005a1601005c1601005e16010060160100621601006416010066160100681601006a1601006c1601006e16010070160100721601007416010076160100781601007a1601007c1601007e16010080160100821601008416010086160100881601008a1601008c1601008e16010090160100921601009416010096160100981601009a1601009c1601009e160100a0160100a2160100a4160100a6160100a8160100aa160100ac160100ae160100b0160100b2160100b4160100b6160100b8160100ba160100bc160100be160100c0160100c2160100c4160100c6160100c8160100ca160100cc160100ce160100d0160100d2160100d4160100d6160100d8160100da160100dc160100de160100e0160100e2160100e4160100e6160100e8160100ea160100ec160100ee160100f0160100f2160100f4160100f6160100f8160100fa160100fc160100fe16010000170100081701000a1701000c170100121701001a1701001c1701001e1701002017010022170100281701002e17010030170100321701003417010000ca9a3bffffff7f m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -2007,7 +2007,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: 00000000f2000100f4000100f6000100f8000100fa000100fc000100fe00010000010100020101000401010006010100080101000a0101000c0101000e01010010010100120101001401010016010100180101001a0101001c0101001e01010020010100220101002401010026010100280101002a0101002c0101002e01010030010100320101003401010036010100380101003a0101003c0101003e01010040010100420101004401010046010100480101004a0101004c0101004e01010050010100520101005401010056010100580101005a0101005c0101005e01010060010100620101006401010066010100680101006a0101006c0101006e01010070010100720101007401010076010100780101007a0101007c0101007e01010080010100820101008401010086010100880101008a0101008c0101008e01010090010100920101009401010096010100980101009a0101009c0101009e010100a0010100a2010100a4010100a6010100a8010100aa010100ac010100ae010100b0010100b2010100b4010100b6010100b8010100ba010100bc010100be010100c0010100c2010100c4010100c6010100c8010100ca010100cc010100ce010100d0010100d2010100d4010100d6010100d8010100da010100dc010100de010100e0010100e2010100e4010100e6010100e8010100ea010100ec010100ee010100f0010100f2010100f4010100f6010100f8010100fa010100fc010100fe01010000020100020201000402010006020100080201000a0201000c0201000e02010010020100120201001402010016020100180201001a0201001c0201001e020100 + m_ExpandedIDs: 000000000c1601000e16010010160100121601001416010016160100181601001a1601001c1601001e16010020160100221601002416010026160100281601002a1601002c1601002e16010030160100321601003416010036160100381601003a1601003c1601003e16010040160100421601004416010046160100481601004a1601004c1601004e16010050160100521601005416010056160100581601005a1601005c1601005e16010060160100621601006416010066160100681601006a1601006c1601006e16010070160100721601007416010076160100781601007a1601007c1601007e16010080160100821601008416010086160100881601008a1601008c1601008e16010090160100921601009416010096160100981601009a1601009c1601009e160100a0160100a2160100a4160100a6160100a8160100aa160100ac160100ae160100b0160100b2160100b4160100b6160100b8160100ba160100bc160100be160100c0160100c2160100c4160100c6160100c8160100ca160100cc160100ce160100d0160100d2160100d4160100d6160100d8160100da160100dc160100de160100e0160100e2160100e4160100e6160100e8160100ea160100ec160100ee160100f0160100f2160100f4160100f6160100f8160100fa160100fc160100fe16010000170100021701000417010006170100081701000a1701000c1701000e17010010170100121701001417010016170100181701001a1701001c1701001e17010020170100221701002417010026170100281701002a1701002c1701002e17010030170100321701003417010036170100 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -2034,7 +2034,7 @@ MonoBehaviour: m_ListAreaState: m_SelectedInstanceIDs: m_LastClickedInstanceID: 0 - m_HadKeyboardFocusLastEvent: 1 + m_HadKeyboardFocusLastEvent: 0 m_ExpandedInstanceIDs: c0b000000eab00006ce3f5ff m_RenameOverlay: m_UserAcceptedRename: 0