add project files

This commit is contained in:
Boris Nikolaev
2026-08-14 01:58:31 +03:00
parent 9134cad79b
commit 5f1e94b653
4399 changed files with 12286903 additions and 0 deletions
@@ -0,0 +1,39 @@
using System;
using UnityEngine;
using OHM.UnityToolkit;
using UnityEngine.Serialization;
public class PickUpItemHandler : MonoBehaviour
{
[SerializeField]
private SFX GoodItem;
[SerializeField]
private SFX BadItem;
[SerializeField]
[FormerlySerializedAs("keyItem")]
private SFX _keyItem;
public event Action<PickUpItem> onPickUpItem;
private void OnTriggerEnter(Collider other)
{
PickUpItem item = other.GetComponentInParent<PickUpItem>();
if (item != null && !item.isUse)
{
item.UseItem();
SFX sfx = (((int)item.valueChange >= 1) ? GoodItem : BadItem);
sfx.Play(base.transform);
if (this.onPickUpItem != null)
{
this.onPickUpItem(item);
}
}
Doors doors = other.GetComponentInParent<Doors>();
if (doors != null)
{
doors.DisableDoors();
}
}
}