Esempio n. 1
0
        public override void OnInspectorGUI()
        {
            serializedObject.UpdateIfRequiredOrScript();

            EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins);
            Editor.DrawPropertiesExcluding(serializedObject, "m_Script");

            if (GUILayout.Button("Generate", GUI.skin.FindStyle("LargeButton"), GUILayout.Height(32)))
            {
                Generate();
            }

            EditorGUILayout.HelpBox("Particle mass (kg):\n" +
                                    "2D:" + material.GetParticleMass(Oni.SolverParameters.Mode.Mode2D) + "\n" +
                                    "3D;" + material.GetParticleMass(Oni.SolverParameters.Mode.Mode3D) + "\n\n" +
                                    "Particle size:\n" +
                                    "2D:" + material.GetParticleSize(Oni.SolverParameters.Mode.Mode2D) + "\n" +
                                    "3D;" + material.GetParticleSize(Oni.SolverParameters.Mode.Mode3D), MessageType.Info);

            EditorGUILayout.EndVertical();

            // Apply changes to the serializedProperty
            if (GUI.changed)
            {
                serializedObject.ApplyModifiedProperties();
            }
        }
Esempio n. 2
0
        public void AddShape(ObiEmitterShape shape)
        {
            if (!emitterShapes.Contains(shape))
            {
                emitterShapes.Add(shape);

                if (solver != null)
                {
                    shape.particleSize = (emitterBlueprint != null) ? emitterBlueprint.GetParticleSize(m_Solver.parameters.mode) : 0.1f;
                    shape.GenerateDistribution();
                    distEnumerator = GetDistributionEnumerator();
                }
            }
        }