This file contains hidden or 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 CameraDragController : MonoBehaviour { | |
public Transform Target; | |
public float Sensitivity = 0.1f; | |
public bool Invert = false; | |
public bool Hold = false; | |
public Rect Bounds; |
This file contains hidden or 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 System; | |
using System.Linq; | |
public static class Messenger | |
{ | |
public static void AddListener(string eventType, Action handler) | |
{ | |
MessengerInternal.AddListener(eventType, handler); | |
} | |
public static void AddListener<TReturn>(string eventType, Func<TReturn> handler) | |
{ |
This file contains hidden or 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 System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public static class ListExtensions | |
{ | |
private static System.Random s_rand = new System.Random(); | |
public static T RandomElement<T>(this List<T> source) | |
{ | |
if (source.Count == 0) |
This file contains hidden or 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; | |
using System.Collections; | |
using System.Collections.Generic; | |
[Serializable] | |
public class Conversation | |
{ | |
// The ID of the current Conversation. |
This file contains hidden or 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
// In most games I need a touch of OLD Unity GUI and for that I need a scaling GUI solution, most out there just don't seem to really work for me. | |
// So I made my own with a very simple method, most designs rely on a target device resolution, if you know what that is. | |
// It essentially means everytime I design something I design GUI for ONE resolution and so I want it to scale to every resolution. | |
// So first we define our design resolution. | |
// For the example we chose a common portrait resolution. | |
[SerializeField] | |
private Vector2 DesignResolution = new Vector2(480,800); | |
// Now we need our Scale variable to store the difference between the design resolution and new. | |
[SerializeField] |
This file contains hidden or 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 | |
# | |
# first - Required programs and packages install for swgemu development environment | |
# | |
# Author: Scurby <[email protected]> | |
# Edited: Grimmdev <[email protected]> | |
# | |
# Created: Dec 3 2015 | |
# | |
# Changed - |
This file contains hidden or 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
// My Example | |
print("Let's fly!") | |
ship.reset | |
ship.x = 0 | |
ship.y = 0 | |
for a in range(0, 90, 1) | |
ship.rot = a | |
wait(1/180) | |
end for | |
for a in range(0,90,1) |
This file contains hidden or 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 SimpleJSON; | |
public class JSONExtras { | |
public int[] ToIntArray(string n) { | |
var j = JSON.Parse(n); | |
int[] a = new int[j.Count]; |
This file contains hidden or 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
// Sean Loper | |
// 2016 | |
// PreferenceUtility.cs | |
using UnityEngine; | |
using System.Globalization; | |
using LostPolygon.uLiveWallpaper; | |
public class PreferenceUtility | |
{ |
This file contains hidden or 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 System; | |
public class ShortGUID | |
{ | |
private static Guid tmpGuid; | |
public static string NewGuid() | |
{ | |
tmpGuid = Guid.NewGuid (); | |
return Convert.ToBase64String(tmpGuid.ToByteArray()); |