stride3d / stride

Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
https://stride3d.net
MIT License
6.56k stars 947 forks source link

classes with 2 generics create clutter in GameStudio. #1628

Open Doprez opened 1 year ago

Doprez commented 1 year ago

Release Type: Official Release

Version: 4.1.0.1805

Platform(s): Windows

Describe the bug There seems to be a minor bug with classes that have 2 generic types attached to them.

image

To Reproduce Steps to reproduce the behavior:

  1. create a class that inherits a SyncScript or StartupScript

  2. make 2 generic types in the class image

  3. go to Gamestudio and they will show like above

Expected behavior A clear and concise description of what you expected to happen.

not sure what should be expected I would assume they shouldnt show at all. If I try to add those class to an Entity it wont let me so this is purely visual noise.

Additional context This is a very minor bug but if something like DataMemberIgnore exists for classes it would be nice to clean this up and may be an easy work around.

Doprez commented 1 year ago

image this also happens with a single generic described in the class

using Stride.Engine;

public class TestGeneric <T> : StartupScript
{
    public bool IsBroken{get;set;}
}
manio143 commented 1 year ago

The solution is to filter out types which are generic as they can't be constructed.

To be perfectly honest I don't think it is expected that scripts, or components in general, would be generic. It can only make sense for things instantiated through code.

manio143 commented 1 year ago

Reopening because I still think there's a fix to be made for this - we should prevent editor failures, even if user has generic components in the code.

Doprez commented 1 year ago

Ah no worries I was too quick to close sorry.