Exemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        ParticleCountManager myTarget = (ParticleCountManager)target;

        myTarget.ParticleCountFactor = EditorGUILayout.IntSlider("Particle Count", myTarget.ParticleCountFactor, 1, 1024);
        EditorGUILayout.LabelField("Final count: " + (myTarget.ParticleCountFactor * 1024));

        myTarget.ParticleBuffer = (BufferSetup)EditorGUILayout.ObjectField("Particle Buffer", myTarget.ParticleBuffer, typeof(BufferSetup), true);
        myTarget.DistanceBuffer = (BufferSetup)EditorGUILayout.ObjectField("Distance Buffer", myTarget.DistanceBuffer, typeof(BufferSetup), true);

        if (myTarget.ParticleBuffer != null)
        {
            if (Application.isPlaying)
            {
                if ((myTarget.ParticleCountFactor * 1024) != myTarget.ParticleBuffer.Count)
                {
                    if (GUILayout.Button("Apply Particle Count"))
                    {
                        myTarget.ApplyParticleCount();
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
 public void ApplyParticleCount(bool skipChangeCheck = false)
 {
     CountManager.ParticleCountFactor = CurrentSettings.System.MaxParticleCount;
     CountManager.ApplyParticleCount();
 }
Exemplo n.º 3
0
 void Awake()
 {
     CountManager.ParticleCountFactor = MaxParticleCount;
     CountManager.ApplyParticleCount();
 }