Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serializable structs with explicit layout #111

Open
dungeon2567 opened this issue Apr 28, 2023 · 0 comments
Open

Serializable structs with explicit layout #111

dungeon2567 opened this issue Apr 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@dungeon2567
Copy link

Describe the bug
Can`t edit area of effects values
Expected behavior
able to edit area of effect values

Code Sample



[Serializable]
[StructLayout(LayoutKind.Explicit)]
public struct GameplayAction
{
    [FieldOffset(0)]
    public GameplayActionType Type;

    [FieldOffset(4)]
    [ShowIf(nameof(Type), GameplayActionType.SpawnProjectile)]
    public SpawnProjectileAction SpawnProjectile;

    [FieldOffset(4)]
    [ShowIf(nameof(Type), GameplayActionType.ApplyEffect)]
    public ApplyEffectAction ApplyEffect;

    [FieldOffset(4)]
    [ShowIf(nameof(Type), GameplayActionType.ApplyAreaOfEffect)]
    public AreaOfEffectShape AreaOfEffect;

    [FieldOffset(4)]
    [ShowIf(nameof(Type), GameplayActionType.SpawnAreaOfEffect)]
    public SpawnAreaOfEffectAction SpawnAreaOfEffect;
}
// 

Screenshots

Desktop: Windows 11
**Unity version: 2020.3.35f1
image

Tri Inspector version: 1.1.01

@dungeon2567 dungeon2567 added the bug Something isn't working label Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant