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.8 KiB
61 lines
2.8 KiB
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using AX.Network.Protocols; |
|
using UnityEngine; |
|
using AX.Serialization; |
|
using UnityEngine.AI; |
|
|
|
/// <summary> |
|
/// 被困人员。伤员血量同步 |
|
/// </summary> |
|
public class HAEMAL_BLOOD_SYNC : NetworkMessageBehaviour |
|
{ |
|
protected override void Execute(BinaryMessage message) |
|
{ |
|
InputHistory.Instance.RegisterInputHistory(message); |
|
|
|
var info = message.Body.Deserialize<HaemalSyncData>(); |
|
// var sender = info.SendUserID; |
|
if (InputManager.Instance) |
|
{ |
|
if (CurrentUserInfo.mySelf.Id != info.SendUserID) |
|
{ |
|
if (info.gameObjID == GetComponent<BaseGameObjInfo>().gameObjID) |
|
{ |
|
GetComponent<BaseHaemalController>().Haemal = info.Haemal; |
|
if (GetComponent<TrappedMoveFree>()) |
|
{ |
|
GetComponent<TrappedMoveFree>().Haemal = info.Haemal; |
|
if (info.FallDown) |
|
{ |
|
if (GetComponent<TrappedPathFind>()) |
|
{ |
|
GetComponent<TrappedMoveFree>().CancelInvoke(); |
|
GetComponent<TrappedPathFind>().StopAllCoroutines(); |
|
GetComponent<Animator>().SetFloat("Speed", 0); |
|
GetComponent<Animator>().SetBool("FallDown", true); |
|
GetComponent<TrappedMoveFree>().movestate = MoveState.FALLDOWN; |
|
GetComponent<TrappedPathFind>().pathFindEnable = false; |
|
GetComponent<NavMeshAgent>().SetDestination(transform.position); |
|
GetComponent<TrappedMoveFree>().targetPosition = transform.position; |
|
// GetComponent<NavMeshAgent>().enabled = false; |
|
//GetComponent<CapsuleCollider>().center = new Vector3(0f, 0.2f, 0f); |
|
// GetComponent<CapsuleCollider>().direction = 0; |
|
|
|
//if (GetComponent<CapsuleCollider>().enabled) |
|
//{ |
|
// GetComponent<TrappedMoveFree>().FallDown(); |
|
// //GetComponent<CapsuleCollider>().enabled = false; |
|
// //GetComponent<BoxCollider>().enabled = true; |
|
// //transform.Find("Trigger").GetComponent<BoxCollider>().center = GetComponent<BoxCollider>().center; |
|
//} |
|
} |
|
} |
|
} |
|
|
|
} |
|
} |
|
}; |
|
} |
|
}
|
|
|