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.
 
 
 
 
 
 

49 lines
1.0 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VictoryScript : MonoBehaviour
{
private bool isTriggering = false;
void OnTriggerEnter(Collider other)
{
if (other.tag != "Player")
return;
if (Searchlight.state == Searchlight.SearchState.Chasing)
return;
if (isTriggering)
return;
isTriggering = true;
NotificationServer.notify("show VictoryButton");
}
void OnTriggerExit(Collider other)
{
if (other.tag != "Player")
return;
if (!isTriggering)
return;
isTriggering = false;
NotificationServer.notify("hide VictoryButton");
}
void searchlightStateChanged()
{
if (isTriggering && Searchlight.state == Searchlight.SearchState.Chasing)
{
isTriggering = false;
NotificationServer.notify("hide VictoryButton");
}
}
public void victoryClicked()
{
NotificationServer.notify("fade bgm");
NotificationServer.notify("play sfx", "shipSpotted_2:0.5");
NotificationServer.notify("show VictoryPanel");
NotificationServer.notify("hide GameUI");
}
}