Files
Nicolas Musset 41381dedd5 refactor: Nullable and Modernization for Core projects (#2643)
* [Core.Mathematics] Modernize code

* [Core.Mathematics] Add tests to Stride.Tests.Simple

* [Core] Cleanup some code

* [Core.CompilerServices] Cleanup some code

* [Core.CompilerServices] Add tests to Stride.Tests.Simple

* [Core.IO] Modernize code

* [Core.MicroThreading] Modernize code

* [Core.Serialization] Modernize code

* [Core.AssemblyProcessor.Tests] Modernize code

* [Core.CompilerServices.Tests] Modernize code

* [Core.Mathematics.Tests] Modernize code

* [Core.Tests] Modernize code

* [Core.Translation] Modernize code

* [Core.Reflection] Modernize code

* Fixes build of Stride.VisualStudio.sln

* [Core.Yaml.Tests] Modernize code

* [Core.Design] Modernize code

* [Core.Design.Tests] Modernize code

* [Core.Mathematics] More annotations

* Fix build of projects that import code from Core.Design

Especially those targeting .NET Framework
2025-02-22 16:50:47 +01:00

37 lines
2.2 KiB
C#

// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
using System.ComponentModel;
using Stride.Core.Mathematics;
using Stride.Core.Reflection;
using Stride.Core.Serialization;
using Stride.Core.TypeConverters;
using Half = Stride.Core.Mathematics.Half;
using HalfConverter = Stride.Core.TypeConverters.HalfConverter;
namespace Stride.Core;
internal class Module
{
[ModuleInitializer]
public static void Initialize()
{
// Make sure that this assembly is registered
AssemblyRegistry.Register(typeof(Module).Assembly, AssemblyCommonCategories.Assets);
TypeDescriptor.AddAttributes(typeof(Color), new TypeConverterAttribute(typeof(ColorConverter)));
TypeDescriptor.AddAttributes(typeof(Color3), new TypeConverterAttribute(typeof(Color3Converter)));
TypeDescriptor.AddAttributes(typeof(Color4), new TypeConverterAttribute(typeof(Color4Converter)));
TypeDescriptor.AddAttributes(typeof(Half), new TypeConverterAttribute(typeof(HalfConverter)));
TypeDescriptor.AddAttributes(typeof(Half2), new TypeConverterAttribute(typeof(Half2Converter)));
TypeDescriptor.AddAttributes(typeof(Half3), new TypeConverterAttribute(typeof(Half3Converter)));
TypeDescriptor.AddAttributes(typeof(Half4), new TypeConverterAttribute(typeof(Half4Converter)));
TypeDescriptor.AddAttributes(typeof(Matrix), new TypeConverterAttribute(typeof(MatrixConverter)));
TypeDescriptor.AddAttributes(typeof(Quaternion), new TypeConverterAttribute(typeof(QuaternionConverter)));
TypeDescriptor.AddAttributes(typeof(Vector2), new TypeConverterAttribute(typeof(Vector2Converter)));
TypeDescriptor.AddAttributes(typeof(Vector3), new TypeConverterAttribute(typeof(Vector3Converter)));
TypeDescriptor.AddAttributes(typeof(Vector4), new TypeConverterAttribute(typeof(Vector4Converter)));
TypeDescriptor.AddAttributes(typeof(IUrlReference), new TypeConverterAttribute(typeof(UrlReferenceConverter)));
}
}