示例#1
0
    public void OnAskButtonClick(Advisor.Reply reply)
    {
        if (!string.IsNullOrEmpty(reply.url))
        {
            SG_Utils.OpenLink(reply.url, reply.name);

            Reset(reply.name);
            if (!string.IsNullOrEmpty(reply.answer))
            {
                ReplyBubbleShow(reply.answer);
            }
        }
        else if (!string.IsNullOrEmpty(reply.email))
        {
            // Utils.Email(reply.email, reply.subject, reply.body);

            ui.options.SendEmail();

            Reset(reply.name);
            if (!string.IsNullOrEmpty(reply.answer))
            {
                ReplyBubbleShow(reply.answer);
            }
        }
        else
        {
            Ask(reply.name);
        }
    }
示例#2
0
    public void OpenRateApp()
    {
        string link = null;

        if (platform == Platform.AppStore)
        {
            link = (SystemInfo.operatingSystem.Contains(" 6.") ? "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=" : "itms-apps://itunes.apple.com/app/id") + build.APPLE_ID;
        }
        else if (platform == Platform.GooglePlay)
        {
            link = "market://details?id=" + build.ID;
        }
        else if (platform == Platform.Amazon)
        {
            link = "amzn://apps/android?p=" + build.ID;
        }
        else
        {
            link = server.links.landingPage;
        }

        SG_Utils.OpenLink(link, "RateApp");

        PlayerPrefs.SetInt("RateApp", int.MaxValue); // Флаг, чтобы окно Rate App больше не вылезало
    }
示例#3
0
 public void OpenHelp()
 {
     if (advisor && !string.IsNullOrEmpty(advisor.GetProjectId(Localization.language)))
     {
         ui.PopupShow(ui.advisor);
     }
     else
     {
         SG_Utils.OpenLink(Localization.language == SystemLanguage.Russian ? server.links.helpPageRU : server.links.helpPage, "SiteHelp");
     }
 }
示例#4
0
    public override void OnInspectorGUI()
    {
        if (GUILayout.Button("Open Spreadsheet"))
        {
            SG_Utils.OpenLink(localization.urlSpreadsheet);
        }

        GUILayout.Space(10);
        if (GUILayout.Button("Update"))
        {
            EditorCoroutine.StartCoroutine(localization.LoadCoroutine(), localization);
        }

        GUILayout.Space(10);
        base.OnInspectorGUI();
    }
示例#5
0
    public void OnGetReply(Advisor.Status status, Advisor.Response response, Advisor.Request request)
    {
        if (status == Advisor.Status.NoConnection)
        {
            ReplyBubbleShow(Localization.Get("advisorReplyNoConnection"));
            return;
        }

        if (status != Advisor.Status.Success || response == null)
        {
            ReplyBubbleShow(Localization.Get("advisorReplyError"));
            return;
        }

        Analytic.EventProperties("Advisor", response.input, request.text);

        ReplyBubbleShow(response.output);

        if (!string.IsNullOrEmpty(response.imageUrl))
        {
            server.DownloadPic(replyBubble.bubbleContentImage, response.imageUrl);
        }

        if (!string.IsNullOrEmpty(response.url))
        {
            SG_Utils.OpenLink(response.url, response.output);
        }

        var replies = response.replies;

        while (replies.Count > 3)
        {
            replies.Remove(replies[Random.Range(0, replies.Count)]);
        }
        foreach (var reply in replies)
        {
            askButtons.Add(askButtonPrefab.Copy(reply));
        }

        misunderstandingsCount = response.input == "All" ? misunderstandingsCount + 1 : 0;
    }
示例#6
0
    public void SendEmail()
    {
        if (platform == Platform.Facebook)
        {
            SG_Utils.OpenLink(server.links.contactsPage, "SiteContacts");
            return;
        }

        string subject = Localization.Get("mailSubject", Random.Range(100000, 999999));

        string body = Localization.Get("mailBody", SystemInfo.deviceModel, SystemInfo.operatingSystem,
                                       SG_Utils.resolution, SystemInfo.systemMemorySize, SystemInfo.processorType, SystemInfo.graphicsDeviceName,
                                       SystemInfo.graphicsMemorySize, SystemInfo.graphicsDeviceVersion, user.isId ? user.id : "-",
                                       string.IsNullOrEmpty(user.deviceId) ? "-" : user.deviceId,
                                       string.IsNullOrEmpty(user.facebookId) ? "-" : user.facebookId,
                                       string.IsNullOrEmpty(user.gameCenterId) ? "-" : user.gameCenterId,
                                       string.IsNullOrEmpty(user.googleGamesId) ? "-" : user.googleGamesId,
                                       build.version);

        SG_Utils.Email(server.links.supportEmail, subject, body);
    }
