Ejemplo n.º 1
0
        /// <summary>
        /// 显示创建角色
        /// </summary>
        /// <param name="entityComponent"></param>
        /// <param name="jobId">职业Id</param>
        public static void ShowCreateRole(this EntityComponent entityComponent, int jobId)
        {
            JobDBModel jobDBModel = GameEntry.DataTable.GetDataTable <JobDBModel>();
            JobEntity  jobEntity  = jobDBModel.Get(jobId);

            if (jobEntity == null)
            {
                Log.Warning("Can not load createrole entity id '{0}' from data table.", jobId.ToString());
                return;
            }
            int entityId = jobId * -10000;

            entityComponent.ShowEntity(entityId, typeof(CreateRoleEntity), AssetUtility.GetCreateRoleAsset(jobEntity.CreateRoleAssetName), "Role", Constant.AssetPriority.CreateRoleAsset, new CreateRoleData().Fill(entityId, jobEntity.Id, jobId));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 设置UI是否选中显示
        /// </summary>
        /// <param name="selectRoleId">选中的Id</param>
        private void SetImage(int selectRoleId)
        {
            JobDBModel jobDBModel = GameEntry.DataTable.GetDataTable <JobDBModel>();
            JobEntity  jobEntity  = jobDBModel.Get(m_JobId);

            if (jobEntity == null)
            {
                Log.Warning("Can not load job '{0}' from data table.", m_JobId.ToString());
                return;
            }
            if (selectRoleId == m_RoleId)
            {
                m_ImageSelection.SetImage(AssetUtility.GetCreateRoleImageAsset(jobEntity.HeadSelectAssetName));
            }
            else
            {
                m_ImageSelection.SetImage(AssetUtility.GetCreateRoleImageAsset(jobEntity.HeadNotSelectAssetName));
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 显示武器
        /// </summary>
        /// <param name="entityComponent"></param>
        /// <param name="Owner"></param>
        /// <param name="jobId"></param>
        /// <param name="wingTypeId"></param>
        public static void ShowWeapon(this EntityComponent entityComponent, Entity owner, int jobId, int wingTypeId)
        {
            JobDBModel jobDBModel = GameEntry.DataTable.GetDataTable <JobDBModel>();
            JobEntity  jobEntity  = jobDBModel.Get(jobId);

            if (jobEntity == null)
            {
                Log.Warning("Can not load job wapon id '{0}' from data table.", jobId.ToString());
                return;
            }
            if (jobEntity.WeaponPointCount == 1)
            {
                entityComponent.ShowEntity(typeof(WeaponEntity), "Weapon", Constant.AssetPriority.WingAsset, new WeaponData(entityComponent.GenerateSerialId(), wingTypeId, jobId, owner.Id, jobEntity.WeaponPoint1));
            }
            else if (jobEntity.WeaponPointCount == 2)
            {
                entityComponent.ShowEntity(typeof(WeaponEntity), "Weapon", Constant.AssetPriority.WingAsset, new WeaponData(entityComponent.GenerateSerialId(), wingTypeId, jobId, owner.Id, jobEntity.WeaponPoint1));
                entityComponent.ShowEntity(typeof(WeaponEntity), "Weapon", Constant.AssetPriority.WingAsset, new WeaponData(entityComponent.GenerateSerialId(), wingTypeId, jobId, owner.Id, jobEntity.WeaponPoint2));
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 显示主玩家
        /// </summary>
        /// <param name="entityComponent"></param>
        public static void ShowMainPlayer(this EntityComponent entityComponent)
        {
            RoleInfo roleInfo = GameEntry.Data.UserData.RoleInfo;

            if (roleInfo == null)
            {
                Log.Error("Roleinfo is invalid.");
                return;
            }

            JobDBModel jobDBModel = GameEntry.DataTable.GetDataTable <JobDBModel>();
            JobEntity  jobEntity  = jobDBModel.Get(roleInfo.JobId);

            if (jobEntity == null)
            {
                Log.Warning("Can not load createrole entity id '{0}' from data table.", roleInfo.JobId.ToString());
                return;
            }
            int entityId = roleInfo.RoleId;

            entityComponent.ShowEntity(entityId, typeof(MainPlayer), AssetUtility.GetRoleAsset(jobEntity.AssetName), "Role", Constant.AssetPriority.RolePlayerAsset, new ManiPlayerData().Fill(roleInfo));
        }
Ejemplo n.º 5
0
        public override void Init()
        {
            m_Animator = Owner.gameObject.GetOrAddComponent <Animator>();
            if (Owner is PlayerBase)
            {
                int jobId = ((PlayerBase)Owner).PlayerBaseData.RoleInfoBase.JobId;

                JobDBModel jobDBModel = GameEntry.DataTable.GetDataTable <JobDBModel>();
                JobEntity  jobEntity  = jobDBModel.Get(jobId);
                if (jobEntity == null)
                {
                    Log.Warning("Can not load job controller id '{0}' from data table.", jobId.ToString());
                    return;
                }
                GameEntry.Controller.SetController(m_Animator, AssetUtility.GetRoleControllerAsset(jobEntity.RoleController));
            }
            else
            {
                Debug.Log("其他角色控制器 例如NPC 还没做!");
            }
            m_Animator.speed = 1;
            isStop           = false;
        }
Ejemplo n.º 6
0
        public MagicData(int entityId, int typeId, int jobId, int ownerId)
            : base(entityId, typeId, jobId, ownerId)
        {
            TrumpDBModel trumpDBModel = GameEntry.DataTable.GetDataTable <TrumpDBModel>();
            TrumpEntity  trumpEntity  = trumpDBModel.Get(typeId);

            if (trumpEntity == null)
            {
                return;
            }

            Fill(AssetUtility.GetMagicAsset(trumpEntity.AssetName));

            JobDBModel jobDBModel = GameEntry.DataTable.GetDataTable <JobDBModel>();
            JobEntity  jobEntity  = jobDBModel.Get(jobId);

            if (jobEntity == null)
            {
                Log.Warning("Can not load job magicpoint id '{0}' from data table.", jobId.ToString());
                return;
            }

            m_MagicPoint = jobEntity.TrumpPoint;
        }