You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
822 B
38 lines
822 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
|
|
public class SetItem : MonoBehaviour
|
|
{
|
|
public int i = 0;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
private void OnTriggerStay(Collider collision)
|
|
{
|
|
// Debug.Log(collision.gameObject.name);
|
|
Camera.main.GetComponent<Player>().Hp -= Time.deltaTime;
|
|
Camera.main.GetComponent<Player>().SetHp();
|
|
}
|
|
|
|
private void OnTriggerEnter(Collider collision)
|
|
{
|
|
Camera.main.GetComponent<Player>().inTarget = true;
|
|
}
|
|
|
|
private void OnTriggerExit(Collider collision)
|
|
{
|
|
Camera.main.GetComponent<Player>().inTarget = false;
|
|
}
|
|
}
|