示例#7
0
 public void OpenAmazon()
 {
     SG_Utils.OpenLink(string.Format(amazon, build.AMAZON_ID), "Amazon");
 }
示例#8
0
 public void OpenGooglePlay()
 {
     SG_Utils.OpenLink(string.Format(googlePlay, build.ID), "GooglePlay");
 }
示例#9
0
 public void OpenApple()
 {
     SG_Utils.OpenLink(string.Format(Localization.language == SystemLanguage.Russian ? appStoreRU : appStoreEN, build.APPLE_ID), "AppStore");
 }
示例#10
0
 public void OpenLike()
 {
     SG_Utils.OpenLink(server.links.fbGroup, "FacebookGroup");
 }
示例#11
0
 public void OpenYoutube()
 {
     SG_Utils.OpenLink(server.links.youtube, "Youtube");
 }
示例#12
0
 public void OpenVKPage()
 {
     SG_Utils.OpenLink(server.links.vkGroup, "VKontacteGroup");
 }
示例#13
0
 public void OpenTwitter()
 {
     SG_Utils.OpenLink(server.links.twitter, "Twitter");
 }
示例#14
0
 public void OpenFacebookPage()
 {
     SG_Utils.OpenLink(server.links.fbGroupShort, "FacebookGroup");
 }
示例#15
0
    void Update()
    {
        // SetCanvasScale();

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (tutorial.gameObject.activeSelf)
            {
                tutorial.currentBubble.Hide();
            }
            else if (current != null && !isBlock)
            {
                current.OnEscapeKey();
            }
        }
        else if (current == promocode)
        {
            if (Input.GetKeyDown(KeyCode.Return))
            {
                promocode.EnterCode();
            }
        }

        if (build.cheats || platform == Platform.Editor)
        {
            if (Input.GetKeyDown(KeyCode.M))
            {
                ui.options.MusicToggle();
            }
            // else if (Input.GetKeyDown(KeyCode.L)) ui.options.LanguageToggle();
            else if (Input.GetKeyDown(KeyCode.S))
            {
                ui.options.SoundToggle();
            }
#if UNITY_EDITOR
            else if (Input.GetKeyDown(KeyCode.P))
            {
                UnityEditor.EditorApplication.isPaused = false;
            }
#endif
            else if (Input.GetKeyDown(KeyCode.S))
            {
                SG_Utils.TakeScreenshot();
            }
            else if (current == prepare)
            {
                if (Input.GetKeyDown(KeyCode.UpArrow))
                {
                    LevelUpNow();
                }
                else if (Input.GetKeyDown(KeyCode.DownArrow))
                {
                    LevelDownNow();
                }
            }
            else if (current == collection)
            {
                if (Input.GetKeyDown(KeyCode.UpArrow) && collection.bigCatSlot.catItem != null && !collection.bigCatSlot.catItem.isMaxLevel)
                {
                    user.GetCat(collection.bigCatSlot.catItem.type);

                    collection.bigLevelText.text = collection.bigCatSlot.catItem.level.ToString();
                }
                else if (Input.GetKeyDown(KeyCode.DownArrow) && collection.bigCatSlot.catItem != null && collection.bigCatSlot.catItem.level > 1)
                {
                    collection.bigCatSlot.catItem.level--;
                    collection.bigLevelText.text = collection.bigCatSlot.catItem.level.ToString();
                    user.CollectionSave(true);
                }
            }
            else if (current == options)
            {
                if (Input.GetKeyDown(KeyCode.UpArrow))
                {
                    ProgressMAX();
                }
                else if (Input.GetKeyDown(KeyCode.DownArrow))
                {
                    ProgressReset();
                }
            }
            else if (current == game)
            {
                if (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.Keypad8))
                {
                    gameplay.seconds += 90;
                }
                else if (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.Keypad2))
                {
                    TimeOut();
                }
                else if (Input.GetKeyDown(KeyCode.O))
                {
                    gameplay.score += 100000;
                }
            }
        }

        if (!string.IsNullOrEmpty(build.updateUrl) && build.isCriticalUpdateNeeded)
        {
            SG_Utils.OpenLink(build.updateUrl, "Update");
        }
    }