This file contains 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; | |
namespace Opendream { | |
public class ExampleRotate : MonoBehaviour { | |
public Transform m_Transform; | |
public Vector3 angle; |
This file contains 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 UnityEditor; | |
using System.Collections; | |
public class GUIControlEditorWindow : EditorWindow { | |
[MenuItem("Window/GUIControl Test")] | |
public static void OpenGUIControlEditorWindow() { | |
EditorWindow.GetWindow<GUIControlEditorWindow>(); | |
} |
This file contains 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
[System.Serializable] | |
public class BaseField<T> { | |
public string name; | |
public T value; | |
public Field(string name) { | |
this.name = name; | |
this.value = default(T); |
This file contains 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 UnityEditor; | |
using UnityEditor.Callbacks; | |
using System.Diagnostics; | |
using System.IO; | |
public static class ProcessBuild | |
{ | |
[PostProcessBuild(1000)] | |
public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject) |
This file contains 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.Text.RegularExpressions; | |
using UnityEngine; | |
public class AnimationBroadcastStateMachineBehaviour : StateMachineBehaviour { | |
// Could not find the way to get current state name. | |
// So end up with this. Define variable again. | |
public string stateName; |
This file contains 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
# convert Input/*.png -crop [width]x[height]+[pos.x]+[pos.y] -set filename:fname '%t_tn' +adjoin 'Output/[filename:fname].png' | |
convert Input/*.png -crop 1136x640+418+138 -set filename:fname '%t_tn' +adjoin 'Output/[filename:fname].png' |
This file contains 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
function isInt(n){ | |
return Number(n).toString() === n.toString() && n % 1 === 0; | |
} | |
function isFloat(n){ | |
return Number(n).toString() === n.toString() && n % 1 !== 0; | |
} |
This file contains 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
// Get private or protected field of items | |
FieldInfo fieldInfo = obj.GetType().GetField("items", BindingFlags.NonPublic | BindingFlags.Instance); | |
object field = fieldInfo.GetValue(obj); | |
// Invoke simple method. | |
// instance.Clear(); | |
MethodInfo methodInfo = type.GetMethod("Clear"); | |
methodInfo.Invoke(obj, null); | |
// Invoke method with parameter(s). |
This file contains 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
#!/usr/bin/env python | |
from PIL import Image | |
import math | |
import os | |
from glob import glob | |
allowed_sizes = [2, 4, 8, 16, 64, 128, 256, 512, 1024, 2048] |
This file contains 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 UnityEditor; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class DragAndDropEditorWindow : EditorWindow | |
{ | |
[MenuItem("Window/Drag And Drop")] | |
public static void Open() | |
{ |