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
// Replacement module for Standalone Input Module | |
// Up to date for Unity 4.6 beta 19 | |
// | |
// Usage: | |
// -Remove the standalone module from your event system | |
// -Add this instead | |
// -Include ExtraMouseEvents.cs and IExtraMouseEventsHandler.cs | |
// -Implement IRightPointerClickHandler, IRightPointerDownHandler, IRightPointerUpHandler, IMiddlePointerClickHandler, | |
// IMiddlePointerDownHandler and/or IMiddlePointerUpHandler. | |
// |
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 UnityEngine.EventSystems; | |
public static class ExtraMouseEvents | |
{ | |
/// <summary> | |
/// Right mouse-click | |
/// </summary> | |
/// <param name="handler">Handler.</param> | |
/// <param name="data">Data.</param> |
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 UnityEngine.EventSystems; | |
public interface IRightPointerClickHandler : IEventSystemHandler | |
{ | |
void OnRightPointerClick(PointerEventData data); | |
} | |
public interface IRightPointerDownHandler : IEventSystemHandler |
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
// Class to test that saving/compression works in Unity. | |
// Largely untested outside of OS X. | |
using UnityEngine; | |
using NSC; | |
public class SaveTesting : MonoBehaviour | |
{ | |
void Start() |
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
# Unity generated | |
[Tt]emp/ | |
[Oo]bj/ | |
[Bb]uild | |
[Ll]ibrary/ | |
sysinfo.txt | |
*.stackdump | |
# Visual Studio / MonoDevelop | |
[Ee]xported[Oo]bj/ |
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
public interface State | |
{ | |
void Enter(); | |
void Run(); | |
void Exit(); | |
} | |
public class StateMachine | |
{ | |
State currentState; |
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
// humanNumber turns long numbers into sensible units for file sizes etc. | |
// Converted from C code found on the web. | |
func humanNumber(n int, si bool) string { | |
num := float64(n) | |
var unit float64 = 1024 | |
if si { | |
unit = 1000 | |
} | |
if num < unit { | |
return fmt.Sprintf("%dB", int(num)) |
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
package main | |
import ( | |
"fmt" | |
"strings" | |
ui "github.com/gizak/termui" | |
) | |
type ProgressBar struct { |
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
package main | |
import ( | |
"fmt" | |
ui "github.com/gizak/termui" | |
) | |
type ScrollableList struct { | |
list *ui.List |
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
// addon/addon.go | |
// The definition of a plugin. Each plugin project would include this stub. | |
package addon | |
type Addon interface { | |
Hello() | |
} |