Exemple #1
0
 public static bool IsSelfHomeBase(Ientity entity)
 {
     if (entity == null)
     {
         return(false);
     }
     if (PlayerManager.Instance.LocalPlayer != null && PlayerManager.Instance.LocalPlayer.EntityCamp != entity.EntityCamp)
     {
         return(false);
     }
     for (int i = 0; i < HOME_BASE_ID.Length; i++)
     {
         if (HOME_BASE_ID[i] == entity.NpcGUIDType)
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #2
0
        public static int HandleDelectEntity(UInt64 sGUID)
        {
            if (!AllEntitys.ContainsKey(sGUID))
            {
                return((int)ReturnRet.eT_DelEntityFailed);
            }
            Ientity entity = null;

            if (EntityManager.AllEntitys.TryGetValue(sGUID, out entity) && entity.entityType == EntityType.Player)
            {
                if (PlayerManager.Instance.LocalAccount.ObType == ObPlayerOrPlayer.PlayerType)
                {
                    Iplayer.AddOrDelEnemy((Iplayer)entity, false);
                }
            }
            Iselfplayer player = PlayerManager.Instance.LocalPlayer;

            if (player != null && player.SyncLockTarget == AllEntitys[sGUID])
            {
                player.SetSyncLockTarget(null);
            }
            if (entity.entityType == EntityType.Building)
            {
                MonoBehaviour.DestroyImmediate(AllEntitys[sGUID].realObject);
            }
            else
            {
                //删除GameObject
                GameObjectPool.Instance.ReleaseGO(AllEntitys[sGUID].resPath, AllEntitys[sGUID].realObject, PoolObjectType.POT_Entity);
            }
            AllEntitys[sGUID].DestroyXueTiao();
            AllEntitys[sGUID] = null;
            AllEntitys.Remove(sGUID);

            return((int)ReturnRet.eT_Normal);
        }
Exemple #3
0
 /// <summary>
 /// 设置entity基本属性、读取配置表
 /// </summary>
 /// <param name="id"></param>
 public virtual void SetCommonProperty(Ientity entity, int id)
 {
     entity.ModelName   = GetModeName(id);
     entity.NpcGUIDType = id;
 }
Exemple #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="entity"></param>
 public static void DelectBombBase(Ientity entity)
 {
     MonoBehaviour.DestroyImmediate(entity.realObject);
     entity.DestroyXueTiao();
     entity = null;
 }
Exemple #5
0
 /// <summary>
 /// EntityFSMChangeDataOnSing
 /// </summary>
 /// <param name="mvPos"></param>
 /// <param name="mvDir"></param>
 /// <param name="skillID"></param>
 /// <param name="targetID"></param>
 public void EntityFSMChangeDataOnSing(Vector3 mvPos, Vector3 mvDir, int skillID, Ientity targetID)
 {
     EntityFSMPosition  = mvPos;
     EntityFSMDirection = mvDir;
     EntitySkillID      = skillID;
     entitySkillTarget  = targetID;
 }
Exemple #6
0
 protected int isAbsorb;   //1是吸附0不是
 public void EntityFSMChangeDataOnPrepareSkill(Vector3 mvPos, Vector3 mvDir, int skillID, Ientity targetID, int isAbsorbSkill = 0)
 {
     EntityFSMPosition  = mvPos;
     EntityFSMDirection = mvDir;
     EntitySkillID      = skillID;
     entitySkillTarget  = targetID;
     isAbsorb           = isAbsorbSkill;
 }