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 / soundPlayer AngularJS Service
Last active August 14, 2018 13:45
This is a soundPlayer for AngularJS using the soundManager2 API.
// download soundManager2 and refer it in your scripts http://www.schillmania.com/projects/soundmanager2/doc/download/#latest
// also add the swf directory to your project
// your module declaration
var app = angular.module('myApp', []);
// attach the soundManager global for AngularJS dependency injection
app.value('soundManager', soundManager);
// usage
@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);
/**
@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 / AimInput.gd
Last active December 7, 2021 08:29
Joypad support for 1-bit-godot Metroidvania by heartbeast
extends Node
enum AimDevice {MOUSE, JOYPAD}
var last_device = null
var last_joypad_vector = null
func get_aim_vector(player):
if last_device in [AimDevice.MOUSE, null]:
return player.get_local_mouse_position()
@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
}