Giter Club home page Giter Club logo

Comments (30)

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024 1

@SolidAlloy Thanks! Good work!

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

In Console

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-11-21 Π² 23 49 37

image

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

NullReference fixed by switch .NET to 4. But DropDown still empty =(

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

@SolidAlloy

from classtypereference-for-unity.

SolidAlloy avatar SolidAlloy commented on May 27, 2024

Hi, sorry for the late response. I'll take a look at it today

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

Thanks!

from classtypereference-for-unity.

SolidAlloy avatar SolidAlloy commented on May 27, 2024

It works without issues for me in versions 2019.4.11 and 2020.2.0 on Windows. I also tried switching between .NET 2.0 and 4.x, and it didn't cause any errors. I'm very surprised to see there is a difference in code execution on .NET 2.0 and 4.x, as nothing in the code should produce such an error.

Is your default assembly called Assembly-CSharp? If not, it can theoretically produce an empty drop-down.

Please try using 2.6.2 again and import Usage Samples from Package Manager. Open the Demo scene inside the sample and check if the drop-down menus are empty there too.

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

I used Samples and when I start project I saw this Warnings and DropDown still empty

And judging by Rider editor assembly called Assembly-CSharp

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-11-27 Π² 16 10 29

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-11-27 Π² 15 45 23

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

Hey! If add DropdownHeight = 300 it works, but place left, it is weird =D

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-11-27 Π² 16 26 43

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

I think issue in DropDownWindow.AdjustSizeIfNeeded() Debug.Log(1) called once but Debug.Log(2) infinite loop until close DropDown.

image

from classtypereference-for-unity.

SolidAlloy avatar SolidAlloy commented on May 27, 2024

Thanks for the debugging! I'll check what causes this behavior and get back to you

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

Thanks!

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

If windowSize.height == 0 ShowAsDropDown doesn't call OnGUI and DrawContent doesn't called too and doesn't calculate contentHeight

I added windowHeight == 0f ? 1 : windowHeight and change f (_contentHeight == 1f || Event.current.type == EventType.Repaint) _contentHeight = contentHeight; in DrawContent and it works!

But window appears in left and up of screen this still needs to be finalized =D
And still looping in update

I think it is macOS problems. Unity windows often appears in left instead of right =D But it possible fix by change x position in Resize method.

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-11-27 Π² 17 59 26

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-11-27 Π² 18 01 34

from classtypereference-for-unity.

SolidAlloy avatar SolidAlloy commented on May 27, 2024

I just pushed an update that fixes different DropdownWindow position issues. Please update ClassTypeReference to 2.6.3 and check how it works on your end. I didn't include your suggestion to change the window height to 1 pixel yet because the update to 2.6.3 may have already fixed it. But if it still doesn't work for you, I will include your fix too. In the end, it may really be a MacOS-specific issue.
The amount of work put into just showing a window in the right place is huge. I wish Unity made it easier πŸ˜“

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

I updated both dependencies and something went wrong =D

image

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

I replaced EditorGUIUtility.GetMainWindowPosition() with Screen.currentResolution it fix this problem but DropDown still empty and onGUI doesn't called with zero height. And still in left corner =D

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

I added windowHeight == 0 ? 1 : windowHeight and if (_contentHeight == 1f || Event.current.type == EventType.Repaint) _contentHeight = contentHeight; in DrawContent() it works.

Now by Y axis this work properly, but X axis on left =D

image

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

@SolidAlloy SolidUtilities has critical bug with GetMainWindowPosition. Dependency doesn't has this method.

from classtypereference-for-unity.

SolidAlloy avatar SolidAlloy commented on May 27, 2024

Sorry about that, the bug has been fixed, and ClassTypeReference 2.6.4 should be working fine now.
I created the max-os-position-fix branch to further investigate the issue you have with the drop-down position.
I added a change there, that initiates the drop-down window with a 100 height instead of 0 (long story short, the height of 1 messes up with the drop-down position on Windows, so 100 should work on both platforms). Please check that the drop-down is at least non-empty now. Please follow these steps to install the package in this branch:

  1. Remove SolidUtilities and ClassTypeReference if you have them installed.
  2. Package Manager -> Add package from Git URL.
  3. Enter "https://github.com/SolidAlloy/SolidUtilities.git#mac-os-position-fix".
  4. Enter "https://github.com/SolidAlloy/ClassTypeReference-for-Unity.git#mac-os-position-fix".

Sorry for having to investigate it on your end πŸ™ If only I had a Mac to test it on.

As for the X-axis issue, I think it has something to do with resizing inside of AdjustSizeIfNeeded(). I will add more debug logs in mac-os-position-fix, and I hope we'll find the root cause soon.

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

@SolidAlloy

New versions with new errors =)

