first commit
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class NarrativeEventManager : MonoBehaviour
|
||||
{
|
||||
public HintManager hintManager;
|
||||
public GameObject secretChest;
|
||||
public Light secretLight;
|
||||
public Transform exitDoor;
|
||||
public Vector3 doorOpenOffset = new Vector3(0f, 2.6f, 0f);
|
||||
|
||||
private bool statueEventCompleted;
|
||||
private bool sceneFinished;
|
||||
private Vector3 closedDoorPosition;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (exitDoor != null)
|
||||
{
|
||||
closedDoorPosition = exitDoor.position;
|
||||
}
|
||||
|
||||
if (secretChest != null)
|
||||
{
|
||||
secretChest.SetActive(false);
|
||||
}
|
||||
|
||||
if (secretLight != null)
|
||||
{
|
||||
secretLight.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnStatueInteracted()
|
||||
{
|
||||
if (statueEventCompleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
statueEventCompleted = true;
|
||||
hintManager?.ShowHint("В стене открылся тайный механизм...", 3.5f);
|
||||
|
||||
// This is the simple narrative payoff: reveal reward, add light, and open the exit.
|
||||
if (secretChest != null)
|
||||
{
|
||||
secretChest.SetActive(true);
|
||||
}
|
||||
|
||||
if (secretLight != null)
|
||||
{
|
||||
secretLight.enabled = true;
|
||||
}
|
||||
|
||||
if (exitDoor != null)
|
||||
{
|
||||
exitDoor.position = closedDoorPosition + doorOpenOffset;
|
||||
}
|
||||
}
|
||||
|
||||
public void FinishScene()
|
||||
{
|
||||
if (sceneFinished)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sceneFinished = true;
|
||||
hintManager?.ShowHint("Артефакт найден. Сцена завершена.", 4f);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user