示例#1
0
    public static void OpenLink(string link, string eventName = "")
    {
        if (Core.build.parentGate && Core.ui.parentGate != null)
        {
            Core.ui.parentGate.Show(() =>
            {
#if UNITY_WEBGL && !UNITY_EDITOR
                Application.ExternalEval("window.open('" + link + "')");
#else
                Application.OpenURL(link);
#endif
            });

            return;
        }

#if UNITY_WEBGL && !UNITY_EDITOR
        Application.ExternalEval("window.open('" + link + "')");
#else
        Application.OpenURL(link);
#endif

        if (!string.IsNullOrEmpty(eventName))
        {
            Analytic.Event("OpenLink", eventName);
        }
    }
示例#2
0
    public void UseBoost(Boost boost)
    {
        if (boost.count > 0)
        {
            --boost.count;
            BoostsSave();

            Analytic.Event("Boosts", "Use");
        }
        else
        {
            UpdateCoins(-boost.price, true);

            Analytic.Event("Boosts", "Buy");
        }

        Missions.OnUseBoost(boost);

        boost.ON = true;
    }
示例#3
0
    public override void Init()
    {
        askButtonsRectTransform = askButtonsGrid.transform as RectTransform;

        if (platform == Platform.AppStore)
        {
            askButtonsPositionKeyboard = askButtonsPositionKeyboardIOS;
        }
        else if (platform == Platform.GooglePlay)
        {
            askButtonsPositionKeyboard = askButtonsPositionKeyboardAndroid;
        }
        else
        {
            askButtonsPositionKeyboard = askButtonsPositionKeyboardNone;
        }

        Reset();

        Analytic.Event("Advisor", "Open");
    }
示例#4
0
    public override void Activate()
    {
        base.Activate();

        if (action.ContainsKey("coins"))
        {
            Core.user.UpdateCoins(Convert.ToInt32(action["coins"]), true);
        }

        if (action.ContainsKey("spins"))
        {
            Core.user.UpdateSpins(Convert.ToInt32(action["spins"]), true);
        }

        if (action.ContainsKey("levelUp") && Core.user.level < Missions.MAX_LEVEL)
        {
            Core.user.LevelUp();
        }

        if (action.ContainsKey("catboxPremium") && Core.user.isCanGetPremiumBox)
        {
            Core.user.GetPremiumCatbox();
        }

        if (action.ContainsKey("catboxSimple") && Core.user.isCanGetSimpleBox)
        {
            Core.user.GetSimpleCatbox();
        }

        if (action.ContainsKey("hats"))
        {
            Core.user.newYearHats += Convert.ToInt32(action["hats"]);
        }

        if (action.ContainsKey("hearts"))
        {
            Core.user.stValentinHearts += Convert.ToInt32(action["hearts"]);
        }

        if (action.ContainsKey("bats"))
        {
            Core.user.halloweenBats += Convert.ToInt32(action["bats"]);
        }

        if (action.ContainsKey("useSausagesHistory"))
        {
            Core.user.useSausagesHistory += Convert.ToInt32(action["useSausagesHistory"]);
            Core.achievements.OnUseSausages();
        }

        if (action.ContainsKey("honored"))
        {
            Core.user.honored = 1;
            Core.achievements.OnUpdateHonored();
        }

        foreach (var cat in Core.gameplay.superCats)
        {
            if ((action.ContainsKey(cat.name) && !Core.user.isOwned(cat)))
            {
                Core.user.GetCat(cat, Convert.ToInt32(action[cat.name]));
            }
        }

        Analytic.Event("Promocode", code);
    }