Shield Shader

So i’ve been trying to apply a shader to my spaceship, which has worked I’ve been using the wiki along with stop secret designs tuts. The problem is not having it on permanently, i can set the render on and off when hit, which does not look right. I was hoping someone would know how to have it so where you get hit the shader comes up and dissipates from that point. Pretty much looks like the one in the asset store, which i can’t afford atm.

The shaders i’ve been using to try are from:
http://wiki.unity3d.com/index.php?title=Shield
http://stopsecretdesign.wordpress.com/2011/11/25/stopsecret-spaceship-shield-shader-ssssss/#comment-606

Any help would be much appreciated

-Aaron

Aaron, the key should be in _AlphaRimPower.
Try using SetFloat Unity - Scripting API: Material.SetFloat
With code like this:

var alphapow = 1.0;
var dissipationSpeed = 2.0;

function Update ()
{
alphapow -= Time.deltaTime*dissipationSpeed;
renderer.material.SetFloat( “_AlphaRimPower”, alphapow );
}

function shieldWasHit ()
{
alphaPow = 1.0;
}

Hope this helps!
-SS