贵港吾悦商业管理有限公司多角色网上演练(吾悦广场)
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.
 
 
 
 
 

61 lines
2.3 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AX.MessageSystem;
using System;
using AX.InputSystem;
using AX.NetworkSystem;
public class ForcibleEntryCtrl : MonoBehaviour
{
public List<GameObject> FireManOnRightPos = new List<GameObject>();
private void Awake()
{
MessageDispatcher.AddListener("FORCIBLE_ENTRY_COMMAND", ForcibleExect);
}
private void OnDestroy()
{
MessageDispatcher.RemoveListener("FORCIBLE_ENTRY_COMMAND", ForcibleExect);
}
private void ForcibleExect(IMessage obj)
{
var info = (ForcibleEntryCmdArgs)obj.Data;
if (gameObject.GetComponent<CloneGameObjInfo>().gameObjID == info.gameObjID)
{
GameObject fireMan = EntitiesManager.Instance.GetEntityByID(info.fireManID);
if (FireManOnRightPos.Contains(fireMan))
{
if (fireMan.GetComponent<FireManControl>().workType == FireManSkills.ForcibleEntry)
{
if (fireMan.GetComponent<Bags>().HasEquip("无齿锯"))
{
EntitiesManager.Instance.DeleteObj(gameObject);
LoadPromptWin.Instance.LoadTextPromptWindow("破拆成功", 1f);
//这里暂时用的是物品删除的同步
if (GameSettings.othersSettings.mode != Mode.DisasterManagement)
{
BaseNetworkSyncDate arg = new BaseNetworkSyncDate();
arg.SendUserID = CurrentUserInfo.mySelf.Id;
arg.gameObjID = gameObject.GetComponent<BaseGameObjInfo>().gameObjID;
NetworkManager.Default.SendAsync("OBJ_DELECT_SYNC", arg);
}
}
else
{
LoadPromptWin.Instance.LoadTextPromptWindow("未装备无齿锯", 1f);
}
}
else
{
LoadPromptWin.Instance.LoadTextPromptWindow("请选择破拆技能", 1f);
}
}
else
{
LoadPromptWin.Instance.LoadTextPromptWindow("请站在正确的破拆位置", 1f);
}
}
}
}