Update() public method

public Update ( MonoBehaviour owner ) : void
owner MonoBehaviour
return void
Ejemplo n.º 1
0
    void Update()
    {
        launchpad.Update(this);

        // Turbulence
        targetShaker.position.amount = knobTurbulence.Current;

        // Forward
        target.localPosition = Vector3.right * -knobForward.Current;

        // Particle
        particles.emissionRate = knobParticle.Current;

        // Kicker
        kicker.impulse = knobKicker.Current;

        // Yaw
        cameraPivot.localRotation = Quaternion.AngleAxis(knobYaw.Current, Vector3.forward);

        // Color
        var mixer = GetComponent <PolishableProbeMixer> ();

        mixer.mix       = knobColor.Current;
        mixer.intensity = 1.0f + knobColor.Current;
    }
Ejemplo n.º 2
0
    void Update()
    {
        launchpad.Update(this);

        // Yaw, Pitch
        cameraPivot.localRotation =
            Quaternion.AngleAxis(knobYaw.Current, Vector3.up) *
            Quaternion.AngleAxis(knobPitch.Current, Vector3.right);

        // Turbulence
        foreach (var shaker in lineShakers)
        {
            shaker.position.amount = knobTurbulence.Current;
        }

        twistPivot.localPosition = Vector3.up * knobTurbulence.Current * 0.4f;

        // Alignment
        for (var i = 0; i < linePivots.Length; i++)
        {
            var x = i - linePivots.Length / 2 + 0.5f;
            linePivots [i].localPosition = Vector3.forward * knobAlignment.Current * x;
        }

        // Twist
        twistPivot.localRotation = Quaternion.AngleAxis(knobTwist.Current, Vector3.right);

        // Impulse animation (camera and light)
        Camera.main.fieldOfView = ExpEase.Out(Camera.main.fieldOfView, initialFieldOfView, -6.0f);
        mainLight.intensity     = ExpEase.Out(mainLight.intensity, initialLightIntensity, -4.0f);

        // Stage switching
        stageParam = ExpEase.Out(stageParam, stageSwitch ? 1.0f : 0.0f, -4.0f);
        GetComponent <PolishableProbeMixer> ().mix = stageParam;

        if (stageParam > 0.001f)
        {
            globeDeformer.enabled      = true;
            globeDeformer.deformAmount = Vector3.one * (stageParam * 0.1f);
            bloomFx.enabled            = true;
            bloomFx.bloomIntensity     = stageParam;
        }
        else
        {
            globeDeformer.enabled = false;
            bloomFx.enabled       = false;
        }

        globeDeformer.transform.localScale = Vector3.one * (50.0f - stageParam * 0.5f);

        // Balls
        ballEmitter.emissionRate = ballSwitch ? 140 : 0;
    }