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.
48 lines
1.3 KiB
48 lines
1.3 KiB
4 years ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using AX.InputSystem;
|
||
|
using AX.MessageSystem;
|
||
|
|
||
|
public class AskInsider : MonoBehaviour {
|
||
|
|
||
|
private void OnEnable()
|
||
|
{
|
||
|
MessageDispatcher.AddListener("ASK_PEOPLE_COMMAND", OpenPanel);
|
||
|
}
|
||
|
|
||
|
private void OnDisable()
|
||
|
{
|
||
|
MessageDispatcher.RemoveListener("ASK_PEOPLE_COMMAND", OpenPanel);
|
||
|
}
|
||
|
|
||
|
private void OnDestroy()
|
||
|
{
|
||
|
MessageDispatcher.RemoveListener("ASK_PEOPLE_COMMAND", OpenPanel);
|
||
|
}
|
||
|
|
||
|
|
||
|
private void OpenPanel(IMessage msg)
|
||
|
{
|
||
|
var data = (ForcibleEntryCmdArgs)msg.Data;
|
||
|
if (GameSettings.othersSettings.playState == PlayState.Playing)
|
||
|
{
|
||
|
CursorManager.GetInstance.SetClick(data);
|
||
|
}
|
||
|
|
||
|
if (gameObject.GetComponent<CloneGameObjInfo>().gameObjID == data.gameObjID)
|
||
|
{
|
||
|
GameObject fireMan = EntitiesManager.Instance.GetEntityByID(data.fireManID);
|
||
|
if (Vector3.Distance(fireMan.transform.position, transform.position) < 2f)
|
||
|
{
|
||
|
AskInsiderPanel.Instance.Show();
|
||
|
// AskInsiderPanel.Instance.OpenPanel();
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
LoadPromptWin.Instance.LoadTextPromptWindow("请靠近知情人", 1f);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|