Graphics Reference
In-Depth Information
Invoke ("ResetFireSoundDelay",
timeBetweenFireSounds);
}
}
}
void ResetFireSoundDelay()
{
canPlayFireSound=true;
}
void resetRespawn()
{
canRespawn=true;
}
public void GetAIInput ()
{
// calculate steering amount
steer= Mathf.Clamp( AIController.GetHorizontal(), -1, 1 );
// how much accelerator?
motor= Mathf.Clamp( AIController.GetVertical() , -1, 1 );
}
public void SetAIInput (bool aiFlag)
{
isAIControlled = aiFlag;
}
private ProjectileController aProj;
private GameObject tempGO;
void OnCollisionEnter(Collision collider)
{
// when something collides with our ship, we check its layer
// to see if it is a projectile (Note: remember when you add
// projectiles, set the layers correctly!) by default, we're
// using layer 17 for projectiles fired by enemies and layer
// 9 for projectiles fired by the main player but all we
// need to know here is that it *is* a projectile of any type
if(!isRespawning && !isInvulnerable) // make sure no
// respawning or
// invulnerability is
// happening
{
// temp ref to this collider's gameobject so that we
// don't need to keep looking it up
tempGO= collider.gameObject;
// do a quick layer check to make sure that these
// are in fact projectiles
Search WWH ::




Custom Search