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 Vifi · Jul 11, 2018 at 07:02 AM · custom editordepthdrawcustom inspectoreditor window

Disable input to inspector drawn underneath

Hi, i am doing custom window where i draw my own windows with some objects inspectors. My problem now is to block input to the inspector that is drawn underneath other one. Now when my windows overlap on each other inspector below is taking mouse input very often. Like i have two float fields overlap and when i click on top one, the one from below is getting focus. I tried GUI.depth but it seems not to have any impact. Any ideas?

Thanks in advance, cheers

Comment
Add comment · Show 5
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 tormentoarmagedoom · Jul 11, 2018 at 07:12 AM 0
Share

Good day.

I dont get exatcly whats your problem?

You have 2 canvas elements in overlaping and need one to block clicks on what is behind it?

avatar image Vifi tormentoarmagedoom · Jul 11, 2018 at 07:34 AM 0
Share

I have one custom editor window. In this window i am drawing rectangles with GL (ala windows), and inside of those rectangles i am drawing default or custom inspectors of some scriptable objects. Those rectangles are movable with mouse drag. When i move one rectangle over another their fields from inspector overlaps (one is drawn on top of another). I need a way to say that when i click on some field the very top field in this position will get focus (the one which is on top of others) (i am doing something like blueprints in UnrealEngine)

avatar image Vifi · Jul 12, 2018 at 06:53 AM 0
Share

Here is a screenshot of what i mean.

When my "windows" overlaps and i click on overlaping fields (red dot) the one from bottom will be focused. I need it to be one from the top. alt text

I think it is about drawing queue. The click event on field will be consumed by inspector that is drawn first (on bottom, behind everything). Is there any way to deal with it?

clickunderneath.png (91.3 kB)
avatar image Vifi · Jul 16, 2018 at 07:42 AM 0
Share

Bump. Nobody knows any way to handel it?

avatar image Stratosome · Jul 16, 2018 at 08:18 AM 0
Share

I've been struggling with this myself somewhat recently and sadly haven't found any good way to fix it. So I just kinda moved on and did my stuff differently, heh... I'd be interested to see an answer though if someone knows.

1 Reply

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

Answer by Bunny83 · Jul 16, 2018 at 09:12 AM

You said you're

doing custom window


You know that the IMGUI actually has a Window method? The main point of this is to allow overlapping GUI areas. Since we have no idea how you've implemented your own solution we can't really help you. The IMGUI is an immediate mode GUI. That means everything happens immediately in the order you specified. The drawing order is also the order in which the controls are processed for input. GUI.Window / GUILayout.Window are seperate sub sections. Since they are drawn through a callback Unity can process all windows "forward" when repainting and "backwards" when processing input.

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

88 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 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

Should I use Inspector or custom editor window? 1 Answer

Calling a custom inspector from an editor window of an instance of a class 1 Answer

How to limit an ObjectField to assets with specific file extension 2 Answers

changing value of child objects in root object not persistent? 0 Answers

Is there any way to hide the "Object picker" of an EditorGUILayout.ObjectField ? 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