public void OpenEditPagePanel(StickerPage stickerPage)
    {
        this.gameObject.SetActive(true);

        lastSavedStickers = new List <Sticker>();
        foreach (Sticker copySticker in stickerPage.stickers)
        {
            lastSavedStickers.Add(new Sticker(copySticker));
        }

        contentScroll.RemoveContentComponents();
        //Create a QROption for each sticker
        int i = 0;

        foreach (Sticker sticker in stickerPage.stickers)
        {
            QROption newOption = Instantiate(qrOptionPrefab, contentScroll.content.transform);
            newOption.SetSticker(sticker);
            newOption.transform.localPosition = new Vector3(575 + (i * 150), newOption.transform.localPosition.y);
            i++;
        }

        //Set size of content box
        RectTransform rectTransform = contentScroll.content.GetComponent <RectTransform>();

        rectTransform.sizeDelta = new Vector2(1500 + (i * 100), 0);

        //Initialize scroll variables
        contentScroll.InitializeVariables();
    }
    public void OnCloseEditPagePanel()
    {
        StickerPage returnPage = new StickerPage(lastSavedStickers[0].template);

        foreach (Sticker sticker in lastSavedStickers)
        {
            returnPage.AddSticker(sticker);
        }

        stickerDetailMenu.SetStickerPage(returnPage);
    }
Example #3
0
    public void OpenMenu(Template template)
    {
        this.template = template;
        //If sticker page is already created, continue to use it
        if (stickerPage == null)
        {
            stickerPage = new StickerPage(template);
        }

        this.gameObject.SetActive(true);
        UpdateNumberPerSheetText();
        UpdateInputFields(new Sticker());

        if (stickerPage.stickers.Count > 0)
        {
            editPageButton.interactable = true;
        }
        else
        {
            editPageButton.interactable = false;
        }

        UpdateAddToPageButton();
    }
Example #4
0
 public void SetStickerPage(StickerPage stickerPage)
 {
     this.stickerPage = stickerPage;
 }