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.
28 lines
862 B
28 lines
862 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
|
|
public class TriggerArea : MonoBehaviour
|
|
{
|
|
public PlayableDirector playableDirector;
|
|
public bool repeatable = false;
|
|
bool usable = true;
|
|
|
|
private void OnTriggerEnter2D(Collider2D other)
|
|
{
|
|
if(other.CompareTag("Trigger") && usable)
|
|
{
|
|
Debug.Log("Found");
|
|
Character character = other.transform.parent.GetComponent<Character>();
|
|
if(GameManager.instance.gameMode == GameManager.GameMode.Normal && character.id == 0
|
|
&& GameManager.instance.GetExploreMode())
|
|
{
|
|
GameManager.instance.gameMode = GameManager.GameMode.GamePlay;
|
|
playableDirector.Play();
|
|
}
|
|
if(!repeatable) usable = false;
|
|
}
|
|
}
|
|
}
|