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 /
  • Help Room /
avatar image
1
Question by goodguy · Jun 03, 2016 at 05:21 AM · componentscommentsnote

Is it possible to leave a comment on components like prefabs?

Hi! Is it possible to leave a comment on some components e.g. like prefabs? I'm a programmer and different sensors and other stuff that is used in code is pretty obvious to me, at least I can leave some comments for myself in code, but the artist often wonders of what is it I created in the project? I need to leave comments for him. I see it like this: he clicks on some sensor prefab and sees a text like "this sensor is used where the player should be able to climb up the wall" or "this sensor is placed where the player needs to slide down the slope" or stuff like that. Is it possible somehow? What is the best way to leave "notes" like this in unity?

Thanks!

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Mmmpies · Jun 03, 2016 at 06:18 AM

As long As it's a brief description you could just add a readme.cs script with a tooltip in it (or add a readme section to any script attached to the prefab).

They should see that in the inspector:

     [Space(10)]
 
     [Header(" [Readme]")]
     [Tooltip("IUsed as a hand grip location for wall climbing.")]
 
     [Space(10)]
 
Comment
Add comment · Show 5 · 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 goodguy · Jun 03, 2016 at 07:31 AM 0
Share

So, is it only possible for the objects that have scripts attached? Doesn't seem to be what I'm looking for

avatar image Mmmpies goodguy · Jun 03, 2016 at 08:25 AM 0
Share

The script probably doesn't have to do anything though. Can't really test this as I don't have access to Unity right now.

Create a CS script, call it PREFABNA$$anonymous$$E-Readme.cs and clear out everything apart from the using and class name. Replace that PREFABNA$$anonymous$$E with the actual name of the prefab (so you get a unique one for each prefab) and put in the header line

 [Header("This prefab does a thing but I'm not saying what!")]

put it on the prefab and see if it shows up in the inspector. So no Start() or Update(), no code of any kind just a Header line. I think it should work without any real impact on game performance.

avatar image goodguy · Jun 03, 2016 at 09:19 AM 0
Share

Yep. This works. But it's all in one line. Is there a way to add a multiline header? Anyway, thanks for this!

avatar image Mmmpies goodguy · Jun 03, 2016 at 09:25 AM 0
Share

Again I can't check, it might respond to an escape key but more likely it won't so the simplest way would just to have multiple Header lines. I doubt it's got intelligence built in to expect a variable under the header before the next header.

avatar image goodguy · Jun 03, 2016 at 10:31 AM 0
Share

It's kind of strange Unity does not have such a trivial functionality. I think it'd be great to be able to use something like this: Inspector - Add Component - Comment Block, and so this block would be visible after one selects any object

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

58 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why won't script work on 3d text? (menu script) 1 Answer

Disabling a script while pressing a key down 2 Answers

Create a clone without components at runtime 0 Answers

Use of if(Component) 1 Answer

Copy template object component to dummy objects 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