using System;
using System.Collections;
using System.Collections.Generic;
using AX.Network.Protocols;
using UnityEngine;
using AX.Serialization;
using UnityEngine.AI;
///
/// 被困人员。伤员血量同步
///
public class HAEMAL_BLOOD_SYNC : NetworkMessageBehaviour
{
protected override void Execute(BinaryMessage message)
{
InputHistory.Instance.RegisterInputHistory(message);
var info = message.Body.Deserialize();
// var sender = info.SendUserID;
if (InputManager.Instance)
{
if (CurrentUserInfo.mySelf.Id != info.SendUserID)
{
if (info.gameObjID == GetComponent().gameObjID)
{
GetComponent().Haemal = info.Haemal;
if (GetComponent())
{
GetComponent().Haemal = info.Haemal;
if (info.FallDown)
{
if (GetComponent())
{
GetComponent().CancelInvoke();
GetComponent().StopAllCoroutines();
GetComponent().SetFloat("Speed", 0);
GetComponent().SetBool("FallDown", true);
GetComponent().movestate = MoveState.FALLDOWN;
GetComponent().pathFindEnable = false;
GetComponent().SetDestination(transform.position);
GetComponent().targetPosition = transform.position;
// GetComponent().enabled = false;
//GetComponent().center = new Vector3(0f, 0.2f, 0f);
// GetComponent().direction = 0;
//if (GetComponent().enabled)
//{
// GetComponent().FallDown();
// //GetComponent().enabled = false;
// //GetComponent().enabled = true;
// //transform.Find("Trigger").GetComponent().center = GetComponent().center;
//}
}
}
}
}
}
};
}
}