Exemplo n.º 1
0
    private IEnumerator delayedSubmitSuccess(CatalogServiceEvents.ItemSubmissionCompleteEvent evt)
    {
        yield return(new WaitForSeconds(4f));

        CustomizationContext.EventBus.DispatchEvent(default(CustomizerUIEvents.EndPurchaseMoment));
        ClothingDesignerContext.EventBus.DispatchEvent(new ClothingDesignerUIEvents.ShowSubmittedInCatalog(evt.Response.clothingCatalogItemId));
        int coins2 = Service.Get <CPDataEntityCollection>().GetComponent <CoinsData>(Service.Get <CPDataEntityCollection>().LocalPlayerHandle).Coins;

        if (evt.Response.newCoinTotal > coins2)
        {
            coins2 = (int)evt.Response.newCoinTotal - coins2;
            CatalogThemeDefinition catalogTheme = Service.Get <CatalogServiceProxy>().GetCatalogTheme();
            string tokenTranslation             = Service.Get <Localizer>().GetTokenTranslation(catalogTheme.Title);
            Service.Get <ICPSwrveService>().CoinsGiven(coins2, "rewarded", tokenTranslation, "clothing_catalog_challenge");
            Service.Get <ICPSwrveService>().Action("clothing_catalog_challenge", "submit_outfit", catalogTheme.ToString(), tokenTranslation);
        }
    }