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
0
Question by skalev · Oct 02, 2012 at 10:28 PM · editoreditor-scriptinghierarchy

Selecting a Foldout Button? and Dragging it?

I'm trying to make a tool that will have hierarchy functionality along with some other custom behavior.

I can get the view working pretty well, using IndentLevel and Foldouts. However I want to be able to select items, and move them around (by dragging, same way it is done in the Hierarchy panel).

I know I'll have to manage the selections my self, which is fine.

How do I make a Foldout button that can be selected? ( just like the Hierarchy) and how to manage the drag and drop to rearrange the Hierarchy?

Is there anyway to actually just duplicate the Hierarchy, or subclass it and provide some custom behavior?

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 $$anonymous$$ · Feb 25, 2015 at 10:48 PM 0
Share

@skalev Did you ever find a solution for this? I am interested in implementing a similar GUI control.

1 Reply

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

Answer by skalev · Feb 26, 2015 at 02:46 AM

@zeenobit -> answering my own question so its documented.

I ended up drawing my own custom gui in an editor window.

To produce the "selection" I wrapped the folder call with a BeginHorizontal(), which returns a rect, which allows you to check if that part of gui was clicked. then, i would just update the GUIStyle the horizontal is using, so the background appears selected.

using this technique, you can apply any mouse operation to any "row" of your gui.

Sorry that I have no access to the code I wrote at the time to provide a sample.

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

9 People are following this question.

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

Related Questions

Is it possible to detect drag and drop in hierachy window? 0 Answers

Find hierarchy object index OR figure out if an object is collapsed in the hierarchy window 0 Answers

Custom Hierarchy background rect lines 0 Answers

Highlighting / Focusing on an Editor Window Through Code 1 Answer

Hierarchy in editor 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