/// <summary> /// スキルリストの設定 /// </summary> /// <param name="monster"></param> private void SetSkillList(BattleMapMonster monster) { List <MonsterSkill> skillList = monster.GetAvailableSkillList(); int skillCount = skillList.Count; if (SKILL_BUTTON_VIEW_COUNT < skillCount) { skillCount = SKILL_BUTTON_VIEW_COUNT; } // 全体 RectTransform panelRect = skillSelectObject.GameObject.GetComponent <RectTransform>(); panelRect.sizeDelta = new Vector2(panelRect.sizeDelta.x, GetPanelHeight(skillCount)); // 本体の位置 float posY = PANEL_POSY_MARGIN + (panelRect.sizeDelta.y / 2); panelRect.anchoredPosition = new Vector2(PANEL_POSX, posY); // スクロールビュー RectTransform scrollViewRect = skillSelectObject.ScrollViewGameObject.GetComponent <RectTransform>(); scrollViewRect.sizeDelta = new Vector2(scrollViewRect.sizeDelta.x, skillCount * SKILL_BUTTON_HEIGHT); scrollViewRect.anchoredPosition = new Vector2(scrollViewRect.anchoredPosition.x, -(scrollViewRect.sizeDelta.y / 2 + SCROLL_VIEW_Y_MARGIN)); // 概要の初期化 skillSelectObject.OverviewText.text = ""; // スキルボタンの設定 SetSkillButtonList(monster, skillList); }
/// <summary> /// モードごとに設定 /// </summary> /// <param name="panelType"></param> /// <param name="monster"></param> /// <param name="panelPositionType"></param> private void SetPanelMode( BattleMapMonster monster, BattleMapStatusPanelType panelType, BattleMapStatusPanelPositionType panelPositionType) { float panelHeight = PANEL_HEIGHT; if (panelType == BattleMapStatusPanelType.NORMAL) { spObject.PaperGameObject.SetActive(true); spObject.PaperSubGameObject.SetActive(false); spObject.SkillButton.SetActive(false); spObject.CancelButton.SetActive(false); panelHeight = PANEL_HEIGHT; } else if (panelType == BattleMapStatusPanelType.SKILL1) { spObject.PaperGameObject.SetActive(false); spObject.PaperSubGameObject.SetActive(true); spObject.SkillButton.SetActive(true); spObject.CancelButton.SetActive(true); panelHeight = PANEL_HEIGHT_SKILL; } RectTransform goRect = spObject.GameObject.GetComponent <RectTransform>(); goRect.anchorMin = new Vector2(0, 0); goRect.anchorMax = new Vector2(0, 0); // 本体の高さ goRect.sizeDelta = new Vector2(goRect.sizeDelta.x, panelHeight); // 本体の位置 float posY = PANEL_POSY_MARGIN + (goRect.sizeDelta.y / 2); // スキル表示ありの場合 if (panelPositionType == BattleMapStatusPanelPositionType.ON_SKILL_PANEL) { posY += BattleMapSkillSelectOperator.GetPanelHeight(monster.GetAvailableSkillList().Count); } // 控えありの場合 else if (panelPositionType == BattleMapStatusPanelPositionType.ON_RESERVE) { posY += goRect.sizeDelta.y + PANEL_POSY_RESERVE_MARGIN; } goRect.anchoredPosition = new Vector2(PANEL_POSX, posY); }