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; | |
#if UNITY_PS4 | |
using UnityEngine.PS4; | |
#endif | |
using System.Collections; | |
using System.Collections.Generic; | |
using InControl; | |
public class InputVibration : SingletonBehaviour<InputVibrator> | |
{ |
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 FullSerializer; | |
using System; | |
using System.IO; | |
using System.Runtime.Serialization.Formatters.Binary; | |
public static class DataSerializer | |
{ | |
private static readonly fsSerializer serializer = new fsSerializer(); | |
public static string Serialize<T>(object value, bool prettify = false) |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
public static class RandomUtility | |
{ | |
public interface IWeighted | |
{ | |
float Weight { get; } |
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
void OrderVerts(ref List<Vector2> vertices, Vector2 center) | |
{ | |
vertices.Sort((v2, v1) => (Mathf.Atan2(v2.y - center.y, v2.x - center.x)).CompareTo(Mathf.Atan2(v1.y - center.y, v1.x - center.x))); | |
} |
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
public static float RoundToNearestPixel(float unityUnits, Camera viewingCamera) | |
{ | |
float valueInPixels = (Screen.height / (viewingCamera.orthographicSize * 2)) * unityUnits; | |
valueInPixels = Mathf.Round(valueInPixels); | |
float adjustedUnityUnits = valueInPixels / (Screen.height / (viewingCamera.orthographicSize * 2)); | |
return adjustedUnityUnits; | |
} |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
less: { | |
production: { | |
options: { | |
paths: ["assets/less"], | |
compress: true, | |
yuicompress: true | |
}, | |
files: { |
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
#!/bin/bash | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
MUSER="root" | |
MPASS="pass" | |
MHOST="localhost" | |
BACKUP_LOCATION="/backup/mysql" | |
AWS_BUCKET_NAME="my_bucket" | |
NOW=$(date +"%h-%d-%Y") |
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
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
echo "This will set permissions which will allow wordpress to auto-update for the specified web directory, then restore them to secure permissions when done." | |
echo -n "Enter the site path to work with: /var/www/" | |
read site | |