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
====================================================================================================== | |
ObjectField | |
var newMaterial = (Material) EditorGUILayout.ObjectField("Material", currentMaterial, typeof(Material),false); | |
====================================================================================================== |
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
Handles.BeginGUI(); | |
GUILayout.Window(2, new Rect(Screen.width-110, Screen.height-130, 100, 100), (id)=> { | |
// Content of window here | |
GUILayout.Button("A Button"); | |
}, "Title"); | |
Handles.EndGUI(); |
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 UnityEngine; | |
public class MyCap{ | |
static Texture2D _mainTexture; | |
private static GUIContent _mainHandle; | |
private static GUIContent mainHandle{ |
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 UnityEngine; | |
//http://answers.unity3d.com/questions/463207/how-do-you-make-a-custom-handle-respond-to-the-mou.html | |
// Author http://answers.unity3d.com/users/57609/higekun.html | |
public class MyHandles{ | |
public enum DragHandleResult{ | |
none = 0, | |
LMBPress, |
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
AssetPreview.GetAssetPreview(Object o); |
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
[DidReloadScripts] //Add this attribute to a method to get a notification after scripts have been reloaded. | |
static void A(){ | |
Debug.Log("Hello"); | |
} |
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
public class ToolBarWindow : EditorWindow{ | |
private static Texture image; | |
[MenuItem("Window/TestChamber/ToolBar")] | |
public static void Init(){ | |
b(); | |
GetWindow<ToolBarWindow>().Show(); | |
} | |
private void OnGUI(){DrawToolbar();} |
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
mongod.exe --dbpath=M:\Dev\Database\Mongo\db\ --install --logpath=M:\Dev\Database\Mongo\logs\mongo.log --smallfiles | |
net start MongoDB |
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
public static Vector3 GetWorldPointFromMouse(bool plane = true, float planeLevel = 0) | |
{ | |
var groundPlane = new Plane(Vector3.up, new Vector3(0, planeLevel, 0)); | |
var ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition); | |
RaycastHit rayHit; | |
Vector3 hit = new Vector3(); | |
float dist; | |
if(plane) |
OlderNewer