void GetGoldfish() { if (isRiki) { shape.enabled = false; Destroy(rb); } SG_Utils.Shuffle <Stuff>(Factory.LIVE_STUFF); int goldfishs = (int)item.power; foreach (Stuff stuff in Factory.LIVE_STUFF) { if (stuff != null && stuff is CatBasic && (stuff as CatBasic).isCoin) { stuff.Punch(); (stuff as CatBasic).FreeCoin(); if (--goldfishs <= 0) { break; } } } }
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); } }
IEnumerator WaitForRequest() { while (true) { if (logs.Count > 0) { int count = logs.Count > maxParams ? maxParams : logs.Count; var url = new StringBuilder(googleScriptUrl).Append(deviceId).Append(SystemInfo.deviceUniqueIdentifier); for (int i = 0; i < count; ++i) { url.Append(p).Append(i).Append(equal).Append(SG_Utils.UrlEncode(logs.Dequeue())); } var www = new WWW(url.ToString()); yield return(www); // if (www.error != null) { }; www.Dispose(); } yield return(null); } }
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 больше не вылезало }
void SpreadCoins() { if (isRiki) { shape.enabled = false; Destroy(rb); } SG_Utils.Shuffle <Stuff>(Factory.LIVE_STUFF); int goldfishs = (int)item.power; foreach (Stuff stuff in Factory.LIVE_STUFF) { if (stuff != null && stuff is CatBasic && (stuff as CatBasic).isCanHoldCoin) { Mover.CreateCoinForCat(t.position, stuff as CatBasic); goldfishs--; } if (goldfishs < 1) { break; } } }
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"); } }
void Mix() { var stuff1 = Factory.LIVE_STUFF.ToArray(); var stuff2 = Factory.LIVE_STUFF.ToArray(); SG_Utils.Shuffle <Stuff>(stuff2); for (int i = 0; i < stuff1.Length; i++) { Factory.LIVE_STUFF.Remove(stuff1[i]); stuff1[i].StartCoroutine(stuff1[i].MoveTo(stuff2[i].t.position, Random.Range(0.5f, 2f), s => { Factory.LIVE_STUFF.Add(s); })); } }
public void Send() { string subject = "Error Report " + Random.Range(100000, 999999); string body = string.Format("Hello\n\nMy device: {0}, {1}, Screen {2}, RAM {3} MB, CPU {4}, GPU {5} {6} MB {7}\n\nMy profile: {8} (Facebook {9}, Game Center {10}, Google Games {11})\n\nGame version: {12}\n\n{13}", SystemInfo.deviceModel, SystemInfo.operatingSystem, SG_Utils.resolution, SystemInfo.systemMemorySize, SystemInfo.processorType, SystemInfo.graphicsDeviceName, SystemInfo.graphicsMemorySize, SystemInfo.graphicsDeviceVersion, user.isId ? user.id : "-", string.IsNullOrEmpty(user.facebookId) ? "-" : user.facebookId, string.IsNullOrEmpty(user.gameCenterId) ? "-" : user.gameCenterId, string.IsNullOrEmpty(user.googleGamesId) ? "-" : user.googleGamesId, build.version, errorText.text); SG_Utils.Email(server.links.supportEmail, subject, body); Hide(); }
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(); }
void Magic() { if (isRiki) { shape.enabled = false; Destroy(rb); } SG_Utils.Shuffle <Stuff>(Factory.LIVE_STUFF); int count = (int)item.power; Stuff[] sortStuff = Factory.LIVE_STUFF.ToArray(); System.Array.Sort(sortStuff, delegate(Stuff s1, Stuff s2) { if (s1 == null || s2 == null) { return(0); } else { return(DistanceTo(s1).CompareTo(DistanceTo(s2))); } }); foreach (Stuff stuff in sortStuff) { if (stuff != null && stuff is CatBasic && !(stuff is CatJoker) && (stuff as CatBasic).type != changingColor.catType) { (stuff as CatBasic).ChangeType(changingColor.catType); stuff.Punch(); if (--count <= 0) { break; } } } }
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; }
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); }
public void OpenLike() { SG_Utils.OpenLink(server.links.fbGroup, "FacebookGroup"); }
public void OpenAmazon() { SG_Utils.OpenLink(string.Format(amazon, build.AMAZON_ID), "Amazon"); }
public void OpenGooglePlay() { SG_Utils.OpenLink(string.Format(googlePlay, build.ID), "GooglePlay"); }
public void OpenApple() { SG_Utils.OpenLink(string.Format(Localization.language == SystemLanguage.Russian ? appStoreRU : appStoreEN, build.APPLE_ID), "AppStore"); }
public override void ActivatePower() { var types = new CatType[] { CatType.GetCatType(Cats.Snow), CatType.GetCatType(Cats.Loki), CatType.GetCatType(Cats.Orion), CatType.GetCatType(Cats.Zen), CatType.GetCatType(Cats.Disco), CatType.GetCatType(Cats.Boom), CatType.GetCatType(Cats.Cap), CatType.GetCatType(Cats.King), CatType.GetCatType(Cats.Flint) }; type = types[Random.Range(0, types.Length)]; item = new CatItem(type, item.level, 0); if (type == CatType.GetCatType(Cats.Zen)) { shape.enabled = false; StartCoroutine(FlyingTimers((int)item.power)); iTween.PunchScale(ui.game.timeText.gameObject, new Vector3(0.6f, 0.6f, 0), 1); if (!isRiki) { ShakeAndDestroy(); } } else if (type == CatType.GetCatType(Cats.Snow)) { shape.enabled = false; gameplay.FreezeSeconds(item.power); if (!isRiki) { ShakeAndDestroy(); } } else if (type == CatType.GetCatType(Cats.Disco)) { shape.enabled = false; gameplay.StartFever(item.power); if (!isRiki) { ShakeAndDestroy(); } } else if (type == CatType.GetCatType(Cats.Boom)) { shape.enabled = false; Bomb((type.levelPower[0] + (type.levelPower[item.level - 1] - type.levelPower[0]) * 0.4f)); if (!isRiki) { ShakeAndDestroy(); } } else if (type == CatType.GetCatType(Cats.Cap)) { Destroy(rb); shape.enabled = false; float scale = type.scale.x * (smallScreen ? 1.1f : 1f) * 0.6f * (type.levelPower[item.level - 1] / type.levelPower[0]); iTween.ScaleTo(gameObject, iTween.Hash("x", scale, "y", scale, "easeType", "easeOutBack", "time", 0.6f)); StartCoroutine(Fly()); StartCoroutine(PushOutCatsOnPath()); } else if (type == CatType.GetCatType(Cats.King)) { shape.enabled = false; SG_Utils.Shuffle <Stuff>(Factory.LIVE_STUFF); int goldfishs = (int)item.power; foreach (Stuff stuff in Factory.LIVE_STUFF) { if (stuff != null && stuff is CatBasic && (stuff as CatBasic).isCanHoldCoin) { Mover.CreateCoinForCat(t.position, stuff as CatBasic); goldfishs--; } if (goldfishs < 1) { break; } } if (!isRiki) { ShakeAndDestroy(); } } else if (type == CatType.GetCatType(Cats.Flint)) { shape.enabled = false; SG_Utils.Shuffle <Stuff>(Factory.LIVE_STUFF); int goldfishs = (int)item.power; foreach (Stuff stuff in Factory.LIVE_STUFF) { if (stuff != null && stuff is CatBasic && (stuff as CatBasic).isCoin) { stuff.Punch(); (stuff as CatBasic).FreeCoin(); if (--goldfishs <= 0) { break; } } } if (!isRiki) { ShakeAndDestroy(); } } else if (type == CatType.GetCatType(Cats.Loki)) { shape.enabled = false; for (byte i = 0; i < CatLoki.bomb[item.level - 1, 0]; i++) { factory.CreateFirework(factory.fireworkPrefabs.boomSmall, new Vector3(Random.Range(-2f, 2f), Random.Range(-6f, 6f), 0)); } for (byte i = 0; i < CatLoki.bomb[item.level - 1, 1]; i++) { factory.CreateFirework(factory.fireworkPrefabs.rocket, new Vector3(Random.Range(-2f, 2f), Random.Range(-6f, 6f), 0)); } for (byte i = 0; i < CatLoki.bomb[item.level - 1, 2]; i++) { factory.CreateFirework(factory.fireworkPrefabs.boomBig, new Vector3(Random.Range(-2f, 2f), Random.Range(-6f, 6f), 0)); } for (byte i = 0; i < CatLoki.bomb[item.level - 1, 3]; i++) { factory.CreateFirework(factory.fireworkPrefabs.color, new Vector3(Random.Range(-2f, 2f), Random.Range(-6f, 6f), 0)); } if (!isRiki) { ShakeAndDestroy(); } } else if (type == CatType.GetCatType(Cats.Orion)) { shape.enabled = false; BlackHole.Create(t.position, item.power); if (!isRiki) { ShakeAndDestroy(); } } }
public void OpenFacebookPage() { SG_Utils.OpenLink(server.links.fbGroupShort, "FacebookGroup"); }
public void OpenTwitter() { SG_Utils.OpenLink(server.links.twitter, "Twitter"); }
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"); } }
public void OpenYoutube() { SG_Utils.OpenLink(server.links.youtube, "Youtube"); }
public void OpenVKPage() { SG_Utils.OpenLink(server.links.vkGroup, "VKontacteGroup"); }