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
Vector2 mousePos = _camera.ScreenToWorldPoint(Input.mousePosition); | |
Vector2 aimDirection = mousePos - (Vector2)_transform.position; | |
float aimAngle = Vector2.Angle(_transform.up, aimDirection); | |
if (Vector3.Cross(_transform.up, aimDirection).z > 0) | |
{ | |
aimAngle = 360 - aimAngle; | |
} | |
Vector3 newPos = new Vector3(_transform.position.x + bulletSpawnRadius * Mathf.Sin(aimAngle * Mathf.Deg2Rad), | |
_transform.position.y + bulletSpawnRadius * Mathf.Cos(aimAngle * Mathf.Deg2Rad), |
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
describe('$resource', function () { | |
var $httpBackend, | |
$rootScope, | |
Tasks; | |
beforeEach(module('ngResource')); | |
beforeEach(inject(function (_$httpBackend_, _$rootScope_) { | |
$httpBackend = _$httpBackend_; | |
$rootScope = _$rootScope_; |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "hashicorp/precise64" | |
config.vm.provision "docker" do |d| |
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
angular.module('dialogBox', []) | |
.factory('DialogBox', function ($q) { | |
var instances = {}; | |
function DialogBox (name) { | |
if (!instances[name]) { | |
instances[name] = $q.defer(); | |
} | |
instances[name].resolve(this); |
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; | |
using System.Collections; | |
public class EventConsumer : MonoBehaviour | |
{ | |
EventProvider ep; | |
void Awake () | |
{ | |
ep = GetComponent<EventProvider>(); |
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; | |
public class MouseFollow : MonoBehaviour | |
{ | |
new public Camera camera; | |
public float zValue = 0; | |
public enum CoordinateSystem | |
{ | |
World, |
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; | |
using System.Collections; | |
public class FooScript : MonoBehaviour | |
{ | |
// Use this for initialization | |
void Start() | |
{ | |
} |
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; | |
using System.Collections; | |
public class CoupledComponent : MonoBehaviour | |
{ | |
void Update () | |
{ | |
if (Input.GetKeyDown(KeyCode.E)) | |
{ | |
PerformAction(); |
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
(VBoxManage list runningvms | grep "Ora_XE" && echo "Oracle VM is already running... skipping start step.") || VBoxManage startvm Ora_XE_11.2 |
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
// 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)){ |
OlderNewer