ArgumentException: Getting control 1's position in a group with only 1 controls when doing DragPerform
Unity3D/Problems 2013. 9. 1. 20:14ArgumentException: Getting control 1's position in a group with only 1 controls when doing DragPerform
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
public class TestEditor : EditorWindow {
private List<string> list = new List<string>();
[MenuItem("Test/FoldItem")]
static void Init(){
EditorWindow window = EditorWindow.GetWindow(typeof(TestEditor));
window.Show();
}
void OnGUI(){
EventType type = Event.current.type;
if( type == EventType.DragUpdated ){
DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
}
if( type == EventType.DragPerform ){
for(int i = 0; i<DragAndDrop.objectReferences.Length; i++){
Debug.Log(DragAndDrop.objectReferences[i]);
GUILayout.BeginArea(new Rect(0, 0, position.width, position.height));
if( DragAndDrop.objectReferences.Length > 0) {
Debug.Log("-> " + DragAndDrop.objectReferences[0].name);
GUILayout.Label("test");
}
GUILayout.EndArea();
}
}
}
}
'Unity3D > Problems' 카테고리의 다른 글
EditorWindow loses reference of ScriptableObject on Play mode (0) | 2013.09.13 |
---|---|
Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption. (0) | 2013.09.03 |
주변의 여러 오브젝트들의 Scene에서 확인하며 이동 하는 방법은 없는가? (0) | 2013.08.26 |
Unity3D Error building Player: Exception: android (invokation failed) (0) | 2013.08.20 |
[스크랩] Visual studio 2010 에서 소스파일을 UTF-8 로 자동변환 (1) | 2013.08.06 |