本文整理汇总了C#中GameFramework.EntityInfo.IsDead方法的典型用法代码示例。如果您正苦于以下问题:C# EntityInfo.IsDead方法的具体用法?C# EntityInfo.IsDead怎么用?C# EntityInfo.IsDead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameFramework.EntityInfo
的用法示例。
在下文中一共展示了EntityInfo.IsDead方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnStateLogicCheck
protected override bool OnStateLogicCheck(EntityInfo npc, long deltaTime)
{
if (npc.IsDead()) {
NotifyAiDead(npc);
return false;
}
return true;
}
示例2: OnStateLogicCheck
protected override bool OnStateLogicCheck(EntityInfo entity, long deltaTime)
{
if (entity.IsDead()) {
if (entity.GetAiStateInfo().CurState != (int)AiStateId.Idle) {
NotifyAiStopPursue(entity);
ChangeToState(entity, (int)AiStateId.Idle);
}
return false;
}
return true;
}
示例3: OnStateLogicCheck
protected override bool OnStateLogicCheck(EntityInfo entity, long deltaTime)
{
if (entity.IsDead()) {
if (entity.GetAiStateInfo().CurState != (int)AiStateId.Idle) {
NotifyAiStopPursue(entity);
ChangeToState(entity, (int)AiStateId.Idle);
}
return false;
}
if (IsLeaderDead(entity)) {
entity.SetHp(Operate_Type.OT_Absolute, 0);
return false;
}
return true;
}
示例4: MoveNpc
private void MoveNpc(EntityInfo obj, long deltaTime)
{
if (obj.IsHaveStateFlag(CharacterState_Type.CST_Sleep)
|| obj.IsHaveStateFlag(CharacterState_Type.CST_FixedPosition)) {
return;
}
MovementStateInfo msi = obj.GetMovementStateInfo();
//npc执行移动时忽略阻挡与避让,这些行为由ai模块在规划其路径时执行。
if (!obj.IsDead() && obj.CanMove && msi.IsMoving && !msi.IsSkillMoving) {
ScriptRuntime.Vector3 pos = msi.GetPosition3D();
float speed = (float)obj.GetActualProperty().MoveSpeed;
float distance = (speed * (float)(int)deltaTime) / 1000.0f;
ScriptRuntime.Vector3 dir = msi.TargetDir;
//LogSystem.Debug("MovementSystem npc:{0} speed:{1} deltaTime:{2} distance:{3}", obj.GetId(), speed, deltaTime, distance);
float x = 0, y = 0;
if (msi.CalcDistancSquareToTarget() < distance * distance) {
x = msi.TargetPosition.X;
y = msi.TargetPosition.Z;
ScriptRuntime.Vector2 newPos = new ScriptRuntime.Vector2(x, y);
msi.SetPosition2D(newPos);
msi.IsMoving = false;
User user = obj.CustomData as User;
if (null != user) {
Msg_RC_NpcMove npcMoveBuilder = DataSyncUtility.BuildNpcMoveMessage(obj);
if (null != npcMoveBuilder) {
Scene scene = user.OwnRoom.ActiveScene;
if (null != scene) {
scene.NotifyAllUser(RoomMessageDefine.Msg_RC_NpcMove, npcMoveBuilder);
}
}
}
} else {
ScriptRuntime.Vector3 tpos = pos + dir * distance;
msi.SetPosition(tpos);
}
}
}