public void ShareMiniGame() { GameObject go = (GameObject)Resources.Load("UI/ShareWindow/UI Root Shoot", typeof(GameObject)); GameObject result = UnityEngine.Object.Instantiate <GameObject>(go); ScreenShoot ss = result.GetComponent <ScreenShoot> (); ss.Shoot(); }
public override async Task Run(SocketIOResponse response) { ScreenShoot sc = new ScreenShoot(); Progress.Set("screenshoot", 30); var imageBytes = sc.CaptureScreenToBytes(ImageFormat.Png); Progress.Set("screenshoot", 70); string filename = $"{Guid.NewGuid()}.png"; Log.Information("Pomyslnie zrobiono zrzut ekranu"); await Socket.EmitAsync("get_screenshoot", new { img = imageBytes, filename = filename, clientId = $"/clients#{Socket.Id}" }); Progress.Set("screenshoot", 100); Notification.Success.Send("Pomyslnie zrobiono zrzut ekranu"); }