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
+50
View File
@@ -0,0 +1,50 @@
using System;
using UnityEngine;
public class WinHandler : MonoBehaviour
{
public bool Won { get; private set; }
public bool isWinning { get; private set; }
public bool moveActive { get; private set; }
public WinZone LastWinZone { get; private set; }
public event Action<WinZone> onTryPassDoor;
private void OnTriggerEnter(Collider other)
{
if (Won)
{
return;
}
WinZone zone = other.GetComponentInParent<WinZone>();
if (zone != null)
{
isWinning = true;
moveActive = zone.moveActive;
LastWinZone = zone;
if (this.onTryPassDoor != null)
{
this.onTryPassDoor(zone);
}
}
}
public void PassZone()
{
if (LastWinZone != null)
{
LastWinZone.Pass();
}
}
public void WinZone()
{
if (LastWinZone != null)
{
Won = true;
}
}
}