예제 #1
0
        private bool Init(UnityEngine.Object obj, EditorFeatures requirements)
        {
            this.editor = Editor.CreateEditor(obj);
            if (this.editor == null)
            {
                return(false);
            }
            if ((requirements & EditorFeatures.PreviewGUI) > EditorFeatures.None && !this.editor.HasPreviewGUI())
            {
                return(false);
            }
            Type       type   = this.editor.GetType();
            MethodInfo method = type.GetMethod("OnSceneDrag", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

            if (method != null)
            {
                this.OnSceneDrag = (EditorWrapper.VoidDelegate)Delegate.CreateDelegate(typeof(EditorWrapper.VoidDelegate), this.editor, method);
            }
            else
            {
                if ((requirements & EditorFeatures.OnSceneDrag) > EditorFeatures.None)
                {
                    return(false);
                }
                this.OnSceneDrag = new EditorWrapper.VoidDelegate(this.DefaultOnSceneDrag);
            }
            return(true);
        }
예제 #2
0
		private bool Init(UnityEngine.Object obj, EditorFeatures requirements)
		{
			this.editor = Editor.CreateEditor(obj);
			if (this.editor == null)
			{
				return false;
			}
			if ((requirements & EditorFeatures.PreviewGUI) > EditorFeatures.None && !this.editor.HasPreviewGUI())
			{
				return false;
			}
			Type type = this.editor.GetType();
			MethodInfo method = type.GetMethod("OnSceneDrag", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			if (method != null)
			{
				this.OnSceneDrag = (EditorWrapper.VoidDelegate)Delegate.CreateDelegate(typeof(EditorWrapper.VoidDelegate), this.editor, method);
			}
			else
			{
				if ((requirements & EditorFeatures.OnSceneDrag) > EditorFeatures.None)
				{
					return false;
				}
				this.OnSceneDrag = new EditorWrapper.VoidDelegate(this.DefaultOnSceneDrag);
			}
			return true;
		}
예제 #3
0
 public void Dispose()
 {
     if (this.editor != null)
     {
         this.OnSceneDrag = null;
         UnityEngine.Object.DestroyImmediate(this.editor);
         this.editor = null;
     }
     GC.SuppressFinalize(this);
 }
예제 #4
0
 public void Dispose()
 {
     if ((UnityEngine.Object) this.editor != (UnityEngine.Object)null)
     {
         this.OnSceneDrag = (EditorWrapper.VoidDelegate)null;
         UnityEngine.Object.DestroyImmediate((UnityEngine.Object) this.editor);
         this.editor = (Editor)null;
     }
     GC.SuppressFinalize((object)this);
 }
예제 #5
0
		public void Dispose()
		{
			if (this.editor != null)
			{
				this.OnSceneDrag = null;
				UnityEngine.Object.DestroyImmediate(this.editor);
				this.editor = null;
			}
			GC.SuppressFinalize(this);
		}
예제 #6
0
 public void Dispose()
 {
   if ((UnityEngine.Object) this.editor != (UnityEngine.Object) null)
   {
     this.OnSceneDrag = (EditorWrapper.VoidDelegate) null;
     UnityEngine.Object.DestroyImmediate((UnityEngine.Object) this.editor);
     this.editor = (Editor) null;
   }
   GC.SuppressFinalize((object) this);
 }