Esempio n. 1
0
    private void SetParameter(ParticleManager.PARAMETER parameter, float val)
    {
                #if UNITY_EDITOR
        if (this.GetComponent <ParticleSystem>() == null)
        {
            EB.Debug.LogError("Partical Pal is attached to something without a particle system");
            return;
        }
                #endif

        switch (parameter)
        {
        case (ParticleManager.PARAMETER.EmissionRate):
            var em   = this.GetComponent <ParticleSystem>().emission;
            var rate = em.rate;
            rate.constantMin = rate.constantMax = val;
            em.rate          = rate;
            break;

        case (ParticleManager.PARAMETER.StartingLifeSpan):
            this.GetComponent <ParticleSystem>().startLifetime = val;
            break;

        case (ParticleManager.PARAMETER.StartingSize):
            this.GetComponent <ParticleSystem>().startSize = val;
            break;

        case (ParticleManager.PARAMETER.StartingSpeed):
            this.GetComponent <ParticleSystem>().startSpeed = val;
            break;

        case (ParticleManager.PARAMETER.StartingRotation):
            this.GetComponent <ParticleSystem>().startRotation = val;
            break;

        case (ParticleManager.PARAMETER.GravityMultiplier):
            this.GetComponent <ParticleSystem>().gravityModifier = val;
            break;

        case (ParticleManager.PARAMETER.None):
            break;

        default:
                        #if UNITY_EDITOR
            EB.Debug.LogError("ParticlePal float parameter {0} is not recognized", parameter.ToString());
                        #endif
            break;
        }
    }
Esempio n. 2
0
    private void SetParameter(ParticleManager.PARAMETER parameter, Color val)
    {
        switch (parameter)
        {
        case (ParticleManager.PARAMETER.StartingColor):
            this.GetComponent <ParticleSystem>().startColor = val;
            break;

        default:
                        #if UNITY_EDITOR
            EB.Debug.LogError("ParticlePal color parameter {0} is not recognized", parameter.ToString());
                        #endif
            break;
        }
    }