private void UpdateSelectedBone() { int num = AvatarMappingEditor.s_SelectedBoneIndex; if (AvatarMappingEditor.s_SelectedBoneIndex < 0 || AvatarMappingEditor.s_SelectedBoneIndex >= this.m_Bones.Length || this.m_Bones[AvatarMappingEditor.s_SelectedBoneIndex].bone != Selection.activeTransform) { AvatarMappingEditor.s_SelectedBoneIndex = -1; if (Selection.activeTransform != null) { for (int i = 0; i < this.m_Bones.Length; i++) { if (this.m_Bones[i].bone == Selection.activeTransform) { AvatarMappingEditor.s_SelectedBoneIndex = i; break; } } } } if (AvatarMappingEditor.s_SelectedBoneIndex != num) { List <int> viewsThatContainBone = AvatarControl.GetViewsThatContainBone(AvatarMappingEditor.s_SelectedBoneIndex); if (viewsThatContainBone.Count > 0 && !viewsThatContainBone.Contains(this.m_BodyView)) { this.m_BodyView = viewsThatContainBone[0]; } } }
private void UpdateSelectedBone() { // Look for selected bone slot int oldSelectedBoneIndex = s_SelectedBoneIndex; if (s_SelectedBoneIndex < 0 || s_SelectedBoneIndex >= m_Bones.Length || m_Bones[s_SelectedBoneIndex].bone != Selection.activeTransform) { s_SelectedBoneIndex = -1; if (Selection.activeTransform != null) { for (int i = 0; i < m_Bones.Length; i++) { if (m_Bones[i].bone == Selection.activeTransform) { s_SelectedBoneIndex = i; break; } } } } if (s_SelectedBoneIndex != oldSelectedBoneIndex) { // If selected bone changed, change visual to show image that contains that bone. List <int> views = AvatarControl.GetViewsThatContainBone(s_SelectedBoneIndex); if (views.Count > 0 && !views.Contains(m_BodyView)) { m_BodyView = views[0]; } } }
private void UpdateSelectedBone() { int selectedBoneIndex = AvatarMappingEditor.s_SelectedBoneIndex; if (AvatarMappingEditor.s_SelectedBoneIndex < 0 || AvatarMappingEditor.s_SelectedBoneIndex >= this.m_Bones.Length || (UnityEngine.Object) this.m_Bones[AvatarMappingEditor.s_SelectedBoneIndex].bone != (UnityEngine.Object)Selection.activeTransform) { AvatarMappingEditor.s_SelectedBoneIndex = -1; if ((UnityEngine.Object)Selection.activeTransform != (UnityEngine.Object)null) { for (int index = 0; index < this.m_Bones.Length; ++index) { if ((UnityEngine.Object) this.m_Bones[index].bone == (UnityEngine.Object)Selection.activeTransform) { AvatarMappingEditor.s_SelectedBoneIndex = index; break; } } } } if (AvatarMappingEditor.s_SelectedBoneIndex == selectedBoneIndex) { return; } List <int> viewsThatContainBone = AvatarControl.GetViewsThatContainBone(AvatarMappingEditor.s_SelectedBoneIndex); if (viewsThatContainBone.Count <= 0 || viewsThatContainBone.Contains(this.m_BodyView)) { return; } this.m_BodyView = viewsThatContainBone[0]; }