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);
        }
		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;
		}
 public void Dispose()
 {
     if (this.editor != null)
     {
         this.OnSceneDrag = null;
         UnityEngine.Object.DestroyImmediate(this.editor);
         this.editor = null;
     }
     GC.SuppressFinalize(this);
 }
Exemple #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);
 }
		public void Dispose()
		{
			if (this.editor != null)
			{
				this.OnSceneDrag = null;
				UnityEngine.Object.DestroyImmediate(this.editor);
				this.editor = null;
			}
			GC.SuppressFinalize(this);
		}
 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);
 }