private void AssignedWeightsAndSetBoundsLoop(Transform t, Bounds bounds, Transform rootBone = null) { SkinnedMeshRenderer component1 = (SkinnedMeshRenderer)((Component)t).GetComponent <SkinnedMeshRenderer>(); if (Object.op_Implicit((Object)component1)) { int length = component1.get_bones().Length; Transform[] transformArray = new Transform[length]; GameObject gameObject = (GameObject)null; for (int index = 0; index < length; ++index) { if (this.dictBone.TryGetValue(((Object)component1.get_bones()[index]).get_name(), out gameObject)) { transformArray[index] = gameObject.get_transform(); } } component1.set_bones(transformArray); component1.set_localBounds(bounds); Cloth component2 = (Cloth)((Component)component1).get_gameObject().GetComponent <Cloth>(); if (Object.op_Implicit((Object)rootBone) && Object.op_Equality((Object)null, (Object)component2)) { component1.set_rootBone(rootBone); } else if (Object.op_Implicit((Object)component1.get_rootBone()) && this.dictBone.TryGetValue(((Object)component1.get_rootBone()).get_name(), out gameObject)) { component1.set_rootBone(gameObject.get_transform()); } } IEnumerator enumerator = ((Component)t).get_gameObject().get_transform().GetEnumerator(); try { while (enumerator.MoveNext()) { this.AssignedWeightsAndSetBoundsLoop((Transform)enumerator.Current, bounds, rootBone); } } finally { if (enumerator is IDisposable disposable) { disposable.Dispose(); } } }
private static int set_localBounds(IntPtr L) { object obj = null; int result; try { obj = ToLua.ToObject(L, 1); SkinnedMeshRenderer skinnedMeshRenderer = (SkinnedMeshRenderer)obj; Bounds localBounds = ToLua.ToBounds(L, 2); skinnedMeshRenderer.set_localBounds(localBounds); result = 0; } catch (Exception ex) { result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.get_Message() : "attempt to index localBounds on a nil value"); } return(result); }