question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some Unity struct types do now allow edit-time modification

See original GitHub issue

Summary

There is currently a bug with the Inspector/Drawers for editing Reference constant, variable, or collections of Vector4 and Quaternion where only a foldout is shown with no editable fields (tested on 2019.1.0f2).

I have resolved this drawing issue by adding some hardcoded checks to GenericPropertyDrawer (for layout and non-layout methods) to check for these types and show the appropriate controls and changing the BaseReferenceDrawer to use this helper class, but the work is based on PRs https://github.com/DanielEverland/ScriptableObject-Architecture/pull/57 and https://github.com/DanielEverland/ScriptableObject-Architecture/pull/65 so I would wait until those are merged prior to making another PR.

Before

Vector4Variable image

QuaternionCollection image

Example script with various references image

After

Vector4Variable image

QuaternionCollection image

Example script with various references image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Jeffrey-Campbell-Zapdotcommented, May 1, 2019

Nice job! Looks great

0reactions
DanielEverlandcommented, May 1, 2019

I fixed the following issues

  • Space between popup and value fields
  • Incorrect use of multiline for primitives (Types now require the [MultiLine] attribute)
  • Non-multiline fields will no longer draw beneath their labels on inspectors with low width

inspector

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't modify struct members because it is a foreach ...
I have honestly no idea how else to find such a value within the list. Code (CSharp):. public bool IsThisGoldCoinCollected(string level, int ...
Read more >
C# Struct mutability: Is a boolean ok to mutate?
I've read a lot of advice on using structs being "Don't allow mutable structs", due to poor copy behaviour resulting in modified copies,...
Read more >
How and Why to use Structs in your C# Unity Game - YouTube
Help to support the channel if you are feeling super kind: https://www.patreon.com/dapperdino Join our Discord: https://discord.gg/sn9xXK4 ...
Read more >
Structure types - C# reference
Typically, you use structure types to design small data-centric types that provide little or no behavior. For example, .
Read more >
Assembly definitions
Every time you change one script, Unity has to recompile all the other scripts, increasing overall compilation time for iterative code changes. Any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found