示例#1
0
    private void ModifyTorqueFactor(float value)
    {
        TorqueFactor = Mathf.Clamp(TorqueFactor + value, FactorMinLimit, FactorMaxLimit);
        float ratio = TorqueFactor / FactorMaxLimit;

        UpdateParts(RotationParts, ratio);
        RotationGauge.SetValue(ratio);

        ParticleSystem.MinMaxCurve startSpeedCurve    = new ParticleSystem.MinMaxCurve(Mathf.Lerp(1f, 6f, ratio));
        ParticleSystem.MinMaxCurve startLifetimeCurve = new ParticleSystem.MinMaxCurve(Mathf.Lerp(0.05f, 0.1f, ratio));
        float duration = Mathf.Lerp(0.5f, 1f, ratio);

        LeftParticleSystem.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
        ParticleSystem.MainModule leftMain = LeftParticleSystem.main;
        leftMain.startSpeed    = startSpeedCurve;
        leftMain.startLifetime = startLifetimeCurve;
        leftMain.duration      = duration;
        LeftParticleSystem.Play();

        RightParticleSystem.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
        ParticleSystem.MainModule rightMain = RightParticleSystem.main;
        rightMain.startSpeed    = startSpeedCurve;
        rightMain.startLifetime = startLifetimeCurve;
        rightMain.duration      = duration;
        RightParticleSystem.Play();
    }
示例#2
0
    private void ModifyAccelerationFactor(float value)
    {
        AccelerationFactor = Mathf.Clamp(AccelerationFactor + value, FactorMinLimit, FactorMaxLimit);
        float ratio = AccelerationFactor / FactorMaxLimit;

        UpdateParts(AccelerationParts, ratio);
        AccelerationGauge.SetValue(ratio);

        ParticleSystem.MainModule main = TailParticleSystem.main;
        TailParticleSystem.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
        main.startSpeed    = new ParticleSystem.MinMaxCurve(Mathf.Lerp(2.5f, 10f, ratio));
        main.startLifetime = new ParticleSystem.MinMaxCurve(Mathf.Lerp(0.05f, 0.1f, ratio));
        main.duration      = Mathf.Lerp(1f, 4f, ratio);
        TailParticleSystem.Play();
    }
示例#3
0
 private void ModifyShieldFactor(float value)
 {
     ShieldFactor = Mathf.Clamp(ShieldFactor + value, FactorMinLimit, FactorMaxLimit);
     UpdateParts(ShieldParts, ShieldFactor / FactorMaxLimit);
     ShieldGauge.SetValue(ShieldFactor / FactorMaxLimit);
 }
示例#4
0
 private void ModifyShootFactor(float value)
 {
     ShootFactor = Mathf.Clamp(ShootFactor + value, FactorMinLimit, FactorMaxLimit);
     UpdateParts(BlasterParts, ShootFactor / FactorMaxLimit);
     BlasterGauge.SetValue(ShootFactor / FactorMaxLimit);
 }