本文整理汇总了C#中GameFramework.EntityInfo类的典型用法代码示例。如果您正苦于以下问题:C# EntityInfo类的具体用法?C# EntityInfo怎么用?C# EntityInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityInfo类属于GameFramework命名空间,在下文中一共展示了EntityInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: BuildCampChangedMessage
internal static Msg_RC_CampChanged BuildCampChangedMessage(EntityInfo obj)
{
Msg_RC_CampChanged msg = new Msg_RC_CampChanged();
msg.obj_id = obj.GetId();
msg.camp_id = obj.GetCampId();
return msg;
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:7,代码来源:DataSyncUtility.cs
示例2: OnStateLogicInit
protected override void OnStateLogicInit(EntityInfo entity, long deltaTime)
{
AiStateInfo info = entity.GetAiStateInfo();
info.Time = 0;
info.HomePos = entity.GetMovementStateInfo().GetPosition3D();
info.Target = 0;
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:7,代码来源:AiLogic_Npc_Member.cs
示例3: BuildNpcFaceMessage
internal static Msg_RC_NpcFace BuildNpcFaceMessage(EntityInfo npc)
{
Msg_RC_NpcFace npcFaceBuilder = new Msg_RC_NpcFace();
npcFaceBuilder.npc_id = npc.GetId();
npcFaceBuilder.face_direction = ProtoHelper.EncodeFloat(npc.GetMovementStateInfo().GetFaceDir());
return npcFaceBuilder;
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:7,代码来源:DataSyncUtility.cs
示例4: BuildCreateNpcMessage
internal static Msg_RC_CreateNpc BuildCreateNpcMessage(EntityInfo npc, int rate = -1)
{
Msg_RC_CreateNpc bder = new Msg_RC_CreateNpc();
bder.npc_id = npc.GetId();
bder.unit_id = npc.GetUnitId();
ScriptRuntime.Vector3 pos = npc.GetMovementStateInfo().GetPosition3D();
GameFrameworkMessage.Position pos_bd = new GameFrameworkMessage.Position();
pos_bd.x = (float)pos.X;
pos_bd.z = (float)pos.Z;
bder.cur_pos = pos_bd;
bder.face_direction = (float)npc.GetMovementStateInfo().GetFaceDir();
bder.link_id = npc.GetLinkId();
bder.camp_id = npc.GetCampId();
if (npc.OwnerId > 0) {
bder.owner_id = npc.OwnerId;
}
if (npc.GetAiStateInfo().LeaderID > 0) {
bder.leader_id = npc.GetAiStateInfo().LeaderID;
}
User user = npc.CustomData as User;
if (null != user) {
bder.key = user.GetKey();
}
bder.level = npc.GetLevel();
return bder;
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:27,代码来源:DataSyncUtility.cs
示例5: OnCreateEntity
private void OnCreateEntity(EntityInfo entity)
{
if (null != entity) {
StorySystem.SendMessage("obj_created", entity.GetId());
StorySystem.SendMessage(string.Format("npc_created:{0}", entity.GetUnitId()), entity.GetId());
}
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:7,代码来源:Scene_EventHandler.cs
示例6: TickNpc
private void TickNpc(EntityInfo entity, long delta)
{
IAiStateLogic logic = AiLogicManager.Instance.GetNpcStateLogic(entity.GetAiStateInfo().AiLogic);
if (null != logic) {
logic.Execute(entity, delta);
}
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:7,代码来源:AiSystem.cs
示例7: OnAiFace
private void OnAiFace(EntityInfo entity)
{
if (null != entity && entity.EntityType != (int)EntityTypeEnum.Tower) {
float dir = entity.GetMovementStateInfo().GetFaceDir();
GameObject actor = EntityController.Instance.GetGameObject(entity.GetId());
actor.transform.localRotation = Quaternion.Euler(0, Utility.RadianToDegree(dir), 0);
}
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:8,代码来源:AiViewModelManager.cs
示例8: DslLogicHandler
private void DslLogicHandler(EntityInfo entity, long deltaTime)
{
AiStateInfo info = entity.GetAiStateInfo();
if (null != info.AiStoryInstanceInfo) {
long curTime = TimeUtility.GetLocalMilliseconds();
info.AiStoryInstanceInfo.m_StoryInstance.Tick(curTime);
}
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:8,代码来源:AiLogic_Npc_DslLogic.cs
示例9: OnStateLogicCheck
protected override bool OnStateLogicCheck(EntityInfo npc, long deltaTime)
{
if (npc.IsDead()) {
NotifyAiDead(npc);
return false;
}
return true;
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:8,代码来源:AiLogic_Npc_General.cs
示例10: RefixAttrByImpact
public static void RefixAttrByImpact(EntityInfo obj)
{
List<ImpactInfo> impacts = obj.GetSkillStateInfo().GetAllImpact();
for (int i = 0; i < impacts.Count; ++i) {
ImpactInfo impact = impacts[i];
impact.RefixCharacterProperty(obj);
}
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:8,代码来源:AttrCalculator.cs
示例11: GfxSkillSenderInfo
internal GfxSkillSenderInfo(TableConfig.Skill configData, int seq, int actorId, EntityInfo gfxObj, Scene scene)
{
m_Seq = seq;
m_ConfigData = configData;
m_ActorId = actorId;
m_GfxObj = gfxObj;
m_Scene = scene;
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:8,代码来源:ServerSkillSystem.cs
示例12: Calc
public static void Calc(EntityInfo entity)
{
ResetBaseProperty(entity);
RefixAttrByImpact(entity);
int hpMax = entity.GetActualProperty().HpMax;
entity.GetActualProperty().SetHpMax(Operate_Type.OT_Absolute, hpMax);
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:8,代码来源:AttrCalculator.cs
示例13: AddObjForBuild
public void AddObjForBuild(EntityInfo obj)
{
if (null == m_Objects[m_ObjectNum])
m_Objects[m_ObjectNum] = new KdTreeObject(obj);
else
m_Objects[m_ObjectNum].CopyFrom(obj);
++m_ObjectNum;
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:8,代码来源:KdObjectTree.cs
示例14: GetLivingCharacterInfoHelper
public static EntityInfo GetLivingCharacterInfoHelper(EntityInfo srcObj, int id)
{
EntityInfo target = srcObj.EntityManager.GetEntityInfo(id);
if (null != target) {
if (target.IsDead())
target = null;
}
return target;
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:9,代码来源:AiLogicUtility.cs
示例15: GetAiData
private AiData_General GetAiData(EntityInfo entity)
{
AiData_General data = entity.GetAiStateInfo().AiDatas.GetData<AiData_General>();
if (null == data) {
data = new AiData_General();
entity.GetAiStateInfo().AiDatas.AddData(data);
}
return data;
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:9,代码来源:AiLogic_Npc_DslLogic.cs
示例16: OnDestroyEntity
private void OnDestroyEntity(EntityInfo entity)
{
if (null != entity) {
TableConfig.LevelMonster monster = entity.LevelMonsterData;
if (null != monster) {
ReloadMonstersQueue.Enqueue(monster);
}
}
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:9,代码来源:Scene_EventHandler.cs
示例17: IdleHandler
private void IdleHandler(EntityInfo entity, long deltaTime)
{
AiStateInfo info = entity.GetAiStateInfo();
info.Time += deltaTime;
if (info.Time > 100) {
info.Time = 0;
ChangeToState(entity, (int)AiStateId.DslLogic);
}
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:9,代码来源:AiLogic_Npc_DslLogic.cs
示例18: GetHearstTargetHelper
public static EntityInfo GetHearstTargetHelper(EntityInfo srcObj,float range,CharacterRelation relation, AiTargetType type)
{
EntityInfo nearstTarget = null;
float minPowDist = 999999;
srcObj.SceneContext.KdTree.Query(srcObj, range, (float distSqr, KdTreeObject kdTreeObj) => {
StepCalcNearstTarget(srcObj, relation, type, distSqr, kdTreeObj.Object, ref minPowDist, ref nearstTarget);
});
return nearstTarget;
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:9,代码来源:AiLogicUtility.cs
示例19: CombatHandler
private void CombatHandler(EntityInfo npc, long deltaTime)
{
if (npc.GetSkillStateInfo().IsSkillActivated()) {
return;
}
AiStateInfo info = npc.GetAiStateInfo();
Vector3 targetPos = info.HomePos;
ScriptRuntime.Vector3 srcPos = npc.GetMovementStateInfo().GetPosition3D();
float distSqrToHome = Geometry.DistanceSquare(srcPos, info.HomePos);
if (distSqrToHome > npc.GohomeRange * npc.GohomeRange) {
NotifyAiStopPursue(npc);
ChangeToState(npc, (int)AiStateId.GoHome);
return;
}
///
EntityInfo attackTarget = null;
SkillStateInfo currSkInfo = npc.GetSkillStateInfo();
///找到可以使用的技能
SkillInfo skInfo = AiLogicUtility.NpcFindCanUseSkill(npc, this.GetAiData(npc), true);
NotifyAiSelectSkill(npc, skInfo);
if (skInfo == null) {
//没有可以使用的技能就切换到Idle状态
ChangeToState(npc, (int)AiStateId.Idle);
return;
}
CharacterRelation relation =
(skInfo.TargetType == SkillTargetType.Friend ||
skInfo.TargetType == SkillTargetType.RandFriend) ?
CharacterRelation.RELATION_FRIEND :
CharacterRelation.RELATION_ENEMY;
attackTarget = AiLogicUtility.GetNearstTargetHelper(
npc, skInfo.Distance, relation);
if (attackTarget != null && null != skInfo) //攻击范围内找到可攻击目标
{
info.Target = attackTarget.GetId();
NotifyAiStopPursue(npc);
NotifyAiSkill(npc, skInfo.SkillId); //攻击目标
return;
}
attackTarget = AiLogicUtility.GetNearstTargetHelper(
npc, npc.ViewRange, relation);
if (attackTarget != null) //视野范围内找到可攻击目标
{
NotifyAiPursue(npc, attackTarget.GetMovementStateInfo().GetPosition3D()); // 追赶目标
return;
}
currSkInfo.SetCurSkillInfo(0);
NotifyAiStopPursue(npc);
ChangeToState(npc, (int)AiStateId.GoHome);
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:56,代码来源:AiLogic_Npc_General.cs
示例20: CombatHandler
private void CombatHandler(EntityInfo npc, long deltaTime)
{
AiStateInfo aiInfo = npc.GetAiStateInfo();
AiData_Leader aiData = GetAiData(npc);
if (npc.GetSkillStateInfo().IsSkillActivated()) {
return;
}
///
SkillStateInfo currSkInfo = npc.GetSkillStateInfo();
///找到可以使用的技能
SkillInfo skInfo = AiLogicUtility.NpcFindCanUseSkill(npc, this.GetAiData(npc), aiData.IsAutoOperate);
NotifyAiSelectSkill(npc, skInfo);
if (skInfo == null) {
//没有可以使用的技能就切换到Idle状态
ChangeToState(npc, (int)AiStateId.Idle);
return;
}
CharacterRelation relation =
(skInfo.TargetType == SkillTargetType.Friend ||
skInfo.TargetType == SkillTargetType.RandFriend) ?
CharacterRelation.RELATION_FRIEND :
CharacterRelation.RELATION_ENEMY;
EntityInfo attackTarget = AiLogicUtility.GetNearstAttackerHelper(npc, relation, aiData);
if (null != attackTarget) {
NotifyAiTarget(npc, attackTarget);
if (Geometry.DistanceSquare(npc.GetMovementStateInfo().GetPosition3D(), attackTarget.GetMovementStateInfo().GetPosition3D()) < skInfo.Distance * skInfo.Distance) {
aiInfo.Target = attackTarget.GetId();
NotifyAiStopPursue(npc);
NotifyAiSkill(npc, skInfo.SkillId);
return;
}
}
attackTarget = AiLogicUtility.GetNearstTargetHelper(npc, skInfo.Distance, relation);
if (attackTarget != null && null != skInfo) { //攻击范围内找到可攻击目标
NotifyAiTarget(npc, attackTarget);
aiInfo.Target = attackTarget.GetId();
NotifyAiStopPursue(npc);
NotifyAiSkill(npc, skInfo.SkillId); //攻击目标
return;
}
if (aiData.IsAutoOperate) {
attackTarget = AiLogicUtility.GetNearstTargetHelper(npc, npc.ViewRange, relation);
if (attackTarget != null && null != skInfo) { //视野内找到可攻击目标
NotifyAiPursue(npc, attackTarget.GetMovementStateInfo().GetPosition3D());
return;
}
}
///退出战斗模式清理一下手动技能
currSkInfo.SetCurSkillInfo(0);
aiData.ManualSkillId = 0;
NotifyAiStopPursue(npc);
ChangeToState(npc, (int)AiStateId.Idle);
}
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:55,代码来源:AiLogic_Npc_Leader.cs
注:本文中的GameFramework.EntityInfo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论