void Update() { if (isShown && Input.GetKeyDown(KeyCode.Space)) { GameObject go = GameObject.Find("Player"); go.GetComponent <CharacterMovement>().canMove = true; if (assetName == "pitch") { Asset info = collectionCore.GetAssetInfoByName("pitch"); string[] pitches = ((string)(info.GetCustom("title", ""))).Split(";" [0]); string pitch = pitches [Random.Range(0, pitches.Length)]; GameObject obj = GameObject.Find("MainDialog"); MainDialog dialog = obj.GetComponent <MainDialog>(); dialog.ShowDialog("Now go show Woo your pitch for " + pitch + "!", null, null); GameController gameCtrler = (GameController)AppController.Instance.GetController(Controller.GAME); gameCtrler.hasPitch = true; } isShown = false; gameObject.SetActive(false); Destroy(iconObject); } }
void OnEntitlementsRefreshed() { foreach (string id in pendingEntitlementIds) { //notify user of new inventory Entitlement ent = collectionCore.GetEntitlementById(id); Asset info = collectionCore.GetAssetInfoByName(ent.AssetName); string prefabName = (string)info.GetCustom("prefabName", ""); string descript = (string)info.Description; popupPrefab.SetPrefab(prefabName, descript); RecipeController ctrler = (RecipeController)AppController.Instance.GetController(Controller.RECIPE); //check recipes for completion string outcome = ctrler.OnNewInventory((string)info.Name); if (!String.IsNullOrEmpty(outcome)) { foreach (Image fuse in fusions) { if (fuse.gameObject.name == "icon_fus_" + outcome) { fuse.color = Color.white; break; } } } foreach (Image image in images) { if (image.gameObject.name == "icon_" + ent.AssetName) { image.color = Color.white; foreach (Image fuse in fusions) { if (fuse.gameObject.name == "icon_fus_" + ent.AssetName) { fuse.enabled = false; break; } } break; } } } pendingEntitlementIds.Clear(); }