コード例 #1
0
        public static EntityBase GetEntity(this EntityComponent entityComponent, int serialId)
        {
            Entity     playerEntity = entityComponent.GetEntity(serialId);
            EntityBase entity       = (EntityBase)playerEntity?.Logic;

            return(entity);
        }
        /// <summary>
        /// 获取实体逻辑脚本
        /// </summary>
        /// <param name="entityId">实体编号</param>
        public static Entity GetGameEntity(this EntityComponent entityComponent, int entityId)
        {
            UnityGameFramework.Runtime.Entity entity = entityComponent.GetEntity(entityId);
            if (entity == null)
            {
                return(null);
            }

            return((Entity)entity.Logic);
        }
コード例 #3
0
        public static T GetRole <T>(this EntityComponent entityComponent, int entityId) where T : RoleEntityBase
        {
            if (entityId == 0)
            {
                return(default(T));
            }

            T role = entityComponent.GetEntity(entityId)?.Logic as T;

            return(role);
        }
コード例 #4
0
        public static EntityLogic GetGameEntity(this EntityComponent entityComponent, int entityId)
        {
            Entity entity = entityComponent.GetEntity(entityId);

            if (entity == null)
            {
                return(null);
            }

            return((EntityLogic)entity.Logic);
        }
コード例 #5
0
        /// <summary>
        /// 根据实体id获取实体
        /// </summary>
        /// <param name="entityComponent">实体组件</param>
        /// <param name="entityId">实体编号</param>
        /// <returns>逻辑实体</returns>
        public static EntityLogicBase GetGameEntity(this EntityComponent entityComponent, int entityId)
        {
            UnityGameFrame.Runtime.Entity entity = entityComponent.GetEntity(entityId);
            HotEntity hotEntity = entity.Logic as HotEntity;

            if (hotEntity == null)
            {
                return(null);
            }

            return(hotEntity.HotLogicInstance as EntityLogicBase);
        }
コード例 #6
0
        public static EntityBase GetGameEntity(this EntityComponent entityComponent, int entityId)
        {
            Entity entity = entityComponent.GetEntity(entityId);

            return((EntityBase)entity?.Logic);
        }
コード例 #7
0
 public static void GetMyCharacter(this EntityComponent entityComponent)
 {
     entityComponent.GetEntity(-1);
     //		    entityComponent.ShowEntity(typeof(MyCharacter), "Character", Constant.AssetPriority.MyAircraftAsset, data);
 }