Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Joshua · Jul 31, 2011 at 04:25 AM · gizmosgizmo3.4

Accessing Unity 3.4 gizmos through code.

Hey guys,

As you all might know Unity 3.4 comes with new and improved Editor Gizmo stuff. This has some pretty nice features, that for instance in two clicks let you set up a nice colored label gizmo above your Game Object.

But how do you do this through code? I've looked through all the new documentation and can't find anything about this. Am I correct that it can't be done? That would render it useless for anything but prefabs..

What I want to be able to do is

 var myNewGO : GameObject = new GameObject();
 myNewGO.thisNewGizmoStuff.label.enabled;
 myNewGo.thisnewGizmoStuff.label.color = Color.yellow;

The same as creating an empty Game Object in the editor, going through it's inspector, clicking the new gizmo tool and clicking the yellow label. Please tell me this is possible..?

Regards, Joshua.

Comment
Add comment · Show 3
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 testure · Jul 31, 2011 at 04:38 AM 0
Share

I'd also like to know more about this. from what I've seen it's kind of useless other than being able to turn off and on certain built-ins like audio sources and lights :\

avatar image Joshua · Jul 31, 2011 at 04:40 AM 0
Share

The label (gameobject's name with a colored background) gizmo seems pretty nice to me. But if you can only set it up manually it's useless.

avatar image Joshua · Jul 31, 2011 at 02:21 PM 0
Share

Well.. since it seems not to be possible.. feature request!

http://feedback.unity3d.com/forums/15792-unity/suggestions/2093123-access-to-the-new-3-4-gizmos-through-script

If you have any votes left, I'd much appreciate one or two :)

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by DaveA · Jul 31, 2011 at 04:53 AM

I just replaced my gizmo code with the new API (which is to say, I deleted it). So you could do the reverse: don't assign it with the editor feature, and use the old fashioned DrawGizmo stuff to do it in code.

Comment
Add comment · Show 1 · 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 Joshua · Jul 31, 2011 at 04:59 AM 0
Share

But there's no easy way to, through the Gizmo class API, easily draw a text above a gameObject, and it looks a LOT less nice. Seeing how they've implemented this stuff it seems ridiculous that it's inaccessible. Thanks for the answer though :)

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Custom inspector draw Gizmos 0 Answers

How to hide Gizmos by script 4 Answers

Gizmo equivalent of Handles.DrawSolidArc? 0 Answers

Gizmos drawing units 1 Answer

DrawGizmo attribute render draw depth bug? 0 Answers


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