Skip to content

Instantly share code, notes, and snippets.

View oronbz's full-sized avatar
🏠
Working from home

Oron Ben Zvi oronbz

🏠
Working from home
View GitHub Profile
@oronbz
oronbz / ContentView.swift
Created October 15, 2024 09:06 — forked from JSerZANP/ContentView.swift
communication between native(swiftUI) and wkwebview
import SwiftUI
import WebKit
struct WebView: UIViewRepresentable {
class Coordinator: NSObject, WKNavigationDelegate, WKScriptMessageHandler {
var webView: WKWebView?
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
self.webView = webView
}
@oronbz
oronbz / SwipeInput.cs
Created July 8, 2020 18:38 — forked from Fonserbc/SwipeInput.cs
A simple swipe detector for touchscreens for Unity3D. Four cardinal directions.
using UnityEngine;
/*
* Swipe Input script for Unity by @fonserbc, free to use wherever
*
* Attack to a gameObject, check the static booleans to check if a swipe has been detected this frame
* Eg: if (SwipeInput.swipedRight) ...
*
*
*/
@oronbz
oronbz / PixelPerfectCam.cs
Last active September 21, 2015 20:33 — forked from pixelrevision/PixelPerfectCam.cs
Script for unity to create a pixel locked orthogonal camera
using UnityEngine;
/**
* A camera to help with Orthagonal mode when you need it to lock to pixels. Desiged to be used on android and retina devices.
*/
public class PixelPerfectCam : MonoBehaviour {
/**
* The target size of the view port.
*/
public Vector2 targetViewportSizeInPixels = new Vector2(480.0f, 320.0f);
/**