Ejemplo n.º 1
0
    public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs e)
    {
        if (String.Equals(e.purchasedProduct.definition.id, m_MetalInitID, StringComparison.Ordinal))
        {
            UserData.m_MetalSkillInit = 1;
        }
        else if (String.Equals(e.purchasedProduct.definition.id, m_WoodInitID, StringComparison.Ordinal))
        {
            UserData.m_WoodSkillInit = 1;
        }
        else if (String.Equals(e.purchasedProduct.definition.id, m_WaterInitID, StringComparison.Ordinal))
        {
            UserData.m_WaterSkillInit = 1;
        }
        else if (String.Equals(e.purchasedProduct.definition.id, m_FireInitID, StringComparison.Ordinal))
        {
            UserData.m_FireSkillInit = 1;
        }
        else if (String.Equals(e.purchasedProduct.definition.id, m_EarthInitID, StringComparison.Ordinal))
        {
            UserData.m_EarthSkillInit = 1;
        }
        UserData.SaveUserData();
        m_US.UpdateUpgradeItem(false);

        return(PurchaseProcessingResult.Complete);
    }
Ejemplo n.º 2
0
    void DoUpgrade()
    {
        UserData.m_MaterialRes -= m_MaterialCost;
        UserData.m_DNARes      -= m_DNACost;
        switch (m_Type)
        {
        case ItemType.METAL_SKILL:
            UserData.m_MetalSkillLevel++;
            break;

        case ItemType.WOOD_SKILL:
            UserData.m_WoodSkillLevel++;
            break;

        case ItemType.WATER_SKILL:
            UserData.m_WaterSkillLevel++;
            break;

        case ItemType.FIRE_SKILL:
            UserData.m_FireSkillLevel++;
            break;

        case ItemType.EARTH_SKILL:
            UserData.m_EarthSkillLevel++;
            break;

        case ItemType.TIME_ACC:
            UserData.m_TimeAccLevel++;
            break;

        case ItemType.METAL_INIT:
            UserData.m_MetalSkillInit++;
            break;

        case ItemType.WOOD_INIT:
            UserData.m_WoodSkillInit++;
            break;

        case ItemType.WATER_INIT:
            UserData.m_WaterSkillInit++;
            break;

        case ItemType.FIRE_INIT:
            UserData.m_FireSkillInit++;
            break;

        case ItemType.EARTH_INIT:
            UserData.m_EarthSkillInit++;
            break;
        }
        UserData.SaveUserData();
        m_US.UpdateUpgradeItem(true);
    }