Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Dasinf · May 14, 2011 at 08:51 PM · editor-scriptingeditorwindowsceneviewdraw

Drawing to scene view from EditorWindow?

Hello,

I'm starting to learn Unity editor extension programming, but there seems to be something very elementary that I'm missing. I want to visualize a point in the scene view from an editor extension that's an EditorWindow. Basically it's an extension that will parse through some external data with coordinates and overlay them on the scene view for designers to see. Ideally I would then add various setting to the editor to color-code and filter the shown data among other things.

Because of the lack of documentation (that I could understand, anyway) I'm not sure what tools are available to me. I would like to use color coded spheres such as gizmos, I don't know how to access them from an extension. Handles also seem to require the OnSceneGUI that is not available to an EditorWindow. Debug.DrawLine and DrawRay both work but it seems like a hack and they can't visualize points.

I would like to avoid generating tons of dummy GameObjects to represent the points, because it would then clutter the scene hierarchy and they would be a pain to manage.

Any helpful pointers would be greatly appreciated!

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Rennat · Aug 22, 2011 at 08:56 PM 0
Share

I'm wondering the exact same thing.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by 3D-Magic-VR · Aug 22, 2011 at 09:14 PM

Hi there, try to check the method using on iTween Path, that's a good starting point to learn how to drive helpers in the scene editor.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0
Wiki

Answer by vjoseph · Jun 09, 2012 at 11:57 AM

I know its fairly late to answer the question; but just for the records...

How to draw on scene from CustomEditor

The way I did it was to write a Custom Editor, and a custom Inspector for my component/object.

My editor doesn't know about any inspector, and only exposes a bunch of delegates that it will call when it finds something interesting. It picks up values only from your object, and writes values to it.

The custom inspector on the other hand will know about the existence of the custom editor, and will cache this editor in the OnEnable(). In this same function, the inspector will register to the delegates of the custom editor, and handle related sceneView changes when those delegates are called. [Remember to unregister from the delegates in OnDisable()]

Whenever your inspector needs to update something in the editor, it updates the object and then triggers a repaint/refresh on the editor, which will force the editor to get fresh values and update accordingly.

Working with temporary objects created from script Editor and Temporary objects

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Error: Unable to load the icon: 'CustomEditorWindow'. (Custom Scene View) 1 Answer

Custom scene view in editor window 2 Answers

OnSceneGUI event Use() ates too much :) 1 Answer

EditorGUI Get Rect of GUILayout Objects 1 Answer

Set Parent EditorScript 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges