using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using Facebook.Unity; public class FBWindowsPurchaseManager : MonoBehaviour { public FBWindowsLogsManager Logger; public GameObject ProductGameObject; public Transform CatalogPanelTarnsform; public Transform PurchasesPanelTarnsform; // IN APP PURCHASES CATALOG FUNCTIONS ---------------------------------------------------------------------------------------------------------- public void GetCatalogButton() { if (FB.IsLoggedIn) { Logger.DebugLog("GetCatalog"); FB.GetCatalog(ProcessGetCatalog); } else { Logger.DebugWarningLog("Login First"); } } private void ProcessGetCatalog(ICatalogResult result) { foreach (Transform child in CatalogPanelTarnsform) { Destroy(child.gameObject); } if (FB.IsLoggedIn) { Logger.DebugLog("Processing Catalog"); if (result.Error != null) { Logger.DebugErrorLog(result.Error); } else { foreach (Product item in result.Products) { string itemInfo = item.Title + "\n"; itemInfo += item.Description + "\n"; itemInfo += item.Price; GameObject newProduct = Instantiate(ProductGameObject, CatalogPanelTarnsform); newProduct.GetComponentInChildren().text = itemInfo; newProduct.GetComponentInChildren