Пример #1
0
        void OnGUI()
        {
            scrollPos = EditorGUILayout.BeginScrollView(scrollPos);

            EditorGUIUtility.LookLikeControls(120f, 75f);

            cgfSize       = EditorGUILayout.FloatField("Size:", cgfSize, GUILayout.ExpandWidth(false));
            cgfForcePower = EditorGUILayout.FloatField("Force Power:", cgfForcePower, GUILayout.ExpandWidth(false));

            cgfShape = (CircularGravity.Shape)EditorGUILayout.EnumPopup("Shape:", cgfShape, GUILayout.ExpandWidth(false));

            if (cgfShape == CircularGravity.Shape.Capsule)
            {
                cgfCapsuleRadius = EditorGUILayout.FloatField("Capsule Radius:", cgfCapsuleRadius, GUILayout.ExpandWidth(false));
            }

            cgfAngleToForce = EditorGUILayout.Toggle("Align to Force:", cgfAngleToForce, GUILayout.ExpandWidth(false));

            cgfDrawGravityForce = EditorGUILayout.Toggle("Draw Gravity Force:", cgfDrawGravityForce, GUILayout.ExpandWidth(false));
            if (cgfDrawGravityForce)
            {
                cgfDrawGravityForceThickness = EditorGUILayout.FloatField("   Thickness:", cgfDrawGravityForceThickness, GUILayout.ExpandWidth(false));
            }

            cgfGizmos = EditorGUILayout.Toggle("Gizmos:", cgfGizmos, GUILayout.ExpandWidth(false));

            cgfVisualizer = EditorGUILayout.Toggle("Visualizer:", cgfVisualizer, GUILayout.ExpandWidth(false));

            if (cgfVisualizer)
            {
                cgfVisualizerGUIx = EditorGUILayout.FloatField("   x:", cgfVisualizerGUIx, GUILayout.ExpandWidth(false));
                cgfVisualizerGUIy = EditorGUILayout.FloatField("   y:", cgfVisualizerGUIy, GUILayout.ExpandWidth(false));
            }

            buttonCreate = GUILayout.Button("Create ");

            EditorGUILayout.EndScrollView();
        }
        private void DrawCGFGUI()
        {
            cgfSize = EditorGUILayout.FloatField("   Size:", cgfSize);

            cgfForcePower = EditorGUILayout.FloatField("   Force Power:", cgfForcePower);

            cgfShape = (CircularGravity.Shape)EditorGUILayout.EnumPopup("   Shape:", cgfShape);

            if (cgfShape == CircularGravity.Shape.Capsule)
            {
                cgfCapsuleRadius = EditorGUILayout.FloatField("   Capsule Radius:", cgfCapsuleRadius);
            }

            cgfForceType = (CircularGravity.ForceType)EditorGUILayout.EnumPopup("   Force Type:", cgfForceType);

            if (cgfForceType == CircularGravity.ForceType.ExplosionForce)
            {
                cfgExplosionForceUpwardsModifier = EditorGUILayout.FloatField("   Upwards Modifier:", cfgExplosionForceUpwardsModifier);
            }
            else if (cgfForceType == CircularGravity.ForceType.Torque)
            {
                cfgTorqueMaxAngularVelocity = EditorGUILayout.FloatField("   Max Angular Velocity:", cfgTorqueMaxAngularVelocity);
            }

            cgfForceMode = (ForceMode)EditorGUILayout.EnumPopup("   Force Mode:", cgfForceMode);

            if (cgfForceType == CircularGravity.ForceType.ExplosionForce)
            {
                cgfCapsuleRadius = EditorGUILayout.FloatField("   Capsule Radius:", cgfCapsuleRadius);
            }

            cgfAlignToForce = EditorGUILayout.Toggle("   Align to Force:", cgfAlignToForce);
            if (cgfAlignToForce)
            {
                cgfslerpSpeed = EditorGUILayout.FloatField("   Slerp Speed:", cgfslerpSpeed);
            }

            cgfDrawGravityForce = EditorGUILayout.Toggle("   Draw Gravity Force:", cgfDrawGravityForce);
            if (cgfDrawGravityForce)
            {
                cgfDrawGravityForceThickness = EditorGUILayout.FloatField("   Thickness:", cgfDrawGravityForceThickness);
            }

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Controls:", EditorStyles.boldLabel);
            modAxisControls = EditorGUILayout.Toggle("   Add 'Axis Controls':", modAxisControls);
            modKeyControls  = EditorGUILayout.Toggle("   Add 'Key Controls':", modKeyControls);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Mods:", EditorStyles.boldLabel);
            modPulse = EditorGUILayout.Toggle("   Add 'Pulse':", modPulse);
            modSize  = EditorGUILayout.Toggle("   Add 'Size By Raycast':", modSize);

            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Tiggers:", EditorStyles.boldLabel);
            triggerEnable = EditorGUILayout.Toggle("   Create 'Enable':", triggerEnable);
            triggerHover  = EditorGUILayout.Toggle("   Create 'Hover':", triggerHover);

            EditorGUILayout.Space();

            buttonCreate3D = GUILayout.Button("Create CGF");
        }