|
|
|
@ -186,7 +186,7 @@ public class TrappedMoveFree : MonoBehaviour
|
|
|
|
|
public void OnEnable() |
|
|
|
|
{ |
|
|
|
|
//MessageDispatcher.AddListener("SetGuidpathIndex", AddGuidIndex); |
|
|
|
|
// MessageDispatcher.AddListener("MOVE_MAN_COMMAND", MoveExcute); |
|
|
|
|
MessageDispatcher.AddListener("MOVE_MAN_COMMAND", MoveExcute); |
|
|
|
|
MessageDispatcher.AddListener("GUIDANCE_MAN_COMMAND", GuidanceTrapped); |
|
|
|
|
MessageDispatcher.AddListener("FRISTAID_MAN_COMMAND", FristAidTrapped); |
|
|
|
|
MessageDispatcher.AddListener("TRAPPED_MOVE_FOLLOW_GUIDE_POINT_COMMAND", MoveFollowGuidPoint); |
|
|
|
@ -203,7 +203,7 @@ public class TrappedMoveFree : MonoBehaviour
|
|
|
|
|
public void OnDestroy() |
|
|
|
|
{ |
|
|
|
|
// MessageDispatcher.RemoveListener("SetGuidpathIndex", AddGuidIndex); |
|
|
|
|
//MessageDispatcher.RemoveListener("MOVE_MAN_COMMAND", MoveExcute); |
|
|
|
|
MessageDispatcher.RemoveListener("MOVE_MAN_COMMAND", MoveExcute); |
|
|
|
|
MessageDispatcher.RemoveListener("GUIDANCE_MAN_COMMAND", GuidanceTrapped); |
|
|
|
|
MessageDispatcher.RemoveListener("FRISTAID_MAN_COMMAND", FristAidTrapped); |
|
|
|
|
MessageDispatcher.RemoveListener("TRAPPED_MOVE_FOLLOW_GUIDE_POINT_COMMAND", MoveFollowGuidPoint); |
|
|
|
@ -219,7 +219,7 @@ public class TrappedMoveFree : MonoBehaviour
|
|
|
|
|
public void OnDisable() |
|
|
|
|
{ |
|
|
|
|
//MessageDispatcher.RemoveListener("SetGuidpathIndex", AddGuidIndex); |
|
|
|
|
// MessageDispatcher.RemoveListener("MOVE_MAN_COMMAND", MoveExcute); |
|
|
|
|
MessageDispatcher.RemoveListener("MOVE_MAN_COMMAND", MoveExcute); |
|
|
|
|
MessageDispatcher.RemoveListener("GUIDANCE_MAN_COMMAND", GuidanceTrapped); |
|
|
|
|
MessageDispatcher.RemoveListener("FRISTAID_MAN_COMMAND", FristAidTrapped); |
|
|
|
|
MessageDispatcher.RemoveListener("TRAPPED_MOVE_FOLLOW_GUIDE_POINT_COMMAND", MoveFollowGuidPoint); |
|
|
|
@ -403,6 +403,7 @@ public class TrappedMoveFree : MonoBehaviour
|
|
|
|
|
|
|
|
|
|
if (info.gameObjID == GetComponent<BaseGameObjInfo>().gameObjID) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (IsBefirstAirOrMoving) |
|
|
|
|
{ |
|
|
|
@ -419,21 +420,27 @@ public class TrappedMoveFree : MonoBehaviour
|
|
|
|
|
LoadPromptWin.Instance.LoadTextPromptWindow("该人员被营救,不能再进行操作", 1f); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (fireMan.GetComponent<FiremanMoveTrapped>().trappedlist.Count > 0) |
|
|
|
|
|
|
|
|
|
//if (fireMan.GetComponent<FiremanMoveTrapped>().trappedlist.Count > 0) |
|
|
|
|
//{ |
|
|
|
|
// if (fireMan.GetComponent<FiremanMoveTrapped>().trappedlist.Contains(info.gameObjID)) |
|
|
|
|
// { |
|
|
|
|
// LoadPromptWin.Instance.LoadTextPromptWindow("该人员已跟随移动", 1f); |
|
|
|
|
// return; |
|
|
|
|
// } |
|
|
|
|
// else |
|
|
|
|
// { |
|
|
|
|
// LoadPromptWin.Instance.LoadTextPromptWindow("不能同时移动多名人员", 1f); |
|
|
|
|
// return; |
|
|
|
|
// } |
|
|
|
|
//} |
|
|
|
|
if (!IsMoveState && !OverMoveOrGuidance) |
|
|
|
|
{ |
|
|
|
|
if (fireMan.GetComponent<FiremanMoveTrapped>().trappedlist.Contains(info.gameObjID)) |
|
|
|
|
{ |
|
|
|
|
LoadPromptWin.Instance.LoadTextPromptWindow("该人员已跟随移动", 1f); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
if (Haemal > 50) |
|
|
|
|
{ |
|
|
|
|
LoadPromptWin.Instance.LoadTextPromptWindow("不能同时移动多名人员", 1f); |
|
|
|
|
LoadPromptWin.Instance.LoadTextPromptWindow("该被困人员不需要移动", 1f); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!IsMoveState && !OverMoveOrGuidance) |
|
|
|
|
{ |
|
|
|
|
if (Vector3.Distance(fireMan.transform.position, transform.position) > 3) |
|
|
|
|
{ |
|
|
|
|
LoadPromptWin.Instance.LoadTextPromptWindow("请靠近需救助人员", 1f); |
|
|
|
@ -869,12 +876,12 @@ public class TrappedMoveFree : MonoBehaviour
|
|
|
|
|
//引导 |
|
|
|
|
if (Guidance) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (guidPoint.Count == 1 /*&& Vector3.Distance(transform.position, guidPoint[0]) < 2*/) |
|
|
|
|
{ |
|
|
|
|
if (TargetPosition != guidPoint[0]) |
|
|
|
|
if (TargetPosition!=guidPoint[0]) |
|
|
|
|
{ |
|
|
|
|
Debug.Log("<color=#00aa00ff>" + "sssssssss" + "</color>"); |
|
|
|
|
Debug.Log("<color=#00aa00ff>" + "sssssssss"+ "</color>"); |
|
|
|
|
TargetPosition = guidPoint[0]; |
|
|
|
|
if (CurrentUserInfo.room != null && CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id) |
|
|
|
|
{ |
|
|
|
@ -913,7 +920,7 @@ public class TrappedMoveFree : MonoBehaviour
|
|
|
|
|
} |
|
|
|
|
else if (guidPoint.Count > 1) |
|
|
|
|
{ |
|
|
|
|
if (!guidPoint.Contains(TargetPosition)) |
|
|
|
|
if (!guidPoint.Contains(TargetPosition)) |
|
|
|
|
{ |
|
|
|
|
AddGuidIndex(); |
|
|
|
|
} |
|
|
|
@ -1021,11 +1028,11 @@ public class TrappedMoveFree : MonoBehaviour
|
|
|
|
|
|
|
|
|
|
void AniamtorSet() |
|
|
|
|
{ |
|
|
|
|
if (Haemal <= 50) |
|
|
|
|
if (Haemal <= 50) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (nav.enabled == false) |
|
|
|
|
if (nav.enabled==false) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|