Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 deltron1830 · Oct 10, 2014 at 02:41 PM · attributeheader

Header attribute with multiple lines of text?

header attribute is really handy to explain the public fields in my components.

http://docs.unity3d.com/ScriptReference/HeaderAttribute.html

 [Header("Health Settings")]
 public int health = 0;

Just wondering can this work with multiple lines of text? Or is there some other handy way of achieveing that effect (ie. several lines of text above my field explaining it)

EDIT: I have one sorta solution like so..

 [Header("Health Settings")]
 [Header("Set health here!")]
 public int health = 0;


but it would be nice if I could make the text arbitrarily long and it could wrap

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 fermmmm · Apr 04, 2016 at 05:14 AM 0
Share

Your solution not always work because it can be flipped sometimes, use the order parameter, see my respnse.

3 Replies

· Add your reply
  • Sort: 
avatar image
6

Answer by fermmmm · Apr 04, 2016 at 09:02 AM

 [Header("This is the first line of the header text ", order=0)]
 [Space(-10, order = 1)]
 [Header("and this is the second one. With the", order=2)]
 [Space(-10, order = 3)]
 [Header("space and order settings it looks good.", order=4)]
 [Space(10, order = 5)]
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
3

Answer by David-Filipe · Oct 04, 2018 at 01:31 PM

 [Header ("Health Settings."), Space (5), Header ("Set health here!")]
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
1

Answer by sudhir_kotila · Apr 04, 2016 at 06:29 AM

Hi, deltron1830

Please, Try this.

 [Header ("Health Settings." + "\n" + "Set health here!")]
 public int health = 0;
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 rainwizerd · Apr 07 at 07:03 PM 0
Share

This ends up just looking weird in the editor. The lines are stacked on top of each other.

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

33 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

Related Questions

alternative for header atrribute for enums 1 Answer

Is RequireComponent[typeof(CustomScript)] possible? 2 Answers

How could i differentiate attributes using code? 0 Answers

Is it possible to add an icon to indicate there is an editor tooltip decorating a variable? 0 Answers

Custom [Require*] attribute 2 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