55 lines
1.3 KiB
C#
55 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Sirenix.OdinInspector;
|
|
|
|
/// <summary>
|
|
/// 皇帝类,控制皇帝的行为,继承自可交互物体
|
|
/// </summary>
|
|
public class HuangDi : EntryTrigger
|
|
{
|
|
[SerializeField][EnumPaging]
|
|
private KnotMediator.KnotType neededType = KnotMediator.KnotType.编成麻花的绳结;
|
|
|
|
public enum HuangDiState
|
|
{
|
|
None,
|
|
Ask,
|
|
Answer,
|
|
End
|
|
}
|
|
|
|
public HuangDiState state = HuangDiState.None;
|
|
|
|
public override void OnCall()
|
|
{
|
|
|
|
if(state == HuangDiState.Ask)
|
|
{
|
|
if(KnotMediator.Instance.CheckKnotType(neededType))
|
|
{
|
|
Debug.Log("皇帝接受了绳结");
|
|
state = HuangDiState.Answer;
|
|
//触发结束演出
|
|
FindObjectOfType<HuangdiConfused>().OnCall();
|
|
}
|
|
else
|
|
{
|
|
Debug.Log("皇帝拒绝了绳结");
|
|
FindObjectOfType<HuangdiAsk>().OnCall();
|
|
}
|
|
}
|
|
if(state == HuangDiState.None)
|
|
{
|
|
FindObjectOfType<HuangdiAsk>().OnCall();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public void setNeededType(KnotMediator.KnotType type)
|
|
{
|
|
neededType = type;
|
|
}
|
|
}
|