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
// 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
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
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 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 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
String.format = function() { | |
// The string containing the format items (e.g. "{0}") | |
// will and always has to be the first argument. | |
var theString = arguments[0]; | |
// start with the second argument (i = 1) | |
for (var i = 1; i < arguments.length; i++) { | |
// "gm" = RegEx options for Global search (more than one instance) | |
// and for Multiline search | |
var regEx = new RegExp("\\{" + (i - 1) + "\\}", "gm"); |
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 PowerUI.Css; | |
using UnityEngine; | |
namespace PowerUI{ | |
/// <summary> | |
/// This additive:// protocol enables a link to point to another scene. | |
/// E.g. href="additive://sceneName" will load the scene additive called 'sceneName' when clicked. | |
/// </summary> | |
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 GameObjectExtension | |
{ | |
public static T GetComponentInParents<T>(this Component self) where T : Component | |
{ | |
return self.transform.GetComponentInParents<T>(); | |
} |
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; | |
using UnityEngine.UI; | |
public class FPSCounter : MonoBehaviour | |
{ | |
[SerializeField] | |
public Text m_label; |