private void SetupUIWithPacks() { foreach (var product in ListInAppProducts) { switch (product.ProductIdentifier) { case "com.thingsoftomorrow.seekios.observation": ObservationButton.SetTitle(string.Format(Application.LocalizedString("BuyPrice"), product.FormattedPrice), UIControlState.Normal); //ObservationEuroLabel.Text = product.FormattedPrice; -- HIDDEN CONTROL break; case "com.thingsoftomorrow.seekios.discovery": DiscoveryButton.SetTitle(string.Format(Application.LocalizedString("BuyPrice"), product.FormattedPrice), UIControlState.Normal); //DiscoveryEuroLabel.Text = product.FormattedPrice; break; case "com.thingsoftomorrow.seekios.exploration": ExplorationButton.SetTitle(string.Format(Application.LocalizedString("BuyPrice"), product.FormattedPrice), UIControlState.Normal); //ExplorationEuroLabel.Text = product.FormattedPrice; break; case "com.thingsoftomorrow.seekios.aventure": AdventureButton.SetTitle(string.Format(Application.LocalizedString("BuyPrice"), product.FormattedPrice), UIControlState.Normal); //AdventureEuroLabel.Text = product.FormattedPrice; break; case "com.thingsoftomorrow.seekios.epopee": EpicButton.SetTitle(string.Format(Application.LocalizedString("BuyPrice"), product.FormattedPrice), UIControlState.Normal); //EpicEuroLabel.Text = product.FormattedPrice; break; } } }
void LoadPage(Page page) { //pageText.text = page.pageText; Text txt = Instantiate(pageText) as Text; txt.text = page.pageText + System.Environment.NewLine; txt.transform.SetParent(panel); txt.transform.localScale = new Vector3(1, 1, 1); //Uncomment this is you want text appearing in real time. //StartCoroutine(textAppearing(page.pageText,txt)); if (page.imageText != null) { //Instantiate the given image underneath the text string nameSpace = "Images/" + page.imageText; Image newImage = Instantiate(image) as Image; newImage.transform.SetParent(panel); newImage.transform.localScale = new Vector3(1, 1, 1); newImage.sprite = Resources.Load <Sprite>(nameSpace); newImage.SetNativeSize(); } foreach (AdventureButton ab in page.buttonChoices) { //Makes a button, like the prefab, for each choice on the page Button newButton = Instantiate(button) as Button; AdventureButton adventureButton = newButton.GetComponent <AdventureButton>(); adventureButton.text.text = ab.buttonText; adventureButton.associatedPage = ab.associatedPage; newButton.transform.SetParent(panel); newButton.transform.localScale = new Vector3(1, 1, 1); newButton.onClick.AddListener(() => buttonClicked(adventureButton.associatedPage)); } Canvas.ForceUpdateCanvases(); }
void ReleaseDesignerOutlets() { if (AdventureButton != null) { AdventureButton.Dispose(); AdventureButton = null; } if (AdventureCreditLabel != null) { AdventureCreditLabel.Dispose(); AdventureCreditLabel = null; } if (AdventureDiscountLabel != null) { AdventureDiscountLabel.Dispose(); AdventureDiscountLabel = null; } if (AdventureDiscountView != null) { AdventureDiscountView.Dispose(); AdventureDiscountView = null; } if (AdventureEuroLabel != null) { AdventureEuroLabel.Dispose(); AdventureEuroLabel = null; } if (AdventureView != null) { AdventureView.Dispose(); AdventureView = null; } if (DiscoveryButton != null) { DiscoveryButton.Dispose(); DiscoveryButton = null; } if (DiscoveryCreditLabel != null) { DiscoveryCreditLabel.Dispose(); DiscoveryCreditLabel = null; } if (DiscoveryDiscountLabel != null) { DiscoveryDiscountLabel.Dispose(); DiscoveryDiscountLabel = null; } if (DiscoveryDiscountView != null) { DiscoveryDiscountView.Dispose(); DiscoveryDiscountView = null; } if (DiscoveryEuroLabel != null) { DiscoveryEuroLabel.Dispose(); DiscoveryEuroLabel = null; } if (DiscoveryView != null) { DiscoveryView.Dispose(); DiscoveryView = null; } if (EpicButton != null) { EpicButton.Dispose(); EpicButton = null; } if (EpicCreditLabel != null) { EpicCreditLabel.Dispose(); EpicCreditLabel = null; } if (EpicDiscountLabel != null) { EpicDiscountLabel.Dispose(); EpicDiscountLabel = null; } if (EpicDiscountView != null) { EpicDiscountView.Dispose(); EpicDiscountView = null; } if (EpicEuroButton != null) { EpicEuroButton.Dispose(); EpicEuroButton = null; } if (EpicView != null) { EpicView.Dispose(); EpicView = null; } if (ExplorationButton != null) { ExplorationButton.Dispose(); ExplorationButton = null; } if (ExplorationCreditLabel != null) { ExplorationCreditLabel.Dispose(); ExplorationCreditLabel = null; } if (ExplorationDiscountLabel != null) { ExplorationDiscountLabel.Dispose(); ExplorationDiscountLabel = null; } if (ExplorationDiscountView != null) { ExplorationDiscountView.Dispose(); ExplorationDiscountView = null; } if (ExplorationEuroLabel != null) { ExplorationEuroLabel.Dispose(); ExplorationEuroLabel = null; } if (ExplorationView != null) { ExplorationView.Dispose(); ExplorationView = null; } if (InformationTextView != null) { InformationTextView.Dispose(); InformationTextView = null; } if (InformationView != null) { InformationView.Dispose(); InformationView = null; } }
void ReleaseDesignerOutlets() { if (AdvCreditLabel != null) { AdvCreditLabel.Dispose(); AdvCreditLabel = null; } if (AdventureButton != null) { AdventureButton.Dispose(); AdventureButton = null; } if (AdventureCreditLabel != null) { AdventureCreditLabel.Dispose(); AdventureCreditLabel = null; } if (AdventureEuroLabel != null) { AdventureEuroLabel.Dispose(); AdventureEuroLabel = null; } if (AdventureTitle != null) { AdventureTitle.Dispose(); AdventureTitle = null; } if (AdventureView != null) { AdventureView.Dispose(); AdventureView = null; } if (DiscoCreditLabel != null) { DiscoCreditLabel.Dispose(); DiscoCreditLabel = null; } if (DiscoveryButton != null) { DiscoveryButton.Dispose(); DiscoveryButton = null; } if (DiscoveryCreditLabel != null) { DiscoveryCreditLabel.Dispose(); DiscoveryCreditLabel = null; } if (DiscoveryEuroLabel != null) { DiscoveryEuroLabel.Dispose(); DiscoveryEuroLabel = null; } if (DiscoveryTitle != null) { DiscoveryTitle.Dispose(); DiscoveryTitle = null; } if (DiscoveryView != null) { DiscoveryView.Dispose(); DiscoveryView = null; } if (EpicButton != null) { EpicButton.Dispose(); EpicButton = null; } if (EpicCreditLabel != null) { EpicCreditLabel.Dispose(); EpicCreditLabel = null; } if (EpicEuroLabel != null) { EpicEuroLabel.Dispose(); EpicEuroLabel = null; } if (EpicTitle != null) { EpicTitle.Dispose(); EpicTitle = null; } if (EpicView != null) { EpicView.Dispose(); EpicView = null; } if (ExploCreditLabel != null) { ExploCreditLabel.Dispose(); ExploCreditLabel = null; } if (ExplorationButton != null) { ExplorationButton.Dispose(); ExplorationButton = null; } if (ExplorationCreditLabel != null) { ExplorationCreditLabel.Dispose(); ExplorationCreditLabel = null; } if (ExplorationEuroLabel != null) { ExplorationEuroLabel.Dispose(); ExplorationEuroLabel = null; } if (ExplorationTitle != null) { ExplorationTitle.Dispose(); ExplorationTitle = null; } if (ExplorationView != null) { ExplorationView.Dispose(); ExplorationView = null; } if (InformationTextView != null) { InformationTextView.Dispose(); InformationTextView = null; } if (InformationView != null) { InformationView.Dispose(); InformationView = null; } if (ObsCreditLabel != null) { ObsCreditLabel.Dispose(); ObsCreditLabel = null; } if (ObservationButton != null) { ObservationButton.Dispose(); ObservationButton = null; } if (ObservationCreditsLabel != null) { ObservationCreditsLabel.Dispose(); ObservationCreditsLabel = null; } if (ObservationEuroLabel != null) { ObservationEuroLabel.Dispose(); ObservationEuroLabel = null; } if (ObservationTitle != null) { ObservationTitle.Dispose(); ObservationTitle = null; } if (ObservationView != null) { ObservationView.Dispose(); ObservationView = null; } }