Ejemplo n.º 1
0
    public override void Construct()
    {
        m_UI = GameObject.Instantiate(m_Manager.battleOptionListPrefab, m_Manager.battleMenus);

        foreach (Option option in m_Options)
        {
            m_UI.Add(option.enabled, option.labels);
            m_UI[m_UI.Count - 1].Description = option.description;
        }

        m_UI.Index = m_Index;
        m_UI.Reset();
        m_UI.ShowDescription(m_Options[m_Index].description);
    }
Ejemplo n.º 2
0
    protected override void Start()
    {
        base.Start();

        if (transform.GetSiblingIndex() > 0)
        {
            Transform        priorMenuTransform = transform.parent.GetChild(transform.GetSiblingIndex() - 1);
            BattleOptionList priorMenu          = priorMenuTransform.GetComponent <BattleOptionList>();

            if (priorMenu != null)
            {
                float h = 8f + (9.5f * m_Options.Count);
                float y = priorMenu.HeightController.sizeDelta.y +
                          8f + (19f * (priorMenu.m_Options.Count - priorMenu.Index)) - 9.5f;

                /*priorMenu.optionListBox.sizeDelta.y +
                 * priorMenu.m_Options[priorMenu.Index].GetComponent<RectTransform>().anchoredPosition.y;*/

                HeightController.sizeDelta = new Vector2(0f, Mathf.Max(6f, Mathf.Round(y - h)));
            }
        }

        DescriptionBox.GetComponent <Image>().color = Settings.TextBoxColor;
    }
Ejemplo n.º 3
0
 public override void Destruct()
 {
     GameObject.Destroy(m_UI.gameObject);
     m_UI = null;
 }