stride3d / stride3d/stride

Allow for readonly field in the inspector

Open
#962 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-GameStudio enhancement priority-Low work-estimate-S
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Is your feature request related to a problem? Please describe.
The problem is more or less if u wanna just show custom readonly values as a better visual clarification so u can see tthem also in the inspector and have a better understanding what ur script exposes otherwise its harder sometimes to keep track of what ur script uses and what not so to say..

Describe the solution you'd like
Its super useful to have the inspector serialize out public readonly fields (or in .net5.0 now also init fields) BUT to obviously grey out the textbox where they are shown so u cannot modify the values in them. But I also would rather allow it to be only like this via an attribute like [SerializeReadonlyField] maaybe not all developers want it that way but so u can ensure both in my opinion, since even in unity this was requested quiet heavily and ppl needed towrite ugly custom editorscripts for this kind of stuff.

Describe alternatives you've considered
Alternative sadly is only doing it via custom scripts but this would be so awesome if allowed by default thru the engine and not the ugly unity way like u need to do it urself..

Additional context
nope.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The request concerns Stride's inspector and serialization of public readonly or init fields, with an optional SerializeReadonlyField attribute. Start by tracing the inspector entry point and the existing custom editor-script approach; done means readonly values are visible but non-editable and the opt-in behavior is defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.