A https://github.com /patricfallon/Bad-Vibes-Game/blob/master/Hazard.cs Z:/Server HD/Library/WebServer/Documents/Web Sites/nanoDLP/github.com/patricfallon/Bad-Vibes-Game/blob/master/Hazard.html delayed https://github.com /patricfallon/Bad-Vibes-Game Z:/Server HD/Library/WebServer/Documents/Web Sites/nanoDLP/github.com/patricfallon/Bad-Vibes-Game/blob/master/Hazard.html.z x H]Z |B | OK text/html utf-8 gzip iH | q Tue, 16 Jan 2018 00:34:36 GMT gj pеl@ H]Z H* |
Bad-Vibes-Game/Hazard.cs at master · patricfallon/Bad-Vibes-Game · GitHub
Permalink
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
|
|
public class Hazard : MonoBehaviour |
|
{ |
|
float timer; |
|
float damage = 5f; |
|
|
|
void Update() |
|
{ |
|
timer += Time.deltaTime; |
|
} |
|
|
|
private void OnTriggerEnter(Collider other) |
|
{ |
|
if (other.CompareTag("Player") && timer >= 5) |
|
{ |
|
other.SendMessage("EnemyHit", damage, SendMessageOptions.DontRequireReceiver); |
|
timer = 0; |
|
} |
|
} |
|
} |
You can't perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.