├── Assets ├── DynamicBone.meta ├── DynamicBone │ ├── Demo.meta │ ├── Demo │ │ ├── Demo1.unity │ │ ├── Demo1.unity.meta │ │ ├── DynamicBoneDemo1.cs │ │ ├── DynamicBoneDemo1.cs.meta │ │ ├── Player.prefab │ │ ├── Player.prefab.meta │ │ ├── c1.fbx │ │ ├── c1.fbx.meta │ │ ├── tail.FBX │ │ └── tail.FBX.meta │ ├── ReadMe.txt │ ├── ReadMe.txt.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── DynamicBone.cs │ │ ├── DynamicBone.cs.meta │ │ ├── DynamicBoneCollider.cs │ │ ├── DynamicBoneCollider.cs.meta │ │ ├── DynamicBoneColliderBase.cs │ │ ├── DynamicBoneColliderBase.cs.meta │ │ ├── DynamicBonePlaneCollider.cs │ │ └── DynamicBonePlaneCollider.cs.meta ├── DynamicBoneBeta.cs ├── DynamicBoneBeta.cs.meta ├── DynamicBoneManager.cs ├── DynamicBoneManager.cs.meta ├── Respawn.cs ├── Respawn.cs.meta ├── Scenes.meta ├── Scenes │ ├── SampleScene.unity │ └── SampleScene.unity.meta ├── smcs.rsp └── smcs.rsp.meta ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset └── VFXManager.asset ├── README.md └── img ├── jobstate.webp ├── opmized.webp └── origin.webp /Assets/DynamicBone.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6ba56ede2604dd4082ed2d0b4f435dd 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Demo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21a42390d25252341a66bc19a8addaea 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Demo/Demo1.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 902c84bf971339c459ce4b757e333a55 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Demo/DynamicBoneDemo1.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class DynamicBoneDemo1 : MonoBehaviour 5 | { 6 | public GameObject m_Player; 7 | float m_weight = 1; 8 | 9 | void Update() 10 | { 11 | m_Player.transform.Rotate(new Vector3(0, Input.GetAxis("Horizontal") * Time.deltaTime * 200, 0)); 12 | m_Player.transform.Translate(transform.forward * Input.GetAxis("Vertical") * Time.deltaTime * 4); 13 | } 14 | 15 | void OnGUI() 16 | { 17 | GUI.Label(new Rect(50, 50, 200, 24), "Press arrow key to move"); 18 | Animation a = m_Player.GetComponentInChildren(); 19 | a.enabled = GUI.Toggle(new Rect(50, 70, 200, 24), a.enabled, "Play Animation"); 20 | 21 | DynamicBone[] dbs = m_Player.GetComponents(); 22 | GUI.Label(new Rect(50, 100, 200, 24), "Choose dynamic bone:"); 23 | dbs[0].enabled = dbs[1].enabled = GUI.Toggle(new Rect(50, 120, 100, 24), dbs[0].enabled, "Breasts"); 24 | dbs[2].enabled = GUI.Toggle(new Rect(50, 140, 100, 24), dbs[2].enabled, "Tail"); 25 | 26 | GUI.Label(new Rect(50, 160, 200, 24), "Weight"); 27 | m_weight = GUI.HorizontalSlider(new Rect(100, 160, 100, 24), m_weight, 0, 1); 28 | foreach (var db in dbs) 29 | db.SetWeight(m_weight); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Demo/DynamicBoneDemo1.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 178320cedf292cb4f8d6c0b737b35953 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Demo/Player.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &2216316980269099858 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 2216316980526390994} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: baedd976e12657241bf7ff2d1c685342, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_Direction: 1 16 | m_Center: {x: 0, y: -0.2, z: 0} 17 | m_Bound: 0 18 | m_Radius: 0.1 19 | m_Height: 0.6 20 | --- !u!1 &2216316980897813484 21 | GameObject: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 100000, guid: 8a4fd2ea0aec44e449f6dc1271079085, 24 | type: 3} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | serializedVersion: 6 28 | m_Component: 29 | - component: {fileID: 2216316980897813487} 30 | - component: {fileID: 2216316980897813481} 31 | - component: {fileID: 2216316980897813480} 32 | - component: {fileID: 2216316980897813483} 33 | m_Layer: 0 34 | m_Name: Player 35 | m_TagString: Player 36 | m_Icon: {fileID: 0} 37 | m_NavMeshLayer: 0 38 | m_StaticEditorFlags: 0 39 | m_IsActive: 1 40 | --- !u!4 &2216316980897813487 41 | Transform: 42 | m_ObjectHideFlags: 0 43 | m_CorrespondingSourceObject: {fileID: 400000, guid: 8a4fd2ea0aec44e449f6dc1271079085, 44 | type: 3} 45 | m_PrefabInstance: {fileID: 0} 46 | m_PrefabAsset: {fileID: 0} 47 | m_GameObject: {fileID: 2216316980897813484} 48 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 49 | m_LocalPosition: {x: 0, y: 0, z: 0} 50 | m_LocalScale: {x: 1, y: 1, z: 1} 51 | m_Children: 52 | - {fileID: 2216316980526744442} 53 | m_Father: {fileID: 0} 54 | m_RootOrder: 0 55 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 56 | --- !u!114 &2216316980897813481 57 | MonoBehaviour: 58 | m_ObjectHideFlags: 0 59 | m_CorrespondingSourceObject: {fileID: 0} 60 | m_PrefabInstance: {fileID: 0} 61 | m_PrefabAsset: {fileID: 0} 62 | m_GameObject: {fileID: 2216316980897813484} 63 | m_Enabled: 1 64 | m_EditorHideFlags: 0 65 | m_Script: {fileID: 11500000, guid: f9ac8d30c6a0d9642a11e5be4c440740, type: 3} 66 | m_Name: 67 | m_EditorClassIdentifier: 68 | m_Root: {fileID: 2216316980526744400} 69 | m_UpdateRate: 60 70 | m_UpdateMode: 0 71 | m_Damping: 0.2 72 | m_DampingDistrib: 73 | serializedVersion: 2 74 | m_Curve: [] 75 | m_PreInfinity: 2 76 | m_PostInfinity: 2 77 | m_RotationOrder: 4 78 | m_Elasticity: 0.1 79 | m_ElasticityDistrib: 80 | serializedVersion: 2 81 | m_Curve: [] 82 | m_PreInfinity: 2 83 | m_PostInfinity: 2 84 | m_RotationOrder: 4 85 | m_Stiffness: 0.8 86 | m_StiffnessDistrib: 87 | serializedVersion: 2 88 | m_Curve: [] 89 | m_PreInfinity: 2 90 | m_PostInfinity: 2 91 | m_RotationOrder: 4 92 | m_Inert: 0.5 93 | m_InertDistrib: 94 | serializedVersion: 2 95 | m_Curve: [] 96 | m_PreInfinity: 2 97 | m_PostInfinity: 2 98 | m_RotationOrder: 4 99 | m_Friction: 0 100 | m_FrictionDistrib: 101 | serializedVersion: 2 102 | m_Curve: [] 103 | m_PreInfinity: 2 104 | m_PostInfinity: 2 105 | m_RotationOrder: 4 106 | m_Radius: 0 107 | m_RadiusDistrib: 108 | serializedVersion: 2 109 | m_Curve: [] 110 | m_PreInfinity: 2 111 | m_PostInfinity: 2 112 | m_RotationOrder: 4 113 | m_EndLength: 0 114 | m_EndOffset: {x: -0.1, y: -0.1, z: 0.3} 115 | m_Gravity: {x: 0, y: 0, z: 0} 116 | m_Force: {x: 0, y: 0, z: 0} 117 | m_Colliders: [] 118 | m_Exclusions: [] 119 | m_FreezeAxis: 0 120 | m_DistantDisable: 0 121 | m_ReferenceObject: {fileID: 0} 122 | m_DistanceToObject: 20 123 | --- !u!114 &2216316980897813480 124 | MonoBehaviour: 125 | m_ObjectHideFlags: 0 126 | m_CorrespondingSourceObject: {fileID: 0} 127 | m_PrefabInstance: {fileID: 0} 128 | m_PrefabAsset: {fileID: 0} 129 | m_GameObject: {fileID: 2216316980897813484} 130 | m_Enabled: 1 131 | m_EditorHideFlags: 0 132 | m_Script: {fileID: 11500000, guid: f9ac8d30c6a0d9642a11e5be4c440740, type: 3} 133 | m_Name: 134 | m_EditorClassIdentifier: 135 | m_Root: {fileID: 2216316980526744332} 136 | m_UpdateRate: 60 137 | m_UpdateMode: 0 138 | m_Damping: 0.2 139 | m_DampingDistrib: 140 | serializedVersion: 2 141 | m_Curve: [] 142 | m_PreInfinity: 2 143 | m_PostInfinity: 2 144 | m_RotationOrder: 4 145 | m_Elasticity: 0.1 146 | m_ElasticityDistrib: 147 | serializedVersion: 2 148 | m_Curve: [] 149 | m_PreInfinity: 2 150 | m_PostInfinity: 2 151 | m_RotationOrder: 4 152 | m_Stiffness: 0.8 153 | m_StiffnessDistrib: 154 | serializedVersion: 2 155 | m_Curve: [] 156 | m_PreInfinity: 2 157 | m_PostInfinity: 2 158 | m_RotationOrder: 4 159 | m_Inert: 0.5 160 | m_InertDistrib: 161 | serializedVersion: 2 162 | m_Curve: [] 163 | m_PreInfinity: 2 164 | m_PostInfinity: 2 165 | m_RotationOrder: 4 166 | m_Friction: 0 167 | m_FrictionDistrib: 168 | serializedVersion: 2 169 | m_Curve: [] 170 | m_PreInfinity: 2 171 | m_PostInfinity: 2 172 | m_RotationOrder: 4 173 | m_Radius: 0 174 | m_RadiusDistrib: 175 | serializedVersion: 2 176 | m_Curve: 177 | - serializedVersion: 3 178 | time: 0.28642094 179 | value: 0.8996325 180 | inSlope: -0.9737102 181 | outSlope: -0.11496421 182 | tangentMode: 1 183 | weightedMode: 0 184 | inWeight: 0.33333334 185 | outWeight: 0.33333334 186 | m_PreInfinity: 2 187 | m_PostInfinity: 2 188 | m_RotationOrder: 4 189 | m_EndLength: 0 190 | m_EndOffset: {x: 0.1, y: -0.1, z: 0.3} 191 | m_Gravity: {x: 0, y: 0, z: 0} 192 | m_Force: {x: 0, y: 0, z: 0} 193 | m_Colliders: [] 194 | m_Exclusions: [] 195 | m_FreezeAxis: 0 196 | m_DistantDisable: 0 197 | m_ReferenceObject: {fileID: 0} 198 | m_DistanceToObject: 20 199 | --- !u!114 &2216316980897813483 200 | MonoBehaviour: 201 | m_ObjectHideFlags: 0 202 | m_CorrespondingSourceObject: {fileID: 0} 203 | m_PrefabInstance: {fileID: 0} 204 | m_PrefabAsset: {fileID: 0} 205 | m_GameObject: {fileID: 2216316980897813484} 206 | m_Enabled: 1 207 | m_EditorHideFlags: 0 208 | m_Script: {fileID: 11500000, guid: f9ac8d30c6a0d9642a11e5be4c440740, type: 3} 209 | m_Name: 210 | m_EditorClassIdentifier: 211 | m_Root: {fileID: 2216316981729166297} 212 | m_UpdateRate: 60 213 | m_UpdateMode: 0 214 | m_Damping: 0.2 215 | m_DampingDistrib: 216 | serializedVersion: 2 217 | m_Curve: [] 218 | m_PreInfinity: 2 219 | m_PostInfinity: 2 220 | m_RotationOrder: 4 221 | m_Elasticity: 0.05 222 | m_ElasticityDistrib: 223 | serializedVersion: 2 224 | m_Curve: [] 225 | m_PreInfinity: 2 226 | m_PostInfinity: 2 227 | m_RotationOrder: 4 228 | m_Stiffness: 0.7 229 | m_StiffnessDistrib: 230 | serializedVersion: 2 231 | m_Curve: [] 232 | m_PreInfinity: 2 233 | m_PostInfinity: 2 234 | m_RotationOrder: 4 235 | m_Inert: 0.5 236 | m_InertDistrib: 237 | serializedVersion: 2 238 | m_Curve: [] 239 | m_PreInfinity: 2 240 | m_PostInfinity: 2 241 | m_RotationOrder: 4 242 | m_Friction: 0 243 | m_FrictionDistrib: 244 | serializedVersion: 2 245 | m_Curve: [] 246 | m_PreInfinity: 2 247 | m_PostInfinity: 2 248 | m_RotationOrder: 4 249 | m_Radius: 0.15 250 | m_RadiusDistrib: 251 | serializedVersion: 2 252 | m_Curve: 253 | - serializedVersion: 3 254 | time: 0.004166667 255 | value: 1.0124999 256 | inSlope: -0.762605 257 | outSlope: -0.762605 258 | tangentMode: 34 259 | weightedMode: 0 260 | inWeight: 0.33333334 261 | outWeight: 0.33333334 262 | - serializedVersion: 3 263 | time: 0.99583334 264 | value: 0.25624996 265 | inSlope: -0.762605 266 | outSlope: -0.762605 267 | tangentMode: 34 268 | weightedMode: 0 269 | inWeight: 0.33333334 270 | outWeight: 0.33333334 271 | m_PreInfinity: 2 272 | m_PostInfinity: 2 273 | m_RotationOrder: 4 274 | m_EndLength: 0 275 | m_EndOffset: {x: 0, y: 0, z: 0} 276 | m_Gravity: {x: 0, y: -0.002, z: 0} 277 | m_Force: {x: 0, y: 0, z: 0} 278 | m_Colliders: 279 | - {fileID: 2216316980980374431} 280 | - {fileID: 2216316980269099858} 281 | m_Exclusions: [] 282 | m_FreezeAxis: 0 283 | m_DistantDisable: 0 284 | m_ReferenceObject: {fileID: 0} 285 | m_DistanceToObject: 20 286 | --- !u!114 &2216316980980374431 287 | MonoBehaviour: 288 | m_ObjectHideFlags: 0 289 | m_CorrespondingSourceObject: {fileID: 0} 290 | m_PrefabInstance: {fileID: 0} 291 | m_PrefabAsset: {fileID: 0} 292 | m_GameObject: {fileID: 2216316980526391062} 293 | m_Enabled: 1 294 | m_EditorHideFlags: 0 295 | m_Script: {fileID: 11500000, guid: baedd976e12657241bf7ff2d1c685342, type: 3} 296 | m_Name: 297 | m_EditorClassIdentifier: 298 | m_Direction: 1 299 | m_Center: {x: 0, y: -0.2, z: 0} 300 | m_Bound: 0 301 | m_Radius: 0.1 302 | m_Height: 0.6 303 | --- !u!1001 &2216316980526356990 304 | PrefabInstance: 305 | m_ObjectHideFlags: 0 306 | serializedVersion: 2 307 | m_Modification: 308 | m_TransformParent: {fileID: 2216316980897813487} 309 | m_Modifications: 310 | - target: {fileID: 400004, guid: ba128457d0ea5e3439dbe4a53b9d1273, type: 3} 311 | propertyPath: m_LocalPosition.x 312 | value: 0 313 | objectReference: {fileID: 0} 314 | - target: {fileID: 400004, guid: ba128457d0ea5e3439dbe4a53b9d1273, type: 3} 315 | propertyPath: m_LocalPosition.y 316 | value: 0 317 | objectReference: {fileID: 0} 318 | - target: {fileID: 400004, guid: ba128457d0ea5e3439dbe4a53b9d1273, type: 3} 319 | propertyPath: m_LocalPosition.z 320 | value: 0 321 | objectReference: {fileID: 0} 322 | - target: {fileID: 400004, guid: ba128457d0ea5e3439dbe4a53b9d1273, type: 3} 323 | propertyPath: m_LocalRotation.x 324 | value: 0 325 | objectReference: {fileID: 0} 326 | - target: {fileID: 400004, guid: ba128457d0ea5e3439dbe4a53b9d1273, type: 3} 327 | propertyPath: m_LocalRotation.y 328 | value: 0 329 | objectReference: {fileID: 0} 330 | - target: {fileID: 400004, guid: ba128457d0ea5e3439dbe4a53b9d1273, type: 3} 331 | propertyPath: m_LocalRotation.z 332 | value: 0 333 | objectReference: {fileID: 0} 334 | - target: {fileID: 400004, guid: ba128457d0ea5e3439dbe4a53b9d1273, type: 3} 335 | propertyPath: m_LocalRotation.w 336 | value: 1 337 | objectReference: {fileID: 0} 338 | - target: {fileID: 11100000, guid: ba128457d0ea5e3439dbe4a53b9d1273, type: 3} 339 | propertyPath: m_Enabled 340 | value: 1 341 | objectReference: {fileID: 0} 342 | m_RemovedComponents: [] 343 | m_SourcePrefab: {fileID: 100100000, guid: ba128457d0ea5e3439dbe4a53b9d1273, type: 3} 344 | --- !u!4 &2216316980526744442 stripped 345 | Transform: 346 | m_CorrespondingSourceObject: {fileID: 400004, guid: ba128457d0ea5e3439dbe4a53b9d1273, 347 | type: 3} 348 | m_PrefabInstance: {fileID: 2216316980526356990} 349 | m_PrefabAsset: {fileID: 0} 350 | --- !u!4 &2216316980526744432 stripped 351 | Transform: 352 | m_CorrespondingSourceObject: {fileID: 400014, guid: ba128457d0ea5e3439dbe4a53b9d1273, 353 | type: 3} 354 | m_PrefabInstance: {fileID: 2216316980526356990} 355 | m_PrefabAsset: {fileID: 0} 356 | --- !u!4 &2216316980526744400 stripped 357 | Transform: 358 | m_CorrespondingSourceObject: {fileID: 400046, guid: ba128457d0ea5e3439dbe4a53b9d1273, 359 | type: 3} 360 | m_PrefabInstance: {fileID: 2216316980526356990} 361 | m_PrefabAsset: {fileID: 0} 362 | --- !u!4 &2216316980526744332 stripped 363 | Transform: 364 | m_CorrespondingSourceObject: {fileID: 400114, guid: ba128457d0ea5e3439dbe4a53b9d1273, 365 | type: 3} 366 | m_PrefabInstance: {fileID: 2216316980526356990} 367 | m_PrefabAsset: {fileID: 0} 368 | --- !u!1 &2216316980526391062 stripped 369 | GameObject: 370 | m_CorrespondingSourceObject: {fileID: 100072, guid: ba128457d0ea5e3439dbe4a53b9d1273, 371 | type: 3} 372 | m_PrefabInstance: {fileID: 2216316980526356990} 373 | m_PrefabAsset: {fileID: 0} 374 | --- !u!1 &2216316980526390994 stripped 375 | GameObject: 376 | m_CorrespondingSourceObject: {fileID: 100140, guid: ba128457d0ea5e3439dbe4a53b9d1273, 377 | type: 3} 378 | m_PrefabInstance: {fileID: 2216316980526356990} 379 | m_PrefabAsset: {fileID: 0} 380 | --- !u!1001 &2216316981729302861 381 | PrefabInstance: 382 | m_ObjectHideFlags: 0 383 | serializedVersion: 2 384 | m_Modification: 385 | m_TransformParent: {fileID: 2216316980526744432} 386 | m_Modifications: 387 | - target: {fileID: 400016, guid: 19015a5957bbaa745a61cba005220542, type: 3} 388 | propertyPath: m_LocalPosition.x 389 | value: 0 390 | objectReference: {fileID: 0} 391 | - target: {fileID: 400016, guid: 19015a5957bbaa745a61cba005220542, type: 3} 392 | propertyPath: m_LocalPosition.y 393 | value: 0 394 | objectReference: {fileID: 0} 395 | - target: {fileID: 400016, guid: 19015a5957bbaa745a61cba005220542, type: 3} 396 | propertyPath: m_LocalPosition.z 397 | value: 0 398 | objectReference: {fileID: 0} 399 | - target: {fileID: 400016, guid: 19015a5957bbaa745a61cba005220542, type: 3} 400 | propertyPath: m_LocalRotation.x 401 | value: 0.00000018966082 402 | objectReference: {fileID: 0} 403 | - target: {fileID: 400016, guid: 19015a5957bbaa745a61cba005220542, type: 3} 404 | propertyPath: m_LocalRotation.y 405 | value: 0.7071068 406 | objectReference: {fileID: 0} 407 | - target: {fileID: 400016, guid: 19015a5957bbaa745a61cba005220542, type: 3} 408 | propertyPath: m_LocalRotation.z 409 | value: -0.7071068 410 | objectReference: {fileID: 0} 411 | - target: {fileID: 400016, guid: 19015a5957bbaa745a61cba005220542, type: 3} 412 | propertyPath: m_LocalRotation.w 413 | value: 0.00000018966082 414 | objectReference: {fileID: 0} 415 | - target: {fileID: 400016, guid: 19015a5957bbaa745a61cba005220542, type: 3} 416 | propertyPath: m_LocalScale.x 417 | value: 0.8 418 | objectReference: {fileID: 0} 419 | - target: {fileID: 400016, guid: 19015a5957bbaa745a61cba005220542, type: 3} 420 | propertyPath: m_LocalScale.y 421 | value: 0.8 422 | objectReference: {fileID: 0} 423 | - target: {fileID: 400016, guid: 19015a5957bbaa745a61cba005220542, type: 3} 424 | propertyPath: m_LocalScale.z 425 | value: 0.8 426 | objectReference: {fileID: 0} 427 | - target: {fileID: 400016, guid: 19015a5957bbaa745a61cba005220542, type: 3} 428 | propertyPath: m_RootOrder 429 | value: 2 430 | objectReference: {fileID: 0} 431 | - target: {fileID: 400014, guid: 19015a5957bbaa745a61cba005220542, type: 3} 432 | propertyPath: m_LocalRotation.x 433 | value: -7.54951487e-15 434 | objectReference: {fileID: 0} 435 | - target: {fileID: 400014, guid: 19015a5957bbaa745a61cba005220542, type: 3} 436 | propertyPath: m_LocalRotation.y 437 | value: 3.07254154e-14 438 | objectReference: {fileID: 0} 439 | - target: {fileID: 400014, guid: 19015a5957bbaa745a61cba005220542, type: 3} 440 | propertyPath: m_LocalRotation.z 441 | value: 7.45057882e-09 442 | objectReference: {fileID: 0} 443 | - target: {fileID: 400014, guid: 19015a5957bbaa745a61cba005220542, type: 3} 444 | propertyPath: m_LocalPosition.x 445 | value: -.159488067 446 | objectReference: {fileID: 0} 447 | - target: {fileID: 400014, guid: 19015a5957bbaa745a61cba005220542, type: 3} 448 | propertyPath: m_LocalPosition.y 449 | value: 0 450 | objectReference: {fileID: 0} 451 | - target: {fileID: 400014, guid: 19015a5957bbaa745a61cba005220542, type: 3} 452 | propertyPath: m_LocalPosition.z 453 | value: 6.6989605e-09 454 | objectReference: {fileID: 0} 455 | - target: {fileID: 400012, guid: 19015a5957bbaa745a61cba005220542, type: 3} 456 | propertyPath: m_LocalRotation.x 457 | value: -1.29496388e-14 458 | objectReference: {fileID: 0} 459 | - target: {fileID: 400012, guid: 19015a5957bbaa745a61cba005220542, type: 3} 460 | propertyPath: m_LocalRotation.y 461 | value: 2.88675842e-14 462 | objectReference: {fileID: 0} 463 | - target: {fileID: 400012, guid: 19015a5957bbaa745a61cba005220542, type: 3} 464 | propertyPath: m_LocalRotation.z 465 | value: .176200867 466 | objectReference: {fileID: 0} 467 | - target: {fileID: 400012, guid: 19015a5957bbaa745a61cba005220542, type: 3} 468 | propertyPath: m_LocalRotation.w 469 | value: .984354258 470 | objectReference: {fileID: 0} 471 | - target: {fileID: 400012, guid: 19015a5957bbaa745a61cba005220542, type: 3} 472 | propertyPath: m_LocalPosition.x 473 | value: -.183964223 474 | objectReference: {fileID: 0} 475 | - target: {fileID: 400012, guid: 19015a5957bbaa745a61cba005220542, type: 3} 476 | propertyPath: m_LocalPosition.y 477 | value: 3.81469718e-08 478 | objectReference: {fileID: 0} 479 | - target: {fileID: 400012, guid: 19015a5957bbaa745a61cba005220542, type: 3} 480 | propertyPath: m_LocalPosition.z 481 | value: 8.04060107e-09 482 | objectReference: {fileID: 0} 483 | - target: {fileID: 400010, guid: 19015a5957bbaa745a61cba005220542, type: 3} 484 | propertyPath: m_LocalRotation.x 485 | value: -1.85772452e-14 486 | objectReference: {fileID: 0} 487 | - target: {fileID: 400010, guid: 19015a5957bbaa745a61cba005220542, type: 3} 488 | propertyPath: m_LocalRotation.y 489 | value: 2.47326353e-14 490 | objectReference: {fileID: 0} 491 | - target: {fileID: 400010, guid: 19015a5957bbaa745a61cba005220542, type: 3} 492 | propertyPath: m_LocalRotation.z 493 | value: .067116484 494 | objectReference: {fileID: 0} 495 | - target: {fileID: 400010, guid: 19015a5957bbaa745a61cba005220542, type: 3} 496 | propertyPath: m_LocalRotation.w 497 | value: .997745156 498 | objectReference: {fileID: 0} 499 | - target: {fileID: 400010, guid: 19015a5957bbaa745a61cba005220542, type: 3} 500 | propertyPath: m_LocalPosition.x 501 | value: -.269845426 502 | objectReference: {fileID: 0} 503 | - target: {fileID: 400010, guid: 19015a5957bbaa745a61cba005220542, type: 3} 504 | propertyPath: m_LocalPosition.y 505 | value: 0 506 | objectReference: {fileID: 0} 507 | - target: {fileID: 400010, guid: 19015a5957bbaa745a61cba005220542, type: 3} 508 | propertyPath: m_LocalPosition.z 509 | value: 1.20644108e-08 510 | objectReference: {fileID: 0} 511 | - target: {fileID: 400008, guid: 19015a5957bbaa745a61cba005220542, type: 3} 512 | propertyPath: m_LocalRotation.x 513 | value: -2.33242567e-14 514 | objectReference: {fileID: 0} 515 | - target: {fileID: 400008, guid: 19015a5957bbaa745a61cba005220542, type: 3} 516 | propertyPath: m_LocalRotation.y 517 | value: 2.38246363e-14 518 | objectReference: {fileID: 0} 519 | - target: {fileID: 400008, guid: 19015a5957bbaa745a61cba005220542, type: 3} 520 | propertyPath: m_LocalRotation.z 521 | value: .0788995922 522 | objectReference: {fileID: 0} 523 | - target: {fileID: 400008, guid: 19015a5957bbaa745a61cba005220542, type: 3} 524 | propertyPath: m_LocalRotation.w 525 | value: .996882558 526 | objectReference: {fileID: 0} 527 | - target: {fileID: 400008, guid: 19015a5957bbaa745a61cba005220542, type: 3} 528 | propertyPath: m_LocalPosition.x 529 | value: -.163523868 530 | objectReference: {fileID: 0} 531 | - target: {fileID: 400008, guid: 19015a5957bbaa745a61cba005220542, type: 3} 532 | propertyPath: m_LocalPosition.y 533 | value: 0 534 | objectReference: {fileID: 0} 535 | - target: {fileID: 400008, guid: 19015a5957bbaa745a61cba005220542, type: 3} 536 | propertyPath: m_LocalPosition.z 537 | value: 7.1477233e-09 538 | objectReference: {fileID: 0} 539 | - target: {fileID: 400006, guid: 19015a5957bbaa745a61cba005220542, type: 3} 540 | propertyPath: m_LocalRotation.x 541 | value: -2.77442271e-14 542 | objectReference: {fileID: 0} 543 | - target: {fileID: 400006, guid: 19015a5957bbaa745a61cba005220542, type: 3} 544 | propertyPath: m_LocalRotation.y 545 | value: 1.74333594e-14 546 | objectReference: {fileID: 0} 547 | - target: {fileID: 400006, guid: 19015a5957bbaa745a61cba005220542, type: 3} 548 | propertyPath: m_LocalRotation.z 549 | value: .142351687 550 | objectReference: {fileID: 0} 551 | - target: {fileID: 400006, guid: 19015a5957bbaa745a61cba005220542, type: 3} 552 | propertyPath: m_LocalRotation.w 553 | value: .989816129 554 | objectReference: {fileID: 0} 555 | - target: {fileID: 400006, guid: 19015a5957bbaa745a61cba005220542, type: 3} 556 | propertyPath: m_LocalPosition.x 557 | value: -.233021542 558 | objectReference: {fileID: 0} 559 | - target: {fileID: 400006, guid: 19015a5957bbaa745a61cba005220542, type: 3} 560 | propertyPath: m_LocalPosition.y 561 | value: -3.81469718e-08 562 | objectReference: {fileID: 0} 563 | - target: {fileID: 400006, guid: 19015a5957bbaa745a61cba005220542, type: 3} 564 | propertyPath: m_LocalPosition.z 565 | value: 1.01855058e-08 566 | objectReference: {fileID: 0} 567 | - target: {fileID: 400004, guid: 19015a5957bbaa745a61cba005220542, type: 3} 568 | propertyPath: m_LocalRotation.x 569 | value: -3.34032593e-14 570 | objectReference: {fileID: 0} 571 | - target: {fileID: 400004, guid: 19015a5957bbaa745a61cba005220542, type: 3} 572 | propertyPath: m_LocalRotation.y 573 | value: 1.07828522e-14 574 | objectReference: {fileID: 0} 575 | - target: {fileID: 400004, guid: 19015a5957bbaa745a61cba005220542, type: 3} 576 | propertyPath: m_LocalRotation.z 577 | value: .0872370228 578 | objectReference: {fileID: 0} 579 | - target: {fileID: 400004, guid: 19015a5957bbaa745a61cba005220542, type: 3} 580 | propertyPath: m_LocalRotation.w 581 | value: .996187627 582 | objectReference: {fileID: 0} 583 | - target: {fileID: 400004, guid: 19015a5957bbaa745a61cba005220542, type: 3} 584 | propertyPath: m_LocalPosition.x 585 | value: -.273902506 586 | objectReference: {fileID: 0} 587 | - target: {fileID: 400004, guid: 19015a5957bbaa745a61cba005220542, type: 3} 588 | propertyPath: m_LocalPosition.y 589 | value: -4.7683713e-08 590 | objectReference: {fileID: 0} 591 | - target: {fileID: 400004, guid: 19015a5957bbaa745a61cba005220542, type: 3} 592 | propertyPath: m_LocalPosition.z 593 | value: 1.19724319e-08 594 | objectReference: {fileID: 0} 595 | - target: {fileID: 400002, guid: 19015a5957bbaa745a61cba005220542, type: 3} 596 | propertyPath: m_LocalRotation.x 597 | value: -3.65551231e-14 598 | objectReference: {fileID: 0} 599 | - target: {fileID: 400002, guid: 19015a5957bbaa745a61cba005220542, type: 3} 600 | propertyPath: m_LocalRotation.y 601 | value: 4.19035161e-15 602 | objectReference: {fileID: 0} 603 | - target: {fileID: 400002, guid: 19015a5957bbaa745a61cba005220542, type: 3} 604 | propertyPath: m_LocalRotation.z 605 | value: .104671292 606 | objectReference: {fileID: 0} 607 | - target: {fileID: 400002, guid: 19015a5957bbaa745a61cba005220542, type: 3} 608 | propertyPath: m_LocalRotation.w 609 | value: .994506896 610 | objectReference: {fileID: 0} 611 | - target: {fileID: 400002, guid: 19015a5957bbaa745a61cba005220542, type: 3} 612 | propertyPath: m_LocalPosition.x 613 | value: -.237109601 614 | objectReference: {fileID: 0} 615 | - target: {fileID: 400002, guid: 19015a5957bbaa745a61cba005220542, type: 3} 616 | propertyPath: m_LocalPosition.y 617 | value: -3.86498868e-08 618 | objectReference: {fileID: 0} 619 | - target: {fileID: 400002, guid: 19015a5957bbaa745a61cba005220542, type: 3} 620 | propertyPath: m_LocalPosition.z 621 | value: 1.03641966e-08 622 | objectReference: {fileID: 0} 623 | - target: {fileID: 400000, guid: 19015a5957bbaa745a61cba005220542, type: 3} 624 | propertyPath: m_LocalRotation.x 625 | value: 2.33569484e-08 626 | objectReference: {fileID: 0} 627 | - target: {fileID: 400000, guid: 19015a5957bbaa745a61cba005220542, type: 3} 628 | propertyPath: m_LocalRotation.y 629 | value: -2.33569484e-08 630 | objectReference: {fileID: 0} 631 | - target: {fileID: 400000, guid: 19015a5957bbaa745a61cba005220542, type: 3} 632 | propertyPath: m_LocalRotation.z 633 | value: -.707106829 634 | objectReference: {fileID: 0} 635 | - target: {fileID: 400000, guid: 19015a5957bbaa745a61cba005220542, type: 3} 636 | propertyPath: m_LocalRotation.w 637 | value: .707106829 638 | objectReference: {fileID: 0} 639 | - target: {fileID: 400000, guid: 19015a5957bbaa745a61cba005220542, type: 3} 640 | propertyPath: m_LocalPosition.x 641 | value: .000276203005 642 | objectReference: {fileID: 0} 643 | - target: {fileID: 400000, guid: 19015a5957bbaa745a61cba005220542, type: 3} 644 | propertyPath: m_LocalPosition.y 645 | value: -.00660187891 646 | objectReference: {fileID: 0} 647 | - target: {fileID: 400000, guid: 19015a5957bbaa745a61cba005220542, type: 3} 648 | propertyPath: m_LocalPosition.z 649 | value: -2.88577301e-10 650 | objectReference: {fileID: 0} 651 | m_RemovedComponents: [] 652 | m_SourcePrefab: {fileID: 100100000, guid: 19015a5957bbaa745a61cba005220542, type: 3} 653 | --- !u!4 &2216316981729166297 stripped 654 | Transform: 655 | m_CorrespondingSourceObject: {fileID: 400020, guid: 19015a5957bbaa745a61cba005220542, 656 | type: 3} 657 | m_PrefabInstance: {fileID: 2216316981729302861} 658 | m_PrefabAsset: {fileID: 0} 659 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Demo/Player.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 171bb7ed26205a64a96c070befe0763e 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Demo/c1.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dreamfairy/Unity-DynamicBone-JobSystem-Opmized/faf11dfb38a765924256d4ceb02f028132b94e1e/Assets/DynamicBone/Demo/c1.fbx -------------------------------------------------------------------------------- /Assets/DynamicBone/Demo/c1.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba128457d0ea5e3439dbe4a53b9d1273 3 | ModelImporter: 4 | serializedVersion: 16 5 | fileIDToRecycleName: 6 | 100000: abdomen 7 | 100002: abdomen2 8 | 100004: //RootNode 9 | 100006: chest 10 | 100008: Genesis2Female 11 | 100010: Genesis2Female.Shape 12 | 100012: head 13 | 100014: hip 14 | 100016: lBigToe 15 | 100018: lCarpal1 16 | 100020: lCarpal2 17 | 100022: lCollar 18 | 100024: lEye 19 | 100026: lFoot 20 | 100028: lForeArm 21 | 100030: lHand 22 | 100032: lIndex1 23 | 100034: lIndex2 24 | 100036: lIndex3 25 | 100038: lMid1 26 | 100040: lMid2 27 | 100042: lMid3 28 | 100044: lowerJaw 29 | 100046: lPectoral 30 | 100048: lPinky1 31 | 100050: lPinky2 32 | 100052: lPinky3 33 | 100054: lRing1 34 | 100056: lRing2 35 | 100058: lRing3 36 | 100060: lShin 37 | 100062: lShldr 38 | 100064: lSmallToe1 39 | 100066: lSmallToe2 40 | 100068: lSmallToe3 41 | 100070: lSmallToe4 42 | 100072: lThigh 43 | 100074: lThumb1 44 | 100076: lThumb2 45 | 100078: lThumb3 46 | 100080: lToe 47 | 100082: neck 48 | 100084: pelvis 49 | 100086: rBigToe 50 | 100088: rCarpal1 51 | 100090: rCarpal2 52 | 100092: rCollar 53 | 100094: rEye 54 | 100096: rFoot 55 | 100098: rForeArm 56 | 100100: rHand 57 | 100102: rIndex1 58 | 100104: rIndex2 59 | 100106: rIndex3 60 | 100108: rMid1 61 | 100110: rMid2 62 | 100112: rMid3 63 | 100114: rPectoral 64 | 100116: rPinky1 65 | 100118: rPinky2 66 | 100120: rPinky3 67 | 100122: rRing1 68 | 100124: rRing2 69 | 100126: rRing3 70 | 100128: rShin 71 | 100130: rShldr 72 | 100132: rSmallToe1 73 | 100134: rSmallToe2 74 | 100136: rSmallToe3 75 | 100138: rSmallToe4 76 | 100140: rThigh 77 | 100142: rThumb1 78 | 100144: rThumb2 79 | 100146: rThumb3 80 | 100148: rToe 81 | 100150: tongue01 82 | 100152: tongue02 83 | 100154: tongue03 84 | 100156: tongue04 85 | 100158: tongue05 86 | 100160: tongueBase 87 | 100162: tongueTip 88 | 100164: upperJaw 89 | 400000: abdomen 90 | 400002: abdomen2 91 | 400004: //RootNode 92 | 400006: chest 93 | 400008: Genesis2Female 94 | 400010: Genesis2Female.Shape 95 | 400012: head 96 | 400014: hip 97 | 400016: lBigToe 98 | 400018: lCarpal1 99 | 400020: lCarpal2 100 | 400022: lCollar 101 | 400024: lEye 102 | 400026: lFoot 103 | 400028: lForeArm 104 | 400030: lHand 105 | 400032: lIndex1 106 | 400034: lIndex2 107 | 400036: lIndex3 108 | 400038: lMid1 109 | 400040: lMid2 110 | 400042: lMid3 111 | 400044: lowerJaw 112 | 400046: lPectoral 113 | 400048: lPinky1 114 | 400050: lPinky2 115 | 400052: lPinky3 116 | 400054: lRing1 117 | 400056: lRing2 118 | 400058: lRing3 119 | 400060: lShin 120 | 400062: lShldr 121 | 400064: lSmallToe1 122 | 400066: lSmallToe2 123 | 400068: lSmallToe3 124 | 400070: lSmallToe4 125 | 400072: lThigh 126 | 400074: lThumb1 127 | 400076: lThumb2 128 | 400078: lThumb3 129 | 400080: lToe 130 | 400082: neck 131 | 400084: pelvis 132 | 400086: rBigToe 133 | 400088: rCarpal1 134 | 400090: rCarpal2 135 | 400092: rCollar 136 | 400094: rEye 137 | 400096: rFoot 138 | 400098: rForeArm 139 | 400100: rHand 140 | 400102: rIndex1 141 | 400104: rIndex2 142 | 400106: rIndex3 143 | 400108: rMid1 144 | 400110: rMid2 145 | 400112: rMid3 146 | 400114: rPectoral 147 | 400116: rPinky1 148 | 400118: rPinky2 149 | 400120: rPinky3 150 | 400122: rRing1 151 | 400124: rRing2 152 | 400126: rRing3 153 | 400128: rShin 154 | 400130: rShldr 155 | 400132: rSmallToe1 156 | 400134: rSmallToe2 157 | 400136: rSmallToe3 158 | 400138: rSmallToe4 159 | 400140: rThigh 160 | 400142: rThumb1 161 | 400144: rThumb2 162 | 400146: rThumb3 163 | 400148: rToe 164 | 400150: tongue01 165 | 400152: tongue02 166 | 400154: tongue03 167 | 400156: tongue04 168 | 400158: tongue05 169 | 400160: tongueBase 170 | 400162: tongueTip 171 | 400164: upperJaw 172 | 4300000: Genesis2Female.Shape 173 | 7400000: Animation 174 | 9500000: //RootNode 175 | 11100000: //RootNode 176 | 13700000: Genesis2Female.Shape 177 | materials: 178 | importMaterials: 0 179 | materialName: 0 180 | materialSearch: 1 181 | animations: 182 | legacyGenerateAnimations: 4 183 | bakeSimulation: 0 184 | optimizeGameObjects: 0 185 | animationCompression: 2 186 | animationRotationError: .5 187 | animationPositionError: .5 188 | animationScaleError: .5 189 | animationWrapMode: 0 190 | extraExposedTransformPaths: [] 191 | clipAnimations: 192 | - serializedVersion: 16 193 | name: Animation 194 | takeName: Animation 195 | firstFrame: 0 196 | lastFrame: 206 197 | wrapMode: 2 198 | orientationOffsetY: 0 199 | level: 0 200 | cycleOffset: 0 201 | loop: 0 202 | loopTime: 0 203 | loopBlend: 0 204 | loopBlendOrientation: 0 205 | loopBlendPositionY: 0 206 | loopBlendPositionXZ: 0 207 | keepOriginalOrientation: 0 208 | keepOriginalPositionY: 1 209 | keepOriginalPositionXZ: 0 210 | heightFromFeet: 0 211 | mirror: 0 212 | bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 213 | curves: [] 214 | events: [] 215 | transformMask: 216 | - path: 217 | weight: 1 218 | - path: Genesis2Female 219 | weight: 1 220 | - path: Genesis2Female/Genesis2Female.Shape 221 | weight: 1 222 | - path: Genesis2Female/hip 223 | weight: 1 224 | - path: Genesis2Female/hip/abdomen 225 | weight: 1 226 | - path: Genesis2Female/hip/abdomen/abdomen2 227 | weight: 1 228 | - path: Genesis2Female/hip/abdomen/abdomen2/chest 229 | weight: 1 230 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar 231 | weight: 1 232 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr 233 | weight: 1 234 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm 235 | weight: 1 236 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand 237 | weight: 1 238 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal1 239 | weight: 1 240 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal1/lIndex1 241 | weight: 1 242 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal1/lIndex1/lIndex2 243 | weight: 1 244 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal1/lIndex1/lIndex2/lIndex3 245 | weight: 1 246 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal1/lMid1 247 | weight: 1 248 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal1/lMid1/lMid2 249 | weight: 1 250 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal1/lMid1/lMid2/lMid3 251 | weight: 1 252 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal2 253 | weight: 1 254 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal2/lPinky1 255 | weight: 1 256 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal2/lPinky1/lPinky2 257 | weight: 1 258 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal2/lPinky1/lPinky2/lPinky3 259 | weight: 1 260 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal2/lRing1 261 | weight: 1 262 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal2/lRing1/lRing2 263 | weight: 1 264 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lCarpal2/lRing1/lRing2/lRing3 265 | weight: 1 266 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lThumb1 267 | weight: 1 268 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lThumb1/lThumb2 269 | weight: 1 270 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lCollar/lShldr/lForeArm/lHand/lThumb1/lThumb2/lThumb3 271 | weight: 1 272 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/lPectoral 273 | weight: 1 274 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck 275 | weight: 1 276 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck/head 277 | weight: 1 278 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck/head/lEye 279 | weight: 1 280 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck/head/lowerJaw 281 | weight: 1 282 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck/head/lowerJaw/tongueBase 283 | weight: 1 284 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck/head/lowerJaw/tongueBase/tongue01 285 | weight: 1 286 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck/head/lowerJaw/tongueBase/tongue01/tongue02 287 | weight: 1 288 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck/head/lowerJaw/tongueBase/tongue01/tongue02/tongue03 289 | weight: 1 290 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck/head/lowerJaw/tongueBase/tongue01/tongue02/tongue03/tongue04 291 | weight: 1 292 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck/head/lowerJaw/tongueBase/tongue01/tongue02/tongue03/tongue04/tongue05 293 | weight: 1 294 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck/head/lowerJaw/tongueBase/tongue01/tongue02/tongue03/tongue04/tongue05/tongueTip 295 | weight: 1 296 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck/head/rEye 297 | weight: 1 298 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/neck/head/upperJaw 299 | weight: 1 300 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar 301 | weight: 1 302 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr 303 | weight: 1 304 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm 305 | weight: 1 306 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand 307 | weight: 1 308 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal1 309 | weight: 1 310 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal1/rIndex1 311 | weight: 1 312 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal1/rIndex1/rIndex2 313 | weight: 1 314 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal1/rIndex1/rIndex2/rIndex3 315 | weight: 1 316 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal1/rMid1 317 | weight: 1 318 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal1/rMid1/rMid2 319 | weight: 1 320 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal1/rMid1/rMid2/rMid3 321 | weight: 1 322 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal2 323 | weight: 1 324 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal2/rPinky1 325 | weight: 1 326 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal2/rPinky1/rPinky2 327 | weight: 1 328 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal2/rPinky1/rPinky2/rPinky3 329 | weight: 1 330 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal2/rRing1 331 | weight: 1 332 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal2/rRing1/rRing2 333 | weight: 1 334 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rCarpal2/rRing1/rRing2/rRing3 335 | weight: 1 336 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rThumb1 337 | weight: 1 338 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rThumb1/rThumb2 339 | weight: 1 340 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rCollar/rShldr/rForeArm/rHand/rThumb1/rThumb2/rThumb3 341 | weight: 1 342 | - path: Genesis2Female/hip/abdomen/abdomen2/chest/rPectoral 343 | weight: 1 344 | - path: Genesis2Female/hip/pelvis 345 | weight: 1 346 | - path: Genesis2Female/hip/pelvis/lThigh 347 | weight: 1 348 | - path: Genesis2Female/hip/pelvis/lThigh/lShin 349 | weight: 1 350 | - path: Genesis2Female/hip/pelvis/lThigh/lShin/lFoot 351 | weight: 1 352 | - path: Genesis2Female/hip/pelvis/lThigh/lShin/lFoot/lToe 353 | weight: 1 354 | - path: Genesis2Female/hip/pelvis/lThigh/lShin/lFoot/lToe/lBigToe 355 | weight: 1 356 | - path: Genesis2Female/hip/pelvis/lThigh/lShin/lFoot/lToe/lSmallToe1 357 | weight: 1 358 | - path: Genesis2Female/hip/pelvis/lThigh/lShin/lFoot/lToe/lSmallToe2 359 | weight: 1 360 | - path: Genesis2Female/hip/pelvis/lThigh/lShin/lFoot/lToe/lSmallToe3 361 | weight: 1 362 | - path: Genesis2Female/hip/pelvis/lThigh/lShin/lFoot/lToe/lSmallToe4 363 | weight: 1 364 | - path: Genesis2Female/hip/pelvis/rThigh 365 | weight: 1 366 | - path: Genesis2Female/hip/pelvis/rThigh/rShin 367 | weight: 1 368 | - path: Genesis2Female/hip/pelvis/rThigh/rShin/rFoot 369 | weight: 1 370 | - path: Genesis2Female/hip/pelvis/rThigh/rShin/rFoot/rToe 371 | weight: 1 372 | - path: Genesis2Female/hip/pelvis/rThigh/rShin/rFoot/rToe/rBigToe 373 | weight: 1 374 | - path: Genesis2Female/hip/pelvis/rThigh/rShin/rFoot/rToe/rSmallToe1 375 | weight: 1 376 | - path: Genesis2Female/hip/pelvis/rThigh/rShin/rFoot/rToe/rSmallToe2 377 | weight: 1 378 | - path: Genesis2Female/hip/pelvis/rThigh/rShin/rFoot/rToe/rSmallToe3 379 | weight: 1 380 | - path: Genesis2Female/hip/pelvis/rThigh/rShin/rFoot/rToe/rSmallToe4 381 | weight: 1 382 | maskType: 0 383 | maskSource: {instanceID: 0} 384 | isReadable: 0 385 | meshes: 386 | lODScreenPercentages: [] 387 | globalScale: .00999999978 388 | meshCompression: 0 389 | addColliders: 0 390 | importBlendShapes: 0 391 | swapUVChannels: 0 392 | generateSecondaryUV: 0 393 | useFileUnits: 1 394 | optimizeMeshForGPU: 1 395 | weldVertices: 1 396 | secondaryUVAngleDistortion: 8 397 | secondaryUVAreaDistortion: 15.000001 398 | secondaryUVHardAngle: 88 399 | secondaryUVPackMargin: 4 400 | tangentSpace: 401 | normalSmoothAngle: 60 402 | splitTangentsAcrossUV: 1 403 | normalImportMode: 0 404 | tangentImportMode: 2 405 | importAnimation: 1 406 | copyAvatar: 0 407 | humanDescription: 408 | human: [] 409 | skeleton: [] 410 | armTwist: .5 411 | foreArmTwist: .5 412 | upperLegTwist: .5 413 | legTwist: .5 414 | armStretch: .0500000007 415 | legStretch: .0500000007 416 | feetSpacing: 0 417 | rootMotionBoneName: 418 | lastHumanDescriptionAvatarSource: {instanceID: 0} 419 | animationType: 1 420 | additionalBone: 0 421 | userData: 422 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Demo/tail.FBX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dreamfairy/Unity-DynamicBone-JobSystem-Opmized/faf11dfb38a765924256d4ceb02f028132b94e1e/Assets/DynamicBone/Demo/tail.FBX -------------------------------------------------------------------------------- /Assets/DynamicBone/Demo/tail.FBX.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19015a5957bbaa745a61cba005220542 3 | ModelImporter: 4 | serializedVersion: 16 5 | fileIDToRecycleName: 6 | 100000: Bone01 7 | 100002: Bone02 8 | 100004: Bone03 9 | 100006: Bone04 10 | 100008: Bone05 11 | 100010: Bone06 12 | 100012: Bone07 13 | 100014: Bone08 14 | 100016: //RootNode 15 | 100018: tail 16 | 100020: tail1 17 | 100022: tail2 18 | 100024: tail3 19 | 100026: tail4 20 | 100028: tail5 21 | 100030: tail6 22 | 100032: tail7 23 | 100034: tail8 24 | 400000: Bone01 25 | 400002: Bone02 26 | 400004: Bone03 27 | 400006: Bone04 28 | 400008: Bone05 29 | 400010: Bone06 30 | 400012: Bone07 31 | 400014: Bone08 32 | 400016: //RootNode 33 | 400018: tail 34 | 400020: tail1 35 | 400022: tail2 36 | 400024: tail3 37 | 400026: tail4 38 | 400028: tail5 39 | 400030: tail6 40 | 400032: tail7 41 | 400034: tail8 42 | 4300000: tail 43 | 9500000: //RootNode 44 | 11100000: //RootNode 45 | 13700000: tail 46 | materials: 47 | importMaterials: 0 48 | materialName: 0 49 | materialSearch: 1 50 | animations: 51 | legacyGenerateAnimations: 4 52 | bakeSimulation: 0 53 | optimizeGameObjects: 0 54 | animationCompression: 1 55 | animationRotationError: .5 56 | animationPositionError: .5 57 | animationScaleError: .5 58 | animationWrapMode: 0 59 | extraExposedTransformPaths: [] 60 | clipAnimations: [] 61 | isReadable: 0 62 | meshes: 63 | lODScreenPercentages: [] 64 | globalScale: .00999999978 65 | meshCompression: 0 66 | addColliders: 0 67 | importBlendShapes: 0 68 | swapUVChannels: 0 69 | generateSecondaryUV: 0 70 | useFileUnits: 1 71 | optimizeMeshForGPU: 1 72 | weldVertices: 1 73 | secondaryUVAngleDistortion: 8 74 | secondaryUVAreaDistortion: 15.000001 75 | secondaryUVHardAngle: 88 76 | secondaryUVPackMargin: 4 77 | tangentSpace: 78 | normalSmoothAngle: 60 79 | splitTangentsAcrossUV: 1 80 | normalImportMode: 0 81 | tangentImportMode: 2 82 | importAnimation: 0 83 | copyAvatar: 0 84 | humanDescription: 85 | human: [] 86 | skeleton: [] 87 | armTwist: .5 88 | foreArmTwist: .5 89 | upperLegTwist: .5 90 | legTwist: .5 91 | armStretch: .0500000007 92 | legStretch: .0500000007 93 | feetSpacing: 0 94 | rootMotionBoneName: 95 | lastHumanDescriptionAvatarSource: {instanceID: 0} 96 | animationType: 1 97 | additionalBone: 0 98 | userData: 99 | -------------------------------------------------------------------------------- /Assets/DynamicBone/ReadMe.txt: -------------------------------------------------------------------------------- 1 | Dynamic Bone apply physics to character's bones or joints. 2 | With simple setup, your character's hair, cloth, breasts or any part will move realistically. 3 | 4 | Open Assets/DynamicBone/Demo/Demo1 to see how it works. 5 | If you have any questions or suggestions, please contact willhongcom@gmail.com. 6 | 7 | 8 | ------------------------------------------------------------------------- 9 | Basic setup: 10 | 11 | 1. Prepare a properly setup character, both Mecanim and legacy rigs are supported. 12 | 2. Select the game object you want to apply Dynamic Bone. 13 | 3. In the component menu, select Dynamic Bone -> Dynamic Bone. 14 | 4. In the inspector, select root object. 15 | 5. Adjust dynamic bone parameters (see detail descriptions in the following section). 16 | 17 | 18 | You can add collider objects if required: 19 | 20 | 1. Select game object the collider will attached. 21 | 2. In the component menu, select Dynamic Bone -> Dynamic Bone Collider. 22 | 3. Adjust position and size of the collider. 23 | 4. In Dynamic Bone component, increase size of colliders and append corresponding object. 24 | 25 | 26 | ------------------------------------------------------------------------- 27 | Dynamic Bone component description: 28 | 29 | - Root 30 | The root of the transform hierarchy to apply physics. 31 | 32 | - Update Rate 33 | Internal physics simulation rate, measures in frames per seconds. 34 | 35 | - UpdateMode 36 | Normal: Normal update. 37 | AnimatePhysics: Updates during the physic loop in order to synchronized with the physics engine. 38 | UnscaledTime: Updates independently of Time.timeScale. 39 | 40 | - Damping 41 | How much the bones slowed down. 42 | 43 | - Elasticity 44 | How much the force applied to return each bone to original orientation. 45 | 46 | - Stiffness 47 | How much bone's original orientation are preserved. 48 | 49 | - Inert 50 | How much character's position change is ignored in physics simulation. 51 | 52 | - Friction 53 | How much the bones slowed down when collide. 54 | 55 | - Radius 56 | Each bone can be a sphere to collide with colliders. Radius describe sphere's size. 57 | 58 | - Damping Distrib, Elasticity Distrib, Stiffness Distrib, Inert Distrib, Radius Distrib 59 | How parameters change over hierarchy chain. Curve values are multiplied to corresponding parameters. 60 | 61 | - End Length 62 | If End Length is not zero, an extra bone is generated at the end of transform hierarchy, 63 | length is multiplied by last two bone's distance. 64 | 65 | - End Offset 66 | If End Offset is not zero, an extra bone is generated at the end of transform hierarchy, 67 | offset is in character's local space. 68 | 69 | - Gravity 70 | The force apply to bones, in world space. Partial force apply to character's initial pose is cancelled out. 71 | 72 | - Force 73 | The force apply to bones, in world space. 74 | 75 | - Colliders 76 | Collider objects interact with the bones. 77 | 78 | - Exclusions 79 | Bones exclude from physics simulation. 80 | 81 | - Freeze Axis 82 | Constrain bones to move on specified plane. 83 | 84 | - Distant Disable, Reference Object, Distance To Object 85 | Disable physics simulation automatically if character is far from camera or player. 86 | If there is no reference object, default main camera is used. 87 | 88 | 89 | Dynamic Bone Collider component description: 90 | 91 | - Center 92 | The center of the sphere or capsule, in the object's local space. 93 | 94 | - Radius 95 | The radius of the sphere or capsule, will be scaled by the transform's scale. 96 | 97 | - Height 98 | The height of the capsule, including two half-spheres, will be scaled by the transform's scale. 99 | 100 | - Direction 101 | The axis of the capsule's height. 102 | 103 | - Bound 104 | Constrain bones to outside bound or inside bound. 105 | 106 | ------------------------------------------------------------------------- 107 | Dynamic Bone script reference: 108 | 109 | - public void SetWeight(float w); 110 | Control how physics blend with existing animation. 111 | 112 | - public void UpdateParameters(); 113 | Update parameters at runtime, call this funtion after modifing parameters. 114 | 115 | ------------------------------------------------------------------------- 116 | Version History 117 | 118 | 1.0.1 Initial release. 119 | 1.0.2 Improve inspector UI. 120 | 1.0.3 Fix inert unstable when enabled / disabled. 121 | 1.1.0 Use curve to setup parameters over hierarchy chain. 122 | Collider can configured to constrain bones inside bound. 123 | 1.1.1 Add exclusion setting. 124 | 1.1.2 Deal with negative scale problem. 125 | 1.1.3 Fix bug with bones contain scale. 126 | 1.1.4 Add freeze axis. 127 | Fix bug when added via script. 128 | 1.1.5 Add distant disable. 129 | Reduce GC alloc. 130 | 1.1.6 Fix capsule collider bug. 131 | 1.1.7 Unity 5 support. 132 | 1.1.8 Fix problems caused by negative scale. 133 | 1.1.9 Improve detecting negative scale. 134 | Fix bug if collider is set as inside. 135 | Add UpdateMode setting. 136 | 1.1.10 Fix problems caused by negative scale after Unity 5.4. 137 | 1.2.0 Add tool tips. 138 | Add plane collider. 139 | Add function to update parameters at runtime. 140 | 1.2.1 Add friction parameter. 141 | Update UNITY_5 to compatible with newer version. 142 | -------------------------------------------------------------------------------- /Assets/DynamicBone/ReadMe.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdbe6feeda2a62b45ad9a4e311031478 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 993edbffbda2d3e4abd24f1bf074c5f2 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Scripts/DynamicBone.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | [AddComponentMenu("Dynamic Bone/Dynamic Bone")] 5 | public class DynamicBone : MonoBehaviour 6 | { 7 | #if UNITY_5_3_OR_NEWER 8 | [Tooltip("The root of the transform hierarchy to apply physics.")] 9 | #endif 10 | public Transform m_Root = null; 11 | 12 | #if UNITY_5_3_OR_NEWER 13 | [Tooltip("Internal physics simulation rate.")] 14 | #endif 15 | public float m_UpdateRate = 60.0f; 16 | 17 | public enum UpdateMode 18 | { 19 | Normal, 20 | AnimatePhysics, 21 | UnscaledTime 22 | } 23 | public UpdateMode m_UpdateMode = UpdateMode.Normal; 24 | 25 | #if UNITY_5_3_OR_NEWER 26 | [Tooltip("How much the bones slowed down.")] 27 | #endif 28 | [Range(0, 1)] 29 | public float m_Damping = 0.1f; 30 | public AnimationCurve m_DampingDistrib = null; 31 | 32 | #if UNITY_5_3_OR_NEWER 33 | [Tooltip("How much the force applied to return each bone to original orientation.")] 34 | #endif 35 | [Range(0, 1)] 36 | public float m_Elasticity = 0.1f; 37 | public AnimationCurve m_ElasticityDistrib = null; 38 | 39 | #if UNITY_5_3_OR_NEWER 40 | [Tooltip("How much bone's original orientation are preserved.")] 41 | #endif 42 | [Range(0, 1)] 43 | public float m_Stiffness = 0.1f; 44 | public AnimationCurve m_StiffnessDistrib = null; 45 | 46 | #if UNITY_5_3_OR_NEWER 47 | [Tooltip("How much character's position change is ignored in physics simulation.")] 48 | #endif 49 | [Range(0, 1)] 50 | public float m_Inert = 0; 51 | public AnimationCurve m_InertDistrib = null; 52 | 53 | #if UNITY_5_3_OR_NEWER 54 | [Tooltip("How much the bones slowed down when collide.")] 55 | #endif 56 | public float m_Friction = 0; 57 | public AnimationCurve m_FrictionDistrib = null; 58 | 59 | #if UNITY_5_3_OR_NEWER 60 | [Tooltip("Each bone can be a sphere to collide with colliders. Radius describe sphere's size.")] 61 | #endif 62 | public float m_Radius = 0; 63 | public AnimationCurve m_RadiusDistrib = null; 64 | 65 | #if UNITY_5_3_OR_NEWER 66 | [Tooltip("If End Length is not zero, an extra bone is generated at the end of transform hierarchy.")] 67 | #endif 68 | public float m_EndLength = 0; 69 | 70 | #if UNITY_5_3_OR_NEWER 71 | [Tooltip("If End Offset is not zero, an extra bone is generated at the end of transform hierarchy.")] 72 | #endif 73 | public Vector3 m_EndOffset = Vector3.zero; 74 | 75 | #if UNITY_5_3_OR_NEWER 76 | [Tooltip("The force apply to bones. Partial force apply to character's initial pose is cancelled out.")] 77 | #endif 78 | public Vector3 m_Gravity = Vector3.zero; 79 | 80 | #if UNITY_5_3_OR_NEWER 81 | [Tooltip("The force apply to bones.")] 82 | #endif 83 | public Vector3 m_Force = Vector3.zero; 84 | 85 | #if UNITY_5_3_OR_NEWER 86 | [Tooltip("Collider objects interact with the bones.")] 87 | #endif 88 | public List m_Colliders = null; 89 | 90 | #if UNITY_5_3_OR_NEWER 91 | [Tooltip("Bones exclude from physics simulation.")] 92 | #endif 93 | public List m_Exclusions = null; 94 | 95 | 96 | public enum FreezeAxis 97 | { 98 | None, X, Y, Z 99 | } 100 | #if UNITY_5_3_OR_NEWER 101 | [Tooltip("Constrain bones to move on specified plane.")] 102 | #endif 103 | public FreezeAxis m_FreezeAxis = FreezeAxis.None; 104 | 105 | #if UNITY_5_3_OR_NEWER 106 | [Tooltip("Disable physics simulation automatically if character is far from camera or player.")] 107 | #endif 108 | public bool m_DistantDisable = false; 109 | public Transform m_ReferenceObject = null; 110 | public float m_DistanceToObject = 20; 111 | 112 | public Vector3 m_LocalGravity = Vector3.zero; 113 | public Vector3 m_ObjectMove = Vector3.zero; 114 | public Vector3 m_ObjectPrevPosition = Vector3.zero; 115 | public float m_BoneTotalLength = 0; 116 | public float m_ObjectScale = 1.0f; 117 | public float m_Time = 0; 118 | public float m_Weight = 1.0f; 119 | public bool m_DistantDisabled = false; 120 | 121 | class Particle 122 | { 123 | public Transform m_Transform = null; 124 | public int m_ParentIndex = -1; 125 | public float m_Damping = 0; 126 | public float m_Elasticity = 0; 127 | public float m_Stiffness = 0; 128 | public float m_Inert = 0; 129 | public float m_Friction = 0; 130 | public float m_Radius = 0; 131 | public float m_BoneLength = 0; 132 | public bool m_isCollide = false; 133 | 134 | public Vector3 m_Position = Vector3.zero; 135 | public Vector3 m_PrevPosition = Vector3.zero; 136 | public Vector3 m_EndOffset = Vector3.zero; 137 | public Vector3 m_InitLocalPosition = Vector3.zero; 138 | public Quaternion m_InitLocalRotation = Quaternion.identity; 139 | } 140 | 141 | List m_Particles = new List(); 142 | 143 | void Start() 144 | { 145 | SetupParticles(); 146 | } 147 | 148 | void FixedUpdate() 149 | { 150 | if (m_UpdateMode == UpdateMode.AnimatePhysics) 151 | PreUpdate(); 152 | } 153 | 154 | void Update() 155 | { 156 | if (m_UpdateMode != UpdateMode.AnimatePhysics) 157 | PreUpdate(); 158 | } 159 | 160 | public void DebugUpdate() 161 | { 162 | PreUpdate(); 163 | } 164 | 165 | public void DebugLateUpdate() 166 | { 167 | float dt = Time.deltaTime; 168 | UpdateDynamicBones(dt); 169 | } 170 | 171 | void LateUpdate() 172 | { 173 | //if (m_DistantDisable) 174 | // CheckDistance(); 175 | 176 | if (m_Weight > 0 && !(m_DistantDisable && m_DistantDisabled)) 177 | { 178 | #if UNITY_5_3_OR_NEWER 179 | float dt = m_UpdateMode == UpdateMode.UnscaledTime ? Time.unscaledDeltaTime : Time.deltaTime; 180 | #else 181 | float dt = Time.deltaTime; 182 | #endif 183 | UpdateDynamicBones(dt); 184 | } 185 | } 186 | 187 | void PreUpdate() 188 | { 189 | if (m_Weight > 0 && !(m_DistantDisable && m_DistantDisabled)) 190 | InitTransforms(); 191 | } 192 | 193 | void CheckDistance() 194 | { 195 | Transform rt = m_ReferenceObject; 196 | if (rt == null && Camera.main != null) 197 | rt = Camera.main.transform; 198 | if (rt != null) 199 | { 200 | float d = (rt.position - transform.position).sqrMagnitude; 201 | bool disable = d > m_DistanceToObject * m_DistanceToObject; 202 | if (disable != m_DistantDisabled) 203 | { 204 | if (!disable) 205 | ResetParticlesPosition(); 206 | m_DistantDisabled = disable; 207 | } 208 | } 209 | } 210 | 211 | void OnEnable() 212 | { 213 | ResetParticlesPosition(); 214 | } 215 | 216 | void OnDisable() 217 | { 218 | InitTransforms(); 219 | } 220 | 221 | void OnValidate() 222 | { 223 | m_UpdateRate = Mathf.Max(m_UpdateRate, 0); 224 | m_Damping = Mathf.Clamp01(m_Damping); 225 | m_Elasticity = Mathf.Clamp01(m_Elasticity); 226 | m_Stiffness = Mathf.Clamp01(m_Stiffness); 227 | m_Inert = Mathf.Clamp01(m_Inert); 228 | m_Friction = Mathf.Clamp01(m_Friction); 229 | m_Radius = Mathf.Max(m_Radius, 0); 230 | 231 | if (Application.isEditor && Application.isPlaying) 232 | { 233 | InitTransforms(); 234 | SetupParticles(); 235 | } 236 | } 237 | 238 | void OnDrawGizmosSelected() 239 | { 240 | if (!enabled || m_Root == null) 241 | return; 242 | 243 | if (Application.isEditor && !Application.isPlaying && transform.hasChanged) 244 | { 245 | InitTransforms(); 246 | SetupParticles(); 247 | } 248 | 249 | Gizmos.color = Color.white; 250 | for (int i = 0; i < m_Particles.Count; ++i) 251 | { 252 | Particle p = m_Particles[i]; 253 | if (p.m_ParentIndex >= 0) 254 | { 255 | Particle p0 = m_Particles[p.m_ParentIndex]; 256 | Gizmos.DrawLine(p.m_Position, p0.m_Position); 257 | } 258 | if (p.m_Radius > 0) 259 | Gizmos.DrawWireSphere(p.m_Position, p.m_Radius * m_ObjectScale); 260 | } 261 | } 262 | 263 | public void SetWeight(float w) 264 | { 265 | if (m_Weight != w) 266 | { 267 | if (w == 0) 268 | InitTransforms(); 269 | else if (m_Weight == 0) 270 | ResetParticlesPosition(); 271 | m_Weight = w; 272 | } 273 | } 274 | 275 | public float GetWeight() 276 | { 277 | return m_Weight; 278 | } 279 | 280 | void UpdateDynamicBones(float t) 281 | { 282 | if (m_Root == null) 283 | return; 284 | 285 | m_ObjectScale = Mathf.Abs(transform.lossyScale.x); 286 | m_ObjectMove = transform.position - m_ObjectPrevPosition; 287 | m_ObjectPrevPosition = transform.position; 288 | 289 | Vector3 force = m_Gravity; 290 | Vector3 fdir = m_Gravity.normalized; 291 | Vector3 rf = m_Root.TransformDirection(m_LocalGravity); 292 | Vector3 pf = fdir * Mathf.Max(Vector3.Dot(rf, fdir), 0); // project current gravity to rest gravity 293 | force -= pf; // remove projected gravity 294 | force = (force + m_Force) * m_ObjectScale; 295 | 296 | int loop = 1; 297 | if (m_UpdateRate > 0) 298 | { 299 | float dt = 1.0f / m_UpdateRate; 300 | m_Time += t; 301 | loop = 0; 302 | 303 | while (m_Time >= dt) 304 | { 305 | m_Time -= dt; 306 | if (++loop >= 3) 307 | { 308 | m_Time = 0; 309 | break; 310 | } 311 | } 312 | } 313 | 314 | if (loop > 0) 315 | { 316 | for (int i = 0; i < loop; ++i) 317 | { 318 | UpdateParticles1(force); 319 | UpdateParticles2(); 320 | m_ObjectMove = Vector3.zero; 321 | } 322 | } 323 | else 324 | { 325 | SkipUpdateParticles(); 326 | } 327 | 328 | ApplyParticlesToTransforms(); 329 | } 330 | 331 | public void SetupParticles() 332 | { 333 | m_Particles.Clear(); 334 | if (m_Root == null) 335 | return; 336 | 337 | m_LocalGravity = m_Root.InverseTransformDirection(m_Gravity); 338 | m_ObjectScale = Mathf.Abs(transform.lossyScale.x); 339 | m_ObjectPrevPosition = transform.position; 340 | m_ObjectMove = Vector3.zero; 341 | m_BoneTotalLength = 0; 342 | AppendParticles(m_Root, -1, 0); 343 | UpdateParameters(); 344 | } 345 | 346 | void AppendParticles(Transform b, int parentIndex, float boneLength) 347 | { 348 | Particle p = new Particle(); 349 | p.m_Transform = b; 350 | p.m_ParentIndex = parentIndex; 351 | if (b != null) 352 | { 353 | p.m_Position = p.m_PrevPosition = b.position; 354 | p.m_InitLocalPosition = b.localPosition; 355 | p.m_InitLocalRotation = b.localRotation; 356 | } 357 | else // end bone 358 | { 359 | Transform pb = m_Particles[parentIndex].m_Transform; 360 | if (m_EndLength > 0) 361 | { 362 | Transform ppb = pb.parent; 363 | if (ppb != null) 364 | p.m_EndOffset = pb.InverseTransformPoint((pb.position * 2 - ppb.position)) * m_EndLength; 365 | else 366 | p.m_EndOffset = new Vector3(m_EndLength, 0, 0); 367 | } 368 | else 369 | { 370 | p.m_EndOffset = pb.InverseTransformPoint(transform.TransformDirection(m_EndOffset) + pb.position); 371 | } 372 | p.m_Position = p.m_PrevPosition = pb.TransformPoint(p.m_EndOffset); 373 | } 374 | 375 | if (parentIndex >= 0) 376 | { 377 | boneLength += (m_Particles[parentIndex].m_Transform.position - p.m_Position).magnitude; 378 | p.m_BoneLength = boneLength; 379 | m_BoneTotalLength = Mathf.Max(m_BoneTotalLength, boneLength); 380 | } 381 | 382 | int index = m_Particles.Count; 383 | m_Particles.Add(p); 384 | 385 | if (b != null) 386 | { 387 | for (int i = 0; i < b.childCount; ++i) 388 | { 389 | bool exclude = false; 390 | if (m_Exclusions != null) 391 | { 392 | for (int j = 0; j < m_Exclusions.Count; ++j) 393 | { 394 | Transform e = m_Exclusions[j]; 395 | if (e == b.GetChild(i)) 396 | { 397 | exclude = true; 398 | break; 399 | } 400 | } 401 | } 402 | if (!exclude) 403 | AppendParticles(b.GetChild(i), index, boneLength); 404 | else if (m_EndLength > 0 || m_EndOffset != Vector3.zero) 405 | AppendParticles(null, index, boneLength); 406 | } 407 | 408 | if (b.childCount == 0 && (m_EndLength > 0 || m_EndOffset != Vector3.zero)) 409 | AppendParticles(null, index, boneLength); 410 | } 411 | } 412 | 413 | public void UpdateParameters() 414 | { 415 | if (m_Root == null) 416 | return; 417 | 418 | m_LocalGravity = m_Root.InverseTransformDirection(m_Gravity); 419 | 420 | for (int i = 0; i < m_Particles.Count; ++i) 421 | { 422 | Particle p = m_Particles[i]; 423 | p.m_Damping = m_Damping; 424 | p.m_Elasticity = m_Elasticity; 425 | p.m_Stiffness = m_Stiffness; 426 | p.m_Inert = m_Inert; 427 | p.m_Friction = m_Friction; 428 | p.m_Radius = m_Radius; 429 | 430 | if (m_BoneTotalLength > 0) 431 | { 432 | float a = p.m_BoneLength / m_BoneTotalLength; 433 | if (m_DampingDistrib != null && m_DampingDistrib.keys.Length > 0) 434 | p.m_Damping *= m_DampingDistrib.Evaluate(a); 435 | if (m_ElasticityDistrib != null && m_ElasticityDistrib.keys.Length > 0) 436 | p.m_Elasticity *= m_ElasticityDistrib.Evaluate(a); 437 | if (m_StiffnessDistrib != null && m_StiffnessDistrib.keys.Length > 0) 438 | p.m_Stiffness *= m_StiffnessDistrib.Evaluate(a); 439 | if (m_InertDistrib != null && m_InertDistrib.keys.Length > 0) 440 | p.m_Inert *= m_InertDistrib.Evaluate(a); 441 | if (m_FrictionDistrib != null && m_FrictionDistrib.keys.Length > 0) 442 | p.m_Friction *= m_FrictionDistrib.Evaluate(a); 443 | if (m_RadiusDistrib != null && m_RadiusDistrib.keys.Length > 0) 444 | p.m_Radius *= m_RadiusDistrib.Evaluate(a); 445 | } 446 | 447 | p.m_Damping = Mathf.Clamp01(p.m_Damping); 448 | p.m_Elasticity = Mathf.Clamp01(p.m_Elasticity); 449 | p.m_Stiffness = Mathf.Clamp01(p.m_Stiffness); 450 | p.m_Inert = Mathf.Clamp01(p.m_Inert); 451 | p.m_Friction = Mathf.Clamp01(p.m_Friction); 452 | p.m_Radius = Mathf.Max(p.m_Radius, 0); 453 | } 454 | } 455 | 456 | void InitTransforms() 457 | { 458 | for (int i = 0; i < m_Particles.Count; ++i) 459 | { 460 | Particle p = m_Particles[i]; 461 | if (p.m_Transform != null) 462 | { 463 | p.m_Transform.localPosition = p.m_InitLocalPosition; 464 | p.m_Transform.localRotation = p.m_InitLocalRotation; 465 | } 466 | } 467 | } 468 | 469 | void ResetParticlesPosition() 470 | { 471 | for (int i = 0; i < m_Particles.Count; ++i) 472 | { 473 | Particle p = m_Particles[i]; 474 | if (p.m_Transform != null) 475 | { 476 | p.m_Position = p.m_PrevPosition = p.m_Transform.position; 477 | } 478 | else // end bone 479 | { 480 | Transform pb = m_Particles[p.m_ParentIndex].m_Transform; 481 | p.m_Position = p.m_PrevPosition = pb.TransformPoint(p.m_EndOffset); 482 | } 483 | p.m_isCollide = false; 484 | } 485 | m_ObjectPrevPosition = transform.position; 486 | } 487 | 488 | void UpdateParticles1(Vector3 force) 489 | { 490 | for (int i = 0; i < m_Particles.Count; ++i) 491 | { 492 | Particle p = m_Particles[i]; 493 | if (p.m_ParentIndex >= 0) 494 | { 495 | // verlet integration 496 | Vector3 v = p.m_Position - p.m_PrevPosition; 497 | Vector3 rmove = m_ObjectMove * p.m_Inert; 498 | p.m_PrevPosition = p.m_Position + rmove; 499 | float damping = p.m_Damping; 500 | if (p.m_isCollide) 501 | { 502 | damping += p.m_Friction; 503 | if (damping > 1) 504 | damping = 1; 505 | p.m_isCollide = false; 506 | } 507 | p.m_Position += v * (1 - damping) + force + rmove; 508 | } 509 | else 510 | { 511 | p.m_PrevPosition = p.m_Position; 512 | p.m_Position = p.m_Transform.position; 513 | } 514 | } 515 | } 516 | 517 | void UpdateParticles2() 518 | { 519 | //Plane movePlane = new Plane(); 520 | 521 | for (int i = 1; i < m_Particles.Count; ++i) 522 | { 523 | Particle p = m_Particles[i]; 524 | Particle p0 = m_Particles[p.m_ParentIndex]; 525 | 526 | float restLen; 527 | if (p.m_Transform != null) 528 | restLen = (p0.m_Transform.position - p.m_Transform.position).magnitude; 529 | else 530 | restLen = p0.m_Transform.localToWorldMatrix.MultiplyVector(p.m_EndOffset).magnitude; 531 | 532 | // keep shape 533 | float stiffness = Mathf.Lerp(1.0f, p.m_Stiffness, m_Weight); 534 | if (stiffness > 0 || p.m_Elasticity > 0) 535 | { 536 | Matrix4x4 m0 = p0.m_Transform.localToWorldMatrix; 537 | m0.SetColumn(3, p0.m_Position); 538 | Vector3 restPos; 539 | if (p.m_Transform != null) 540 | restPos = m0.MultiplyPoint3x4(p.m_Transform.localPosition); 541 | else 542 | restPos = m0.MultiplyPoint3x4(p.m_EndOffset); 543 | 544 | Vector3 d = restPos - p.m_Position; 545 | p.m_Position += d * p.m_Elasticity; 546 | 547 | if (stiffness > 0) 548 | { 549 | d = restPos - p.m_Position; 550 | float len = d.magnitude; 551 | float maxlen = restLen * (1 - stiffness) * 2; 552 | if (len > maxlen) 553 | p.m_Position += d * ((len - maxlen) / len); 554 | } 555 | } 556 | 557 | // collide 558 | if (m_Colliders != null) 559 | { 560 | float particleRadius = p.m_Radius * m_ObjectScale; 561 | for (int j = 0; j < m_Colliders.Count; ++j) 562 | { 563 | DynamicBoneColliderBase c = m_Colliders[j]; 564 | if (c != null && c.enabled) 565 | p.m_isCollide |= c.Collide(ref p.m_Position, particleRadius); 566 | } 567 | } 568 | 569 | // freeze axis, project to plane 570 | //if (m_FreezeAxis != FreezeAxis.None) 571 | //{ 572 | // switch (m_FreezeAxis) 573 | // { 574 | // case FreezeAxis.X: 575 | // movePlane.SetNormalAndPosition(p0.m_Transform.right, p0.m_Position); 576 | // break; 577 | // case FreezeAxis.Y: 578 | // movePlane.SetNormalAndPosition(p0.m_Transform.up, p0.m_Position); 579 | // break; 580 | // case FreezeAxis.Z: 581 | // movePlane.SetNormalAndPosition(p0.m_Transform.forward, p0.m_Position); 582 | // break; 583 | // } 584 | // p.m_Position -= movePlane.normal * movePlane.GetDistanceToPoint(p.m_Position); 585 | //} 586 | 587 | // keep length 588 | Vector3 dd = p0.m_Position - p.m_Position; 589 | float leng = dd.magnitude; 590 | if (leng > 0) 591 | p.m_Position += dd * ((leng - restLen) / leng); 592 | } 593 | } 594 | 595 | // only update stiffness and keep bone length 596 | void SkipUpdateParticles() 597 | { 598 | for (int i = 0; i < m_Particles.Count; ++i) 599 | { 600 | Particle p = m_Particles[i]; 601 | if (p.m_ParentIndex >= 0) 602 | { 603 | p.m_PrevPosition += m_ObjectMove; 604 | p.m_Position += m_ObjectMove; 605 | 606 | Particle p0 = m_Particles[p.m_ParentIndex]; 607 | 608 | float restLen; 609 | if (p.m_Transform != null) 610 | restLen = (p0.m_Transform.position - p.m_Transform.position).magnitude; 611 | else 612 | restLen = p0.m_Transform.localToWorldMatrix.MultiplyVector(p.m_EndOffset).magnitude; 613 | 614 | // keep shape 615 | float stiffness = Mathf.Lerp(1.0f, p.m_Stiffness, m_Weight); 616 | if (stiffness > 0) 617 | { 618 | Matrix4x4 m0 = p0.m_Transform.localToWorldMatrix; 619 | m0.SetColumn(3, p0.m_Position); 620 | Vector3 restPos; 621 | if (p.m_Transform != null) 622 | restPos = m0.MultiplyPoint3x4(p.m_Transform.localPosition); 623 | else 624 | restPos = m0.MultiplyPoint3x4(p.m_EndOffset); 625 | 626 | Vector3 d = restPos - p.m_Position; 627 | float len = d.magnitude; 628 | float maxlen = restLen * (1 - stiffness) * 2; 629 | if (len > maxlen) 630 | p.m_Position += d * ((len - maxlen) / len); 631 | } 632 | 633 | // keep length 634 | Vector3 dd = p0.m_Position - p.m_Position; 635 | float leng = dd.magnitude; 636 | if (leng > 0) 637 | p.m_Position += dd * ((leng - restLen) / leng); 638 | } 639 | else 640 | { 641 | p.m_PrevPosition = p.m_Position; 642 | p.m_Position = p.m_Transform.position; 643 | } 644 | } 645 | } 646 | 647 | static Vector3 MirrorVector(Vector3 v, Vector3 axis) 648 | { 649 | return v - axis * (Vector3.Dot(v, axis) * 2); 650 | } 651 | 652 | void ApplyParticlesToTransforms() 653 | { 654 | #if !UNITY_5_4_OR_NEWER 655 | // detect negative scale 656 | Vector3 ax = Vector3.right; 657 | Vector3 ay = Vector3.up; 658 | Vector3 az = Vector3.forward; 659 | bool nx = false, ny = false, nz = false; 660 | 661 | Vector3 loosyScale = transform.lossyScale; 662 | if (loosyScale.x < 0 || loosyScale.y < 0 || loosyScale.z < 0) 663 | { 664 | Transform mirrorObject = transform; 665 | do 666 | { 667 | Vector3 ls = mirrorObject.localScale; 668 | nx = ls.x < 0; 669 | if (nx) 670 | ax = mirrorObject.right; 671 | ny = ls.y < 0; 672 | if (ny) 673 | ay = mirrorObject.up; 674 | nz = ls.z < 0; 675 | if (nz) 676 | az = mirrorObject.forward; 677 | if (nx || ny || nz) 678 | break; 679 | 680 | mirrorObject = mirrorObject.parent; 681 | } 682 | while (mirrorObject != null); 683 | } 684 | #endif 685 | 686 | for (int i = 1; i < m_Particles.Count; ++i) 687 | { 688 | Particle p = m_Particles[i]; 689 | Particle p0 = m_Particles[p.m_ParentIndex]; 690 | 691 | if (p0.m_Transform.childCount <= 1) // do not modify bone orientation if has more then one child 692 | { 693 | Vector3 v; 694 | if (p.m_Transform != null) 695 | v = p.m_Transform.localPosition; 696 | else 697 | v = p.m_EndOffset; 698 | Vector3 v2 = p.m_Position - p0.m_Position; 699 | #if !UNITY_5_4_OR_NEWER 700 | if (nx) 701 | v2 = MirrorVector(v2, ax); 702 | if (ny) 703 | v2 = MirrorVector(v2, ay); 704 | if (nz) 705 | v2 = MirrorVector(v2, az); 706 | #endif 707 | Quaternion rot = Quaternion.FromToRotation(p0.m_Transform.TransformDirection(v), v2); 708 | p0.m_Transform.rotation = rot * p0.m_Transform.rotation; 709 | } 710 | 711 | if (p.m_Transform != null) 712 | p.m_Transform.position = p.m_Position; 713 | } 714 | } 715 | } 716 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Scripts/DynamicBone.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9ac8d30c6a0d9642a11e5be4c440740 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Scripts/DynamicBoneCollider.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | [AddComponentMenu("Dynamic Bone/Dynamic Bone Collider")] 4 | public class DynamicBoneCollider : DynamicBoneColliderBase 5 | { 6 | #if UNITY_5_3_OR_NEWER 7 | [Tooltip("The radius of the sphere or capsule.")] 8 | #endif 9 | public float m_Radius = 0.5f; 10 | 11 | #if UNITY_5_3_OR_NEWER 12 | [Tooltip("The height of the capsule.")] 13 | #endif 14 | public float m_Height = 0; 15 | 16 | void OnValidate() 17 | { 18 | m_Radius = Mathf.Max(m_Radius, 0); 19 | m_Height = Mathf.Max(m_Height, 0); 20 | } 21 | 22 | public override bool Collide(ref Vector3 particlePosition, float particleRadius) 23 | { 24 | float radius = m_Radius * Mathf.Abs(transform.lossyScale.x); 25 | float h = m_Height * 0.5f - m_Radius; 26 | if (h <= 0) 27 | { 28 | if (m_Bound == Bound.Outside) 29 | return OutsideSphere(ref particlePosition, particleRadius, transform.TransformPoint(m_Center), radius); 30 | else 31 | return InsideSphere(ref particlePosition, particleRadius, transform.TransformPoint(m_Center), radius); 32 | } 33 | else 34 | { 35 | Vector3 c0 = m_Center; 36 | Vector3 c1 = m_Center; 37 | 38 | switch (m_Direction) 39 | { 40 | case Direction.X: 41 | c0.x -= h; 42 | c1.x += h; 43 | break; 44 | case Direction.Y: 45 | c0.y -= h; 46 | c1.y += h; 47 | break; 48 | case Direction.Z: 49 | c0.z -= h; 50 | c1.z += h; 51 | break; 52 | } 53 | if (m_Bound == Bound.Outside) 54 | return OutsideCapsule(ref particlePosition, particleRadius, transform.TransformPoint(c0), transform.TransformPoint(c1), radius); 55 | else 56 | return InsideCapsule(ref particlePosition, particleRadius, transform.TransformPoint(c0), transform.TransformPoint(c1), radius); 57 | } 58 | } 59 | 60 | static bool OutsideSphere(ref Vector3 particlePosition, float particleRadius, Vector3 sphereCenter, float sphereRadius) 61 | { 62 | float r = sphereRadius + particleRadius; 63 | float r2 = r * r; 64 | Vector3 d = particlePosition - sphereCenter; 65 | float len2 = d.sqrMagnitude; 66 | 67 | // if is inside sphere, project onto sphere surface 68 | if (len2 > 0 && len2 < r2) 69 | { 70 | float len = Mathf.Sqrt(len2); 71 | particlePosition = sphereCenter + d * (r / len); 72 | return true; 73 | } 74 | return false; 75 | } 76 | 77 | static bool InsideSphere(ref Vector3 particlePosition, float particleRadius, Vector3 sphereCenter, float sphereRadius) 78 | { 79 | float r = sphereRadius - particleRadius; 80 | float r2 = r * r; 81 | Vector3 d = particlePosition - sphereCenter; 82 | float len2 = d.sqrMagnitude; 83 | 84 | // if is outside sphere, project onto sphere surface 85 | if (len2 > r2) 86 | { 87 | float len = Mathf.Sqrt(len2); 88 | particlePosition = sphereCenter + d * (r / len); 89 | return true; 90 | } 91 | return false; 92 | } 93 | 94 | static bool OutsideCapsule(ref Vector3 particlePosition, float particleRadius, Vector3 capsuleP0, Vector3 capsuleP1, float capsuleRadius) 95 | { 96 | float r = capsuleRadius + particleRadius; 97 | float r2 = r * r; 98 | Vector3 dir = capsuleP1 - capsuleP0; 99 | Vector3 d = particlePosition - capsuleP0; 100 | float t = Vector3.Dot(d, dir); 101 | 102 | if (t <= 0) 103 | { 104 | // check sphere1 105 | float len2 = d.sqrMagnitude; 106 | if (len2 > 0 && len2 < r2) 107 | { 108 | float len = Mathf.Sqrt(len2); 109 | particlePosition = capsuleP0 + d * (r / len); 110 | return true; 111 | } 112 | } 113 | else 114 | { 115 | float dl = dir.sqrMagnitude; 116 | if (t >= dl) 117 | { 118 | // check sphere2 119 | d = particlePosition - capsuleP1; 120 | float len2 = d.sqrMagnitude; 121 | if (len2 > 0 && len2 < r2) 122 | { 123 | float len = Mathf.Sqrt(len2); 124 | particlePosition = capsuleP1 + d * (r / len); 125 | return true; 126 | } 127 | } 128 | else if (dl > 0) 129 | { 130 | // check cylinder 131 | t /= dl; 132 | d -= dir * t; 133 | float len2 = d.sqrMagnitude; 134 | if (len2 > 0 && len2 < r2) 135 | { 136 | float len = Mathf.Sqrt(len2); 137 | particlePosition += d * ((r - len) / len); 138 | return true; 139 | } 140 | } 141 | } 142 | return false; 143 | } 144 | 145 | static bool InsideCapsule(ref Vector3 particlePosition, float particleRadius, Vector3 capsuleP0, Vector3 capsuleP1, float capsuleRadius) 146 | { 147 | float r = capsuleRadius - particleRadius; 148 | float r2 = r * r; 149 | Vector3 dir = capsuleP1 - capsuleP0; 150 | Vector3 d = particlePosition - capsuleP0; 151 | float t = Vector3.Dot(d, dir); 152 | 153 | if (t <= 0) 154 | { 155 | // check sphere1 156 | float len2 = d.sqrMagnitude; 157 | if (len2 > r2) 158 | { 159 | float len = Mathf.Sqrt(len2); 160 | particlePosition = capsuleP0 + d * (r / len); 161 | return true; 162 | } 163 | } 164 | else 165 | { 166 | float dl = dir.sqrMagnitude; 167 | if (t >= dl) 168 | { 169 | // check sphere2 170 | d = particlePosition - capsuleP1; 171 | float len2 = d.sqrMagnitude; 172 | if (len2 > r2) 173 | { 174 | float len = Mathf.Sqrt(len2); 175 | particlePosition = capsuleP1 + d * (r / len); 176 | return true; 177 | } 178 | } 179 | else if (dl > 0) 180 | { 181 | // check cylinder 182 | t /= dl; 183 | d -= dir * t; 184 | float len2 = d.sqrMagnitude; 185 | if (len2 > r2) 186 | { 187 | float len = Mathf.Sqrt(len2); 188 | particlePosition += d * ((r - len) / len); 189 | return true; 190 | } 191 | } 192 | } 193 | return false; 194 | } 195 | 196 | void OnDrawGizmosSelected() 197 | { 198 | if (!enabled) 199 | return; 200 | 201 | if (m_Bound == Bound.Outside) 202 | Gizmos.color = Color.yellow; 203 | else 204 | Gizmos.color = Color.magenta; 205 | float radius = m_Radius * Mathf.Abs(transform.lossyScale.x); 206 | float h = m_Height * 0.5f - m_Radius; 207 | if (h <= 0) 208 | { 209 | Gizmos.DrawWireSphere(transform.TransformPoint(m_Center), radius); 210 | } 211 | else 212 | { 213 | Vector3 c0 = m_Center; 214 | Vector3 c1 = m_Center; 215 | 216 | switch (m_Direction) 217 | { 218 | case Direction.X: 219 | c0.x -= h; 220 | c1.x += h; 221 | break; 222 | case Direction.Y: 223 | c0.y -= h; 224 | c1.y += h; 225 | break; 226 | case Direction.Z: 227 | c0.z -= h; 228 | c1.z += h; 229 | break; 230 | } 231 | Gizmos.DrawWireSphere(transform.TransformPoint(c0), radius); 232 | Gizmos.DrawWireSphere(transform.TransformPoint(c1), radius); 233 | } 234 | } 235 | } 236 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Scripts/DynamicBoneCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: baedd976e12657241bf7ff2d1c685342 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Scripts/DynamicBoneColliderBase.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class DynamicBoneColliderBase : MonoBehaviour 4 | { 5 | public enum Direction 6 | { 7 | X, Y, Z 8 | } 9 | 10 | #if UNITY_5_3_OR_NEWER 11 | [Tooltip("The axis of the capsule's height.")] 12 | #endif 13 | public Direction m_Direction = Direction.Y; 14 | 15 | #if UNITY_5_3_OR_NEWER 16 | [Tooltip("The center of the sphere or capsule, in the object's local space.")] 17 | #endif 18 | public Vector3 m_Center = Vector3.zero; 19 | 20 | public enum Bound 21 | { 22 | Outside, 23 | Inside 24 | } 25 | 26 | #if UNITY_5_3_OR_NEWER 27 | [Tooltip("Constrain bones to outside bound or inside bound.")] 28 | #endif 29 | public Bound m_Bound = Bound.Outside; 30 | 31 | public virtual bool Collide(ref Vector3 particlePosition, float particleRadius) 32 | { 33 | return false; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Scripts/DynamicBoneColliderBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04878769c08021a41bc2d2375e23ec0b 3 | timeCreated: 1482666371 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Scripts/DynamicBonePlaneCollider.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | [AddComponentMenu("Dynamic Bone/Dynamic Bone Plane Collider")] 4 | public class DynamicBonePlaneCollider : DynamicBoneColliderBase 5 | { 6 | void OnValidate() 7 | { 8 | } 9 | 10 | public override bool Collide(ref Vector3 particlePosition, float particleRadius) 11 | { 12 | Vector3 normal = Vector3.up; 13 | switch (m_Direction) 14 | { 15 | case Direction.X: 16 | normal = transform.right; 17 | break; 18 | case Direction.Y: 19 | normal = transform.up; 20 | break; 21 | case Direction.Z: 22 | normal = transform.forward; 23 | break; 24 | } 25 | 26 | Vector3 p = transform.TransformPoint(m_Center); 27 | Plane plane = new Plane(normal, p); 28 | float d = plane.GetDistanceToPoint(particlePosition); 29 | 30 | if (m_Bound == Bound.Outside) 31 | { 32 | if (d < 0) 33 | { 34 | particlePosition -= normal * d; 35 | return true; 36 | } 37 | } 38 | else 39 | { 40 | if (d > 0) 41 | { 42 | particlePosition -= normal * d; 43 | return true; 44 | } 45 | } 46 | return false; 47 | } 48 | 49 | void OnDrawGizmosSelected() 50 | { 51 | if (!enabled) 52 | return; 53 | 54 | if (m_Bound == Bound.Outside) 55 | Gizmos.color = Color.yellow; 56 | else 57 | Gizmos.color = Color.magenta; 58 | 59 | Vector3 normal = Vector3.up; 60 | switch (m_Direction) 61 | { 62 | case Direction.X: 63 | normal = transform.right; 64 | break; 65 | case Direction.Y: 66 | normal = transform.up; 67 | break; 68 | case Direction.Z: 69 | normal = transform.forward; 70 | break; 71 | } 72 | 73 | Vector3 p = transform.TransformPoint(m_Center); 74 | Gizmos.DrawLine(p, p + normal); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Assets/DynamicBone/Scripts/DynamicBonePlaneCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e535bdf3689369408cc4d078260ef6a 3 | timeCreated: 1482666461 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/DynamicBoneBeta.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | using Unity.Mathematics; 4 | using Unity.Collections; 5 | 6 | [AddComponentMenu("Dynamic Bone/Dynamic BoneBeta")] 7 | public class DynamicBoneBeta : MonoBehaviour 8 | { 9 | public bool outputBySIMD = false; 10 | 11 | public const int MAX_TRANSFORM_LIMIT = 10; 12 | 13 | [Tooltip("The root of the transform hierarchy to apply physics.")] 14 | public Transform m_Root = null; 15 | 16 | [Tooltip("Internal physics simulation rate.")] 17 | public float m_UpdateRate = 60.0f; 18 | 19 | public enum UpdateMode 20 | { 21 | Normal, 22 | AnimatePhysics, 23 | UnscaledTime 24 | } 25 | public UpdateMode m_UpdateMode = UpdateMode.Normal; 26 | 27 | [Tooltip("How much the bones slowed down.")] 28 | [Range(0, 1)] 29 | public float m_Damping = 0.1f; 30 | public AnimationCurve m_DampingDistrib = null; 31 | 32 | [Tooltip("How much the force applied to return each bone to original orientation.")] 33 | [Range(0, 1)] 34 | public float m_Elasticity = 0.1f; 35 | public AnimationCurve m_ElasticityDistrib = null; 36 | 37 | [Tooltip("How much bone's original orientation are preserved.")] 38 | [Range(0, 1)] 39 | public float m_Stiffness = 0.1f; 40 | public AnimationCurve m_StiffnessDistrib = null; 41 | 42 | [Tooltip("How much character's position change is ignored in physics simulation.")] 43 | [Range(0, 1)] 44 | public float m_Inert = 0; 45 | public AnimationCurve m_InertDistrib = null; 46 | 47 | [Tooltip("How much the bones slowed down when collide.")] 48 | public float m_Friction = 0; 49 | public AnimationCurve m_FrictionDistrib = null; 50 | 51 | [Tooltip("Each bone can be a sphere to collide with colliders. Radius describe sphere's size.")] 52 | public float m_Radius = 0; 53 | public AnimationCurve m_RadiusDistrib = null; 54 | 55 | [Tooltip("If End Length is not zero, an extra bone is generated at the end of transform hierarchy.")] 56 | public float m_EndLength = 0; 57 | 58 | [Tooltip("If End Offset is not zero, an extra bone is generated at the end of transform hierarchy.")] 59 | public Vector3 m_EndOffset = Vector3.zero; 60 | 61 | [Tooltip("The force apply to bones. Partial force apply to character's initial pose is cancelled out.")] 62 | public Vector3 m_Gravity = Vector3.zero; 63 | 64 | [Tooltip("The force apply to bones.")] 65 | public Vector3 m_Force = Vector3.zero; 66 | 67 | [Tooltip("Collider objects interact with the bones.")] 68 | public List m_Colliders = null; 69 | 70 | [Tooltip("Bones exclude from physics simulation.")] 71 | public List m_Exclusions = null; 72 | 73 | 74 | public enum FreezeAxis 75 | { 76 | None, X, Y, Z 77 | } 78 | [Tooltip("Constrain bones to move on specified plane.")] 79 | public FreezeAxis m_FreezeAxis = FreezeAxis.None; 80 | 81 | [Tooltip("Disable physics simulation automatically if character is far from camera or player.")] 82 | public bool m_DistantDisable = false; 83 | public Transform m_ReferenceObject = null; 84 | public float m_DistanceToObject = 20; 85 | 86 | public Vector3 m_LocalGravity = Vector3.zero; 87 | public Vector3 m_ObjectMove = Vector3.zero; 88 | public Vector3 m_ObjectPrevPosition = Vector3.zero; 89 | public float m_BoneTotalLength = 0; 90 | public float m_ObjectScale = 1.0f; 91 | public float m_Time = 0; 92 | public float m_Weight = 1.0f; 93 | public bool m_DistantDisabled = false; 94 | 95 | private Vector3 m_GravityNormalize; 96 | 97 | public struct HeadInfo 98 | { 99 | int m_HeadIndex; 100 | 101 | public float m_UpdateRate; 102 | public Vector3 m_PerFrameForce; 103 | 104 | public Vector3 m_ObjectMove; 105 | public float m_Weight; 106 | public int m_particleCount; 107 | public int m_jobDataOffset; 108 | public int m_ParticleLoopCount; 109 | 110 | public float3 m_RootParentBoneWorldPos; 111 | public quaternion m_RootParentBoneWorldRot; 112 | 113 | public void ResetHeadIndex(int index) 114 | { 115 | this.m_HeadIndex = index; 116 | } 117 | 118 | public int GetHeadIndex() 119 | { 120 | return this.m_HeadIndex; 121 | } 122 | } 123 | 124 | public struct Particle 125 | { 126 | public int index; 127 | public int m_ParentIndex; 128 | public float m_Damping; 129 | public float m_Elasticity; 130 | public float m_Stiffness; 131 | public float m_Inert; 132 | public float m_Friction; 133 | public float m_Radius; 134 | public float m_BoneLength; 135 | public int m_isCollide; 136 | 137 | public float3 m_EndOffset; 138 | public float3 m_InitLocalPosition; 139 | public quaternion m_InitLocalRotation; 140 | 141 | public int m_ChildCount; 142 | 143 | 144 | //for calc worldPos 145 | public float3 localPosition; 146 | public quaternion localRotation; 147 | 148 | public float3 tmpWorldPosition; 149 | public float3 tmpPrevWorldPosition; 150 | 151 | public float3 parentScale; 152 | public int isRootParticle; 153 | 154 | //for output 155 | public float3 worldPosition; 156 | public quaternion worldRotation; 157 | } 158 | 159 | public NativeArray m_Particles; 160 | public Transform[] m_particleTransformArr; 161 | private int m_ParticleCount; 162 | private Transform m_transform; 163 | public Transform m_rootParentTransform; 164 | public HeadInfo m_headInfo; 165 | 166 | private void Awake() 167 | { 168 | m_transform = this.transform; 169 | 170 | m_headInfo = new HeadInfo(); 171 | m_headInfo.m_UpdateRate = this.m_UpdateRate; 172 | m_headInfo.m_ObjectMove = this.m_ObjectMove; 173 | m_headInfo.m_Weight = this.m_Weight; 174 | m_headInfo.m_particleCount = 0; 175 | 176 | m_Particles = new NativeArray(MAX_TRANSFORM_LIMIT, Allocator.Persistent); 177 | m_particleTransformArr = new Transform[MAX_TRANSFORM_LIMIT]; 178 | m_ParticleCount = 0; 179 | 180 | m_GravityNormalize = m_Gravity.normalized; 181 | 182 | SetupParticles(ref m_headInfo); 183 | 184 | } 185 | 186 | public HeadInfo ResetHeadIndexAndDataOffset(int headIndex) 187 | { 188 | m_headInfo.ResetHeadIndex(headIndex); 189 | m_headInfo.m_jobDataOffset = headIndex * MAX_TRANSFORM_LIMIT; 190 | 191 | return m_headInfo; 192 | } 193 | 194 | void FixedUpdate() 195 | { 196 | if (m_UpdateMode == UpdateMode.AnimatePhysics) 197 | PreUpdate(); 198 | } 199 | 200 | private bool useJob = false; 201 | void Update() 202 | { 203 | if (useJob) 204 | { 205 | return; 206 | } 207 | 208 | if (m_UpdateMode != UpdateMode.AnimatePhysics) 209 | PreUpdate(); 210 | } 211 | 212 | public void DebugUpdate() 213 | { 214 | PreUpdate(); 215 | } 216 | 217 | 218 | void PrepareParticle() 219 | { 220 | m_headInfo.m_RootParentBoneWorldPos = m_rootParentTransform.position; 221 | m_headInfo.m_RootParentBoneWorldRot = m_rootParentTransform.rotation; 222 | 223 | float3 parentPosition = m_rootParentTransform.position; 224 | quaternion parentRotation = m_rootParentTransform.rotation; 225 | 226 | for (int i = 0; i < m_ParticleCount; i++) 227 | { 228 | Particle p = m_Particles[i]; 229 | Transform trans = m_particleTransformArr[p.index]; 230 | 231 | p.m_ChildCount = trans.childCount; 232 | 233 | var localPosition = p.localPosition * p.parentScale; 234 | var localRotation = p.localRotation; 235 | var worldPosition = parentPosition + math.mul(parentRotation, localPosition); 236 | var worldRotation = math.mul(parentRotation, localRotation); 237 | 238 | p.worldPosition = worldPosition; 239 | p.worldRotation = worldRotation; 240 | 241 | parentPosition = worldPosition; 242 | parentRotation = worldRotation; 243 | 244 | m_Particles[i] = p; 245 | } 246 | } 247 | 248 | public void PrepareJobData() 249 | { 250 | m_headInfo.m_RootParentBoneWorldPos = m_rootParentTransform.position; 251 | m_headInfo.m_RootParentBoneWorldRot = m_rootParentTransform.rotation; 252 | m_headInfo.m_ObjectMove = m_transform.position - m_ObjectPrevPosition; 253 | 254 | m_ObjectScale = Mathf.Abs(transform.lossyScale.x); 255 | m_ObjectPrevPosition = transform.position; 256 | 257 | Vector3 force = m_Gravity; 258 | Vector3 fdir = m_GravityNormalize; 259 | Vector3 rf = m_Root.TransformDirection(m_LocalGravity); 260 | Vector3 pf = fdir * Mathf.Max(Vector3.Dot(rf, fdir), 0); // project current gravity to rest gravity 261 | force -= pf; // remove projected gravity 262 | force = (force + m_Force) * m_ObjectScale; 263 | 264 | m_headInfo.m_PerFrameForce = force; 265 | } 266 | 267 | void LateUpdate() 268 | { 269 | if (useJob) 270 | { 271 | return; 272 | } 273 | 274 | //if (m_DistantDisable) 275 | // CheckDistance(); 276 | 277 | if (m_Weight > 0 && !(m_DistantDisable && m_DistantDisabled)) 278 | { 279 | PrepareParticle(); 280 | float dt = m_UpdateMode == UpdateMode.UnscaledTime ? Time.unscaledDeltaTime : Time.deltaTime; 281 | UpdateDynamicBones(dt, ref m_headInfo); 282 | } 283 | } 284 | 285 | void PreUpdate() 286 | { 287 | if (m_Weight > 0 && !(m_DistantDisable && m_DistantDisabled)) 288 | InitTransforms(); 289 | } 290 | 291 | void CheckDistance() 292 | { 293 | Transform rt = m_ReferenceObject; 294 | if (rt == null && Camera.main != null) 295 | rt = Camera.main.transform; 296 | if (rt != null) 297 | { 298 | float d = (rt.position - transform.position).sqrMagnitude; 299 | bool disable = d > m_DistanceToObject * m_DistanceToObject; 300 | if (disable != m_DistantDisabled) 301 | { 302 | if (!disable) 303 | ResetParticlesPosition(ref m_headInfo); 304 | m_DistantDisabled = disable; 305 | } 306 | } 307 | } 308 | 309 | void OnEnable() 310 | { 311 | //ResetParticlesPosition(ref m_headInfo); 312 | 313 | DynamicBoneManager.Instance.OnEnter(this, ref m_headInfo, this.m_Particles, this.m_particleTransformArr); 314 | useJob = true; 315 | } 316 | 317 | void OnDisable() 318 | { 319 | InitTransforms(); 320 | 321 | DynamicBoneManager.Instance.OnExit(this, ref m_headInfo); 322 | } 323 | 324 | public void ClearJobData() 325 | { 326 | if (m_Particles.IsCreated) 327 | { 328 | m_Particles.Dispose(); 329 | } 330 | 331 | m_particleTransformArr = null; 332 | } 333 | 334 | public void SetWeight(float w, ref HeadInfo head) 335 | { 336 | if (head.m_Weight != w) 337 | { 338 | if (w == 0) 339 | InitTransforms(); 340 | else if (head.m_Weight == 0) 341 | ResetParticlesPosition(ref head); 342 | head.m_Weight = w; 343 | } 344 | } 345 | 346 | public float GetWeight() 347 | { 348 | return m_headInfo.m_Weight; 349 | } 350 | 351 | void UpdateDynamicBones(float t, ref HeadInfo head) 352 | { 353 | if (m_Root == null) 354 | return; 355 | m_ObjectScale = Mathf.Abs(transform.lossyScale.x); 356 | m_ObjectMove = m_transform.position - m_ObjectPrevPosition; 357 | m_ObjectPrevPosition = transform.position; 358 | 359 | Vector3 force = m_Gravity; 360 | Vector3 fdir = m_Gravity.normalized; 361 | Vector3 rf = m_Root.TransformDirection(m_LocalGravity); 362 | Vector3 pf = fdir * Mathf.Max(Vector3.Dot(rf, fdir), 0); // project current gravity to rest gravity 363 | force -= pf; // remove projected gravity 364 | force = (force + m_Force) * m_ObjectScale; 365 | 366 | int loop = 1; 367 | if (m_UpdateRate > 0) 368 | { 369 | float dt = 1.0f / m_UpdateRate; 370 | m_Time += t; 371 | loop = 0; 372 | 373 | while (m_Time >= dt) 374 | { 375 | m_Time -= dt; 376 | if (++loop >= 3) 377 | { 378 | m_Time = 0; 379 | break; 380 | } 381 | } 382 | } 383 | 384 | loop = math.max(1, loop); 385 | if (loop > 0) 386 | { 387 | for (int i = 0; i < loop; ++i) 388 | { 389 | UpdateParticles1(force, ref head); 390 | UpdateParticles2(ref head); 391 | m_ObjectMove = Vector3.zero; 392 | } 393 | } 394 | 395 | ApplyParticlesToTransforms(); 396 | } 397 | 398 | public void SetupParticles(ref HeadInfo head) 399 | { 400 | //m_Particles.Clear(); 401 | if (m_Root == null) 402 | return; 403 | 404 | m_rootParentTransform = m_Root.parent; 405 | 406 | m_LocalGravity = m_Root.InverseTransformDirection(m_Gravity); 407 | m_ObjectScale = Mathf.Abs(transform.lossyScale.x); 408 | m_ObjectPrevPosition = transform.position; 409 | m_ObjectMove = Vector3.zero; 410 | m_BoneTotalLength = 0; 411 | AppendParticles(m_Root, -1, 0, ref head); 412 | UpdateParameters(); 413 | 414 | for(int i = 0; i < m_ParticleCount; i++) 415 | { 416 | m_particleTransformArr[i].parent = null; 417 | } 418 | 419 | m_headInfo.m_particleCount = m_ParticleCount; 420 | } 421 | 422 | void AppendParticles(Transform b, int parentIndex, float boneLength, ref HeadInfo head) 423 | { 424 | Particle p = new Particle(); 425 | p.index = m_ParticleCount++; 426 | p.m_ParentIndex = parentIndex; 427 | 428 | if (b != null) 429 | { 430 | p.m_InitLocalPosition = b.localPosition; 431 | p.m_InitLocalRotation = b.localRotation; 432 | 433 | //extend 434 | 435 | p.localPosition = b.localPosition; 436 | p.localRotation = b.localRotation; 437 | p.tmpWorldPosition = p.tmpPrevWorldPosition = b.position; 438 | 439 | p.worldPosition = b.position; 440 | p.worldRotation = b.rotation; 441 | 442 | p.parentScale = b.parent.lossyScale; 443 | p.isRootParticle = parentIndex == -1 ? 1 : 0; 444 | } 445 | else // end bone 446 | { 447 | Transform pb = m_particleTransformArr[parentIndex]; 448 | if (m_EndLength > 0) 449 | { 450 | Transform ppb = pb.parent; 451 | if (ppb != null) 452 | p.m_EndOffset = pb.InverseTransformPoint((pb.position * 2 - ppb.position)) * m_EndLength; 453 | else 454 | p.m_EndOffset = new Vector3(m_EndLength, 0, 0); 455 | } 456 | else 457 | { 458 | p.m_EndOffset = pb.InverseTransformPoint(transform.TransformDirection(m_EndOffset) + pb.position); 459 | } 460 | //p.m_Position = p.m_PrevPosition = pb.TransformPoint(p.m_EndOffset); 461 | p.tmpWorldPosition = p.tmpPrevWorldPosition = pb.TransformPoint(p.m_EndOffset); 462 | } 463 | 464 | if (parentIndex >= 0) 465 | { 466 | float dis = math.distance(m_particleTransformArr[parentIndex].position, p.tmpWorldPosition); 467 | boneLength += dis; 468 | p.m_BoneLength = boneLength; 469 | m_BoneTotalLength = Mathf.Max(m_BoneTotalLength, boneLength); 470 | } 471 | 472 | m_Particles[p.index] = p; 473 | m_particleTransformArr[p.index] = b; 474 | 475 | int index = p.index; 476 | 477 | if (b != null) 478 | { 479 | for (int i = 0; i < b.childCount; ++i) 480 | { 481 | bool exclude = false; 482 | if (m_Exclusions != null) 483 | { 484 | for (int j = 0; j < m_Exclusions.Count; ++j) 485 | { 486 | Transform e = m_Exclusions[j]; 487 | if (e == b.GetChild(i)) 488 | { 489 | exclude = true; 490 | break; 491 | } 492 | } 493 | } 494 | if (!exclude) 495 | AppendParticles(b.GetChild(i), index, boneLength, ref head); 496 | else if (m_EndLength > 0 || m_EndOffset != Vector3.zero) 497 | AppendParticles(null, index, boneLength, ref head); 498 | } 499 | 500 | if (b.childCount == 0 && (m_EndLength > 0 || m_EndOffset != Vector3.zero)) 501 | AppendParticles(null, index, boneLength, ref head); 502 | } 503 | } 504 | 505 | public void UpdateParameters() 506 | { 507 | if (m_Root == null) 508 | return; 509 | 510 | m_LocalGravity = m_Root.InverseTransformDirection(m_Gravity); 511 | 512 | for (int i = 0; i < m_ParticleCount; ++i) 513 | { 514 | Particle p = m_Particles[i]; 515 | p.m_Damping = m_Damping; 516 | p.m_Elasticity = m_Elasticity; 517 | p.m_Stiffness = m_Stiffness; 518 | p.m_Inert = m_Inert; 519 | p.m_Friction = m_Friction; 520 | p.m_Radius = m_Radius; 521 | 522 | if (m_BoneTotalLength > 0) 523 | { 524 | float a = p.m_BoneLength / m_BoneTotalLength; 525 | if (m_DampingDistrib != null && m_DampingDistrib.keys.Length > 0) 526 | p.m_Damping *= m_DampingDistrib.Evaluate(a); 527 | if (m_ElasticityDistrib != null && m_ElasticityDistrib.keys.Length > 0) 528 | p.m_Elasticity *= m_ElasticityDistrib.Evaluate(a); 529 | if (m_StiffnessDistrib != null && m_StiffnessDistrib.keys.Length > 0) 530 | p.m_Stiffness *= m_StiffnessDistrib.Evaluate(a); 531 | if (m_InertDistrib != null && m_InertDistrib.keys.Length > 0) 532 | p.m_Inert *= m_InertDistrib.Evaluate(a); 533 | if (m_FrictionDistrib != null && m_FrictionDistrib.keys.Length > 0) 534 | p.m_Friction *= m_FrictionDistrib.Evaluate(a); 535 | if (m_RadiusDistrib != null && m_RadiusDistrib.keys.Length > 0) 536 | p.m_Radius *= m_RadiusDistrib.Evaluate(a); 537 | } 538 | 539 | p.m_Damping = Mathf.Clamp01(p.m_Damping); 540 | p.m_Elasticity = Mathf.Clamp01(p.m_Elasticity); 541 | p.m_Stiffness = Mathf.Clamp01(p.m_Stiffness); 542 | p.m_Inert = Mathf.Clamp01(p.m_Inert); 543 | p.m_Friction = Mathf.Clamp01(p.m_Friction); 544 | p.m_Radius = Mathf.Max(p.m_Radius, 0); 545 | 546 | 547 | 548 | m_Particles[i] = p; 549 | } 550 | } 551 | 552 | void InitTransforms() 553 | { 554 | for (int i = 0; i < m_ParticleCount; ++i) 555 | { 556 | Particle p = m_Particles[i]; 557 | Transform trans = m_particleTransformArr[p.index]; 558 | if (trans != null) 559 | { 560 | //trans.localPosition = p.m_InitLocalPosition; 561 | //trans.localRotation = p.m_InitLocalRotation; 562 | p.localPosition = p.m_InitLocalPosition; 563 | p.localRotation = p.m_InitLocalRotation; 564 | } 565 | } 566 | } 567 | 568 | void ResetParticlesPosition(ref HeadInfo head) 569 | { 570 | //for (int i = 0; i < m_ParticleCount; ++i) 571 | //{ 572 | // Particle p = m_Particles[i]; 573 | // Transform trans = m_particleTransformArr[p.index]; 574 | // if (trans != null) 575 | // { 576 | // p.m_Position = p.m_PrevPosition = trans.position; 577 | // } 578 | // else // end bone 579 | // { 580 | // Transform pb = m_particleTransformArr[p.m_ParentIndex]; 581 | // p.m_Position = p.m_PrevPosition = pb.TransformPoint(p.m_EndOffset); 582 | // } 583 | // p.m_isCollide = 0; 584 | // m_Particles[i] = p; 585 | //} 586 | m_ObjectPrevPosition = m_transform.position; 587 | } 588 | 589 | void UpdateParticles1(Vector3 force, ref HeadInfo head) 590 | { 591 | for (int i = 0; i < m_ParticleCount; ++i) 592 | { 593 | Particle p = m_Particles[i]; 594 | 595 | if (p.m_ParentIndex >= 0) 596 | { 597 | //extend 598 | float3 ev = p.tmpWorldPosition - p.tmpPrevWorldPosition; 599 | float3 evrmove = head.m_ObjectMove * p.m_Inert; 600 | p.tmpPrevWorldPosition = p.tmpWorldPosition + evrmove; 601 | 602 | float edamping = p.m_Damping; 603 | if (p.m_isCollide == 1) 604 | { 605 | edamping += p.m_Friction; 606 | if (edamping > 1) 607 | edamping = 1; 608 | p.m_isCollide = 0; 609 | } 610 | 611 | float3 eForce = force; 612 | float3 tmp = ev * (1 - edamping) + eForce + evrmove; 613 | p.tmpWorldPosition += tmp; 614 | 615 | } 616 | else 617 | { 618 | //extend 619 | p.tmpPrevWorldPosition = p.tmpWorldPosition; 620 | p.tmpWorldPosition = p.worldPosition; 621 | } 622 | 623 | m_Particles[i] = p; 624 | } 625 | } 626 | 627 | void UpdateParticles2(ref HeadInfo head) 628 | { 629 | for (int i = 1; i < m_ParticleCount; ++i) 630 | { 631 | Particle p = m_Particles[i]; 632 | Particle p0 = m_Particles[p.m_ParentIndex]; 633 | 634 | float3 ePos = p.worldPosition; 635 | float3 ep0Pos = p0.worldPosition; 636 | 637 | 638 | float erestLen = math.distance(ep0Pos, ePos); 639 | 640 | // keep shape 641 | float stiffness = Mathf.Lerp(1.0f, p.m_Stiffness, head.m_Weight); 642 | if (stiffness > 0 || p.m_Elasticity > 0) 643 | { 644 | //extend, 本地坐标变换到父级空间下计算距离 645 | float4x4 em0 = float4x4.TRS(p0.tmpWorldPosition, p0.worldRotation, p.parentScale); 646 | float3 erestPos = math.mul(em0, new float4(p.localPosition.xyz, 1)).xyz; 647 | float3 ed = erestPos - p.tmpWorldPosition; 648 | float3 eStepElasticity = ed * p.m_Elasticity; 649 | p.tmpWorldPosition += eStepElasticity; 650 | 651 | if (stiffness > 0) 652 | { 653 | float len = math.distance(erestPos, p.tmpWorldPosition); 654 | float maxlen = erestLen * (1 - stiffness) * 2; 655 | if (len > maxlen) 656 | { 657 | float3 max = ed * ((len - maxlen) / len); 658 | p.tmpWorldPosition += max; 659 | } 660 | } 661 | 662 | } 663 | 664 | float3 edd = p0.tmpWorldPosition - p.tmpWorldPosition; 665 | float eleng = math.distance(p0.tmpWorldPosition, p.tmpWorldPosition); 666 | if(eleng > 0) 667 | { 668 | float3 tmp = edd * ((eleng - erestLen) / eleng); 669 | p.tmpWorldPosition += tmp; 670 | } 671 | 672 | m_Particles[p.index] = p; 673 | } 674 | } 675 | 676 | static Vector3 MirrorVector(Vector3 v, Vector3 axis) 677 | { 678 | return v - axis * (Vector3.Dot(v, axis) * 2); 679 | } 680 | 681 | void ApplyParticlesToTransforms() 682 | { 683 | Particle parentP = m_Particles[0]; 684 | 685 | for (int i = 1; i < m_ParticleCount; ++i) 686 | { 687 | Particle p = m_Particles[i]; 688 | Particle p0 = parentP; 689 | 690 | if (p0.m_ChildCount <= 1) // do not modify bone orientation if has more then one child 691 | { 692 | float3 ev = p.localPosition; 693 | float3 ev2 = p.tmpWorldPosition - p0.tmpWorldPosition; 694 | 695 | float4x4 epm = float4x4.TRS(p.worldPosition, p.worldRotation, p.parentScale); 696 | 697 | var worldV = math.mul(epm, new float4(ev, 0)).xyz; 698 | Quaternion erot = Quaternion.FromToRotation(worldV, ev2); 699 | var eoutputRot = math.mul(erot, p.worldRotation); 700 | p0.worldRotation = eoutputRot; 701 | } 702 | 703 | p.worldPosition = p.tmpWorldPosition; 704 | 705 | m_Particles[i] = p; 706 | m_Particles[p.m_ParentIndex] = p0; 707 | 708 | parentP = p; 709 | } 710 | 711 | 712 | for (int i = 0; i < m_ParticleCount; i++) 713 | { 714 | Particle p = m_Particles[i]; 715 | Transform trans = m_particleTransformArr[p.index]; 716 | 717 | trans.rotation = p.worldRotation; 718 | trans.position = p.worldPosition; 719 | } 720 | } 721 | } 722 | -------------------------------------------------------------------------------- /Assets/DynamicBoneBeta.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42be98af2f222d44d953caa65c5dd995 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/DynamicBoneManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Jobs; 5 | using Unity.Mathematics; 6 | using Unity.Jobs; 7 | using Unity.Burst; 8 | using Unity.Collections; 9 | 10 | public class DynamicBoneManager : MonoBehaviour 11 | { 12 | private static DynamicBoneManager m_instance; 13 | 14 | public static DynamicBoneManager Instance 15 | { 16 | get 17 | { 18 | if(null == m_instance) 19 | { 20 | m_instance = GameObject.FindObjectOfType(); 21 | if (!m_instance) 22 | { 23 | GameObject go = new GameObject("DynamicBoneManager"); 24 | m_instance = go.AddComponent(); 25 | } 26 | m_instance.Init(); 27 | } 28 | 29 | return m_instance; 30 | } 31 | } 32 | 33 | [BurstCompile] 34 | struct RootPosApplyJob : IJobParallelForTransform 35 | { 36 | public NativeArray ParticleHeadInfo; 37 | 38 | public void Execute(int index, TransformAccess transform) 39 | { 40 | DynamicBoneBeta.HeadInfo headInfo = ParticleHeadInfo[index]; 41 | headInfo.m_RootParentBoneWorldPos = transform.position; 42 | headInfo.m_RootParentBoneWorldRot = transform.rotation; 43 | 44 | ParticleHeadInfo[index] = headInfo; 45 | } 46 | } 47 | 48 | [BurstCompile] 49 | struct PrepareParticleJob : IJob 50 | { 51 | [ReadOnly] 52 | public NativeArray ParticleHeadInfo; 53 | public NativeArray ParticleInfo; 54 | public int HeadCount; 55 | 56 | public void Execute() 57 | { 58 | for (int i = 0; i < HeadCount; i++) 59 | { 60 | DynamicBoneBeta.HeadInfo curHeadInfo = ParticleHeadInfo[i]; 61 | 62 | float3 parentPosition = curHeadInfo.m_RootParentBoneWorldPos; 63 | quaternion parentRotation = curHeadInfo.m_RootParentBoneWorldRot; 64 | 65 | for (int j = 0; j < curHeadInfo.m_particleCount; j++) 66 | { 67 | int pIdx = curHeadInfo.m_jobDataOffset + j; 68 | DynamicBoneBeta.Particle p = ParticleInfo[pIdx]; 69 | 70 | var localPosition = p.localPosition * p.parentScale; 71 | var localRotation = p.localRotation; 72 | var worldPosition = parentPosition + math.mul(parentRotation, localPosition); 73 | var worldRotation = math.mul(parentRotation, localRotation); 74 | 75 | p.worldPosition = worldPosition; 76 | p.worldRotation = worldRotation; 77 | 78 | parentPosition = worldPosition; 79 | parentRotation = worldRotation; 80 | 81 | ParticleInfo[pIdx] = p; 82 | } 83 | } 84 | } 85 | } 86 | 87 | [BurstCompile] 88 | struct UpdateParticles1Job : IJobParallelFor 89 | { 90 | [ReadOnly] 91 | public NativeArray ParticleHeadInfo; 92 | public NativeArray ParticleInfo; 93 | public int HeadCount; 94 | 95 | public void Execute(int index) 96 | { 97 | { 98 | int headIndex = index / DynamicBoneBeta.MAX_TRANSFORM_LIMIT; 99 | DynamicBoneBeta.HeadInfo curHeadInfo = ParticleHeadInfo[headIndex]; 100 | 101 | 102 | { 103 | int singleId = index % DynamicBoneBeta.MAX_TRANSFORM_LIMIT; 104 | 105 | if (singleId >= curHeadInfo.m_particleCount) return; 106 | 107 | int pIdx = curHeadInfo.m_jobDataOffset + (index % DynamicBoneBeta.MAX_TRANSFORM_LIMIT); 108 | 109 | DynamicBoneBeta.Particle p = ParticleInfo[pIdx]; 110 | 111 | if (p.m_ParentIndex >= 0) 112 | { 113 | float3 ev = p.tmpWorldPosition - p.tmpPrevWorldPosition; 114 | float3 evrmove = curHeadInfo.m_ObjectMove * p.m_Inert; 115 | p.tmpPrevWorldPosition = p.tmpWorldPosition + evrmove; 116 | 117 | float edamping = p.m_Damping; 118 | if (p.m_isCollide == 1) 119 | { 120 | edamping += p.m_Friction; 121 | if (edamping > 1) 122 | edamping = 1; 123 | p.m_isCollide = 0; 124 | } 125 | 126 | float3 eForce = curHeadInfo.m_PerFrameForce; 127 | float3 tmp = ev * (1 - edamping) + eForce + evrmove; 128 | p.tmpWorldPosition += tmp; 129 | } 130 | else 131 | { 132 | p.tmpPrevWorldPosition = p.tmpWorldPosition; 133 | p.tmpWorldPosition = p.worldPosition; 134 | } 135 | 136 | ParticleInfo[pIdx] = p; 137 | } 138 | } 139 | } 140 | } 141 | 142 | [BurstCompile] 143 | struct UpdateParticle2Job : IJobParallelFor 144 | { 145 | [ReadOnly] 146 | public NativeArray ParticleHeadInfo; 147 | public NativeArray ParticleInfo; 148 | public int HeadCount; 149 | 150 | public void Execute(int index) 151 | { 152 | { 153 | if (index % DynamicBoneBeta.MAX_TRANSFORM_LIMIT == 0) return; 154 | 155 | int headIndex = index / DynamicBoneBeta.MAX_TRANSFORM_LIMIT; 156 | DynamicBoneBeta.HeadInfo curHeadInfo = ParticleHeadInfo[headIndex]; 157 | { 158 | int singleId = index % DynamicBoneBeta.MAX_TRANSFORM_LIMIT; 159 | 160 | if (singleId >= curHeadInfo.m_particleCount) return; 161 | 162 | int pIdx = curHeadInfo.m_jobDataOffset + (index % DynamicBoneBeta.MAX_TRANSFORM_LIMIT); 163 | 164 | DynamicBoneBeta.Particle p = ParticleInfo[pIdx]; 165 | int p0Idx = curHeadInfo.m_jobDataOffset + p.m_ParentIndex; 166 | DynamicBoneBeta.Particle p0 = ParticleInfo[p0Idx]; 167 | 168 | float3 ePos = p.worldPosition; 169 | float3 ep0Pos = p0.worldPosition; 170 | 171 | float erestLen = math.distance(ep0Pos, ePos); 172 | 173 | float stiffness = Mathf.Lerp(1.0f, p.m_Stiffness, curHeadInfo.m_Weight); 174 | if (stiffness > 0 || p.m_Elasticity > 0) 175 | { 176 | float4x4 em0 = float4x4.TRS(p0.tmpWorldPosition, p0.worldRotation, p.parentScale); 177 | float3 erestPos = math.mul(em0, new float4(p.localPosition.xyz, 1)).xyz; 178 | float3 ed = erestPos - p.tmpWorldPosition; 179 | float3 eStepElasticity = ed * p.m_Elasticity; 180 | p.tmpWorldPosition += eStepElasticity; 181 | 182 | if (stiffness > 0) 183 | { 184 | float len = math.distance(erestPos, p.tmpWorldPosition); 185 | float maxlen = erestLen * (1 - stiffness) * 2; 186 | if (len > maxlen) 187 | { 188 | float3 max = ed * ((len - maxlen) / len); 189 | p.tmpWorldPosition += max; 190 | } 191 | } 192 | } 193 | 194 | float3 edd = p0.tmpWorldPosition - p.tmpWorldPosition; 195 | float eleng = math.distance(p0.tmpWorldPosition, p.tmpWorldPosition); 196 | if (eleng > 0) 197 | { 198 | float3 tmp = edd * ((eleng - erestLen) / eleng); 199 | p.tmpWorldPosition += tmp; 200 | } 201 | 202 | ParticleInfo[pIdx] = p; 203 | } 204 | } 205 | } 206 | } 207 | 208 | [BurstCompile] 209 | struct ApplyParticleToTransform : IJobParallelFor 210 | { 211 | [ReadOnly] 212 | public NativeArray ParticleHeadInfo; 213 | public NativeArray ParticleInfo; 214 | public int HeadCount; 215 | 216 | public void Execute(int index) 217 | { 218 | { 219 | if (index % DynamicBoneBeta.MAX_TRANSFORM_LIMIT == 0) 220 | { 221 | return; 222 | } 223 | 224 | int headIndex = index / DynamicBoneBeta.MAX_TRANSFORM_LIMIT; 225 | 226 | DynamicBoneBeta.HeadInfo curHeadInfo = ParticleHeadInfo[headIndex]; 227 | { 228 | int singleId = index % DynamicBoneBeta.MAX_TRANSFORM_LIMIT; 229 | 230 | if (singleId >= curHeadInfo.m_particleCount) return; 231 | 232 | int pIdx = curHeadInfo.m_jobDataOffset + (index % DynamicBoneBeta.MAX_TRANSFORM_LIMIT); 233 | 234 | DynamicBoneBeta.Particle p = ParticleInfo[pIdx]; 235 | int p0Idx = curHeadInfo.m_jobDataOffset + p.m_ParentIndex; 236 | DynamicBoneBeta.Particle p0 = ParticleInfo[p0Idx]; 237 | 238 | if (p0.m_ChildCount <= 1) 239 | { 240 | float3 ev = p.localPosition; 241 | float3 ev2 = p.tmpWorldPosition - p0.tmpWorldPosition; 242 | 243 | float4x4 epm = float4x4.TRS(p.worldPosition, p.worldRotation, p.parentScale); 244 | 245 | var worldV = math.mul(epm, new float4(ev, 0)).xyz; 246 | Quaternion erot = Quaternion.FromToRotation(worldV, ev2); 247 | var eoutputRot = math.mul(erot, p.worldRotation); 248 | p0.worldRotation = eoutputRot; 249 | } 250 | 251 | p.worldPosition = p.tmpWorldPosition; 252 | 253 | ParticleInfo[pIdx] = p; 254 | ParticleInfo[p0Idx] = p0; 255 | } 256 | } 257 | } 258 | } 259 | 260 | [BurstCompile] 261 | struct FinalJob : IJobParallelForTransform 262 | { 263 | [ReadOnly] 264 | public NativeArray ParticleInfo; 265 | 266 | public void Execute(int index, TransformAccess transform) 267 | { 268 | transform.rotation = ParticleInfo[index].worldRotation; 269 | transform.position = ParticleInfo[index].worldPosition; 270 | } 271 | } 272 | 273 | 274 | private List m_dynamicBoneList; 275 | private NativeList m_particleInfo; 276 | private NativeList m_headInfo; 277 | 278 | 279 | private TransformAccessArray m_headRootTransform; 280 | private TransformAccessArray m_particleTransformArr; 281 | private int m_DbDataLen = 0; 282 | private JobHandle m_lastJobHandle; 283 | 284 | 285 | private void Awake() 286 | { 287 | if (!m_instance) 288 | { 289 | m_instance = this; 290 | m_instance.Init(); 291 | } 292 | } 293 | 294 | public void Init() 295 | { 296 | m_dynamicBoneList = new List(); 297 | m_particleInfo = new NativeList(Allocator.Persistent); 298 | m_headInfo = new NativeList(Allocator.Persistent); 299 | m_particleTransformArr = new TransformAccessArray(200 * DynamicBoneBeta.MAX_TRANSFORM_LIMIT, 64); 300 | m_headRootTransform = new TransformAccessArray(200, 64); 301 | } 302 | 303 | private Queue m_loadingQueue = new Queue(); 304 | private Queue m_removeQueue = new Queue(); 305 | 306 | void UpdateQueue() 307 | { 308 | while(m_loadingQueue.Count > 0) 309 | { 310 | DynamicBoneBeta target = m_loadingQueue.Dequeue(); 311 | 312 | int idx = m_dynamicBoneList.IndexOf(target); 313 | if (idx == -1) 314 | { 315 | m_dynamicBoneList.Add(target); 316 | 317 | 318 | 319 | target.m_headInfo.m_jobDataOffset = m_particleInfo.Length; 320 | 321 | int headIndex = m_headInfo.Length; 322 | target.m_headInfo.ResetHeadIndex(headIndex); 323 | 324 | m_headInfo.Add(target.m_headInfo); 325 | m_particleInfo.AddRange(target.m_Particles); 326 | m_headRootTransform.Add(target.m_rootParentTransform); 327 | 328 | for (int i = 0; i < DynamicBoneBeta.MAX_TRANSFORM_LIMIT; i++) 329 | { 330 | m_particleTransformArr.Add(target.m_particleTransformArr[i]); 331 | } 332 | 333 | m_DbDataLen++; 334 | } 335 | } 336 | 337 | while(m_removeQueue.Count > 0) 338 | { 339 | DynamicBoneBeta target = m_removeQueue.Dequeue(); 340 | 341 | int idx = m_dynamicBoneList.IndexOf(target); 342 | if (idx != -1) 343 | { 344 | m_dynamicBoneList.RemoveAt(idx); 345 | 346 | int curHeadIndex = target.m_headInfo.GetHeadIndex(); 347 | 348 | //是否是队列中末尾对象 349 | bool isEndTarget = curHeadIndex == m_headInfo.Length - 1; 350 | if (isEndTarget) 351 | { 352 | m_headInfo.RemoveAtSwapBack(curHeadIndex); 353 | m_headRootTransform.RemoveAtSwapBack(curHeadIndex); 354 | 355 | for (int i = DynamicBoneBeta.MAX_TRANSFORM_LIMIT - 1; i >= 0; i--) 356 | { 357 | int dataOffset = curHeadIndex * DynamicBoneBeta.MAX_TRANSFORM_LIMIT + i; 358 | m_particleInfo.RemoveAtSwapBack(dataOffset); 359 | m_particleTransformArr.RemoveAtSwapBack(dataOffset); 360 | } 361 | } 362 | else 363 | { 364 | //将最末列的HeadInfo 索引设置为当前将要移除的HeadInfo 索引 365 | DynamicBoneBeta lastTarget = m_dynamicBoneList[m_dynamicBoneList.Count - 1]; 366 | 367 | DynamicBoneBeta.HeadInfo lastHeadInfo = lastTarget.ResetHeadIndexAndDataOffset(curHeadIndex); 368 | 369 | m_headInfo.RemoveAtSwapBack(curHeadIndex); 370 | 371 | m_headInfo[curHeadIndex] = lastHeadInfo; 372 | 373 | m_headRootTransform.RemoveAtSwapBack(curHeadIndex); 374 | 375 | for (int i = DynamicBoneBeta.MAX_TRANSFORM_LIMIT - 1; i >= 0; i--) 376 | { 377 | int dataOffset = curHeadIndex * DynamicBoneBeta.MAX_TRANSFORM_LIMIT + i; 378 | m_particleInfo.RemoveAtSwapBack(dataOffset); 379 | m_particleTransformArr.RemoveAtSwapBack(dataOffset); 380 | } 381 | } 382 | 383 | m_DbDataLen--; 384 | } 385 | 386 | target.ClearJobData(); 387 | } 388 | } 389 | 390 | public void OnEnter(DynamicBoneBeta target, ref DynamicBoneBeta.HeadInfo headInfo, NativeArray particleInfo, Transform[] particleTransformList) 391 | { 392 | m_loadingQueue.Enqueue(target); 393 | } 394 | 395 | public void OnExit(DynamicBoneBeta target, ref DynamicBoneBeta.HeadInfo headInfo) 396 | { 397 | m_removeQueue.Enqueue(target); 398 | } 399 | 400 | private void Update() 401 | { 402 | if (m_DbDataLen == 0) 403 | { 404 | return; 405 | } 406 | } 407 | 408 | private void LateUpdate() 409 | { 410 | if (!m_lastJobHandle.IsCompleted) 411 | { 412 | return; 413 | } 414 | 415 | m_lastJobHandle.Complete(); 416 | 417 | UpdateQueue(); 418 | 419 | if (m_DbDataLen == 0) 420 | { 421 | return; 422 | } 423 | 424 | var dataArrLength = m_DbDataLen * DynamicBoneBeta.MAX_TRANSFORM_LIMIT; 425 | 426 | var rootJob = new RootPosApplyJob 427 | { 428 | ParticleHeadInfo = this.m_headInfo 429 | }; 430 | var rootHandle = rootJob.Schedule(m_headRootTransform); 431 | 432 | var prepareJob = new PrepareParticleJob 433 | { 434 | ParticleHeadInfo = this.m_headInfo, 435 | ParticleInfo = this.m_particleInfo, 436 | HeadCount = m_DbDataLen 437 | }; 438 | var prepareHandle = prepareJob.Schedule(rootHandle); 439 | 440 | var update1Job = new UpdateParticles1Job 441 | { 442 | ParticleHeadInfo = this.m_headInfo, 443 | ParticleInfo = this.m_particleInfo, 444 | HeadCount = m_DbDataLen 445 | }; 446 | var update1Handle = update1Job.Schedule(dataArrLength, DynamicBoneBeta.MAX_TRANSFORM_LIMIT, prepareHandle); 447 | 448 | var update2Job = new UpdateParticle2Job 449 | { 450 | ParticleHeadInfo = this.m_headInfo, 451 | ParticleInfo = this.m_particleInfo, 452 | HeadCount = m_DbDataLen 453 | }; 454 | var update2Handle = update2Job.Schedule(dataArrLength, DynamicBoneBeta.MAX_TRANSFORM_LIMIT, update1Handle); 455 | 456 | var appTransJob = new ApplyParticleToTransform 457 | { 458 | ParticleHeadInfo = this.m_headInfo, 459 | ParticleInfo = this.m_particleInfo, 460 | HeadCount = m_DbDataLen 461 | }; 462 | 463 | var appTransHandle = appTransJob.Schedule(dataArrLength, DynamicBoneBeta.MAX_TRANSFORM_LIMIT, update2Handle); 464 | var finalJob = new FinalJob 465 | { 466 | ParticleInfo = this.m_particleInfo, 467 | }; 468 | var finalHandle = finalJob.Schedule(this.m_particleTransformArr, appTransHandle); 469 | 470 | m_lastJobHandle = finalHandle; 471 | 472 | JobHandle.ScheduleBatchedJobs(); 473 | } 474 | 475 | private void OnDestroy() 476 | { 477 | if (this.m_particleTransformArr.isCreated) 478 | { 479 | this.m_particleTransformArr.Dispose(); 480 | } 481 | 482 | if (this.m_particleInfo.IsCreated) 483 | { 484 | this.m_particleInfo.Dispose(); 485 | } 486 | 487 | if (this.m_headInfo.IsCreated) 488 | { 489 | this.m_headInfo.Dispose(); 490 | } 491 | 492 | if (this.m_headRootTransform.isCreated) 493 | { 494 | this.m_headRootTransform.Dispose(); 495 | } 496 | } 497 | } 498 | -------------------------------------------------------------------------------- /Assets/DynamicBoneManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e3d4006ca38454479219ce9f449850c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Respawn.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @author 4 | * @copyright 5 | * @created 2020-02-13 14:46:20 6 | * @updated 2020-02-13 14:46:20 7 | * 8 | * @brief 9 | */ 10 | using System.Collections; 11 | using System.Collections.Generic; 12 | using Unity.Mathematics; 13 | using UnityEngine; 14 | 15 | public class Respawn : MonoBehaviour 16 | { 17 | public int Count; 18 | public int Cur; 19 | public float IntervalDis; 20 | public GameObject Target; 21 | public GameObject SecTarget; 22 | 23 | private GameObject SelectTarget; 24 | // Start is called before the first frame update 25 | void Start() 26 | { 27 | float3 dual = Vector3.zero; 28 | } 29 | 30 | IEnumerator CreateTarget() 31 | { 32 | int perLineCount = (int)Mathf.Sqrt(Count); 33 | 34 | for(int i = 0; i < Count; i++) 35 | { 36 | Cur++; 37 | 38 | float curX = i % perLineCount; 39 | float curZ = i / perLineCount; 40 | 41 | GameObject go = GameObject.Instantiate(SelectTarget); 42 | go.transform.parent = this.transform; 43 | go.transform.localPosition = new Vector3(curX * IntervalDis, 0, curZ * IntervalDis); 44 | go.SetActive(true); 45 | 46 | yield return new WaitForEndOfFrame(); 47 | } 48 | } 49 | 50 | private void OnGUI() 51 | { 52 | if(GUI.Button(new Rect(0,0,200,200), "SwitchFirst")) 53 | { 54 | SelectTarget = Target; 55 | StartCoroutine(CreateTarget()); 56 | } 57 | 58 | if (GUI.Button(new Rect(0, 250, 200, 200), "SwitchSec")) 59 | { 60 | SelectTarget = SecTarget; 61 | StartCoroutine(CreateTarget()); 62 | } 63 | } 64 | 65 | // Update is called once per frame 66 | void Update() 67 | { 68 | 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Assets/Respawn.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8cd7046475852c6408930e83d34eea88 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33bc673848d476b45abf6934083965a2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 170076734} 41 | m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 10 58 | m_Resolution: 2 59 | m_BakeResolution: 10 60 | m_AtlasSize: 512 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_Padding: 2 66 | m_LightmapParameters: {fileID: 0} 67 | m_LightmapsBakeMode: 1 68 | m_TextureCompression: 1 69 | m_FinalGather: 0 70 | m_FinalGatherFiltering: 1 71 | m_FinalGatherRayCount: 256 72 | m_ReflectionCompression: 2 73 | m_MixedBakeMode: 2 74 | m_BakeBackend: 1 75 | m_PVRSampling: 1 76 | m_PVRDirectSampleCount: 32 77 | m_PVRSampleCount: 256 78 | m_PVRBounces: 2 79 | m_PVRFilterTypeDirect: 0 80 | m_PVRFilterTypeIndirect: 0 81 | m_PVRFilterTypeAO: 0 82 | m_PVRFilteringMode: 1 83 | m_PVRCulling: 1 84 | m_PVRFilteringGaussRadiusDirect: 1 85 | m_PVRFilteringGaussRadiusIndirect: 5 86 | m_PVRFilteringGaussRadiusAO: 2 87 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 88 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 89 | m_PVRFilteringAtrousPositionSigmaAO: 1 90 | m_ShowResolutionOverlay: 1 91 | m_LightingDataAsset: {fileID: 0} 92 | m_UseShadowmask: 1 93 | --- !u!196 &4 94 | NavMeshSettings: 95 | serializedVersion: 2 96 | m_ObjectHideFlags: 0 97 | m_BuildSettings: 98 | serializedVersion: 2 99 | agentTypeID: 0 100 | agentRadius: 0.5 101 | agentHeight: 2 102 | agentSlope: 45 103 | agentClimb: 0.4 104 | ledgeDropHeight: 0 105 | maxJumpAcrossDistance: 0 106 | minRegionArea: 2 107 | manualCellSize: 0 108 | cellSize: 0.16666667 109 | manualTileSize: 0 110 | tileSize: 256 111 | accuratePlacement: 0 112 | debug: 113 | m_Flags: 0 114 | m_NavMeshData: {fileID: 0} 115 | --- !u!1 &170076733 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 170076735} 124 | - component: {fileID: 170076734} 125 | m_Layer: 0 126 | m_Name: Directional Light 127 | m_TagString: Untagged 128 | m_Icon: {fileID: 0} 129 | m_NavMeshLayer: 0 130 | m_StaticEditorFlags: 0 131 | m_IsActive: 1 132 | --- !u!108 &170076734 133 | Light: 134 | m_ObjectHideFlags: 0 135 | m_CorrespondingSourceObject: {fileID: 0} 136 | m_PrefabInstance: {fileID: 0} 137 | m_PrefabAsset: {fileID: 0} 138 | m_GameObject: {fileID: 170076733} 139 | m_Enabled: 1 140 | serializedVersion: 8 141 | m_Type: 1 142 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 143 | m_Intensity: 1 144 | m_Range: 10 145 | m_SpotAngle: 30 146 | m_CookieSize: 10 147 | m_Shadows: 148 | m_Type: 0 149 | m_Resolution: -1 150 | m_CustomResolution: -1 151 | m_Strength: 1 152 | m_Bias: 0.05 153 | m_NormalBias: 0.4 154 | m_NearPlane: 0.2 155 | m_Cookie: {fileID: 0} 156 | m_DrawHalo: 0 157 | m_Flare: {fileID: 0} 158 | m_RenderMode: 0 159 | m_CullingMask: 160 | serializedVersion: 2 161 | m_Bits: 4294967295 162 | m_Lightmapping: 1 163 | m_LightShadowCasterMode: 0 164 | m_AreaSize: {x: 1, y: 1} 165 | m_BounceIntensity: 1 166 | m_ColorTemperature: 6570 167 | m_UseColorTemperature: 0 168 | m_ShadowRadius: 0 169 | m_ShadowAngle: 0 170 | --- !u!4 &170076735 171 | Transform: 172 | m_ObjectHideFlags: 0 173 | m_CorrespondingSourceObject: {fileID: 0} 174 | m_PrefabInstance: {fileID: 0} 175 | m_PrefabAsset: {fileID: 0} 176 | m_GameObject: {fileID: 170076733} 177 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 178 | m_LocalPosition: {x: 0, y: 3, z: 0} 179 | m_LocalScale: {x: 1, y: 1, z: 1} 180 | m_Children: [] 181 | m_Father: {fileID: 0} 182 | m_RootOrder: 1 183 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 184 | --- !u!1001 &458313893 185 | PrefabInstance: 186 | m_ObjectHideFlags: 0 187 | serializedVersion: 2 188 | m_Modification: 189 | m_TransformParent: {fileID: 0} 190 | m_Modifications: 191 | - target: {fileID: 2216316980897813484, guid: 171bb7ed26205a64a96c070befe0763e, 192 | type: 3} 193 | propertyPath: m_Name 194 | value: Player 195 | objectReference: {fileID: 0} 196 | - target: {fileID: 2216316980897813484, guid: 171bb7ed26205a64a96c070befe0763e, 197 | type: 3} 198 | propertyPath: m_IsActive 199 | value: 0 200 | objectReference: {fileID: 0} 201 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 202 | type: 3} 203 | propertyPath: m_LocalPosition.x 204 | value: 0 205 | objectReference: {fileID: 0} 206 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 207 | type: 3} 208 | propertyPath: m_LocalPosition.y 209 | value: 0 210 | objectReference: {fileID: 0} 211 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 212 | type: 3} 213 | propertyPath: m_LocalPosition.z 214 | value: 0 215 | objectReference: {fileID: 0} 216 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 217 | type: 3} 218 | propertyPath: m_LocalRotation.x 219 | value: 0 220 | objectReference: {fileID: 0} 221 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 222 | type: 3} 223 | propertyPath: m_LocalRotation.y 224 | value: 0 225 | objectReference: {fileID: 0} 226 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 227 | type: 3} 228 | propertyPath: m_LocalRotation.z 229 | value: 0 230 | objectReference: {fileID: 0} 231 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 232 | type: 3} 233 | propertyPath: m_LocalRotation.w 234 | value: 1 235 | objectReference: {fileID: 0} 236 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 237 | type: 3} 238 | propertyPath: m_RootOrder 239 | value: 3 240 | objectReference: {fileID: 0} 241 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 242 | type: 3} 243 | propertyPath: m_LocalEulerAnglesHint.x 244 | value: 0 245 | objectReference: {fileID: 0} 246 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 247 | type: 3} 248 | propertyPath: m_LocalEulerAnglesHint.y 249 | value: 0 250 | objectReference: {fileID: 0} 251 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 252 | type: 3} 253 | propertyPath: m_LocalEulerAnglesHint.z 254 | value: 0 255 | objectReference: {fileID: 0} 256 | - target: {fileID: 2216316980897813481, guid: 171bb7ed26205a64a96c070befe0763e, 257 | type: 3} 258 | propertyPath: m_Enabled 259 | value: 0 260 | objectReference: {fileID: 0} 261 | - target: {fileID: 2216316980897813480, guid: 171bb7ed26205a64a96c070befe0763e, 262 | type: 3} 263 | propertyPath: m_Enabled 264 | value: 0 265 | objectReference: {fileID: 0} 266 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 267 | type: 3} 268 | propertyPath: m_Enabled 269 | value: 0 270 | objectReference: {fileID: 0} 271 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 272 | type: 3} 273 | propertyPath: m_Root 274 | value: 275 | objectReference: {fileID: 971160488} 276 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 277 | type: 3} 278 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[0].time 279 | value: 0 280 | objectReference: {fileID: 0} 281 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 282 | type: 3} 283 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[0].value 284 | value: 1 285 | objectReference: {fileID: 0} 286 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 287 | type: 3} 288 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[0].inSlope 289 | value: 0 290 | objectReference: {fileID: 0} 291 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 292 | type: 3} 293 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[0].outSlope 294 | value: 0 295 | objectReference: {fileID: 0} 296 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 297 | type: 3} 298 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[0].inWeight 299 | value: 0 300 | objectReference: {fileID: 0} 301 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 302 | type: 3} 303 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[0].outWeight 304 | value: 0 305 | objectReference: {fileID: 0} 306 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 307 | type: 3} 308 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[1].time 309 | value: 1 310 | objectReference: {fileID: 0} 311 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 312 | type: 3} 313 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[1].value 314 | value: 1 315 | objectReference: {fileID: 0} 316 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 317 | type: 3} 318 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[1].inSlope 319 | value: 0 320 | objectReference: {fileID: 0} 321 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 322 | type: 3} 323 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[1].outSlope 324 | value: 0 325 | objectReference: {fileID: 0} 326 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 327 | type: 3} 328 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[1].inWeight 329 | value: 0 330 | objectReference: {fileID: 0} 331 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 332 | type: 3} 333 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[1].outWeight 334 | value: 0 335 | objectReference: {fileID: 0} 336 | m_RemovedComponents: 337 | - {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, type: 3} 338 | - {fileID: 2216316980897813480, guid: 171bb7ed26205a64a96c070befe0763e, type: 3} 339 | - {fileID: 2216316980897813481, guid: 171bb7ed26205a64a96c070befe0763e, type: 3} 340 | m_SourcePrefab: {fileID: 100100000, guid: 171bb7ed26205a64a96c070befe0763e, type: 3} 341 | --- !u!1 &515580578 stripped 342 | GameObject: 343 | m_CorrespondingSourceObject: {fileID: 2216316980897813484, guid: 171bb7ed26205a64a96c070befe0763e, 344 | type: 3} 345 | m_PrefabInstance: {fileID: 1997346125} 346 | m_PrefabAsset: {fileID: 0} 347 | --- !u!1 &534669902 348 | GameObject: 349 | m_ObjectHideFlags: 0 350 | m_CorrespondingSourceObject: {fileID: 0} 351 | m_PrefabInstance: {fileID: 0} 352 | m_PrefabAsset: {fileID: 0} 353 | serializedVersion: 6 354 | m_Component: 355 | - component: {fileID: 534669905} 356 | - component: {fileID: 534669904} 357 | - component: {fileID: 534669903} 358 | m_Layer: 0 359 | m_Name: Main Camera 360 | m_TagString: MainCamera 361 | m_Icon: {fileID: 0} 362 | m_NavMeshLayer: 0 363 | m_StaticEditorFlags: 0 364 | m_IsActive: 1 365 | --- !u!81 &534669903 366 | AudioListener: 367 | m_ObjectHideFlags: 0 368 | m_CorrespondingSourceObject: {fileID: 0} 369 | m_PrefabInstance: {fileID: 0} 370 | m_PrefabAsset: {fileID: 0} 371 | m_GameObject: {fileID: 534669902} 372 | m_Enabled: 1 373 | --- !u!20 &534669904 374 | Camera: 375 | m_ObjectHideFlags: 0 376 | m_CorrespondingSourceObject: {fileID: 0} 377 | m_PrefabInstance: {fileID: 0} 378 | m_PrefabAsset: {fileID: 0} 379 | m_GameObject: {fileID: 534669902} 380 | m_Enabled: 1 381 | serializedVersion: 2 382 | m_ClearFlags: 1 383 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 384 | m_projectionMatrixMode: 1 385 | m_SensorSize: {x: 36, y: 24} 386 | m_LensShift: {x: 0, y: 0} 387 | m_GateFitMode: 2 388 | m_FocalLength: 50 389 | m_NormalizedViewPortRect: 390 | serializedVersion: 2 391 | x: 0 392 | y: 0 393 | width: 1 394 | height: 1 395 | near clip plane: 0.3 396 | far clip plane: 1000 397 | field of view: 60 398 | orthographic: 0 399 | orthographic size: 5 400 | m_Depth: -1 401 | m_CullingMask: 402 | serializedVersion: 2 403 | m_Bits: 4294967295 404 | m_RenderingPath: -1 405 | m_TargetTexture: {fileID: 0} 406 | m_TargetDisplay: 0 407 | m_TargetEye: 3 408 | m_HDR: 1 409 | m_AllowMSAA: 1 410 | m_AllowDynamicResolution: 0 411 | m_ForceIntoRT: 0 412 | m_OcclusionCulling: 1 413 | m_StereoConvergence: 10 414 | m_StereoSeparation: 0.022 415 | --- !u!4 &534669905 416 | Transform: 417 | m_ObjectHideFlags: 0 418 | m_CorrespondingSourceObject: {fileID: 0} 419 | m_PrefabInstance: {fileID: 0} 420 | m_PrefabAsset: {fileID: 0} 421 | m_GameObject: {fileID: 534669902} 422 | m_LocalRotation: {x: -0.10013114, y: 0.89560395, z: -0.25686562, w: -0.3491236} 423 | m_LocalPosition: {x: 16.352066, y: 6.795481, z: 16.858017} 424 | m_LocalScale: {x: 1, y: 1, z: 1} 425 | m_Children: [] 426 | m_Father: {fileID: 0} 427 | m_RootOrder: 0 428 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 429 | --- !u!4 &971160488 stripped 430 | Transform: 431 | m_CorrespondingSourceObject: {fileID: 2216316981729166297, guid: 171bb7ed26205a64a96c070befe0763e, 432 | type: 3} 433 | m_PrefabInstance: {fileID: 458313893} 434 | m_PrefabAsset: {fileID: 0} 435 | --- !u!1 &1271800202 stripped 436 | GameObject: 437 | m_CorrespondingSourceObject: {fileID: 2216316980897813484, guid: 171bb7ed26205a64a96c070befe0763e, 438 | type: 3} 439 | m_PrefabInstance: {fileID: 458313893} 440 | m_PrefabAsset: {fileID: 0} 441 | --- !u!114 &1271800203 442 | MonoBehaviour: 443 | m_ObjectHideFlags: 0 444 | m_CorrespondingSourceObject: {fileID: 0} 445 | m_PrefabInstance: {fileID: 0} 446 | m_PrefabAsset: {fileID: 0} 447 | m_GameObject: {fileID: 1271800202} 448 | m_Enabled: 1 449 | m_EditorHideFlags: 0 450 | m_Script: {fileID: 11500000, guid: 42be98af2f222d44d953caa65c5dd995, type: 3} 451 | m_Name: 452 | m_EditorClassIdentifier: 453 | outputBySIMD: 0 454 | m_Root: {fileID: 971160488} 455 | m_UpdateRate: 60 456 | m_UpdateMode: 0 457 | m_Damping: 0.2 458 | m_DampingDistrib: 459 | serializedVersion: 2 460 | m_Curve: [] 461 | m_PreInfinity: 2 462 | m_PostInfinity: 2 463 | m_RotationOrder: 4 464 | m_Elasticity: 0.05 465 | m_ElasticityDistrib: 466 | serializedVersion: 2 467 | m_Curve: [] 468 | m_PreInfinity: 2 469 | m_PostInfinity: 2 470 | m_RotationOrder: 4 471 | m_Stiffness: 0.7 472 | m_StiffnessDistrib: 473 | serializedVersion: 2 474 | m_Curve: [] 475 | m_PreInfinity: 2 476 | m_PostInfinity: 2 477 | m_RotationOrder: 4 478 | m_Inert: 0.5 479 | m_InertDistrib: 480 | serializedVersion: 2 481 | m_Curve: [] 482 | m_PreInfinity: 2 483 | m_PostInfinity: 2 484 | m_RotationOrder: 4 485 | m_Friction: 0 486 | m_FrictionDistrib: 487 | serializedVersion: 2 488 | m_Curve: [] 489 | m_PreInfinity: 2 490 | m_PostInfinity: 2 491 | m_RotationOrder: 4 492 | m_Radius: 0.15 493 | m_RadiusDistrib: 494 | serializedVersion: 2 495 | m_Curve: [] 496 | m_PreInfinity: 2 497 | m_PostInfinity: 2 498 | m_RotationOrder: 4 499 | m_EndLength: 0 500 | m_EndOffset: {x: 0, y: 0, z: 0} 501 | m_Gravity: {x: 0, y: -0.002, z: 0} 502 | m_Force: {x: 0, y: 0, z: 0} 503 | m_Colliders: [] 504 | m_Exclusions: [] 505 | m_FreezeAxis: 0 506 | m_DistantDisable: 0 507 | m_ReferenceObject: {fileID: 0} 508 | m_DistanceToObject: 20 509 | m_LocalGravity: {x: 0, y: 0, z: 0} 510 | m_ObjectMove: {x: 0, y: 0, z: 0} 511 | m_ObjectPrevPosition: {x: 0, y: 0, z: 0} 512 | m_BoneTotalLength: 0 513 | m_ObjectScale: 1 514 | m_Time: 0 515 | m_Weight: 1 516 | m_DistantDisabled: 0 517 | m_particleTransformArr: [] 518 | m_rootParentTransform: {fileID: 0} 519 | --- !u!114 &1271800208 520 | MonoBehaviour: 521 | m_ObjectHideFlags: 0 522 | m_CorrespondingSourceObject: {fileID: 0} 523 | m_PrefabInstance: {fileID: 0} 524 | m_PrefabAsset: {fileID: 0} 525 | m_GameObject: {fileID: 1271800202} 526 | m_Enabled: 0 527 | m_EditorHideFlags: 0 528 | m_Script: {fileID: 11500000, guid: 8a0cbe269dbbf1342b9ca119cd85a06d, type: 3} 529 | m_Name: 530 | m_EditorClassIdentifier: 531 | m_Root: {fileID: 971160488} 532 | m_UpdateRate: 60 533 | m_UpdateMode: 0 534 | m_Damping: 0.2 535 | m_DampingDistrib: 536 | serializedVersion: 2 537 | m_Curve: [] 538 | m_PreInfinity: 2 539 | m_PostInfinity: 2 540 | m_RotationOrder: 4 541 | m_Elasticity: 0.05 542 | m_ElasticityDistrib: 543 | serializedVersion: 2 544 | m_Curve: [] 545 | m_PreInfinity: 2 546 | m_PostInfinity: 2 547 | m_RotationOrder: 4 548 | m_Stiffness: 0.7 549 | m_StiffnessDistrib: 550 | serializedVersion: 2 551 | m_Curve: [] 552 | m_PreInfinity: 2 553 | m_PostInfinity: 2 554 | m_RotationOrder: 4 555 | m_Inert: 0.5 556 | m_InertDistrib: 557 | serializedVersion: 2 558 | m_Curve: [] 559 | m_PreInfinity: 2 560 | m_PostInfinity: 2 561 | m_RotationOrder: 4 562 | m_Friction: 0 563 | m_FrictionDistrib: 564 | serializedVersion: 2 565 | m_Curve: [] 566 | m_PreInfinity: 2 567 | m_PostInfinity: 2 568 | m_RotationOrder: 4 569 | m_Radius: 0.15 570 | m_RadiusDistrib: 571 | serializedVersion: 2 572 | m_Curve: [] 573 | m_PreInfinity: 2 574 | m_PostInfinity: 2 575 | m_RotationOrder: 4 576 | m_EndLength: 0 577 | m_EndOffset: {x: 0, y: 0, z: 0} 578 | m_Gravity: {x: 0, y: -0.002, z: 0} 579 | m_Force: {x: 0, y: 0, z: 0} 580 | m_Colliders: [] 581 | m_Exclusions: [] 582 | m_FreezeAxis: 0 583 | m_DistantDisable: 0 584 | m_ReferenceObject: {fileID: 0} 585 | m_DistanceToObject: 20 586 | m_LocalGravity: {x: 0, y: 0, z: 0} 587 | m_ObjectMove: {x: 0, y: 0, z: 0} 588 | m_ObjectPrevPosition: {x: 0, y: 0, z: 0} 589 | m_BoneTotalLength: 0 590 | m_ObjectScale: 1 591 | m_Time: 0 592 | m_Weight: 1 593 | m_DistantDisabled: 0 594 | m_particleTransformArr: [] 595 | --- !u!4 &1598382375 stripped 596 | Transform: 597 | m_CorrespondingSourceObject: {fileID: 2216316981729166297, guid: 171bb7ed26205a64a96c070befe0763e, 598 | type: 3} 599 | m_PrefabInstance: {fileID: 1997346125} 600 | m_PrefabAsset: {fileID: 0} 601 | --- !u!1 &1748464153 602 | GameObject: 603 | m_ObjectHideFlags: 0 604 | m_CorrespondingSourceObject: {fileID: 0} 605 | m_PrefabInstance: {fileID: 0} 606 | m_PrefabAsset: {fileID: 0} 607 | serializedVersion: 6 608 | m_Component: 609 | - component: {fileID: 1748464155} 610 | - component: {fileID: 1748464154} 611 | m_Layer: 0 612 | m_Name: Mgr 613 | m_TagString: Untagged 614 | m_Icon: {fileID: 0} 615 | m_NavMeshLayer: 0 616 | m_StaticEditorFlags: 0 617 | m_IsActive: 1 618 | --- !u!114 &1748464154 619 | MonoBehaviour: 620 | m_ObjectHideFlags: 0 621 | m_CorrespondingSourceObject: {fileID: 0} 622 | m_PrefabInstance: {fileID: 0} 623 | m_PrefabAsset: {fileID: 0} 624 | m_GameObject: {fileID: 1748464153} 625 | m_Enabled: 1 626 | m_EditorHideFlags: 0 627 | m_Script: {fileID: 11500000, guid: 8e3d4006ca38454479219ce9f449850c, type: 3} 628 | m_Name: 629 | m_EditorClassIdentifier: 630 | --- !u!4 &1748464155 631 | Transform: 632 | m_ObjectHideFlags: 0 633 | m_CorrespondingSourceObject: {fileID: 0} 634 | m_PrefabInstance: {fileID: 0} 635 | m_PrefabAsset: {fileID: 0} 636 | m_GameObject: {fileID: 1748464153} 637 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 638 | m_LocalPosition: {x: 3.5135756, y: -5.0610337, z: 2.8931313} 639 | m_LocalScale: {x: 1, y: 1, z: 1} 640 | m_Children: [] 641 | m_Father: {fileID: 0} 642 | m_RootOrder: 5 643 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 644 | --- !u!1 &1959503661 645 | GameObject: 646 | m_ObjectHideFlags: 0 647 | m_CorrespondingSourceObject: {fileID: 0} 648 | m_PrefabInstance: {fileID: 0} 649 | m_PrefabAsset: {fileID: 0} 650 | serializedVersion: 6 651 | m_Component: 652 | - component: {fileID: 1959503662} 653 | - component: {fileID: 1959503663} 654 | m_Layer: 0 655 | m_Name: Respawn 656 | m_TagString: Untagged 657 | m_Icon: {fileID: 0} 658 | m_NavMeshLayer: 0 659 | m_StaticEditorFlags: 0 660 | m_IsActive: 1 661 | --- !u!4 &1959503662 662 | Transform: 663 | m_ObjectHideFlags: 0 664 | m_CorrespondingSourceObject: {fileID: 0} 665 | m_PrefabInstance: {fileID: 0} 666 | m_PrefabAsset: {fileID: 0} 667 | m_GameObject: {fileID: 1959503661} 668 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 669 | m_LocalPosition: {x: 0, y: 0, z: 0} 670 | m_LocalScale: {x: 1, y: 1, z: 1} 671 | m_Children: [] 672 | m_Father: {fileID: 0} 673 | m_RootOrder: 2 674 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 675 | --- !u!114 &1959503663 676 | MonoBehaviour: 677 | m_ObjectHideFlags: 0 678 | m_CorrespondingSourceObject: {fileID: 0} 679 | m_PrefabInstance: {fileID: 0} 680 | m_PrefabAsset: {fileID: 0} 681 | m_GameObject: {fileID: 1959503661} 682 | m_Enabled: 1 683 | m_EditorHideFlags: 0 684 | m_Script: {fileID: 11500000, guid: 8cd7046475852c6408930e83d34eea88, type: 3} 685 | m_Name: 686 | m_EditorClassIdentifier: 687 | Count: 2 688 | Cur: 0 689 | IntervalDis: 1 690 | Target: {fileID: 1271800202} 691 | SecTarget: {fileID: 515580578} 692 | --- !u!1001 &1997346125 693 | PrefabInstance: 694 | m_ObjectHideFlags: 0 695 | serializedVersion: 2 696 | m_Modification: 697 | m_TransformParent: {fileID: 0} 698 | m_Modifications: 699 | - target: {fileID: 2216316980897813484, guid: 171bb7ed26205a64a96c070befe0763e, 700 | type: 3} 701 | propertyPath: m_Name 702 | value: PlayeOrigin 703 | objectReference: {fileID: 0} 704 | - target: {fileID: 2216316980897813484, guid: 171bb7ed26205a64a96c070befe0763e, 705 | type: 3} 706 | propertyPath: m_IsActive 707 | value: 0 708 | objectReference: {fileID: 0} 709 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 710 | type: 3} 711 | propertyPath: m_LocalPosition.x 712 | value: 1.131 713 | objectReference: {fileID: 0} 714 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 715 | type: 3} 716 | propertyPath: m_LocalPosition.y 717 | value: 0 718 | objectReference: {fileID: 0} 719 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 720 | type: 3} 721 | propertyPath: m_LocalPosition.z 722 | value: 0 723 | objectReference: {fileID: 0} 724 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 725 | type: 3} 726 | propertyPath: m_LocalRotation.x 727 | value: 0 728 | objectReference: {fileID: 0} 729 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 730 | type: 3} 731 | propertyPath: m_LocalRotation.y 732 | value: 0 733 | objectReference: {fileID: 0} 734 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 735 | type: 3} 736 | propertyPath: m_LocalRotation.z 737 | value: 0 738 | objectReference: {fileID: 0} 739 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 740 | type: 3} 741 | propertyPath: m_LocalRotation.w 742 | value: 1 743 | objectReference: {fileID: 0} 744 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 745 | type: 3} 746 | propertyPath: m_RootOrder 747 | value: 4 748 | objectReference: {fileID: 0} 749 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 750 | type: 3} 751 | propertyPath: m_LocalEulerAnglesHint.x 752 | value: 0 753 | objectReference: {fileID: 0} 754 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 755 | type: 3} 756 | propertyPath: m_LocalEulerAnglesHint.y 757 | value: 0 758 | objectReference: {fileID: 0} 759 | - target: {fileID: 2216316980897813487, guid: 171bb7ed26205a64a96c070befe0763e, 760 | type: 3} 761 | propertyPath: m_LocalEulerAnglesHint.z 762 | value: 0 763 | objectReference: {fileID: 0} 764 | - target: {fileID: 2216316980897813481, guid: 171bb7ed26205a64a96c070befe0763e, 765 | type: 3} 766 | propertyPath: m_Enabled 767 | value: 0 768 | objectReference: {fileID: 0} 769 | - target: {fileID: 2216316980897813480, guid: 171bb7ed26205a64a96c070befe0763e, 770 | type: 3} 771 | propertyPath: m_Enabled 772 | value: 0 773 | objectReference: {fileID: 0} 774 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 775 | type: 3} 776 | propertyPath: m_Enabled 777 | value: 1 778 | objectReference: {fileID: 0} 779 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 780 | type: 3} 781 | propertyPath: m_Root 782 | value: 783 | objectReference: {fileID: 1598382375} 784 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 785 | type: 3} 786 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[0].time 787 | value: 0 788 | objectReference: {fileID: 0} 789 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 790 | type: 3} 791 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[0].value 792 | value: 1 793 | objectReference: {fileID: 0} 794 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 795 | type: 3} 796 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[0].inSlope 797 | value: 0 798 | objectReference: {fileID: 0} 799 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 800 | type: 3} 801 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[0].outSlope 802 | value: 0 803 | objectReference: {fileID: 0} 804 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 805 | type: 3} 806 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[0].inWeight 807 | value: 0 808 | objectReference: {fileID: 0} 809 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 810 | type: 3} 811 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[0].outWeight 812 | value: 0 813 | objectReference: {fileID: 0} 814 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 815 | type: 3} 816 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[1].time 817 | value: 1 818 | objectReference: {fileID: 0} 819 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 820 | type: 3} 821 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[1].value 822 | value: 1 823 | objectReference: {fileID: 0} 824 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 825 | type: 3} 826 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[1].inSlope 827 | value: 0 828 | objectReference: {fileID: 0} 829 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 830 | type: 3} 831 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[1].outSlope 832 | value: 0 833 | objectReference: {fileID: 0} 834 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 835 | type: 3} 836 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[1].inWeight 837 | value: 0 838 | objectReference: {fileID: 0} 839 | - target: {fileID: 2216316980897813483, guid: 171bb7ed26205a64a96c070befe0763e, 840 | type: 3} 841 | propertyPath: m_RadiusDistrib.m_Curve.Array.data[1].outWeight 842 | value: 0 843 | objectReference: {fileID: 0} 844 | m_RemovedComponents: [] 845 | m_SourcePrefab: {fileID: 100100000, guid: 171bb7ed26205a64a96c070befe0763e, type: 3} 846 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01a8ad1741964084ab64ed94383971f3 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/smcs.rsp: -------------------------------------------------------------------------------- 1 | -unsafe -------------------------------------------------------------------------------- /Assets/smcs.rsp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f1670d4e0eb6a4479ae780ff0a4adf1 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "3.2.2", 5 | "com.unity.burst": "1.2.3", 6 | "com.unity.collab-proxy": "1.2.15", 7 | "com.unity.collections": "0.0.9-preview.12", 8 | "com.unity.jobs": "0.0.7-preview.6", 9 | "com.unity.mathematics": "1.1.0", 10 | "com.unity.package-manager-ui": "2.0.7", 11 | "com.unity.purchasing": "2.0.3", 12 | "com.unity.textmeshpro": "1.4.1", 13 | "com.unity.modules.ai": "1.0.0", 14 | "com.unity.modules.animation": "1.0.0", 15 | "com.unity.modules.assetbundle": "1.0.0", 16 | "com.unity.modules.audio": "1.0.0", 17 | "com.unity.modules.cloth": "1.0.0", 18 | "com.unity.modules.director": "1.0.0", 19 | "com.unity.modules.imageconversion": "1.0.0", 20 | "com.unity.modules.imgui": "1.0.0", 21 | "com.unity.modules.jsonserialize": "1.0.0", 22 | "com.unity.modules.particlesystem": "1.0.0", 23 | "com.unity.modules.physics": "1.0.0", 24 | "com.unity.modules.physics2d": "1.0.0", 25 | "com.unity.modules.screencapture": "1.0.0", 26 | "com.unity.modules.terrain": "1.0.0", 27 | "com.unity.modules.terrainphysics": "1.0.0", 28 | "com.unity.modules.tilemap": "1.0.0", 29 | "com.unity.modules.ui": "1.0.0", 30 | "com.unity.modules.uielements": "1.0.0", 31 | "com.unity.modules.umbra": "1.0.0", 32 | "com.unity.modules.unityanalytics": "1.0.0", 33 | "com.unity.modules.unitywebrequest": "1.0.0", 34 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 35 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 36 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 37 | "com.unity.modules.unitywebrequestwww": "1.0.0", 38 | "com.unity.modules.vehicles": "1.0.0", 39 | "com.unity.modules.video": "1.0.0", 40 | "com.unity.modules.vr": "1.0.0", 41 | "com.unity.modules.wind": "1.0.0", 42 | "com.unity.modules.xr": "1.0.0" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 8 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 39 | m_PreloadedShaders: [] 40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 41 | type: 0} 42 | m_CustomRenderPipeline: {fileID: 0} 43 | m_TransparencySortMode: 0 44 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 45 | m_DefaultRenderingPath: 1 46 | m_DefaultMobileRenderingPath: 1 47 | m_TierSettings: [] 48 | m_LightmapStripping: 0 49 | m_FogStripping: 0 50 | m_InstancingStripping: 0 51 | m_LightmapKeepPlain: 1 52 | m_LightmapKeepDirCombined: 1 53 | m_LightmapKeepDynamicPlain: 1 54 | m_LightmapKeepDynamicDirCombined: 1 55 | m_LightmapKeepShadowMask: 1 56 | m_LightmapKeepSubtractive: 1 57 | m_FogKeepLinear: 1 58 | m_FogKeepExp: 1 59 | m_FogKeepExp2: 1 60 | m_AlbedoSwatchInfos: [] 61 | m_LightsUseLinearIntensity: 0 62 | m_LightsUseColorTemperature: 0 63 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_ReuseCollisionCallbacks: 1 28 | m_AutoSyncTransforms: 0 29 | m_AlwaysShowColliders: 0 30 | m_ShowColliderSleep: 1 31 | m_ShowColliderContacts: 0 32 | m_ShowColliderAABB: 0 33 | m_ContactArrowScale: 0.2 34 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 35 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 36 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 37 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 38 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 39 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: 7 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1020 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1006 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 15 7 | productGUID: 166bf91410dd0564fa833ca21315b6e7 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: DynamicBoneJobSystem 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosAppInBackgroundBehavior: 0 56 | displayResolutionDialog: 1 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidStartInFullscreen: 1 67 | androidRenderOutsideSafeArea: 0 68 | androidBlitType: 0 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 1 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | resizableWindow: 0 83 | useMacAppStoreValidation: 0 84 | macAppStoreCategory: public.app-category.games 85 | gpuSkinning: 1 86 | graphicsJobs: 0 87 | xboxPIXTextureCapture: 0 88 | xboxEnableAvatar: 0 89 | xboxEnableKinect: 0 90 | xboxEnableKinectAutoTracking: 0 91 | xboxEnableFitness: 0 92 | visibleInBackground: 1 93 | allowFullscreenSwitch: 1 94 | graphicsJobMode: 0 95 | fullscreenMode: 1 96 | xboxSpeechDB: 0 97 | xboxEnableHeadOrientation: 0 98 | xboxEnableGuest: 0 99 | xboxEnablePIXSampling: 0 100 | metalFramebufferOnly: 0 101 | xboxOneResolution: 0 102 | xboxOneSResolution: 0 103 | xboxOneXResolution: 3 104 | xboxOneMonoLoggingLevel: 0 105 | xboxOneLoggingLevel: 1 106 | xboxOneDisableEsram: 0 107 | xboxOnePresentImmediateThreshold: 0 108 | switchQueueCommandMemory: 0 109 | switchQueueControlMemory: 16384 110 | switchQueueComputeMemory: 262144 111 | switchNVNShaderPoolsGranularity: 33554432 112 | switchNVNDefaultPoolsGranularity: 16777216 113 | switchNVNOtherPoolsGranularity: 16777216 114 | vulkanEnableSetSRGBWrite: 0 115 | m_SupportedAspectRatios: 116 | 4:3: 1 117 | 5:4: 1 118 | 16:10: 1 119 | 16:9: 1 120 | Others: 1 121 | bundleVersion: 0.1 122 | preloadedAssets: [] 123 | metroInputSource: 0 124 | wsaTransparentSwapchain: 0 125 | m_HolographicPauseOnTrackingLoss: 1 126 | xboxOneDisableKinectGpuReservation: 1 127 | xboxOneEnable7thCore: 1 128 | isWsaHolographicRemotingEnabled: 0 129 | vrSettings: 130 | cardboard: 131 | depthFormat: 0 132 | enableTransitionView: 0 133 | daydream: 134 | depthFormat: 0 135 | useSustainedPerformanceMode: 0 136 | enableVideoLayer: 0 137 | useProtectedVideoMemory: 0 138 | minimumSupportedHeadTracking: 0 139 | maximumSupportedHeadTracking: 1 140 | hololens: 141 | depthFormat: 1 142 | depthBufferSharingEnabled: 1 143 | oculus: 144 | sharedDepthBuffer: 1 145 | dashSupport: 1 146 | enable360StereoCapture: 0 147 | protectGraphicsMemory: 0 148 | enableFrameTimingStats: 0 149 | useHDRDisplay: 0 150 | m_ColorGamuts: 00000000 151 | targetPixelDensity: 30 152 | resolutionScalingMode: 0 153 | androidSupportedAspectRatio: 1 154 | androidMaxAspectRatio: 2.1 155 | applicationIdentifier: {} 156 | buildNumber: {} 157 | AndroidBundleVersionCode: 1 158 | AndroidMinSdkVersion: 16 159 | AndroidTargetSdkVersion: 0 160 | AndroidPreferredInstallLocation: 1 161 | aotOptions: 162 | stripEngineCode: 1 163 | iPhoneStrippingLevel: 0 164 | iPhoneScriptCallOptimization: 0 165 | ForceInternetPermission: 0 166 | ForceSDCardPermission: 0 167 | CreateWallpaper: 0 168 | APKExpansionFiles: 0 169 | keepLoadedShadersAlive: 0 170 | StripUnusedMeshComponents: 1 171 | VertexChannelCompressionMask: 4054 172 | iPhoneSdkVersion: 988 173 | iOSTargetOSVersionString: 9.0 174 | tvOSSdkVersion: 0 175 | tvOSRequireExtendedGameController: 0 176 | tvOSTargetOSVersionString: 9.0 177 | uIPrerenderedIcon: 0 178 | uIRequiresPersistentWiFi: 0 179 | uIRequiresFullScreen: 1 180 | uIStatusBarHidden: 1 181 | uIExitOnSuspend: 0 182 | uIStatusBarStyle: 0 183 | iPhoneSplashScreen: {fileID: 0} 184 | iPhoneHighResSplashScreen: {fileID: 0} 185 | iPhoneTallHighResSplashScreen: {fileID: 0} 186 | iPhone47inSplashScreen: {fileID: 0} 187 | iPhone55inPortraitSplashScreen: {fileID: 0} 188 | iPhone55inLandscapeSplashScreen: {fileID: 0} 189 | iPhone58inPortraitSplashScreen: {fileID: 0} 190 | iPhone58inLandscapeSplashScreen: {fileID: 0} 191 | iPadPortraitSplashScreen: {fileID: 0} 192 | iPadHighResPortraitSplashScreen: {fileID: 0} 193 | iPadLandscapeSplashScreen: {fileID: 0} 194 | iPadHighResLandscapeSplashScreen: {fileID: 0} 195 | appleTVSplashScreen: {fileID: 0} 196 | appleTVSplashScreen2x: {fileID: 0} 197 | tvOSSmallIconLayers: [] 198 | tvOSSmallIconLayers2x: [] 199 | tvOSLargeIconLayers: [] 200 | tvOSLargeIconLayers2x: [] 201 | tvOSTopShelfImageLayers: [] 202 | tvOSTopShelfImageLayers2x: [] 203 | tvOSTopShelfImageWideLayers: [] 204 | tvOSTopShelfImageWideLayers2x: [] 205 | iOSLaunchScreenType: 0 206 | iOSLaunchScreenPortrait: {fileID: 0} 207 | iOSLaunchScreenLandscape: {fileID: 0} 208 | iOSLaunchScreenBackgroundColor: 209 | serializedVersion: 2 210 | rgba: 0 211 | iOSLaunchScreenFillPct: 100 212 | iOSLaunchScreenSize: 100 213 | iOSLaunchScreenCustomXibPath: 214 | iOSLaunchScreeniPadType: 0 215 | iOSLaunchScreeniPadImage: {fileID: 0} 216 | iOSLaunchScreeniPadBackgroundColor: 217 | serializedVersion: 2 218 | rgba: 0 219 | iOSLaunchScreeniPadFillPct: 100 220 | iOSLaunchScreeniPadSize: 100 221 | iOSLaunchScreeniPadCustomXibPath: 222 | iOSUseLaunchScreenStoryboard: 0 223 | iOSLaunchScreenCustomStoryboardPath: 224 | iOSDeviceRequirements: [] 225 | iOSURLSchemes: [] 226 | iOSBackgroundModes: 0 227 | iOSMetalForceHardShadows: 0 228 | metalEditorSupport: 1 229 | metalAPIValidation: 1 230 | iOSRenderExtraFrameOnPause: 0 231 | appleDeveloperTeamID: 232 | iOSManualSigningProvisioningProfileID: 233 | tvOSManualSigningProvisioningProfileID: 234 | iOSManualSigningProvisioningProfileType: 0 235 | tvOSManualSigningProvisioningProfileType: 0 236 | appleEnableAutomaticSigning: 0 237 | iOSRequireARKit: 0 238 | iOSAutomaticallyDetectAndAddCapabilities: 1 239 | appleEnableProMotion: 0 240 | clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea 241 | templatePackageId: com.unity.template.3d@1.3.0 242 | templateDefaultScene: Assets/Scenes/SampleScene.unity 243 | AndroidTargetArchitectures: 5 244 | AndroidSplashScreenScale: 0 245 | androidSplashScreen: {fileID: 0} 246 | AndroidKeystoreName: 247 | AndroidKeyaliasName: 248 | AndroidBuildApkPerCpuArchitecture: 0 249 | AndroidTVCompatibility: 1 250 | AndroidIsGame: 1 251 | AndroidEnableTango: 0 252 | androidEnableBanner: 1 253 | androidUseLowAccuracyLocation: 0 254 | m_AndroidBanners: 255 | - width: 320 256 | height: 180 257 | banner: {fileID: 0} 258 | androidGamepadSupportLevel: 0 259 | resolutionDialogBanner: {fileID: 0} 260 | m_BuildTargetIcons: [] 261 | m_BuildTargetPlatformIcons: [] 262 | m_BuildTargetBatching: 263 | - m_BuildTarget: Standalone 264 | m_StaticBatching: 1 265 | m_DynamicBatching: 0 266 | - m_BuildTarget: tvOS 267 | m_StaticBatching: 1 268 | m_DynamicBatching: 0 269 | - m_BuildTarget: Android 270 | m_StaticBatching: 1 271 | m_DynamicBatching: 0 272 | - m_BuildTarget: iPhone 273 | m_StaticBatching: 1 274 | m_DynamicBatching: 0 275 | - m_BuildTarget: WebGL 276 | m_StaticBatching: 0 277 | m_DynamicBatching: 0 278 | m_BuildTargetGraphicsAPIs: 279 | - m_BuildTarget: AndroidPlayer 280 | m_APIs: 0b00000008000000 281 | m_Automatic: 1 282 | - m_BuildTarget: iOSSupport 283 | m_APIs: 10000000 284 | m_Automatic: 1 285 | - m_BuildTarget: AppleTVSupport 286 | m_APIs: 10000000 287 | m_Automatic: 0 288 | - m_BuildTarget: WebGLSupport 289 | m_APIs: 0b000000 290 | m_Automatic: 1 291 | m_BuildTargetVRSettings: 292 | - m_BuildTarget: Standalone 293 | m_Enabled: 0 294 | m_Devices: 295 | - Oculus 296 | - OpenVR 297 | m_BuildTargetEnableVuforiaSettings: [] 298 | openGLRequireES31: 0 299 | openGLRequireES31AEP: 0 300 | m_TemplateCustomTags: {} 301 | mobileMTRendering: 302 | Android: 1 303 | iPhone: 1 304 | tvOS: 1 305 | m_BuildTargetGroupLightmapEncodingQuality: [] 306 | m_BuildTargetGroupLightmapSettings: [] 307 | playModeTestRunnerEnabled: 0 308 | runPlayModeTestAsEditModeTest: 0 309 | actionOnDotNetUnhandledException: 1 310 | enableInternalProfiler: 0 311 | logObjCUncaughtExceptions: 1 312 | enableCrashReportAPI: 0 313 | cameraUsageDescription: 314 | locationUsageDescription: 315 | microphoneUsageDescription: 316 | switchNetLibKey: 317 | switchSocketMemoryPoolSize: 6144 318 | switchSocketAllocatorPoolSize: 128 319 | switchSocketConcurrencyLimit: 14 320 | switchScreenResolutionBehavior: 2 321 | switchUseCPUProfiler: 0 322 | switchApplicationID: 0x01004b9000490000 323 | switchNSODependencies: 324 | switchTitleNames_0: 325 | switchTitleNames_1: 326 | switchTitleNames_2: 327 | switchTitleNames_3: 328 | switchTitleNames_4: 329 | switchTitleNames_5: 330 | switchTitleNames_6: 331 | switchTitleNames_7: 332 | switchTitleNames_8: 333 | switchTitleNames_9: 334 | switchTitleNames_10: 335 | switchTitleNames_11: 336 | switchTitleNames_12: 337 | switchTitleNames_13: 338 | switchTitleNames_14: 339 | switchPublisherNames_0: 340 | switchPublisherNames_1: 341 | switchPublisherNames_2: 342 | switchPublisherNames_3: 343 | switchPublisherNames_4: 344 | switchPublisherNames_5: 345 | switchPublisherNames_6: 346 | switchPublisherNames_7: 347 | switchPublisherNames_8: 348 | switchPublisherNames_9: 349 | switchPublisherNames_10: 350 | switchPublisherNames_11: 351 | switchPublisherNames_12: 352 | switchPublisherNames_13: 353 | switchPublisherNames_14: 354 | switchIcons_0: {fileID: 0} 355 | switchIcons_1: {fileID: 0} 356 | switchIcons_2: {fileID: 0} 357 | switchIcons_3: {fileID: 0} 358 | switchIcons_4: {fileID: 0} 359 | switchIcons_5: {fileID: 0} 360 | switchIcons_6: {fileID: 0} 361 | switchIcons_7: {fileID: 0} 362 | switchIcons_8: {fileID: 0} 363 | switchIcons_9: {fileID: 0} 364 | switchIcons_10: {fileID: 0} 365 | switchIcons_11: {fileID: 0} 366 | switchIcons_12: {fileID: 0} 367 | switchIcons_13: {fileID: 0} 368 | switchIcons_14: {fileID: 0} 369 | switchSmallIcons_0: {fileID: 0} 370 | switchSmallIcons_1: {fileID: 0} 371 | switchSmallIcons_2: {fileID: 0} 372 | switchSmallIcons_3: {fileID: 0} 373 | switchSmallIcons_4: {fileID: 0} 374 | switchSmallIcons_5: {fileID: 0} 375 | switchSmallIcons_6: {fileID: 0} 376 | switchSmallIcons_7: {fileID: 0} 377 | switchSmallIcons_8: {fileID: 0} 378 | switchSmallIcons_9: {fileID: 0} 379 | switchSmallIcons_10: {fileID: 0} 380 | switchSmallIcons_11: {fileID: 0} 381 | switchSmallIcons_12: {fileID: 0} 382 | switchSmallIcons_13: {fileID: 0} 383 | switchSmallIcons_14: {fileID: 0} 384 | switchManualHTML: 385 | switchAccessibleURLs: 386 | switchLegalInformation: 387 | switchMainThreadStackSize: 1048576 388 | switchPresenceGroupId: 389 | switchLogoHandling: 0 390 | switchReleaseVersion: 0 391 | switchDisplayVersion: 1.0.0 392 | switchStartupUserAccount: 0 393 | switchTouchScreenUsage: 0 394 | switchSupportedLanguagesMask: 0 395 | switchLogoType: 0 396 | switchApplicationErrorCodeCategory: 397 | switchUserAccountSaveDataSize: 0 398 | switchUserAccountSaveDataJournalSize: 0 399 | switchApplicationAttribute: 0 400 | switchCardSpecSize: -1 401 | switchCardSpecClock: -1 402 | switchRatingsMask: 0 403 | switchRatingsInt_0: 0 404 | switchRatingsInt_1: 0 405 | switchRatingsInt_2: 0 406 | switchRatingsInt_3: 0 407 | switchRatingsInt_4: 0 408 | switchRatingsInt_5: 0 409 | switchRatingsInt_6: 0 410 | switchRatingsInt_7: 0 411 | switchRatingsInt_8: 0 412 | switchRatingsInt_9: 0 413 | switchRatingsInt_10: 0 414 | switchRatingsInt_11: 0 415 | switchLocalCommunicationIds_0: 416 | switchLocalCommunicationIds_1: 417 | switchLocalCommunicationIds_2: 418 | switchLocalCommunicationIds_3: 419 | switchLocalCommunicationIds_4: 420 | switchLocalCommunicationIds_5: 421 | switchLocalCommunicationIds_6: 422 | switchLocalCommunicationIds_7: 423 | switchParentalControl: 0 424 | switchAllowsScreenshot: 1 425 | switchAllowsVideoCapturing: 1 426 | switchAllowsRuntimeAddOnContentInstall: 0 427 | switchDataLossConfirmation: 0 428 | switchUserAccountLockEnabled: 0 429 | switchSystemResourceMemory: 16777216 430 | switchSupportedNpadStyles: 3 431 | switchNativeFsCacheSize: 32 432 | switchIsHoldTypeHorizontal: 0 433 | switchSupportedNpadCount: 8 434 | switchSocketConfigEnabled: 0 435 | switchTcpInitialSendBufferSize: 32 436 | switchTcpInitialReceiveBufferSize: 64 437 | switchTcpAutoSendBufferSizeMax: 256 438 | switchTcpAutoReceiveBufferSizeMax: 256 439 | switchUdpSendBufferSize: 9 440 | switchUdpReceiveBufferSize: 42 441 | switchSocketBufferEfficiency: 4 442 | switchSocketInitializeEnabled: 1 443 | switchNetworkInterfaceManagerInitializeEnabled: 1 444 | switchPlayerConnectionEnabled: 1 445 | ps4NPAgeRating: 12 446 | ps4NPTitleSecret: 447 | ps4NPTrophyPackPath: 448 | ps4ParentalLevel: 11 449 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 450 | ps4Category: 0 451 | ps4MasterVersion: 01.00 452 | ps4AppVersion: 01.00 453 | ps4AppType: 0 454 | ps4ParamSfxPath: 455 | ps4VideoOutPixelFormat: 0 456 | ps4VideoOutInitialWidth: 1920 457 | ps4VideoOutBaseModeInitialWidth: 1920 458 | ps4VideoOutReprojectionRate: 60 459 | ps4PronunciationXMLPath: 460 | ps4PronunciationSIGPath: 461 | ps4BackgroundImagePath: 462 | ps4StartupImagePath: 463 | ps4StartupImagesFolder: 464 | ps4IconImagesFolder: 465 | ps4SaveDataImagePath: 466 | ps4SdkOverride: 467 | ps4BGMPath: 468 | ps4ShareFilePath: 469 | ps4ShareOverlayImagePath: 470 | ps4PrivacyGuardImagePath: 471 | ps4NPtitleDatPath: 472 | ps4RemotePlayKeyAssignment: -1 473 | ps4RemotePlayKeyMappingDir: 474 | ps4PlayTogetherPlayerCount: 0 475 | ps4EnterButtonAssignment: 1 476 | ps4ApplicationParam1: 0 477 | ps4ApplicationParam2: 0 478 | ps4ApplicationParam3: 0 479 | ps4ApplicationParam4: 0 480 | ps4DownloadDataSize: 0 481 | ps4GarlicHeapSize: 2048 482 | ps4ProGarlicHeapSize: 2560 483 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 484 | ps4pnSessions: 1 485 | ps4pnPresence: 1 486 | ps4pnFriends: 1 487 | ps4pnGameCustomData: 1 488 | playerPrefsSupport: 0 489 | enableApplicationExit: 0 490 | resetTempFolder: 1 491 | restrictedAudioUsageRights: 0 492 | ps4UseResolutionFallback: 0 493 | ps4ReprojectionSupport: 0 494 | ps4UseAudio3dBackend: 0 495 | ps4SocialScreenEnabled: 0 496 | ps4ScriptOptimizationLevel: 0 497 | ps4Audio3dVirtualSpeakerCount: 14 498 | ps4attribCpuUsage: 0 499 | ps4PatchPkgPath: 500 | ps4PatchLatestPkgPath: 501 | ps4PatchChangeinfoPath: 502 | ps4PatchDayOne: 0 503 | ps4attribUserManagement: 0 504 | ps4attribMoveSupport: 0 505 | ps4attrib3DSupport: 0 506 | ps4attribShareSupport: 0 507 | ps4attribExclusiveVR: 0 508 | ps4disableAutoHideSplash: 0 509 | ps4videoRecordingFeaturesUsed: 0 510 | ps4contentSearchFeaturesUsed: 0 511 | ps4attribEyeToEyeDistanceSettingVR: 0 512 | ps4IncludedModules: [] 513 | monoEnv: 514 | splashScreenBackgroundSourceLandscape: {fileID: 0} 515 | splashScreenBackgroundSourcePortrait: {fileID: 0} 516 | spritePackerPolicy: 517 | webGLMemorySize: 256 518 | webGLExceptionSupport: 1 519 | webGLNameFilesAsHashes: 0 520 | webGLDataCaching: 1 521 | webGLDebugSymbols: 0 522 | webGLEmscriptenArgs: 523 | webGLModulesDirectory: 524 | webGLTemplate: APPLICATION:Default 525 | webGLAnalyzeBuildSize: 0 526 | webGLUseEmbeddedResources: 0 527 | webGLCompressionFormat: 1 528 | webGLLinkerTarget: 1 529 | webGLThreadsSupport: 0 530 | scriptingDefineSymbols: {} 531 | platformArchitecture: {} 532 | scriptingBackend: {} 533 | il2cppCompilerConfiguration: {} 534 | managedStrippingLevel: {} 535 | incrementalIl2cppBuild: {} 536 | allowUnsafeCode: 1 537 | additionalIl2CppArgs: 538 | scriptingRuntimeVersion: 1 539 | apiCompatibilityLevelPerPlatform: {} 540 | m_RenderingPath: 1 541 | m_MobileRenderingPath: 1 542 | metroPackageName: Template_3D 543 | metroPackageVersion: 544 | metroCertificatePath: 545 | metroCertificatePassword: 546 | metroCertificateSubject: 547 | metroCertificateIssuer: 548 | metroCertificateNotAfter: 0000000000000000 549 | metroApplicationDescription: Template_3D 550 | wsaImages: {} 551 | metroTileShortName: 552 | metroTileShowName: 0 553 | metroMediumTileShowName: 0 554 | metroLargeTileShowName: 0 555 | metroWideTileShowName: 0 556 | metroSupportStreamingInstall: 0 557 | metroLastRequiredScene: 0 558 | metroDefaultTileSize: 1 559 | metroTileForegroundText: 2 560 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 561 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 562 | a: 1} 563 | metroSplashScreenUseBackgroundColor: 0 564 | platformCapabilities: {} 565 | metroTargetDeviceFamilies: {} 566 | metroFTAName: 567 | metroFTAFileTypes: [] 568 | metroProtocolName: 569 | metroCompilationOverrides: 1 570 | XboxOneProductId: 571 | XboxOneUpdateKey: 572 | XboxOneSandboxId: 573 | XboxOneContentId: 574 | XboxOneTitleId: 575 | XboxOneSCId: 576 | XboxOneGameOsOverridePath: 577 | XboxOnePackagingOverridePath: 578 | XboxOneAppManifestOverridePath: 579 | XboxOneVersion: 1.0.0.0 580 | XboxOnePackageEncryption: 0 581 | XboxOnePackageUpdateGranularity: 2 582 | XboxOneDescription: 583 | XboxOneLanguage: 584 | - enus 585 | XboxOneCapability: [] 586 | XboxOneGameRating: {} 587 | XboxOneIsContentPackage: 0 588 | XboxOneEnableGPUVariability: 1 589 | XboxOneSockets: {} 590 | XboxOneSplashScreen: {fileID: 0} 591 | XboxOneAllowedProductIds: [] 592 | XboxOnePersistentLocalStorageSize: 0 593 | XboxOneXTitleMemory: 8 594 | xboxOneScriptCompiler: 1 595 | XboxOneOverrideIdentityName: 596 | vrEditorSettings: 597 | daydream: 598 | daydreamIconForeground: {fileID: 0} 599 | daydreamIconBackground: {fileID: 0} 600 | cloudServicesEnabled: 601 | UNet: 1 602 | luminIcon: 603 | m_Name: 604 | m_ModelFolderPath: 605 | m_PortalFolderPath: 606 | luminCert: 607 | m_CertPath: 608 | m_PrivateKeyPath: 609 | luminIsChannelApp: 0 610 | luminVersion: 611 | m_VersionCode: 1 612 | m_VersionName: 613 | facebookSdkVersion: 7.9.4 614 | facebookAppId: 615 | facebookCookies: 1 616 | facebookLogging: 1 617 | facebookStatus: 1 618 | facebookXfbml: 0 619 | facebookFrictionlessRequests: 1 620 | apiCompatibilityLevel: 6 621 | cloudProjectId: 622 | framebufferDepthMemorylessMode: 0 623 | projectName: 624 | organizationId: 625 | cloudEnabled: 0 626 | enableNativePlatformBackendsForNewInputSystem: 0 627 | disableOldInputManagerSupport: 0 628 | legacyClampBlendShapeWeights: 0 629 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.4.7f1 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 4 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 16 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 16 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 16 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 2 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 16 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 40 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 1 136 | antiAliasing: 4 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 16 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 1 164 | antiAliasing: 4 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 16 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSP2: 2 183 | Standalone: 5 184 | Tizen: 2 185 | WebGL: 3 186 | WiiU: 5 187 | Windows Store Apps: 5 188 | XboxOne: 5 189 | iPhone: 2 190 | tvOS: 2 191 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - PostProcessing 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity-DynamicBone-JobSystem-Opmized 2 | Unity-DynamicBone-JobSystem-Opmized 3 | 4 | 5 | 优化前 6 | ![img](https://github.com/dreamfairy/Unity-DynamicBone-JobSystem-Opmized/blob/master/img/opmized.webp) 7 | 8 | 9 | 优化后 10 | ![img](https://github.com/dreamfairy/Unity-DynamicBone-JobSystem-Opmized/blob/master/img/origin.webp) 11 | 12 | 13 | Job状态 14 | ![img](https://github.com/dreamfairy/Unity-DynamicBone-JobSystem-Opmized/blob/master/img/jobstate.webp) -------------------------------------------------------------------------------- /img/jobstate.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dreamfairy/Unity-DynamicBone-JobSystem-Opmized/faf11dfb38a765924256d4ceb02f028132b94e1e/img/jobstate.webp -------------------------------------------------------------------------------- /img/opmized.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dreamfairy/Unity-DynamicBone-JobSystem-Opmized/faf11dfb38a765924256d4ceb02f028132b94e1e/img/opmized.webp -------------------------------------------------------------------------------- /img/origin.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dreamfairy/Unity-DynamicBone-JobSystem-Opmized/faf11dfb38a765924256d4ceb02f028132b94e1e/img/origin.webp --------------------------------------------------------------------------------