| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using DCL.Helpers; |
| | 4 | | using DCL.Shaders; |
| | 5 | | using Unity.Collections; |
| | 6 | | using UnityEngine; |
| | 7 | | using UnityEngine.Rendering; |
| | 8 | |
|
| | 9 | | namespace DCL |
| | 10 | | { |
| | 11 | | public static class AvatarMeshCombinerUtils |
| | 12 | | { |
| | 13 | | internal const string AVATAR_MAP_PROPERTY_NAME = "_AvatarMap"; |
| | 14 | |
|
| 1 | 15 | | internal static readonly int[] AVATAR_MAP_ID_PROPERTIES = |
| | 16 | | { |
| | 17 | | Shader.PropertyToID(AVATAR_MAP_PROPERTY_NAME + "1"), |
| | 18 | | Shader.PropertyToID(AVATAR_MAP_PROPERTY_NAME + "2"), |
| | 19 | | Shader.PropertyToID(AVATAR_MAP_PROPERTY_NAME + "3"), |
| | 20 | | Shader.PropertyToID(AVATAR_MAP_PROPERTY_NAME + "4"), |
| | 21 | | Shader.PropertyToID(AVATAR_MAP_PROPERTY_NAME + "5"), |
| | 22 | | Shader.PropertyToID(AVATAR_MAP_PROPERTY_NAME + "6"), |
| | 23 | | Shader.PropertyToID(AVATAR_MAP_PROPERTY_NAME + "7"), |
| | 24 | | Shader.PropertyToID(AVATAR_MAP_PROPERTY_NAME + "8"), |
| | 25 | | Shader.PropertyToID(AVATAR_MAP_PROPERTY_NAME + "9"), |
| | 26 | | Shader.PropertyToID(AVATAR_MAP_PROPERTY_NAME + "10"), |
| | 27 | | Shader.PropertyToID(AVATAR_MAP_PROPERTY_NAME + "11"), |
| | 28 | | Shader.PropertyToID(AVATAR_MAP_PROPERTY_NAME + "12") |
| | 29 | | }; |
| | 30 | |
|
| 1 | 31 | | private static bool VERBOSE = false; |
| 1 | 32 | | private static ILogger logger = new Logger(Debug.unityLogger.logHandler) { filterLogType = VERBOSE ? LogType.Log |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// This method iterates over all the renderers contained in the given CombineLayer list, and |
| | 36 | | /// outputs an array of all the bones per vertexes |
| | 37 | | /// |
| | 38 | | /// This is needed because Mesh.CombineMeshes don't calculate boneWeights correctly. |
| | 39 | | /// When using Mesh.CombineMeshes, the boneWeights returned correspond to indexes of skeleton copies, |
| | 40 | | /// not the same skeleton. |
| | 41 | | /// </summary> |
| | 42 | | /// <param name="layers">A CombineLayer list. You can generate this array using CombineLayerUtils.Slice().</para |
| | 43 | | /// <returns>A list of Bones per vertex that share the same skeleton.</returns> |
| | 44 | | public static NativeArray<byte> CombineBonesPerVertex(List<CombineLayer> layers) |
| | 45 | | { |
| 20 | 46 | | int layersCount = layers.Count; |
| 20 | 47 | | int totalVertexes = 0; |
| | 48 | |
|
| 20 | 49 | | List<NativeArray<byte>> bonesPerVertexList = new List<NativeArray<byte>>(); |
| | 50 | |
|
| 106 | 51 | | for (int layerIndex = 0; layerIndex < layersCount; layerIndex++) |
| | 52 | | { |
| 33 | 53 | | CombineLayer layer = layers[layerIndex]; |
| 33 | 54 | | var layerRenderers = layer.renderers; |
| 33 | 55 | | int layerRenderersCount = layerRenderers.Count; |
| | 56 | |
|
| 254 | 57 | | for (int i = 0; i < layerRenderersCount; i++) |
| | 58 | | { |
| 94 | 59 | | var bonesPerVertex = layerRenderers[i].sharedMesh.GetBonesPerVertex(); |
| | 60 | |
|
| 94 | 61 | | bonesPerVertexList.Add(bonesPerVertex); |
| 94 | 62 | | totalVertexes += bonesPerVertex.Length; |
| | 63 | | } |
| | 64 | | } |
| | 65 | |
|
| 20 | 66 | | NativeArray<byte> finalBpV = new NativeArray<byte>(totalVertexes, Allocator.Temp, NativeArrayOptions.Uniniti |
| | 67 | |
|
| 20 | 68 | | int indexOffset = 0; |
| 20 | 69 | | int bonesPerVertexListCount = bonesPerVertexList.Count; |
| | 70 | |
|
| 228 | 71 | | for (int i = 0; i < bonesPerVertexListCount; i++) |
| | 72 | | { |
| 94 | 73 | | var narray = bonesPerVertexList[i]; |
| 94 | 74 | | int narrayLength = narray.Length; |
| 94 | 75 | | NativeArray<byte>.Copy(narray, 0, finalBpV, indexOffset, narrayLength); |
| 94 | 76 | | indexOffset += narrayLength; |
| 94 | 77 | | narray.Dispose(); |
| | 78 | | } |
| | 79 | |
|
| 20 | 80 | | return finalBpV; |
| | 81 | | } |
| | 82 | |
|
| | 83 | | /// <summary> |
| | 84 | | /// This method iterates over all the renderers contained in the given CombineLayer list, and |
| | 85 | | /// outputs an array of all the bone weights |
| | 86 | | /// |
| | 87 | | /// This is needed because Mesh.CombineMeshes don't calculate boneWeights correctly. |
| | 88 | | /// When using Mesh.CombineMeshes, the boneWeights returned correspond to indexes of skeleton copies, |
| | 89 | | /// not the same skeleton. |
| | 90 | | /// </summary> |
| | 91 | | /// <param name="layers">A CombineLayer list. You can generate this array using CombineLayerUtils.Slice().</para |
| | 92 | | /// <returns>A list of bone weights that share the same skeleton.</returns> |
| | 93 | | public static NativeArray<BoneWeight1> CombineBonesWeights(List<CombineLayer> layers) |
| | 94 | | { |
| 20 | 95 | | int layersCount = layers.Count; |
| 20 | 96 | | int totalBones = 0; |
| | 97 | |
|
| 20 | 98 | | List<NativeArray<BoneWeight1>> boneWeightArrays = new List<NativeArray<BoneWeight1>>(10); |
| | 99 | |
|
| 106 | 100 | | for (int layerIndex = 0; layerIndex < layersCount; layerIndex++) |
| | 101 | | { |
| 33 | 102 | | CombineLayer layer = layers[layerIndex]; |
| 33 | 103 | | var layerRenderers = layer.renderers; |
| 33 | 104 | | int layerRenderersCount = layerRenderers.Count; |
| | 105 | |
|
| 254 | 106 | | for (int i = 0; i < layerRenderersCount; i++) |
| | 107 | | { |
| 94 | 108 | | var boneWeights = layerRenderers[i].sharedMesh.GetAllBoneWeights(); |
| 94 | 109 | | boneWeightArrays.Add(boneWeights); |
| 94 | 110 | | totalBones += boneWeights.Length; |
| | 111 | | } |
| | 112 | | } |
| | 113 | |
|
| 20 | 114 | | NativeArray<BoneWeight1> finalBones = new NativeArray<BoneWeight1>(totalBones, Allocator.Temp, NativeArrayOp |
| | 115 | |
|
| 20 | 116 | | int indexOffset = 0; |
| 20 | 117 | | var finalBonesCount = boneWeightArrays.Count; |
| | 118 | |
|
| 228 | 119 | | for (int i = 0; i < finalBonesCount; i++) |
| | 120 | | { |
| 94 | 121 | | var narray = boneWeightArrays[i]; |
| 94 | 122 | | int narrayLength = narray.Length; |
| 94 | 123 | | NativeArray<BoneWeight1>.Copy(narray, 0, finalBones, indexOffset, narrayLength); |
| 94 | 124 | | indexOffset += narrayLength; |
| 94 | 125 | | narray.Dispose(); |
| | 126 | | } |
| | 127 | |
|
| 20 | 128 | | return finalBones; |
| | 129 | | } |
| | 130 | |
|
| | 131 | |
|
| | 132 | | /// <summary> |
| | 133 | | /// FlattenMaterials take a CombineLayer list and returns a FlattenedMaterialsData object. |
| | 134 | | /// |
| | 135 | | /// This object can be used to construct a combined mesh that has uniform data encoded in uv attributes. |
| | 136 | | /// This type of encoding can be used to greatly reduce draw calls for seemingly unrelated objects. |
| | 137 | | /// |
| | 138 | | /// The returned object also contains a single material per CombineLayer. |
| | 139 | | /// </summary> |
| | 140 | | /// <param name="layers">A CombineLayer list. You can generate this array using CombineLayerUtils.Slice().</para |
| | 141 | | /// <param name="materialAsset">Material asset that will be cloned to generate the returned materials.</param> |
| | 142 | | /// <returns>A FlattenedMaterialsData object. This object can be used to construct a combined mesh that has unif |
| | 143 | | public static FlattenedMaterialsData FlattenMaterials(List<CombineLayer> layers, Material materialAsset) |
| | 144 | | { |
| 21 | 145 | | int layersCount = layers.Count; |
| | 146 | |
|
| 21 | 147 | | int finalVertexCount = 0; |
| 21 | 148 | | int currentVertexCount = 0; |
| | 149 | |
|
| 112 | 150 | | for (int layerIndex = 0; layerIndex < layersCount; layerIndex++) |
| | 151 | | { |
| 35 | 152 | | CombineLayer layer = layers[layerIndex]; |
| 35 | 153 | | var layerRenderers = layer.renderers; |
| 35 | 154 | | int layerRenderersCount = layerRenderers.Count; |
| | 155 | |
|
| 258 | 156 | | for (int i = 0; i < layerRenderersCount; i++) |
| | 157 | | { |
| 94 | 158 | | var renderer = layerRenderers[i]; |
| 94 | 159 | | finalVertexCount += renderer.sharedMesh.vertexCount; |
| | 160 | | } |
| | 161 | | } |
| | 162 | |
|
| 21 | 163 | | var result = new FlattenedMaterialsData(finalVertexCount); |
| | 164 | |
|
| 112 | 165 | | for (int layerIndex = 0; layerIndex < layersCount; layerIndex++) |
| | 166 | | { |
| 35 | 167 | | CombineLayer layer = layers[layerIndex]; |
| 35 | 168 | | var layerRenderers = layer.renderers; |
| | 169 | |
|
| 35 | 170 | | Material newMaterial = new Material(materialAsset); |
| | 171 | |
|
| 35 | 172 | | CullMode cullMode = layer.cullMode; |
| 35 | 173 | | bool isOpaque = layer.isOpaque; |
| | 174 | |
|
| 35 | 175 | | if ( isOpaque ) |
| 21 | 176 | | MaterialUtils.SetOpaque(newMaterial); |
| | 177 | | else |
| 14 | 178 | | MaterialUtils.SetTransparent(newMaterial); |
| | 179 | |
|
| 35 | 180 | | newMaterial.SetInt(ShaderUtils.Cull, (int)cullMode); |
| | 181 | |
|
| 35 | 182 | | result.materials.Add( newMaterial ); |
| | 183 | |
|
| 35 | 184 | | int layerRenderersCount = layerRenderers.Count; |
| | 185 | |
|
| 258 | 186 | | for (int i = 0; i < layerRenderersCount; i++) |
| | 187 | | { |
| | 188 | |
|
| 94 | 189 | | var renderer = layerRenderers[i]; |
| | 190 | |
|
| | 191 | | // Bone Weights |
| 94 | 192 | | var sharedMesh = renderer.sharedMesh; |
| 94 | 193 | | int vertexCount = sharedMesh.vertexCount; |
| | 194 | |
|
| | 195 | | // Texture IDs |
| 94 | 196 | | Material mat = renderer.sharedMaterial; |
| | 197 | |
|
| 94 | 198 | | Texture2D baseMap = (Texture2D)mat.GetTexture(ShaderUtils.BaseMap); |
| 94 | 199 | | Texture2D emissionMap = (Texture2D)mat.GetTexture(ShaderUtils.EmissionMap); |
| 94 | 200 | | float cutoff = mat.GetFloat(ShaderUtils.Cutoff); |
| | 201 | |
|
| 94 | 202 | | bool baseMapIdIsValid = baseMap != null && layer.textureToId.ContainsKey(baseMap); |
| 94 | 203 | | bool emissionMapIdIsValid = emissionMap != null && layer.textureToId.ContainsKey(emissionMap); |
| | 204 | |
|
| 94 | 205 | | int baseMapId = baseMapIdIsValid ? layer.textureToId[baseMap] : -1; |
| 94 | 206 | | int emissionMapId = emissionMapIdIsValid ? layer.textureToId[emissionMap] : -1; |
| | 207 | |
|
| 94 | 208 | | if ( baseMapId != -1 ) |
| | 209 | | { |
| 88 | 210 | | if ( baseMapId < AVATAR_MAP_ID_PROPERTIES.Length ) |
| | 211 | | { |
| 88 | 212 | | int targetMap = AVATAR_MAP_ID_PROPERTIES[baseMapId]; |
| 88 | 213 | | newMaterial.SetTexture(targetMap, baseMap); |
| | 214 | | } |
| | 215 | | else |
| | 216 | | { |
| 0 | 217 | | if (VERBOSE) |
| 0 | 218 | | logger.Log(LogType.Error, "FlattenMaterials", $"Base Map ID out of bounds! {baseMapId}") |
| | 219 | | } |
| | 220 | | } |
| | 221 | |
|
| 94 | 222 | | if ( emissionMapId != -1 ) |
| | 223 | | { |
| 7 | 224 | | if ( baseMapId < AVATAR_MAP_ID_PROPERTIES.Length ) |
| | 225 | | { |
| 7 | 226 | | int targetMap = AVATAR_MAP_ID_PROPERTIES[emissionMapId]; |
| 7 | 227 | | newMaterial.SetTexture(targetMap, emissionMap); |
| | 228 | | } |
| | 229 | | else |
| | 230 | | { |
| 0 | 231 | | if (VERBOSE) |
| 0 | 232 | | logger.Log(LogType.Error, "FlattenMaterials", $"Emission Map ID out of bounds! {emission |
| | 233 | | } |
| | 234 | | } |
| | 235 | |
|
| 94 | 236 | | Vector4 baseColor = mat.GetVector(ShaderUtils.BaseColor); |
| 94 | 237 | | Vector4 emissionColor = mat.GetVector(ShaderUtils.EmissionColor); |
| 94 | 238 | | Vector3 texturePointerData = new Vector3(baseMapId, emissionMapId, cutoff); |
| | 239 | |
|
| 63742 | 240 | | for ( int ai = 0; ai < vertexCount; ai++ ) |
| | 241 | | { |
| 31777 | 242 | | result.texturePointers[currentVertexCount] = texturePointerData; |
| 31777 | 243 | | result.colors[currentVertexCount] = baseColor; |
| 31777 | 244 | | result.emissionColors[currentVertexCount] = emissionColor; |
| 31777 | 245 | | currentVertexCount++; |
| | 246 | | } |
| | 247 | |
|
| 94 | 248 | | if (VERBOSE) |
| 0 | 249 | | logger.Log($"Layer {i} - vertexCount: {vertexCount} - texturePointers: ({baseMapId}, {emissionMa |
| | 250 | |
|
| | 251 | | } |
| | 252 | |
|
| 35 | 253 | | SRPBatchingHelper.OptimizeMaterial(newMaterial); |
| | 254 | |
|
| | 255 | | } |
| | 256 | |
|
| 21 | 257 | | return result; |
| | 258 | | } |
| | 259 | |
|
| | 260 | | /// <summary> |
| | 261 | | /// ComputeSubMeshes iterates over the given CombineLayer list, and returns a list that can be used to map a |
| | 262 | | /// sub-mesh for each CombineLayer object. A CombineLayer object can group more than a single mesh. |
| | 263 | | /// |
| | 264 | | /// Note that this had to be done because Mesh.CombineMeshes lack the option of controlling the sub-mesh |
| | 265 | | /// output. Currently the only options are to combine everything in a single sub-mesh, or generate a single sub- |
| | 266 | | /// per combined mesh. The CombineLayer approach may need to combine specific meshes to a single sub-mesh |
| | 267 | | /// (because they all can have the same material, if they share the same render state -- i.e. transparency or cu |
| | 268 | | /// </summary> |
| | 269 | | /// <param name="layers">A CombineLayer list. You can generate this array using CombineLayerUtils.Slice().</para |
| | 270 | | /// <returns>A SubMeshDescriptor list that can be used later to set the sub-meshes of the final combined mesh |
| | 271 | | /// in a way that each sub-mesh corresponds with its own layer.</returns> |
| | 272 | | public static List<SubMeshDescriptor> ComputeSubMeshes(List<CombineLayer> layers) |
| | 273 | | { |
| 20 | 274 | | List<SubMeshDescriptor> result = new List<SubMeshDescriptor>(); |
| 20 | 275 | | int layersCount = layers.Count; |
| 20 | 276 | | int subMeshIndexOffset = 0; |
| | 277 | |
|
| 106 | 278 | | for (int layerIndex = 0; layerIndex < layersCount; layerIndex++) |
| | 279 | | { |
| 33 | 280 | | CombineLayer layer = layers[layerIndex]; |
| 33 | 281 | | var layerRenderers = layer.renderers; |
| 33 | 282 | | int layerRenderersCount = layerRenderers.Count; |
| | 283 | |
|
| 33 | 284 | | int subMeshVertexCount = 0; |
| 33 | 285 | | int subMeshIndexCount = 0; |
| | 286 | |
|
| 254 | 287 | | for (int i = 0; i < layerRenderersCount; i++) |
| | 288 | | { |
| 94 | 289 | | var renderer = layerRenderers[i]; |
| | 290 | |
|
| 94 | 291 | | int vertexCount = renderer.sharedMesh.vertexCount; |
| 94 | 292 | | int indexCount = (int)renderer.sharedMesh.GetIndexCount(0); |
| | 293 | |
|
| 94 | 294 | | subMeshVertexCount += vertexCount; |
| 94 | 295 | | subMeshIndexCount += indexCount; |
| | 296 | | } |
| | 297 | |
|
| 33 | 298 | | var subMesh = new SubMeshDescriptor(subMeshIndexOffset, subMeshIndexCount); |
| 33 | 299 | | subMesh.vertexCount = subMeshVertexCount; |
| 33 | 300 | | result.Add(subMesh); |
| | 301 | |
|
| 33 | 302 | | subMeshIndexOffset += subMeshIndexCount; |
| | 303 | | } |
| | 304 | |
|
| 20 | 305 | | return result; |
| | 306 | | } |
| | 307 | |
|
| | 308 | | /// <summary> |
| | 309 | | /// ComputeCombineInstancesData returns a CombineInstance list that can be used to combine all the meshes |
| | 310 | | /// specified by the given CombineLayer list. This is done via Mesh.CombineMeshes() Unity method. |
| | 311 | | /// </summary> |
| | 312 | | /// <param name="layers">A CombineLayer list. You can generate this array using CombineLayerUtils.Slice()</param |
| | 313 | | /// <returns>CombineInstance list usable by Mesh.CombineMeshes()</returns> |
| | 314 | | public static List<CombineInstance> ComputeCombineInstancesData(List<CombineLayer> layers) |
| | 315 | | { |
| 19 | 316 | | var result = new List<CombineInstance>(); |
| 19 | 317 | | int layersCount = layers.Count; |
| | 318 | |
|
| 100 | 319 | | for (int layerIndex = 0; layerIndex < layersCount; layerIndex++) |
| | 320 | | { |
| 31 | 321 | | CombineLayer layer = layers[layerIndex]; |
| 31 | 322 | | var layerRenderers = layer.renderers; |
| 31 | 323 | | int layerRenderersCount = layerRenderers.Count; |
| | 324 | |
|
| 242 | 325 | | for (int i = 0; i < layerRenderersCount; i++) |
| | 326 | | { |
| 90 | 327 | | var renderer = layerRenderers[i]; |
| | 328 | |
|
| 90 | 329 | | Transform meshTransform = renderer.transform; |
| 90 | 330 | | Transform prevParent = meshTransform.parent; |
| 90 | 331 | | meshTransform.SetParent(null, true); |
| | 332 | |
|
| 90 | 333 | | result.Add( new CombineInstance() |
| | 334 | | { |
| | 335 | | subMeshIndex = 0, // this means the source sub-mesh, not destination |
| | 336 | | mesh = renderer.sharedMesh, |
| | 337 | | transform = meshTransform.localToWorldMatrix |
| | 338 | | }); |
| | 339 | |
|
| 90 | 340 | | meshTransform.SetParent( prevParent ); |
| | 341 | | } |
| | 342 | | } |
| | 343 | |
|
| 19 | 344 | | return result; |
| | 345 | | } |
| | 346 | |
|
| | 347 | | public static Mesh CombineMeshesWithLayers( List<CombineInstance> combineInstancesData, List<CombineLayer> layer |
| | 348 | | { |
| 19 | 349 | | Mesh result = new Mesh(); |
| | 350 | | // Is important to use the layerRenderers to combine (i.e. no the original renderers) |
| | 351 | | // Layer renderers are in a specific order that must be abided, or the combining will be broken. |
| 19 | 352 | | List<SkinnedMeshRenderer> layerRenderers = new List<SkinnedMeshRenderer>(); |
| | 353 | |
|
| 100 | 354 | | for (int i = 0; i < layers.Count; i++) |
| | 355 | | { |
| 31 | 356 | | layerRenderers.AddRange( layers[i].renderers ); |
| | 357 | | } |
| | 358 | |
|
| 19 | 359 | | using (var bakedInstances = new BakedCombineInstances()) |
| | 360 | | { |
| 19 | 361 | | bakedInstances.Bake(combineInstancesData, layerRenderers); |
| 19 | 362 | | result.CombineMeshes(combineInstancesData.ToArray(), true, true); |
| 19 | 363 | | } |
| | 364 | |
|
| 19 | 365 | | return result; |
| | 366 | | } |
| | 367 | |
|
| | 368 | | /// <summary> |
| | 369 | | /// ResetBones will reset the given SkinnedMeshRenderer bones to the original bindposes position. |
| | 370 | | /// |
| | 371 | | /// This is done without taking into account the rootBone. We need to do it this way because the meshes must be |
| | 372 | | /// combined posing to match the raw bindposes matrix. |
| | 373 | | /// |
| | 374 | | /// If the combined mesh don't match the bindposes matrices, the resulting skinning will not work. |
| | 375 | | /// |
| | 376 | | /// For this reason, this method doesn't resemble the original method that unity uses to reset the skeleton foun |
| | 377 | | /// https://github.com/Unity-Technologies/UnityCsReference/blob/61f92bd79ae862c4465d35270f9d1d57befd1761/Editor/ |
| | 378 | | /// </summary> |
| | 379 | | internal static void ResetBones(Matrix4x4[] bindPoses, Transform[] bones) |
| | 380 | | { |
| 2520 | 381 | | for ( int i = 0 ; i < bones.Length; i++ ) |
| | 382 | | { |
| 1240 | 383 | | Transform bone = bones[i]; |
| 1240 | 384 | | Matrix4x4 bindPose = bindPoses[i].inverse; |
| 1240 | 385 | | bone.position = bindPose.MultiplyPoint3x4(Vector3.zero); |
| 1240 | 386 | | bone.rotation = bindPose.rotation; |
| | 387 | |
|
| 1240 | 388 | | Vector3 bindPoseScale = bindPose.lossyScale; |
| 1240 | 389 | | Vector3 boneScale = bone.lossyScale; |
| | 390 | |
|
| 1240 | 391 | | bone.localScale = new Vector3(bindPoseScale.x / boneScale.x, |
| | 392 | | bindPoseScale.y / boneScale.y, |
| | 393 | | bindPoseScale.z / boneScale.z); |
| | 394 | | } |
| | 395 | |
|
| | 396 | | #if UNITY_EDITOR |
| 20 | 397 | | DrawDebugSkeleton(bones); |
| | 398 | | #endif |
| 20 | 399 | | } |
| | 400 | |
|
| | 401 | | internal static void DrawDebugSkeleton(Transform[] bones) |
| | 402 | | { |
| 2520 | 403 | | for ( int i = 0 ; i < bones.Length; i++ ) |
| | 404 | | { |
| 1240 | 405 | | Transform bone = bones[i]; |
| 1240 | 406 | | Debug.DrawLine(bone.position, bone.position + bone.forward, Color.cyan, 60); |
| | 407 | |
|
| 4920 | 408 | | foreach ( Transform child in bone ) |
| | 409 | | { |
| 1220 | 410 | | Debug.DrawLine(bone.position, child.position, Color.green, 60); |
| | 411 | | } |
| | 412 | | } |
| 20 | 413 | | } |
| | 414 | | } |
| | 415 | | } |