Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Damage : MonoBehaviour {
- public Health health;
- public float uron;
- public float AttacTime; // Период между атаками
- private float t; // второстипенная переменная необходимая для выполнения логики
- void OnTriggerStay (Collider other) {
- if (other.CompareTag ("Player")) {
- //if (other.GetComponent ("MalePlayer_Photon")) {
- //Debug.Log ("ПЛЕЕР");
- health = GetComponent <Health> ();
- if (Time.time - t > AttacTime)
- {
- //Debug.Log ("ПЛЕЕР2");
- health.Takedamage (uron);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement