Esempio n. 1
0
    public static void Show(string[] menuItemsCaptions = null, float delay = 0)
    {
        Hide();

        if (menuItemsCaptions != null)
        {
            CurrentMenuSet = menuItemsCaptions;
        }

        panel = PanelWithChildren.Create <SelectableTextList> ();
        panel.gameObject.name    = "panel_MainMenu";
        panel.DelayBeforeShowing = delay;
        panel.Initialize(CurrentMenuSet);

        Utils.ProvideCanvas(panel.gameObject);
        RectTransform rt = panel.gameObject.transform as RectTransform;

        rt.SetParent(Design.visibleArea.transform);
        rt.offsetMin = offsetMin;
        rt.offsetMax = rt.offsetMin + new Vector2(itemSize.x, itemSize.y * panel.itemCount);

        panel.SetAligner_FixedTile(itemSize);
        panel.alignDirection = Aligner.AlignDirection.adTop;
        panel.Rebuild();

        panel.OnSelectItem = new UnityAction <string> (ExecuteAction);
    }
Esempio n. 2
0
    private static new StageInfo Create()
    {
        StageInfo result = PanelWithChildren.Create <StageInfo> ();

        result.gameObject.name = "panel_StageInfo";

        RectTransform rt = result.gameObject.transform as RectTransform;

        rt.offsetMin = new Vector2(6, 0);
        rt.offsetMax = new Vector2(8, 6);

        result.items = new List <GameObject> ();

        result.LiScore = CreateScore();
        result.items.Add(result.LiScore.gameObject);

        result.LiHitPoints = CreateHitPoints();
        result.items.Add(result.LiHitPoints.gameObject);

        result.buffCaption = CreateBuffCaption();
        result.items.Add(result.buffCaption.gameObject);

        result.buffZone = BuffZone.Create();
        result.items.Add(result.buffZone.gameObject);

        result.alignDirection = Aligner.AlignDirection.adTop;
        result.SetAligner_Pivot();
        result.Rebuild();

        return(result);
    }
Esempio n. 3
0
    private static PanelWithChildren Prepare()
    {
        PanelWithChildren panel = PanelWithChildren.Create();

        panel.gameObject.AddComponent <AlignIterator> ();

        panel.items = new List <GameObject> ();
        for (int i = 0; i < 10; i++)
        {
            panel.items.Add(CreateChild());
        }
        return(panel);
    }
Esempio n. 4
0
    public static new BuffZone Create()
    {
        BuffZone result = PanelWithChildren.Create <BuffZone> ();

        RectTransform rt = result.gameObject.transform as RectTransform;

        rt.offsetMax = rt.offsetMin + selfSize;

        result.SetAligner_FixedTile(itemSize);
        result.alignDirection = Aligner.AlignDirection.adTop;

        return(result);
    }
Esempio n. 5
0
    public static new LabeledInformation Create()
    {
        LabeledInformation result = PanelWithChildren.Create <LabeledInformation>();

        result.gameObject.name = "panel_LabeledInformation";

        result.SetAligner_AdaptiveTile(2, 1);
        result.alignDirection = Aligner.AlignDirection.adTop;

        result.items = new List <GameObject> ();

        GameObject item = Instantiate(Prefab.textItem);

        item.name       = "text_Caption";
        result.fCaption = item.GetComponent <Text> ();
        result.items.Add(item);

        item          = Instantiate(Prefab.textItem);
        item.name     = "text_Value";
        result.fValue = item.GetComponent <Text> ();
        result.items.Add(item);

        return(result as LabeledInformation);
    }