Downgraded to C# 9

This commit is contained in:
Pascal Serrarens 2025-02-19 11:21:12 +01:00
parent 4044b86a9d
commit 0a75c7f4fd
3 changed files with 8 additions and 12 deletions

View File

@ -3,8 +3,7 @@
<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

View File

@ -1,5 +1,6 @@
#if !UNITY_5_3_OR_NEWER
using System;
namespace Passer.LinearAlgebra {
public class Vector3Of<T> {
public T x;
@ -17,9 +18,11 @@ namespace Passer.LinearAlgebra {
// }
}
public class Vector3Int(int x, int y, int z) : Vector3Of<int>(x, y, z) {
public class Vector3Int : Vector3Of<int> {
public Vector3Int(int x, int y, int z) : base(x, y, z) { }
}
public class Vector3Float(float x, float y, float z) : Vector3Of<float>(x, y, z) {
public class Vector3Float : Vector3Of<float> {
public Vector3Float(float x, float y, float z) : base(x, y, z) { }
public float magnitude {
get => (float)Math.Sqrt(this.x * this.x + this.y * this.y + this.z * this.z);

View File

@ -1,9 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
@ -17,10 +15,6 @@
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
</ItemGroup>
<ItemGroup>
<Using Include="NUnit.Framework" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ControlCore.csproj" />
</ItemGroup>