Quantcast
Channel: Questions in topic: "dll"
Viewing all articles
Browse latest Browse all 706

Plugin To Extend Editor By DLL which contains Mono behaviours

$
0
0
I am developing a plugin which extends unity3d editor. this plugin will append as a managed dll to the project in editor folder. structure of plugin is something like this: 'Editor Folder' '-- CustomPlugin.dll' ' |-- CustomeEditor.cs -- main editor class which inherits EditorWindow' ' -- AnchorNode.cs --a MonoBehaviour' There is a class something like this : [ExecuteInEditMode] public class AnchorNode :MonoBehaviour { public GameObject next=null; public GameObject prev=null; } The plugin class which extends EditorWindow class use MonoBehaviour below like this: var nextAnchor = currentAnchor.GetComponent().next; So everything go ok unitl I want to attach AnchorNode script in dll to game objects in game . I can't and unity says : this is an editor script. Please note I have placed dll in Project's Editor folder because it is a plugin for editor and dll has AnchorNode class which inherits from MonoBehaviour and this MonoBehaviour should be attached to game objects within scene. I have tested this method but I can't get "next" attribute, because Component class has no attribute named "next" : var anchorNode =currentAnchor.GetComponent("AnchorNode"); So How Can I use MonoBehaviour in a dll which is placed in editor folder? Thanks in advance...

Viewing all articles
Browse latest Browse all 706

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>