This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) ... | |
* | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |