public override void press() { Logger.Log("EndMainMenuButton::press()", Logger.Level.INFO); URLOpener.open(studyURLKey, false); //if commented out, causes "enter" in the main menu at the end of the game to restart the game ModalManager.unsetModal(); GameStateController.get().endGame(); }
private void OpenBookmarkInBrowser(object sender, OpenBookmarkEventArgs e) { IModelType typeToOpen = GetModelTypeById(e.IdToOpen, _bookmarksTree); if (typeToOpen.GetType() != typeof(Bookmark)) { return; } URLOpener opener = new URLOpener(Browser.Chrome); opener.Open(((Bookmark)typeToOpen).Url); }
protected override void OnUpdate() { var state = GetSingleton <GameState>(); if (state.Value == GameStateEnum.EndGame) { bool push = false; float2 position = new float2(0, 0); var Input = World.GetExistingSystem <InputSystem>(); if (Input.IsTouchSupported() && touch && /*Input.TouchCount() > 0*/ Input.GetTouch(0).phase == TouchState.Ended) { touch = false; push = true; position.x = Input.GetTouch(0).x; position.y = Input.GetTouch(0).y; } if (Input.GetMouseButtonUp(0)) { push = true; position = Input.GetInputPosition(); } if (Input.IsTouchSupported() && Input.GetTouch(0).phase == TouchState.Began) { touch = true; } if (push) { float2 s2wPos = MyS2W(position); if (235f <= s2wPos.x && s2wPos.x <= 287f && 62f <= s2wPos.y && s2wPos.y <= 114f) { string score = GetSingleton <Counter>().Value.ToString(); // string url = "https://twitter.com/intent/tweet?text=" + score + "個のニンジンを集めました\n&via=poi_third&url=https://poikelp.github.io/TinyPeko"; // if(Input.IsTouchSupported()) // { // url = "twitter://post?message=" + score + "個のニンジンを集めました\nhttps://poikelp.github.io/TinyPeko @poi_third より"; // } URLOpener.OpenURL(score); } } } }
private void goToMOOC(bool newTab) { RedMetricsManager.get().sendEvent(TrackingEvent.GOTOMOOC); URLOpener.open(urlKey, newTab); }
private void Awake() { urlOpener = GetComponent <URLOpener>(); GetComponent <Button>().onClick.AddListener(urlOpener.OpenURL); }
protected override void OnStartRunning() { base.OnStartRunning(); // クエリパラメータの取得、変換 string query = URLOpener.GetQuery(); string bits = ""; foreach (var c in query) { var value = Array.IndexOf(this.ConversionTable, c); bits += value / 32; value %= 32; bits += value / 16; value %= 16; bits += value / 8; value %= 8; bits += value / 4; value %= 4; bits += value / 2; bits += value % 2; } int octet = 0; int bitPosition = 0; List <byte> bytes = new List <byte>(); foreach (var b in bits) { bitPosition++; if (b == '1') { octet += 0b1000_0000 >> (bitPosition - 1); } if (bitPosition == 8) { bytes.Add((byte)octet); octet = 0; bitPosition = 0; } } List <bool> flipList = new List <bool>(); List <byte> idList = new List <byte>(); List <int2> posList = new List <int2>(); for (int i = 0; i < bytes.Count; i += 2) { bool flip = (bytes[i] & 0b1000_0000) == 0b1000_0000; byte id = (byte)(bytes[i] % 0b1000_0000); int2 pos = new int2(bytes[i + 1] % 16, bytes[i + 1] / 16); flipList.Add(flip); idList.Add(id); posList.Add(pos); } // Entityの生成予約 var cmdBuffer = new EntityCommandBuffer(Allocator.TempJob); var generator = GetSingleton <FurnitureGenerator>(); var prefabSR = GetComponent <SpriteRenderer>(generator.Prefab); var renderer = GetComponent <Renderer2D>(generator.Prefab); for (int i = 0; i < flipList.Count; i++) { byte id = idList[i]; Furniture furniture = new Furniture(); InRoomPos inRoomPos = new InRoomPos { Value = posList[i] }; Entities.WithoutBurst().ForEach((in Furniture f) => { if (f.ID == id) { furniture = f; } }).Run();
private void ClickOnBrandingBtn() { URLOpener.OpenURL("https://www.y8.com/"); }