Skip to content

Instantly share code, notes, and snippets.

View Problematic's full-sized avatar

Derek Stobbe Problematic

View GitHub Profile
using UnityEngine;
[CreateAssetMenu]
public class CastService : ScriptableObject
{
public float maxDistance = Mathf.Infinity;
public LayerMask mask;
public QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal;
public bool Raycast (Vector3 origin, Vector3 direction, out RaycastHit hitInfo)
@Problematic
Problematic / gulpfile.js
Last active May 28, 2017 16:29
Using Babel and Browserify with gulp
var gulp = require('gulp');
var browserify = require('browserify');
var through2 = require('through2');
gulp.task('build', function () {
return gulp.src('./src/main.js')
.pipe(through2.obj(function (file, enc, next) {
browserify(file.path, { debug: process.env.NODE_ENV === 'development' })
.transform(require('babelify'))
.bundle(function (err, res) {
@Problematic
Problematic / Screenshake.plugin.js
Created January 17, 2015 04:41
Screenshake plugin for PhaserJS
function Screenshake (game, parent) {
Phaser.Plugin.call(this, game, parent);
this.timer = this.game.time.create(false);
this.timer.start();
this.shakeCount = 0;
this.shakeAmount = 1;
this._initialBounds = this.game.camera.bounds;
// The only thing HSHG expects a collidable object to have is a getAABB() method that
// returns an object with two properties, min and max, that should both have a single
// array with two numbers as coordinates. For example, an object at 10, 10 and
// height/width of 100 would return { min: [10, 10], max: [110, 110] }
function Vertex(args /*x, y, radius*/){
var argProp;
for(argProp in args){
if(args.hasOwnProperty(argProp)){
@Problematic
Problematic / sap_nearest.lua
Created November 18, 2014 23:41
WoW PvP Rogue Macros
#showtooltip Sap
/console SET targetNearestDistance 10
/targetenemy [noharm]
/console SET targetNearestDistance 41
/cast Sap
@Problematic
Problematic / Edge.cs
Created August 31, 2014 20:42
Node graph for Unity3D
using UnityEngine;
[System.Serializable]
public class Edge
{
public Edge()
{
}
public Edge(Node node, int cost)
{
(VBoxManage list runningvms | grep "Ora_XE" && echo "Oracle VM is already running... skipping start step.") || VBoxManage startvm Ora_XE_11.2
using UnityEngine;
using System.Collections;
public class CoupledComponent : MonoBehaviour
{
void Update ()
{
if (Input.GetKeyDown(KeyCode.E))
{
PerformAction();
@Problematic
Problematic / FooScript.cs
Created August 16, 2014 19:44
Default new Unity script
using UnityEngine;
using System.Collections;
public class FooScript : MonoBehaviour
{
// Use this for initialization
void Start()
{
}
@Problematic
Problematic / MouseFollow.cs
Created August 11, 2014 02:52
Unity3D mousefollow script
using UnityEngine;
public class MouseFollow : MonoBehaviour
{
new public Camera camera;
public float zValue = 0;
public enum CoordinateSystem
{
World,