// Token: 0x060001EF RID: 495 RVA: 0x00008F08 File Offset: 0x00007108
    private static bool Field(global::AuthorShared.Content content, ref SoftJointLimit limits, ref float offset)
    {
        GUI.Box(global::AuthorShared.BeginVertical(new GUILayoutOption[0]), GUIContent.none);
        global::AuthorShared.PrefixLabel(content);
        float limit      = limits.limit;
        float spring     = limits.spring;
        float damper     = limits.damper;
        float bounciness = limits.bounciness;
        bool  flag       = global::AuthorShared.FloatField("Limit", ref limit, new GUILayoutOption[0]);

        flag |= global::AuthorShared.FloatField("Spring", ref spring, new GUILayoutOption[0]);
        flag |= global::AuthorShared.FloatField("Damper", ref damper, new GUILayoutOption[0]);
        flag |= global::AuthorShared.FloatField("Bounciness", ref bounciness, new GUILayoutOption[0]);
        if (flag)
        {
            limits.limit      = limit;
            limits.spring     = spring;
            limits.damper     = damper;
            limits.bounciness = bounciness;
        }
        Color contentColor = GUI.contentColor;

        GUI.contentColor = contentColor * new Color(1f, 1f, 1f, 0.3f);
        flag            |= global::AuthorShared.FloatField("Offset(visual only)", ref offset, new GUILayoutOption[0]);
        GUI.contentColor = contentColor;
        global::AuthorShared.EndVertical();
        return(flag);
    }
    // Token: 0x060001ED RID: 493 RVA: 0x00008D54 File Offset: 0x00006F54
    private static bool Field(global::AuthorShared.Content content, ref JointMotor motor, ref bool use)
    {
        GUI.Box(global::AuthorShared.BeginVertical(new GUILayoutOption[0]), GUIContent.none);
        global::AuthorShared.PrefixLabel(content);
        bool flag  = use;
        bool flag2 = global::AuthorShared.Change(ref use, GUILayout.Toggle(use, "Use", new GUILayoutOption[0]));

        if (flag)
        {
            float force          = motor.force;
            float targetVelocity = motor.targetVelocity;
            bool  freeSpin       = motor.freeSpin;
            flag2 |= global::AuthorShared.FloatField("Force", ref force, new GUILayoutOption[0]);
            flag2 |= global::AuthorShared.FloatField("Target Velocity", ref targetVelocity, new GUILayoutOption[0]);
            flag2 |= global::AuthorShared.Change(ref freeSpin, GUILayout.Toggle(freeSpin, "Free Spin", new GUILayoutOption[0]));
            if (use && flag2)
            {
                motor.force          = force;
                motor.targetVelocity = targetVelocity;
                motor.freeSpin       = freeSpin;
            }
        }
        global::AuthorShared.EndVertical();
        return(flag2);
    }
    // Token: 0x060001EE RID: 494 RVA: 0x00008E30 File Offset: 0x00007030
    private static bool Field(global::AuthorShared.Content content, ref JointSpring spring, ref bool use)
    {
        GUI.Box(global::AuthorShared.BeginVertical(new GUILayoutOption[0]), GUIContent.none);
        global::AuthorShared.PrefixLabel(content);
        bool flag  = use;
        bool flag2 = global::AuthorShared.Change(ref use, GUILayout.Toggle(use, "Use", new GUILayoutOption[0]));

        if (flag)
        {
            float spring2        = spring.spring;
            float targetPosition = spring.targetPosition;
            float damper         = spring.damper;
            flag2 |= global::AuthorShared.FloatField("Spring Force", ref spring2, new GUILayoutOption[0]);
            flag2 |= global::AuthorShared.FloatField("Target Position", ref targetPosition, new GUILayoutOption[0]);
            flag2 |= global::AuthorShared.FloatField("Damper", ref damper, new GUILayoutOption[0]);
            if (use && flag2)
            {
                spring.spring         = spring2;
                spring.targetPosition = targetPosition;
                spring.damper         = damper;
            }
        }
        global::AuthorShared.EndVertical();
        return(flag2);
    }
    // Token: 0x060001EC RID: 492 RVA: 0x00008C04 File Offset: 0x00006E04
    private static bool Field(global::AuthorShared.Content content, ref JointLimits limits, ref bool use, ref float offset)
    {
        GUI.Box(global::AuthorShared.BeginVertical(new GUILayoutOption[0]), GUIContent.none);
        global::AuthorShared.PrefixLabel(content);
        bool flag  = use;
        bool flag2 = global::AuthorShared.Change(ref use, GUILayout.Toggle(use, "Use", new GUILayoutOption[0]));

        if (flag)
        {
            float min       = limits.min;
            float max       = limits.max;
            float minBounce = limits.minBounce;
            float maxBounce = limits.maxBounce;
            flag2 |= global::AuthorShared.FloatField("Min", ref min, new GUILayoutOption[0]);
            flag2 |= global::AuthorShared.FloatField("Max", ref max, new GUILayoutOption[0]);
            flag2 |= global::AuthorShared.FloatField("Min bounciness", ref minBounce, new GUILayoutOption[0]);
            flag2 |= global::AuthorShared.FloatField("Max bounciness", ref maxBounce, new GUILayoutOption[0]);
            if (use && flag2)
            {
                limits.min       = min;
                limits.max       = max;
                limits.minBounce = minBounce;
                limits.maxBounce = maxBounce;
            }
            Color contentColor = GUI.contentColor;
            GUI.contentColor = contentColor * new Color(1f, 1f, 1f, 0.3f);
            flag2           |= global::AuthorShared.FloatField("Offset(visual only)", ref offset, new GUILayoutOption[0]);
            GUI.contentColor = contentColor;
        }
        global::AuthorShared.EndVertical();
        return(flag2);
    }
示例#5
0
 // Token: 0x06000083 RID: 131 RVA: 0x00003608 File Offset: 0x00001808
 protected static bool ActionButton(global::AuthorShared.Content content, ref global::AuthorShared.PeiceAction act, bool isSelected, global::AuthorShared.PeiceAction action, GUIStyle style, params GUILayoutOption[] options)
 {
     if (global::AuthorShared.Toggle(content, isSelected, style, options) != isSelected)
     {
         act = action;
         return(true);
     }
     return(false);
 }