Vixen
02b45cc4
csharp
public sealed class TypeDescriptor

Everything the engine knows about one annotated type, decided at compile time.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

This is the replacement for Type-driven discovery. Stride injects module initialisers with Cecil to build the equivalent; ADR-002 forbids that, and [ModuleInitializer] does the same job in the language. What is registered here is what a generator saw in the source, so it survives trimming, survives NativeAOT, and is a build error rather than a start-up surprise when it is wrong.

Reading a member is GetValue; writing one is SetValue; making one is Create. None of those touches System.Reflection.

Fields and properties (8)

  • public Type Type

    The CLR type.

  • public string Alias

    The name it is known by in data and in tools.

  • public IReadOnlyList<string> FormerAliases

    Names it used to be known by.

  • public TypeTraits Traits

    What the annotations say it is for.

  • public string? Category

    Which group the inspector puts it in.

  • public IReadOnlyList<MemberDescriptor> Members

    Its members, in declared order.

  • public bool CanCreate

    Whether an instance can be made without arguments.

  • public DataSerializer? Serializer

    Its serializer, if it has one.

Methods (5)

  • public TypeDescriptor(Type type, string alias, TypeTraits traits, MemberDescriptor[] members, Func<object>? factory = null, string? category = null, string[]? formerAliases = null)

    Describes a type.

  • public object Create()

    Makes an instance.

  • public MemberDescriptor? FindMember(string name)

    Finds a member by name.

  • public bool Has(TypeTraits traits)

    Whether the type carries every one of .

  • public override string ToString()

    Renders the descriptor as its alias.

Used by (22)

  • MaterialHelloUi
  • TypeRegistrationThirdPersonShooter
  • NestedMemberTestsVixen.Ui.Controls.Advanced.Tests
  • PropertyGridVixen.Ui.Controls.Advanced
  • PropertyGridTestsVixen.Ui.Controls.Advanced.Tests
  • SplineAssetTestsVixen.Core.Mathematics.Tests
  • TypeRegistryVixen.Core.Reflection
  • TypeRegistryTestsVixen.Core.Reflection.Tests
  • YamlSerializerVixen.Core.Yaml
  • AnimationClipImporterTestsVixen.Editor.Assets.Tests
  • AssetImporterVixen.Editor.Assets
  • ConstraintAuthoringImporterTestsVixen.Editor.Assets.Tests
  • EditorScriptTestsVixen.Editor.Scripts.Tests
  • HarnessPlanImporterTestsVixen.Editor.Assets.Tests
  • ImportPipelineVixen.Editor.Assets
  • MaterialImporterTestsVixen.Editor.Assets.Tests
  • MoveSetImporterTestsVixen.Editor.Assets.Tests
  • ProjectSettingsStoreVixen.Editor.Core
  • ProxyShapeImporterTestsVixen.Editor.Assets.Tests
  • ReflectedDescriptorVixen.Editor.Inspector
  • ReflectedTypeTestsVixen.Editor.Scripts.Tests
  • ReflectedTypesVixen.Editor.Scripts