internal static CustomRing CreateCustomRing(Ring ring)
        {
            CustomRing customRing = null;

            switch (GetRingTypeFromName(ring.Name))
            {
            case RingType.PetalRing:
                customRing = new PetalRing(ring);
                break;

            case RingType.ButterflyRing:
                customRing = new ButterflyRing(ring);
                break;

            case RingType.FairyRing:
                customRing = new FairyRing(ring);
                break;

            case RingType.RaindropRing:
                customRing = new RaindropRing(ring);
                break;

            case RingType.BunnyRing:
                customRing = new BunnyRing(ring);
                break;

            case RingType.JunimoRing:
                customRing = new JunimoRing(ring);
                break;

            case RingType.SlimeRing:
                customRing = new SlimeRing(ring);
                break;

            case RingType.FireflyRing:
                customRing = new FireflyRing(ring);
                break;

            case RingType.FrogRing:
                customRing = new FrogRing(ring);
                break;

            case RingType.DustRing:
                customRing = new DustRing(ring);
                break;

            case RingType.BatRing:
                customRing = new BatRing(ring);
                break;

            default:
                // Do nothing, though we should never reach here as Unknown isn't handled
                break;
            }

            return(customRing);
        }
Example #2
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        GUI.changed = false;

        DustRing dustRing = (DustRing)target;

        float ringWidthPercent = 0;

        ringWidthPercent = EditorGUILayout.Slider(new GUIContent("Width (% radius)", rPercentTip), 100f * dustRing.ringWidthPercent, 0, 100) / 100f;
        if (GUI.changed)
        {
            Undo.RecordObject(dustRing, "DustRing Change");
            dustRing.ringWidthPercent = FixNaN.FixIfNaN(ringWidthPercent);
            EditorUtility.SetDirty(dustRing);
        }

        if (axisUpdated)
        {
            dustRing.ApplyScale(GravityEngine.Instance().GetLengthScale());
        }
    }