UnityEditor.AvatarMuscleEditor.DrawMuscleHandle C# (CSharp) Method

DrawMuscleHandle() public method

public DrawMuscleHandle ( Transform t, int humanId ) : void
t UnityEngine.Transform
humanId int
return void
        public void DrawMuscleHandle(Transform t, int humanId)
        {
            Vector3 vector2;
            Animator component = base.gameObject.GetComponent(typeof(Animator)) as Animator;
            Avatar avatar = component.avatar;
            int index = HumanTrait.MuscleFromBone(humanId, 0);
            int num2 = HumanTrait.MuscleFromBone(humanId, 1);
            int num3 = HumanTrait.MuscleFromBone(humanId, 2);
            float axisLength = avatar.GetAxisLength(humanId);
            Quaternion preRotation = avatar.GetPreRotation(humanId);
            Quaternion postRotation = avatar.GetPostRotation(humanId);
            preRotation = t.parent.rotation * preRotation;
            postRotation = t.rotation * postRotation;
            Color color = new Color(1f, 1f, 1f, 0.5f);
            Quaternion zYRoll = avatar.GetZYRoll(humanId, Vector3.zero);
            Vector3 limitSign = avatar.GetLimitSign(humanId);
            Vector3 axis = (Vector3) (postRotation * Vector3.right);
            Vector3 vector4 = t.position + ((Vector3) (axis * axisLength));
            Handles.color = Color.white;
            Handles.DrawLine(t.position, vector4);
            if (index != -1)
            {
                Quaternion quaternion4 = avatar.GetZYPostQ(humanId, t.parent.rotation, t.rotation);
                float angle = this.m_MuscleMinEdit[index];
                float num6 = this.m_MuscleMaxEdit[index];
                axis = (Vector3) (postRotation * Vector3.right);
                vector2 = (Vector3) (quaternion4 * Vector3.forward);
                Handles.color = Color.black;
                Vector3 center = t.position + ((Vector3) ((axis * axisLength) * 0.75f));
                axis = (Vector3) ((postRotation * Vector3.right) * limitSign.x);
                vector2 = (Vector3) (Quaternion.AngleAxis(angle, axis) * vector2);
                Handles.color = Color.yellow;
                Handles.color = Handles.xAxisColor * color;
                Handles.DrawSolidArc(center, axis, vector2, num6 - angle, axisLength * 0.25f);
                vector2 = (Vector3) (postRotation * Vector3.forward);
                Handles.color = Handles.centerColor;
                Handles.DrawLine(center, center + ((Vector3) ((vector2 * axisLength) * 0.25f)));
            }
            if (num2 != -1)
            {
                float num7 = this.m_MuscleMinEdit[num2];
                float num8 = this.m_MuscleMaxEdit[num2];
                axis = (Vector3) ((preRotation * Vector3.up) * limitSign.y);
                vector2 = (Vector3) ((preRotation * zYRoll) * Vector3.right);
                Handles.color = Color.black;
                vector2 = (Vector3) (Quaternion.AngleAxis(num7, axis) * vector2);
                Handles.color = Color.yellow;
                Handles.color = Handles.yAxisColor * color;
                Handles.DrawSolidArc(t.position, axis, vector2, num8 - num7, axisLength * 0.25f);
            }
            if (num3 != -1)
            {
                float num9 = this.m_MuscleMinEdit[num3];
                float num10 = this.m_MuscleMaxEdit[num3];
                axis = (Vector3) ((preRotation * Vector3.forward) * limitSign.z);
                vector2 = (Vector3) ((preRotation * zYRoll) * Vector3.right);
                Handles.color = Color.black;
                vector2 = (Vector3) (Quaternion.AngleAxis(num9, axis) * vector2);
                Handles.color = Color.yellow;
                Handles.color = Handles.zAxisColor * color;
                Handles.DrawSolidArc(t.position, axis, vector2, num10 - num9, axisLength * 0.25f);
            }
        }