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 MulticastDelegate: | |
def __init__(self): | |
self.delegates = [] | |
def add(self, delegate): | |
self.delegates.append(delegate) | |
def sub(self, delegate): | |
self.delegates.remove(delegate) |
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
export default (request) => { | |
console.log('--------------------------------------------START') | |
//////////////////////////////// | |
// ---------- external modules | |
// sha256 | |
function SHA256(s){ | |
var chrsz = 8; |
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/env sh | |
lines=$(tput lines) | |
cols=$(tput cols) | |
awkscript=' | |
{ | |
letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()" | |
lines=$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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class GameController : MonoBehaviour | |
{ | |
public static GameController instance; | |
// Singleton Initialization | |
void Awake() |
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; | |
public static class RendererExtensions | |
{ | |
/// <summary> | |
/// Checks if the object is visible from a certain camera | |
/// </summary> | |
/// <returns><c>true</c>, if visible, <c>false</c> otherwise.</returns> | |
/// <param name="renderer">Object Renderer</param> | |
/// <param name="camera">Camera</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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
/// <summary> | |
/// Used to set Sorting Layer for 3D meshes, so they can Z-sort | |
/// correctly when used with 2D Sprites. | |
/// </summary> | |
public class OverrideSortingLayer : MonoBehaviour | |
{ |
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; | |
class WeightedRandomBag<T> { | |
private struct Entry { | |
public double accumulatedWeight; | |
public T item; | |
} |
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
#if UNITY_EDITOR | |
Debug.unityLogger.logEnabled = true; | |
#else | |
Debug.unityLogger.logEnabled = false; | |
#endif |
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.Networking; | |
/// <summary> | |
/// Opens external application to send an email | |
/// </summary> | |
/// <param name="email">Email address</param> | |
/// <param name="subject">Subject.</param> | |
/// <param name="body">Body. E.g "My Body\r\nFull of non-escaped chars"</param> | |
void SendEmail(string email, string subject, string body) | |
{ |
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.Events; | |
//will be displayed in editor | |
public UnityEvent yourCustomEvent; | |
public void Foo() { | |
// Trigger the event! | |
yourCustomEvent.Invoke(); | |
} |
OlderNewer