image

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

I cached _windowPosition OnCreate and used it after Resize and it works properly.

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-11-29 Π² 16 46 32

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-11-29 Π² 16 46 52

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-11-29 Π² 16 47 19

from classtypereference-for-unity.

SolidAlloy avatar SolidAlloy commented on May 27, 2024

OK, now I checked the code against Unity 2019 and correctly placed preprocessor directives. The plugin should finally work without critical errors in Unity 2019.

The Y axis worked for you before, it was the X axis that had the issue, wasn't it? Did setting the height to 100 inside OnCreate() resolve the empty drop-down issue?

The Y position of the window may change later, so just caching it is not a solution, unfortunately. If the drop-down is opened too close to the bottom of the screen, there is not enough place for it, so the window is raised so that it has enough height.

However, I see you also set the X position of the window after this.Resize(height: wantedHeight), so this is a hint. I think the X position changes to 0 inside Resize(), and you revert it back with your positionToAdjust.x = ... line. First-of-all, I merged two Resize() calls into one inside AdjustSizeIfNeeded(). It will be more efficient and will let us pinpoint the root cause sooner. Can you check the drop-down with the latest commits to the mac-os-position-fix branches? Does it work as expected, or the X axis still changes to 0?

I added a few debug logs to check the X position of the window during its creation and resizing.

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

X axis is 0. Height 100 inside OnCreate works properly =)

image

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

It looks like ShowAsDropDown kill x position =D

from classtypereference-for-unity.

SolidAlloy avatar SolidAlloy commented on May 27, 2024

That's weird πŸ˜…
I noticed that an incorrect window X position was being set on the window creation, so I fixed it. Could you get the version with the latest commits from the mac-os-position-fix branch and check if it resolved the 0 X position issue? If not, I have another solution in mind that I can apply.

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

It is still zero =)

image

image

these links

Enter "https://github.com/SolidAlloy/SolidUtilities.git#mac-os-position-fix".
Enter "https://github.com/SolidAlloy/ClassTypeReference-for-Unity.git#mac-os-position-fix".

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

@SolidAlloy

from classtypereference-for-unity.

SolidAlloy avatar SolidAlloy commented on May 27, 2024

Hi, I pushed an update to ClassTypeReference in which the window position is set once again during its first Update after the creation. Please checkout ClassTypeReference in the max-os-position-fix branch and SolidUtilities in the master branch:
https://github.com/SolidAlloy/SolidUtilities.git
https://github.com/SolidAlloy/ClassTypeReference-for-Unity.git#mac-os-position-fix

Let me know if it worked

from classtypereference-for-unity.

Anavrin1990 avatar Anavrin1990 commented on May 27, 2024

@SolidAlloy Now it has error but after import ChildProperties it works properly! =)

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-12-03 Π² 12 33 45

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-12-03 Π² 12 34 26

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-12-03 Π² 12 35 26

Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2020-12-03 Π² 12 36 55

from classtypereference-for-unity.

SolidAlloy avatar SolidAlloy commented on May 27, 2024

Glad to hear it! :) I fixed the error in the sample and merged the fix to master. You can use ClassTypeReference 2.7.0 now

from classtypereference-for-unity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.