public override void OnInspectorGUI()
        {
            DrawDefaultInspector();
            ParticleSystems myScript = (ParticleSystems)target;

            // Validate Duration Based Properties
            if (myScript.duration <= 0.0f)
            {
                if (myScript.loopPlay == true)
                {
                    myScript.loopPlay = false;
                }
                if (myScript.emitType == BabylonParticleEmission.Burst)
                {
                    myScript.emitType = BabylonParticleEmission.Rate;
                }
            }
            if (myScript.systemMode == BabylonSystemMode.GraphicsProcessingUnit)
            {
                if (myScript.emitType == BabylonParticleEmission.Burst)
                {
                    myScript.emitType = BabylonParticleEmission.Rate;
                }
            }
            // Force Scene Gravity Vector And Multiplier Property Values
            if (myScript.gravityMode == BabylonGravityMode.ManualVector)
            {
                myScript.SetSceneGravityVector();
            }
            else if (myScript.gravityMode == BabylonGravityMode.SceneMultiplier)
            {
                myScript.SetSceneGravityMultiplier();
            }
        }
Esempio n. 2
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();
            ParticleSystems myScript = (ParticleSystems)target;

            // Validate Duration Based Properties
            if (myScript.duration <= 0.0f)
            {
                if (myScript.loopPlay == true)
                {
                    myScript.loopPlay = false;
                }
                if (myScript.emitType == BabylonParticleEmission.Burst)
                {
                    myScript.emitType = BabylonParticleEmission.Rate;
                }
                if (myScript.customUpdateFunctions.updateOverTime == true)
                {
                    myScript.customUpdateFunctions.updateOverTime = false;
                }
            }
            // TODO: Force Shape Preset Property Values
            if (myScript.shapePreset != BabylonShapePreset.ManualShape)
            {
                switch (myScript.shapePreset)
                {
                case BabylonShapePreset.BoxVolume:
                    myScript.SetBoxVolumePresetShape();
                    break;

                default:
                    myScript.SetDefaultPresetShape();
                    break;
                }
            }
            // Force Scene Gravity Vector And Multiplier Property Values
            if (myScript.gravityMode == BabylonGravityMode.ManualVector)
            {
                myScript.SetSceneGravityVector();
            }
            else if (myScript.gravityMode == BabylonGravityMode.SceneMultiplier)
            {
                myScript.SetSceneGravityMultiplier();
            }
            //if(GUILayout.Button("Do Somthing"))
            //{
            //myScript.DoSomthing();
            //}
        }