WaveOculusDemoProject.Components.ShockwaveBehavior.Update C# (CSharp) Method

Update() protected method

Updates the shockwave
protected Update ( System.TimeSpan gameTime ) : void
gameTime System.TimeSpan The current game time
return void
        protected override void Update(TimeSpan gameTime)
        {
            if(this.timeLeft <= 0)
            {
                this.IsActive = false;
                this.Owner.IsVisible = false;
                return;
            }

            this.timeLeft -= gameTime.TotalSeconds;

            float lerp = Math.Max((float)(this.timeLeft / DefaultTimeLeft), 0);

            this.material.DiffuseColor = Color.White * lerp;
            this.transform.LocalScale = Vector3.One * MaxScale * (1 - lerp);
        }