Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
/// <summary>
/// A simple free camera to be added to a Unity game object.
///
/// Keys:
using UnityEditor;
using UnityEngine;
public sealed class ExampleClass : EditorWindow
{
private static readonly string[] mList =
{
"AboutWIndowLicenseLabel" ,
"AC LeftArrow" ,
"AC RightArrow" ,

How to Use?

GUIStyle mystyle = new GUIStyle("some string from the list below");


UnityEditor.ConsoleWindow.Constants

  • "CN Box"
  • "Button"
@jaredallard
jaredallard / string.split.lua
Created May 21, 2015 05:07
string.split in lua
-- split a string
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
@Shogan
Shogan / gist:e6eb8222859ccbff9769
Created May 25, 2015 01:56
CharacterCreatorAWSRolePolicy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1432372934255",
"Action": [
"dynamodb:DeleteItem",
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:Scan",
@yamanyar
yamanyar / gist:95a2f42b5c984aef9860
Last active November 20, 2021 13:47
Unity: Creating a Thread and Making Callback Called by UI Thread
delegate void JobResultHandler(bool result);
public static void DoJobAsync (string someParameter, JobResultHandler jobResultHandler = null)
{
//If callback is null; we do not need unity adapter, otherwise we need to create it in ui thread.
ThreadAdapter adapter = jobResultHandler == null ? null : CreateUnityAdapter ();
@protrolium
protrolium / ffmpeg.md
Last active April 13, 2026 00:32
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@liortal53
liortal53 / DecoratorEditor.cs
Last active March 31, 2026 21:28
Extend Unity's built-in inspectors
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// A base class for creating editors that decorate Unity's built-in editor types.
/// </summary>
public abstract class DecoratorEditor : Editor
# Simulator for depth comparison error (i.e. z-fighting)
# Nathan Reed, June 2015
# Written for Python 3.4; requires numpy
import math
import numpy as np
import optparse
# Parse command-line options
parser = optparse.OptionParser()
@joymon
joymon / IPC_StdIn_Out_Source
Created July 20, 2015 16:56
IPC using StdIn and Out Soruce
internal class ProcessStarter
{
internal void StartExeToProcessMessage(string pathToExe, CustomQueueMessage customMsg)
{
string serializedMsg = JsonConvert.SerializeObject(customMsg);
using (Process p = GetProcessAfterStarting(pathToExe))
{
p.StandardInput.WriteLine(serializedMsg);
p.OutputDataReceived += (sender, args) => Console.WriteLine("Data receied from child exe - {0}", args.Data);
p.EnableRaisingEvents = true;