- Home /
Editor Extention - How to instantiate?
Hi there
I´m still working on my 2D Tile Editor, and wanted to ask a very important thing..
I managed to create a "chose a tile" system as a Window in the Unity Editor. Now i want to instantiate a plane in the scene view, and use the TileX/Y position on the tileset, to use as texture for the plane.
i know how to use the materials..
My problem is: how can i instantiate a Plane with mouseclick/mousehold, and give it this texture? Do i need to send the tilesetposition and tilesetname to the scene view? if yes.. how?
Ps.: tileset = the 4096² Texture where all 16² tiles are stored intiles are stored in. Each map can have a individual one.
If I answered your question, please accept my answer. If you don't know how, watch the tutorial video on the right
Answer by Benproductions1 · Aug 19, 2013 at 02:41 AM
Hello,
This is the beauty of the Unity Editor. Technically the Editor is just a feature-full overlay to the same engine. Every function that works at runtime works during the editor, because it is the same runtime.
Wether you call Instantiate
from a MonoBehaviour
, a AssetPostProcessor
or an Editor
, it does not matter. Every call will do the same exact thing. The same goes for any other runtime function. Anything you can do at runtime you can do in the editor :)
Hope this helps,
Benproductions1
Teach a man to fish...I would have gone for the "give-em-the-code" approach. Good all-round answer. Up-voted.
Thanks ;)
I always try and avoid the "give-em-the-code" approach
Your answer
Follow this Question
Related Questions
Intercepting left click in scene view for Custom editor. 1 Answer
Fire object towards mouse cursor 1 Answer
Ensuring Correct Call Order 0 Answers