Game Development Reference
In-Depth Information
function OnTriggerEnter(other:Collider)
{
if(other.gameObject.tag=="PlayerShip")
{
//player's ship touched by
aliens, pause the game
//and display a message
Time.timeScale = 0;
//display a "You lose" message
DisplayGUI.GameEnd="THE ALIENS
DESTROYED YOU!";
//update the hiscore
if(DisplayScore.Score>DisplayScore.HiScore){
DisplayScore.HiScore=DisplayScore.Score;
}
}
if(other.gameObject.tag=="BarrierBrick")
{
Destroy(other.gameObject);
}
}
This ends our section about the basics on developing GUIs using Unity. The next
step is to add some audio effects to our prototype.
Adding audio effects
For our prototype we will use only four audio effects (fx):
• One for the player's ship firing
• One for the aliens moving
Search WWH ::




Custom Search