Exemple #1
0
 /// <summary>
 /// 在角色上设置活动菜单
 /// </summary>
 private void SetCombatMenu(Role role, RoleImage ActiveRoleImage)
 {
     menu.transform.SetParent(CombatUI.transform);
     menu.Enabled   = true;
     menu.SkillList = role.Skills;
     menu.Refresh();
 }
Exemple #2
0
        /// <summary>
        /// 将角色图像载入到地图上
        /// </summary>
        private void LoadRoleOnMay()
        {
            //位置统计
            int  allyCount = 0, enemyCount = 0;
            bool isAlly;

            for (int i = 0; i < CombatRoles.Count; i++)
            {
                Role role = CombatRoles[i];

                bool isActionRole = role == CombatRound.Active;

                if (role.roleType == RoleType.ally ||
                    role.roleType == RoleType.player)
                {
                    isAlly = true;
                }
                else
                {
                    isAlly = false;
                }
                RoleImage roleImageBox = Instantiate(roleImagePrefab);

                // TODO:重新优化函数结构
                SetPostion(roleImageBox, isAlly == true ? allyCount++ : enemyCount++, isAlly, role, isActionRole);

                if (isActionRole == true)
                {
                    SetCombatMenu(role, roleImageBox);
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// 设置角色在地图上的位置
        /// </summary>
        /// <param name="roleCount"></param>
        /// <param name="isAlly"></param>
        /// <param name="role"></param>
        /// <param name="isActionRole"></param>
        private void SetPostion(RoleImage roleImageBox, int roleCount, bool isAlly, Role role, bool isActionRole)
        {
            roleImageBox.RoleType = role.roleType;

            roleImageBox.txtName.text = role.FamilyName + role.Name;

            /*
             * roleImageBox.Path = string.Format("{0}{1}.{2}",
             *  GameData.PicturePath,
             *  GameData.GetMonster(role.ID).Name,
             *  GameData.GetMonster(role.ID).ImageType);
             */
            roleImageBox.transform.SetParent(CombatPosition.transform);

            roleImageBox.transform.localPosition = GetPostiton(isAlly,
                                                               roleCount,
                                                               isActionRole);

            roleImageList.Add(roleImageBox);
        }