Exemple #1
0
        private void SetSelectJob()
        {
            GameEntry.Entity.HideAllLoadedEntities();
            GameEntry.Entity.HideAllLoadingEntities();
            GameEntry.Entity.ShowCreateRole(m_CurrentSelectJobId);
            JobDBModel jobDBModel = GameEntry.DataTable.GetDataTable <JobDBModel>();

            JobEntity jobEntity = jobDBModel.Get(m_CurrentSelectJobId);

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

            //更新选择的职业信息
            m_ImageArr.SetImage(AssetUtility.GetCreateRoleImageAsset(jobEntity.DescImageAssetName));
            m_ImageMiaoShu1.SetImage(AssetUtility.GetCreateRoleImageAsset(jobEntity.DescAllAssetName));
            m_ImageMiaoShu2.SetImage(AssetUtility.GetCreateRoleImageAsset(jobEntity.DescSpecificAssetName));
            if (jobEntity.Sex == 0)
            {
                m_Sex0.gameObject.SetActive(true);
                m_Sex1.gameObject.SetActive(false);
            }
            else
            {
                m_Sex0.gameObject.SetActive(false);
                m_Sex1.gameObject.SetActive(true);
            }
        }
Exemple #2
0
        public WingData(int entityId, int typeId, int jobId, int ownerId)
            : base(entityId, typeId, jobId, ownerId)
        {
            JobWingsDBModel jobWingsDBModel = GameEntry.DataTable.GetDataTable <JobWingsDBModel>();
            JobWingsEntity  jobWingsEntity  = jobWingsDBModel.Get(jobId, typeId);

            if (jobWingsEntity == null)
            {
                return;
            }

            m_WingFighting = jobWingsEntity.WingFighting;
            Fill(AssetUtility.GetWingAsset(jobWingsEntity.AssetName));

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

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

            m_WingPoint = jobEntity.WingPoint;
            m_WingControllerAssetName = AssetUtility.GetWingControllerAsset(jobEntity.WingController);
        }
Exemple #3
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));
        }
Exemple #4
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));
            }
        }
Exemple #5
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));
            }
        }
Exemple #6
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));
        }
Exemple #7
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;
        }
Exemple #8
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;
        }