예제 #1
0
        public void HideEntity(UInt64 sGUID)
        {
            if (!AllEntitys.ContainsKey(sGUID))
            {
                return;
            }

            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);
                    //  UIEnemyTeamMateInfo.Instance.RemovePlayerEnemy((Iplayer)entity);
                }
            }

            //if (UIMiniMap.Instance != null)
            //{
            //    UIMiniMap.Instance.DestroyMapElement(sGUID);
            //}

            Iselfplayer player = PlayerManager.Instance.LocalPlayer;

            if (player != null && player.SyncLockTarget == AllEntitys[sGUID])
            {
                player.SetSyncLockTarget(null);
            }

            AllEntitys[sGUID].HideXueTiao();

            AllEntitys[sGUID].realObject.active = false;
        }
예제 #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);
        }