Skip to content

Commit

Permalink
Merge branch 'master' of github.com:GameProgramming/GameProgramming
Browse files Browse the repository at this point in the history
  • Loading branch information
ben authored and ben committed Jul 12, 2012
2 parents fedac2c + e6ed072 commit d181409
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
Binary file modified SnowFight/Assets/Players/Player.prefab
Binary file not shown.
12 changes: 12 additions & 0 deletions SnowFight/Assets/Players/View/PlayerAnimation.js
Expand Up @@ -28,6 +28,8 @@ private var meshRenderers :MeshRenderer[];
private var skinnedRenderers :SkinnedMeshRenderer[];
private var controller :CharacterController;

var healingSound : AudioClip;

enum PlayerViewMode {Default, AimUp}
private var viewMode :PlayerViewMode = PlayerViewMode.Default;

Expand Down Expand Up @@ -351,11 +353,21 @@ function OnBulletSpawnFired (bs :BulletSpawn) {
function SetClosestBase (base :TeamBase) {
closestBase = base;
healthParticles.enableEmission = base.team == team && !playerStatus.HasFullHp();
if(healthParticles.enableEmission){
PlayAudio(healingSound);
}
}

function OnLand() {
body.SendMessage("OnRightStep");
body.SendMessage("OnLeftStep");
}

function PlayAudio(audio : AudioClip){
transform.audio.clip=audio;
if(!transform.audio.isPlaying){
transform.audio.Play();
}
}

@script RequireComponent (NetworkView)
Binary file added SnowFight/Assets/Sounds/heal.wav
Binary file not shown.
11 changes: 11 additions & 0 deletions SnowFight/Assets/Sounds/heal.wav.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d181409

Please sign in to comment.