1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-23 00:18:47 +00:00

Merge pull request #58 from oliverbooth/develop

3.1.0
This commit is contained in:
Oliver Booth 2022-05-13 09:45:58 +01:00 committed by GitHub
commit b0ac965a7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
184 changed files with 8811 additions and 155 deletions

View File

@ -32,6 +32,7 @@ jobs:
run: |
mkdir build
dotnet pack X10D -p:SymbolPackageFormat=snupkg --include-symbols --include-source -o build -p:VersionSuffix='nightly' -p:BuildNumber=${{ github.run_number }}
dotnet pack X10D.Unity -p:SymbolPackageFormat=snupkg --include-symbols --include-source -o build -p:VersionSuffix='nightly' -p:BuildNumber=${{ github.run_number }}
- name: Push NuGet Package to GitHub
run: dotnet nuget push "build/*" --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate

View File

@ -32,6 +32,7 @@ jobs:
run: |
mkdir build
dotnet pack X10D -p:SymbolPackageFormat=snupkg --include-symbols --include-source -o build -p:VersionSuffix='prerelease' -p:BuildNumber=${{ github.run_number }}
dotnet pack X10D.Unity -p:SymbolPackageFormat=snupkg --include-symbols --include-source -o build -p:VersionSuffix='prerelease' -p:BuildNumber=${{ github.run_number }}
- name: Push NuGet Package to GitHub
run: dotnet nuget push "build/*" --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate

View File

@ -32,6 +32,7 @@ jobs:
run: |
mkdir build
dotnet pack X10D -p:SymbolPackageFormat=snupkg --include-symbols --include-source -o build
dotnet pack X10D.Unity -p:SymbolPackageFormat=snupkg --include-symbols --include-source -o build
- name: Push NuGet Package to GitHub
run: dotnet nuget push "build/*" --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate

View File

@ -32,5 +32,4 @@ jobs:
run: dotnet build -c Debug
- name: Run Source Validation
run: dotnet run --project X10D.SourceValidator ./X10D/src
run: dotnet run --project X10D.SourceValidator ./X10D/src ./X10D.Unity/src

50
.github/workflows/unity.yml vendored Normal file
View File

@ -0,0 +1,50 @@
name: Unity Test Runner
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
build:
name: "Unity Test Runner"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Add GitHub NuGet source
run: dotnet nuget add source --username oliverbooth --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/oliverbooth/index.json"
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release
- name: Copy artifacts to project
run: |
mkdir -p ./X10D.Unity.Tests/Assets/Libraries
cp -r ./X10D/bin/Release/netstandard2.1/X10D.dll ./X10D.Unity.Tests/Assets/Libraries/X10D.dll
cp -r ./X10D.Unity/bin/Release/netstandard2.1/X10D.Unity.dll ./X10D.Unity.Tests/Assets/Libraries/X10D.Unity.dll
- name: Unity - Test runner
uses: game-ci/unity-test-runner@v2.0.2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: X10D.Unity.Tests
githubToken: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,5 +1,80 @@
# Changelog
## [3.1.0]
### Added
- Reintroduced Unity support
- X10D: Added `Color.Inverted()` (#54)
- X10D: Added `Color.WithA()` (#55)
- X10D: Added `Color.WithB()` (#55)
- X10D: Added `Color.WithG()` (#55)
- X10D: Added `Color.WithR()` (#55)
- X10D: Added `ICollection<T>.ClearAndDisposeAll()`
- X10D: Added `ICollection<T>.ClearAndDisposeAllAsync()`
- X10D: Added `IEnumerable<T>.For()` (#50)
- X10D: Added `IEnumerable<T>.ForEach()` (#50)
- X10D: Added `IEnumerable<T>.DisposeAll()`
- X10D: Added `IEnumerable<T>.DisposeAllAsync()`
- X10D: Added `char.IsEmoji`
- X10D: Added `ReadOnlySpan<T>.Count(Predicate<T>)`
- X10D: Added `Rune.IsEmoji`
- X10D: Added `Span<T>.Count(Predicate<T>)`
- X10D: Added `string.IsEmoji`
- X10D: Added `Vector2.WithX()` (#56)
- X10D: Added `Vector2.WithY()` (#56)
- X10D: Added `Vector3.WithX()` (#56)
- X10D: Added `Vector3.WithY()` (#56)
- X10D: Added `Vector3.WithZ()` (#56)
- X10D: Added `Vector4.WithX()` (#56)
- X10D: Added `Vector4.WithY()` (#56)
- X10D: Added `Vector4.WithZ()` (#56)
- X10D: Added `Vector4.WithW()` (#56)
- X10D.Unity: Added `Singleton<T>` class
- X10D.Unity: Added `Color.Inverted()` (#54)
- X10D.Unity: Added `Color.WithA()` (#55)
- X10D.Unity: Added `Color.WithB()` (#55)
- X10D.Unity: Added `Color.WithG()` (#55)
- X10D.Unity: Added `Color.WithR()` (#55)
- X10D.Unity: Added `Color32.Inverted()` (#54)
- X10D.Unity: Added `Color32.WithA()` (#55)
- X10D.Unity: Added `Color32.WithB()` (#55)
- X10D.Unity: Added `Color32.WithG()` (#55)
- X10D.Unity: Added `Color32.WithR()` (#55)
- X10D.Unity: Added `Component.GetComponentsInChildrenOnly<T>()`
- X10D.Unity: Added `GameObject.GetComponentsInChildrenOnly<T>()`
- X10D.Unity: Added `GameObject.LookAt(GameObject[, Vector3])`
- X10D.Unity: Added `GameObject.LookAt(Transform[, Vector3])`
- X10D.Unity: Added `GameObject.LookAt(Vector3[, Vector3])`
- X10D.Unity: Added `GameObject.SetLayerRecursively(int)` (#57)
- X10D.Unity: Added `GameObject.SetParent(GameObject[, bool])`
- X10D.Unity: Added `GameObject.SetParent(Transform[, bool])`
- X10D.Unity: Added `System.Numerics.Quaternion.ToUnityQuaternion()`
- X10D.Unity: Added `Quaternion.ToSystemQuaternion()`
- X10D.Unity: Added `Random.NextColorArgb()`
- X10D.Unity: Added `Random.NextColor32Argb()`
- X10D.Unity: Added `Random.NextColorRgb()`
- X10D.Unity: Added `Random.NextColor32Rgb()`
- X10D.Unity: Added `Random.NextRotation()`
- X10D.Unity: Added `Random.NextRotationUniform()`
- X10D.Unity: Added `Random.NextUnitVector2()`
- X10D.Unity: Added `Random.NextUnitVector3()`
- X10D.Unity: Added `Transform.LookAt(GameObject[, Vector3])`
- X10D.Unity: Added `Transform.SetParent(GameObject[, bool])`
- X10D.Unity: Added `System.Numerics.Vector2.ToUnityVector()`
- X10D.Unity: Added `System.Numerics.Vector3.ToUnityVector()`
- X10D.Unity: Added `System.Numerics.Vector4.ToUnityVector()`
- X10D.Unity: Added `Vector2.ToSystemVector()`
- X10D.Unity: Added `Vector3.ToSystemVector()`
- X10D.Unity: Added `Vector4.ToSystemVector()`
- X10D.Unity: Added `Vector2.WithX()` (#56)
- X10D.Unity: Added `Vector2.WithY()` (#56)
- X10D.Unity: Added `Vector3.WithX()` (#56)
- X10D.Unity: Added `Vector3.WithY()` (#56)
- X10D.Unity: Added `Vector3.WithZ()` (#56)
- X10D.Unity: Added `Vector4.WithX()` (#56)
- X10D.Unity: Added `Vector4.WithY()` (#56)
- X10D.Unity: Added `Vector4.WithZ()` (#56)
- X10D.Unity: Added `Vector4.WithW()` (#56)
## [3.0.0]
In the midst of writing these release notes, I may have missed some important changes. If you notice an API change that is not documented here,
@ -299,6 +374,7 @@ please [open an issue](https://github.com/oliverbooth/X10D/issues)!
### ***Not documented***
[3.1.0]: https://github.com/oliverbooth/X10D/releases/tag/v3.1.0
[3.0.0]: https://github.com/oliverbooth/X10D/releases/tag/v3.0.0
[2.6.0]: https://github.com/oliverbooth/X10D/releases/tag/2.6.0
[2.5.0]: https://github.com/oliverbooth/X10D/releases/tag/2.5.0

View File

@ -23,12 +23,12 @@ Install-Package X10D -Version 3.0.0
### Manual installation
Download the [latest release](https://github.com/oliverbooth/X10D/releases/latest) from this repository and adding a direct assembly reference for your chosen platform.
### What happened to X10D.Unity?
I decided it was time for X10D to be migrated to .NET 6. Unity currently supports .NET Framework 4.x / .NET Standard 2.1, and as such is not compatible with X10D at this time.
Unity have announced official support for .NET 6 in the future (see [this forum post](https://forum.unity.com/threads/unity-future-net-development-status.1092205/) for more details),
but until such a time that Unity supports .NET 6, X10D.Unity will not be maintained or innovated upon.
### Unity installation
Starting with Unity 2021.2, support for .NET Standard 2.1 has been added. With this change, I am confident providing support for this version for the time being, with only minimal feature-loss.
To add X10D into your Unity project, goto the [Package Manager window](https://docs.unity3d.com/Manual/upm-ui.html), and choose to install from a Git URL, and use the URL https://github.com/oliverbooth/X10D.git#upm
The upm branch, however, is still available under version 2.6.0 - if you wish to use this version, add the package https://github.com/oliverbooth/X10D.git#upm to your Unity project.
Parity with the main branch of X10D, and full .NET 6 feature support, is planned - but a timeline is not yet available. Unity plan to add .NET 6 support in the near future.
For more information, see [this forum post](https://forum.unity.com/threads/unity-future-net-development-status.1092205/).
## Features
I'm planning on writing complete and extensive documentation in the near future. As of this time, feel free to browse the source or the API using your favourite IDE.

View File

@ -0,0 +1,68 @@
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;
namespace X10D.SourceGenerator;
[Generator]
internal sealed class EmojiRegexGenerator : ISourceGenerator
{
// ReSharper disable once IdentifierTypo
private const string TwemojiRegexUrl = "https://raw.githubusercontent.com/twitter/twemoji-parser/master/src/lib/regex.js";
private static readonly HttpClient HttpClient = new();
private string _emojiRegex = string.Empty;
/// <inheritdoc />
public void Initialize(GeneratorInitializationContext context)
{
string response = HttpClient.GetStringAsync(TwemojiRegexUrl).GetAwaiter().GetResult();
using var reader = new StringReader(response);
while (reader.ReadLine() is { } line)
{
if (!line.StartsWith("export default /"))
{
continue;
}
Match match = Regex.Match(line, @"export default /(?<regex>.+)/g;");
if (!match.Success)
{
continue;
}
_emojiRegex = $"^{match.Groups["regex"].Value}$";
break;
}
}
/// <inheritdoc />
public void Execute(GeneratorExecutionContext context)
{
if (string.IsNullOrEmpty(_emojiRegex))
{
return;
}
var builder = new StringBuilder();
builder.AppendLine("// This file was auto-generated by X10D.SourceGenerator");
builder.AppendLine("// Do not edit this file manually");
builder.AppendLine();
builder.AppendLine("using System.Text.RegularExpressions;");
builder.AppendLine();
builder.AppendLine("namespace X10D.Text;");
builder.AppendLine();
builder.AppendLine("internal static class EmojiRegex");
builder.AppendLine("{");
builder.AppendLine(" internal static readonly Regex Value = new Regex(");
builder.AppendLine($" @\"{_emojiRegex}\",");
// ReSharper disable once StringLiteralTypo
builder.AppendLine(" RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.Singleline");
builder.AppendLine(" );");
builder.AppendLine("}");
context.AddSource("EmojiRegex.g.cs", SourceText.From(builder.ToString(), Encoding.UTF8));
}
}

View File

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>10.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" PrivateAssets="all"/>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>

View File

@ -1,11 +1,13 @@
using System.Text;
var directories = new Stack<string>(Directory.GetDirectories(args[0]));
var problems = 0;
var files = 0;
while (directories.Count > 0)
foreach (string arg in args)
{
var directories = new Stack<string>(Directory.GetDirectories(arg));
var files = 0;
while (directories.Count > 0)
{
string path = Path.GetFullPath(directories.Pop());
foreach (string directory in Directory.EnumerateDirectories(path))
@ -58,7 +60,9 @@ while (directories.Count > 0)
lineNumber++;
}
}
}
Console.Out.WriteLine($"Finished scanning {files} files, {problems} problems encountered.");
}
Console.Out.WriteLine($"Finished scanning {files} files, {problems} problems encountered.");
return problems;

View File

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>netstandard2.1;net6.0</TargetFrameworks>
<LangVersion>10.0</LangVersion>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>

View File

@ -25,6 +25,7 @@ public class ArrayTests
Assert.ThrowsException<ArgumentNullException>(array!.AsReadOnly);
}
[CLSCompliant(false)]
[TestMethod]
[DataRow]
[DataRow(1)]

View File

@ -0,0 +1,77 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using X10D.Collections;
namespace X10D.Tests.Collections;
[TestClass]
public class CollectionTests
{
[TestMethod]
public void ClearAndDisposeAll_ShouldDispose_GivenCollection()
{
var collection = new List<Disposable> {new(), new(), new()};
var copy = new List<Disposable>(collection);
collection.ClearAndDisposeAll();
Assert.IsTrue(copy.All(x => x.IsDisposed));
Assert.AreEqual(0, collection.Count);
}
[TestMethod]
public async Task ClearAndDisposeAllAsync_ShouldDispose_GivenCollection()
{
var collection = new List<Disposable> {new(), new(), new()};
var copy = new List<Disposable>(collection);
await collection.ClearAndDisposeAllAsync();
Assert.IsTrue(copy.All(x => x.IsDisposed));
Assert.AreEqual(0, collection.Count);
}
[TestMethod]
public void ClearAndDisposeAll_ShouldThrow_GivenNull()
{
List<Disposable>? collection = null;
Assert.ThrowsException<ArgumentNullException>(() => collection!.ClearAndDisposeAll());
}
[TestMethod]
public void ClearAndDisposeAllAsync_ShouldThrow_GivenNull()
{
List<Disposable>? collection = null;
Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await collection!.ClearAndDisposeAllAsync());
}
[TestMethod]
public void ClearAndDisposeAll_ShouldThrow_GivenReadOnlyCollection()
{
var collection = new List<Disposable>().AsReadOnly();
Assert.ThrowsException<InvalidOperationException>(() => collection.ClearAndDisposeAll());
}
[TestMethod]
public void ClearAndDisposeAllAsync_ShouldThrow_GivenReadOnlyCollection()
{
var collection = new List<Disposable>().AsReadOnly();
Assert.ThrowsExceptionAsync<InvalidOperationException>(async () => await collection.ClearAndDisposeAllAsync());
}
private class Disposable : IDisposable, IAsyncDisposable
{
public bool IsDisposed { get; private set; }
public void Dispose()
{
Assert.IsTrue(IsDisposed = true);
}
#pragma warning disable CS1998
public async ValueTask DisposeAsync()
#pragma warning restore CS1998
{
Assert.IsTrue(IsDisposed = true);
}
}
}

View File

@ -6,6 +6,94 @@ namespace X10D.Tests.Collections;
[TestClass]
public class EnumerableTests
{
[TestMethod]
public void DisposeAll_ShouldDispose_GivenCollection()
{
var collection = new List<Disposable> {new(), new(), new()};
collection.DisposeAll();
Assert.IsTrue(collection.All(x => x.IsDisposed));
}
[TestMethod]
public async Task DisposeAllAsync_ShouldDispose_GivenCollection()
{
var collection = new List<Disposable> {new(), new(), new()};
await collection.DisposeAllAsync();
Assert.IsTrue(collection.All(x => x.IsDisposed));
}
[TestMethod]
public void DisposeAll_ShouldThrow_GivenNull()
{
List<Disposable>? collection = null;
Assert.ThrowsException<ArgumentNullException>(() => collection!.DisposeAll());
}
[TestMethod]
public async Task DisposeAllAsync_ShouldThrow_GivenNull()
{
List<Disposable>? collection = null;
await Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await collection!.DisposeAllAsync());
}
[TestMethod]
public void For_ShouldTransform_GivenTransformationDelegate()
{
var oneToTen = new[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
var multipliedByIndex = new[] {0, 2, 6, 12, 20, 30, 42, 56, 72, 90};
IEnumerable<DummyClass> source = oneToTen.Select(i => new DummyClass {Value = i}).ToArray();
IEnumerable<int> values = source.Select(o => o.Value);
CollectionAssert.AreEqual(oneToTen, values.ToArray());
source.For((i, o) => o.Value *= i);
values = source.Select(o => o.Value);
CollectionAssert.AreEqual(multipliedByIndex, values.ToArray());
}
[TestMethod]
public void For_ShouldThrow_GivenNullSource()
{
IEnumerable<object>? source = null;
Assert.ThrowsException<ArgumentNullException>(() => source!.For((_, _) => { }));
}
[TestMethod]
public void For_ShouldThrow_GivenNullAction()
{
IEnumerable<object> source = ArraySegment<object>.Empty;
Assert.ThrowsException<ArgumentNullException>(() => source.For(null!));
}
[TestMethod]
public void ForEach_ShouldTransform_GivenTransformationDelegate()
{
var oneToTen = new[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
var oneToTenDoubled = new[] {2, 4, 6, 8, 10, 12, 14, 16, 18, 20};
IEnumerable<DummyClass> source = oneToTen.Select(i => new DummyClass {Value = i}).ToArray();
IEnumerable<int> values = source.Select(o => o.Value);
CollectionAssert.AreEqual(oneToTen, values.ToArray());
source.ForEach(o => o.Value *= 2);
values = source.Select(o => o.Value);
CollectionAssert.AreEqual(oneToTenDoubled, values.ToArray());
}
[TestMethod]
public void ForEach_ShouldThrow_GivenNullSource()
{
IEnumerable<object>? source = null;
Assert.ThrowsException<ArgumentNullException>(() => source!.ForEach(_ => { }));
}
[TestMethod]
public void ForEach_ShouldThrow_GivenNullAction()
{
IEnumerable<object> source = ArraySegment<object>.Empty;
Assert.ThrowsException<ArgumentNullException>(() => source.ForEach(null!));
}
[TestMethod]
public void Shuffled_ShouldThrow_GivenNull()
{
@ -23,4 +111,26 @@ public class EnumerableTests
shuffled = array.Shuffled().ToArray();
CollectionAssert.AreNotEqual(array, shuffled);
}
private class DummyClass
{
public int Value { get; set; }
}
private class Disposable : IDisposable, IAsyncDisposable
{
public bool IsDisposed { get; private set; }
public void Dispose()
{
Assert.IsTrue(IsDisposed = true);
}
#pragma warning disable CS1998
public async ValueTask DisposeAsync()
#pragma warning restore CS1998
{
Assert.IsTrue(IsDisposed = true);
}
}
}

View File

@ -6,6 +6,7 @@ namespace X10D.Tests.Collections;
[TestClass]
public class ListTests
{
[CLSCompliant(false)]
[TestMethod]
[DataRow(1)]
[DataRow(1, 2, 3)]
@ -25,6 +26,7 @@ public class ListTests
CollectionAssert.AreEqual(all42, list);
}
[CLSCompliant(false)]
[TestMethod]
[DataRow(1)]
[DataRow(1, 2, 3)]

View File

@ -1,20 +0,0 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using X10D.Core;
namespace X10D.Tests.Core;
[TestClass]
public class EnumerableTests
{
[TestMethod]
[DataRow(1)]
[DataRow("f")]
[DataRow(true)]
public void AsEnumerable_ShouldWrapElement_GivenValue(object o)
{
IEnumerable<object?> array = o.AsEnumerableValue().ToArray(); // prevent multiple enumeration of IEnumerable
Assert.IsNotNull(array);
Assert.IsTrue(array.Count() == 1);
Assert.AreEqual(o, array.ElementAt(0));
}
}

View File

@ -0,0 +1,69 @@
using System.Drawing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using X10D.Drawing;
namespace X10D.Tests.Drawing;
[TestClass]
public class ColorTests
{
private static readonly Color Black = Color.FromArgb(0, 0, 0);
private static readonly Color White = Color.FromArgb(255, 255, 255);
private static readonly Color Red = Color.FromArgb(255, 0, 0);
private static readonly Color Green = Color.FromArgb(0, 255, 0);
private static readonly Color Blue = Color.FromArgb(0, 0, 255);
private static readonly Color Cyan = Color.FromArgb(0, 255, 255);
private static readonly Color Magenta = Color.FromArgb(255, 0, 255);
private static readonly Color Yellow = Color.FromArgb(255, 255, 0);
[TestMethod]
public void Inverted_ShouldReturnInvertedColor()
{
Assert.AreEqual(White, Black.Inverted());
Assert.AreEqual(Black, White.Inverted());
Assert.AreEqual(Red, Cyan.Inverted());
Assert.AreEqual(Cyan, Red.Inverted());
Assert.AreEqual(Green, Magenta.Inverted());
Assert.AreEqual(Magenta, Green.Inverted());
Assert.AreEqual(Yellow, Blue.Inverted());
Assert.AreEqual(Blue, Yellow.Inverted());
}
[TestMethod]
public void Inverted_ShouldIgnoreAlpha()
{
Color expected = Color.FromArgb(255, 0, 0, 0);
Color actual = Color.FromArgb(255, 255, 255, 255).Inverted();
Assert.AreEqual(expected, actual);
}
[TestMethod]
public void WithA0_ShouldReturnSameColor_GivenWhite()
{
Color transparent = Color.FromArgb(0, 255, 255, 255);
Assert.AreEqual(transparent, White.WithA(0));
Assert.AreEqual(transparent, transparent.WithA(0));
}
[TestMethod]
public void WithB0_ShouldReturnYellow_GivenWhite()
{
Assert.AreEqual(Yellow, White.WithB(0));
Assert.AreEqual(Yellow, Yellow.WithB(0));
}
[TestMethod]
public void WithG0_ShouldReturnMagenta_GivenWhite()
{
Assert.AreEqual(Magenta, White.WithG(0));
Assert.AreEqual(Magenta, Magenta.WithG(0));
}
[TestMethod]
public void WithR0_ShouldReturnCyan_GivenWhite()
{
Assert.AreEqual(Cyan, White.WithR(0));
Assert.AreEqual(Cyan, Cyan.WithR(0));
}
}

View File

@ -55,4 +55,28 @@ public class ReadOnlySpanTests
return span.Any(null!);
});
}
[TestMethod]
public void Count_ShouldReturn0_GivenEmptySpan()
{
var span = new ReadOnlySpan<int>();
Assert.AreEqual(0, span.Count(i => i % 2 == 0));
}
[TestMethod]
public void Count_ShouldReturn5_ForEvenNumbers_GivenNumbers1To10()
{
var span = new ReadOnlySpan<int>(new[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10});
Assert.AreEqual(5, span.Count(i => i % 2 == 0));
}
[TestMethod]
public void Count_ShouldThrow_GivenNullPredicate()
{
Assert.ThrowsException<ArgumentNullException>(() =>
{
var span = new ReadOnlySpan<int>();
return span.Count(null!);
});
}
}

View File

@ -12,12 +12,12 @@ public class SByteTests
{
sbyte Cast(int i) => (sbyte)i;
Assert.AreEqual(0, Enumerable.Range(0, 10).Product());
Assert.AreEqual(1, Enumerable.Range(1, 1).Product());
Assert.AreEqual(2, Enumerable.Range(1, 2).Product());
Assert.AreEqual(6, Enumerable.Range(1, 3).Product());
Assert.AreEqual(24, Enumerable.Range(1, 4).Product());
Assert.AreEqual(120, Enumerable.Range(1, 5).Product());
Assert.AreEqual(0, Enumerable.Range(0, 10).Select(Cast).Product());
Assert.AreEqual(1, Enumerable.Range(1, 1).Select(Cast).Product());
Assert.AreEqual(2, Enumerable.Range(1, 2).Select(Cast).Product());
Assert.AreEqual(6, Enumerable.Range(1, 3).Select(Cast).Product());
Assert.AreEqual(24, Enumerable.Range(1, 4).Select(Cast).Product());
Assert.AreEqual(120, Enumerable.Range(1, 5).Select(Cast).Product());
// 6! will overflow for sbyte
}

View File

@ -55,4 +55,28 @@ public class SpanTests
return span.Any(null!);
});
}
[TestMethod]
public void Count_ShouldReturn0_GivenEmptySpan()
{
var span = new Span<int>();
Assert.AreEqual(0, span.Count(i => i % 2 == 0));
}
[TestMethod]
public void Count_ShouldReturn5_ForEvenNumbers_GivenNumbers1To10()
{
var span = new Span<int>(new[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10});
Assert.AreEqual(5, span.Count(i => i % 2 == 0));
}
[TestMethod]
public void Count_ShouldThrow_GivenNullPredicate()
{
Assert.ThrowsException<ArgumentNullException>(() =>
{
var span = new Span<int>();
return span.Count(null!);
});
}
}

View File

@ -7,6 +7,7 @@ namespace X10D.Tests.Math;
[TestClass]
public class DecimalTests
{
#if NETCOREAPP3_0_OR_GREATER
[TestMethod]
public void ComplexSqrt_ShouldBeCorrect_GivenReal()
{
@ -25,6 +26,7 @@ public class DecimalTests
Assert.AreEqual(new Complex(0, 3.0), (-9.0m).ComplexSqrt());
Assert.AreEqual(new Complex(0, 4.0), (-16.0m).ComplexSqrt());
}
#endif
[TestMethod]
public void IsEven_ShouldBeFalse_GivenOddNumber()

View File

@ -29,6 +29,7 @@ public class DoubleTests
Assert.AreEqual(12.0, 0.20943951023931953.RadiansToDegrees(), 1e-6);
}
#if NETCOREAPP3_0_OR_GREATER
[TestMethod]
public void ComplexSqrt_ShouldBeCorrect_GivenReal()
{
@ -60,6 +61,7 @@ public class DoubleTests
{
Assert.AreEqual(Complex.NaN, double.NaN.ComplexSqrt());
}
#endif
[TestMethod]
public void IsEven_ShouldBeFalse_GivenOddNumber()

View File

@ -29,6 +29,7 @@ public class SingleTests
Assert.AreEqual(12.0f, 0.20943952f.RadiansToDegrees(), 1e-6f);
}
#if NETCOREAPP3_0_OR_GREATER
[TestMethod]
public void ComplexSqrt_ShouldBeCorrect_GivenReal()
{
@ -60,6 +61,7 @@ public class SingleTests
{
Assert.AreEqual(Complex.NaN, float.NaN.ComplexSqrt());
}
#endif
[TestMethod]
public void IsEven_ShouldBeFalse_GivenOddNumber()

View File

@ -0,0 +1,37 @@
using System.Numerics;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using X10D.Numerics;
namespace X10D.Tests.Numerics;
[TestClass]
public class Vector2Tests
{
[TestMethod]
public void WithX_ShouldReturnVectorWithNewX_GivenVector()
{
Assert.AreEqual(Vector2.UnitY, Vector2.One.WithX(0));
Assert.AreEqual(Vector2.Zero, Vector2.Zero.WithX(0));
Assert.AreEqual(Vector2.Zero, Vector2.UnitX.WithX(0));
Assert.AreEqual(Vector2.UnitY, Vector2.UnitY.WithX(0));
Assert.AreEqual(Vector2.One, Vector2.One.WithX(1));
Assert.AreEqual(Vector2.UnitX, Vector2.Zero.WithX(1));
Assert.AreEqual(Vector2.UnitX, Vector2.UnitX.WithX(1));
Assert.AreEqual(Vector2.One, Vector2.UnitY.WithX(1));
}
[TestMethod]
public void WithY_ShouldReturnVectorWithNewY_GivenVector()
{
Assert.AreEqual(Vector2.UnitX, Vector2.One.WithY(0));
Assert.AreEqual(Vector2.Zero, Vector2.Zero.WithY(0));
Assert.AreEqual(Vector2.UnitX, Vector2.UnitX.WithY(0));
Assert.AreEqual(Vector2.Zero, Vector2.UnitY.WithY(0));
Assert.AreEqual(Vector2.One, Vector2.One.WithY(1));
Assert.AreEqual(Vector2.UnitY, Vector2.Zero.WithY(1));
Assert.AreEqual(Vector2.One, Vector2.UnitX.WithY(1));
Assert.AreEqual(Vector2.UnitY, Vector2.UnitY.WithY(1));
}
}

View File

@ -0,0 +1,57 @@
using System.Numerics;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using X10D.Numerics;
namespace X10D.Tests.Numerics;
[TestClass]
public class Vector3Tests
{
[TestMethod]
public void WithX_ShouldReturnVectorWithNewX_GivenVector()
{
Assert.AreEqual(new Vector3(0, 1, 1), Vector3.One.WithX(0));
Assert.AreEqual(Vector3.Zero, Vector3.Zero.WithX(0));
Assert.AreEqual(Vector3.Zero, Vector3.UnitX.WithX(0));
Assert.AreEqual(Vector3.UnitY, Vector3.UnitY.WithX(0));
Assert.AreEqual(Vector3.UnitZ, Vector3.UnitZ.WithX(0));
Assert.AreEqual(Vector3.One, Vector3.One.WithX(1));
Assert.AreEqual(Vector3.UnitX, Vector3.Zero.WithX(1));
Assert.AreEqual(Vector3.UnitX, Vector3.UnitX.WithX(1));
Assert.AreEqual(new Vector3(1, 1, 0), Vector3.UnitY.WithX(1));
Assert.AreEqual(new Vector3(1, 0, 1), Vector3.UnitZ.WithX(1));
}
[TestMethod]
public void WithY_ShouldReturnVectorWithNewY_GivenVector()
{
Assert.AreEqual(new Vector3(1, 0, 1), Vector3.One.WithY(0));
Assert.AreEqual(Vector3.Zero, Vector3.Zero.WithY(0));
Assert.AreEqual(Vector3.UnitX, Vector3.UnitX.WithY(0));
Assert.AreEqual(Vector3.Zero, Vector3.UnitY.WithY(0));
Assert.AreEqual(Vector3.UnitZ, Vector3.UnitZ.WithY(0));
Assert.AreEqual(Vector3.One, Vector3.One.WithY(1));
Assert.AreEqual(Vector3.UnitY, Vector3.Zero.WithY(1));
Assert.AreEqual(new Vector3(1, 1, 0), Vector3.UnitX.WithY(1));
Assert.AreEqual(Vector3.UnitY, Vector3.UnitY.WithY(1));
Assert.AreEqual(new Vector3(0, 1, 1), Vector3.UnitZ.WithY(1));
}
[TestMethod]
public void WithZ_ShouldReturnVectorWithNewZ_GivenVector()
{
Assert.AreEqual(new Vector3(1, 1, 0), Vector3.One.WithZ(0));
Assert.AreEqual(Vector3.Zero, Vector3.Zero.WithZ(0));
Assert.AreEqual(Vector3.UnitX, Vector3.UnitX.WithZ(0));
Assert.AreEqual(Vector3.UnitY, Vector3.UnitY.WithZ(0));
Assert.AreEqual(Vector3.Zero, Vector3.UnitZ.WithZ(0));
Assert.AreEqual(Vector3.One, Vector3.One.WithZ(1));
Assert.AreEqual(Vector3.UnitZ, Vector3.Zero.WithZ(1));
Assert.AreEqual(new Vector3(1, 0, 1), Vector3.UnitX.WithZ(1));
Assert.AreEqual(new Vector3(0, 1, 1), Vector3.UnitY.WithZ(1));
Assert.AreEqual(Vector3.UnitZ, Vector3.UnitZ.WithZ(1));
}
}

View File

@ -0,0 +1,81 @@
using System.Numerics;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using X10D.Numerics;
namespace X10D.Tests.Numerics;
[TestClass]
public class Vector4Tests
{
[TestMethod]
public void WithW_ShouldReturnVectorWithNewW_GivenVector()
{
Assert.AreEqual(new Vector4(1, 1, 1, 0), Vector4.One.WithW(0));
Assert.AreEqual(Vector4.Zero, Vector4.Zero.WithW(0));
Assert.AreEqual(Vector4.Zero, Vector4.UnitW.WithW(0));
Assert.AreEqual(Vector4.UnitX, Vector4.UnitX.WithW(0));
Assert.AreEqual(Vector4.UnitY, Vector4.UnitY.WithW(0));
Assert.AreEqual(Vector4.UnitZ, Vector4.UnitZ.WithW(0));
Assert.AreEqual(Vector4.One, Vector4.One.WithW(1));
Assert.AreEqual(Vector4.UnitW, Vector4.Zero.WithW(1));
Assert.AreEqual(Vector4.UnitW, Vector4.UnitW.WithW(1));
Assert.AreEqual(new Vector4(1, 0, 0, 1), Vector4.UnitX.WithW(1));
Assert.AreEqual(new Vector4(0, 1, 0, 1), Vector4.UnitY.WithW(1));
Assert.AreEqual(new Vector4(0, 0, 1, 1), Vector4.UnitZ.WithW(1));
}
[TestMethod]
public void WithX_ShouldReturnVectorWithNewX_GivenVector()
{
Assert.AreEqual(new Vector4(0, 1, 1, 1), Vector4.One.WithX(0));
Assert.AreEqual(Vector4.Zero, Vector4.Zero.WithX(0));
Assert.AreEqual(Vector4.UnitW, Vector4.UnitW.WithX(0));
Assert.AreEqual(Vector4.Zero, Vector4.UnitX.WithX(0));
Assert.AreEqual(Vector4.UnitY, Vector4.UnitY.WithX(0));
Assert.AreEqual(Vector4.UnitZ, Vector4.UnitZ.WithX(0));
Assert.AreEqual(Vector4.One, Vector4.One.WithX(1));
Assert.AreEqual(Vector4.UnitX, Vector4.Zero.WithX(1));
Assert.AreEqual(new Vector4(1, 0, 0, 1), Vector4.UnitW.WithX(1));
Assert.AreEqual(Vector4.UnitX, Vector4.UnitX.WithX(1));
Assert.AreEqual(new Vector4(1, 1, 0, 0), Vector4.UnitY.WithX(1));
Assert.AreEqual(new Vector4(1, 0, 1, 0), Vector4.UnitZ.WithX(1));
}
[TestMethod]
public void WithY_ShouldReturnVectorWithNewY_GivenVector()
{
Assert.AreEqual(new Vector4(1, 0, 1, 1), Vector4.One.WithY(0));
Assert.AreEqual(Vector4.Zero, Vector4.Zero.WithY(0));
Assert.AreEqual(Vector4.UnitW, Vector4.UnitW.WithY(0));
Assert.AreEqual(Vector4.UnitX, Vector4.UnitX.WithY(0));
Assert.AreEqual(Vector4.Zero, Vector4.UnitY.WithY(0));
Assert.AreEqual(Vector4.UnitZ, Vector4.UnitZ.WithY(0));
Assert.AreEqual(Vector4.One, Vector4.One.WithY(1));
Assert.AreEqual(Vector4.UnitY, Vector4.Zero.WithY(1));
Assert.AreEqual(new Vector4(0, 1, 0, 1), Vector4.UnitW.WithY(1));
Assert.AreEqual(new Vector4(1, 1, 0, 0), Vector4.UnitX.WithY(1));
Assert.AreEqual(Vector4.UnitY, Vector4.UnitY.WithY(1));
Assert.AreEqual(new Vector4(0, 1, 1, 0), Vector4.UnitZ.WithY(1));
}
[TestMethod]
public void WithZ_ShouldReturnVectorWithNewZ_GivenVector()
{
Assert.AreEqual(new Vector4(1, 1, 0, 1), Vector4.One.WithZ(0));
Assert.AreEqual(Vector4.Zero, Vector4.Zero.WithZ(0));
Assert.AreEqual(Vector4.UnitW, Vector4.UnitW.WithZ(0));
Assert.AreEqual(Vector4.UnitX, Vector4.UnitX.WithZ(0));
Assert.AreEqual(Vector4.UnitY, Vector4.UnitY.WithZ(0));
Assert.AreEqual(Vector4.Zero, Vector4.UnitZ.WithZ(0));
Assert.AreEqual(Vector4.One, Vector4.One.WithZ(1));
Assert.AreEqual(Vector4.UnitZ, Vector4.Zero.WithZ(1));
Assert.AreEqual(new Vector4(0, 0, 1, 1), Vector4.UnitW.WithZ(1));
Assert.AreEqual(new Vector4(1, 0, 1, 0), Vector4.UnitX.WithZ(1));
Assert.AreEqual(new Vector4(0, 1, 1, 0), Vector4.UnitY.WithZ(1));
Assert.AreEqual(Vector4.UnitZ, Vector4.UnitZ.WithZ(1));
}
}

View File

@ -1,4 +1,5 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using X10D.Text;
namespace X10D.Tests.Text;
@ -6,6 +7,25 @@ namespace X10D.Tests.Text;
[TestClass]
public class CharTests
{
[TestMethod]
public void IsEmoji_ShouldReturnTrue_GivenBasicEmoji()
{
Assert.IsTrue('✂'.IsEmoji());
Assert.IsTrue('✅'.IsEmoji());
Assert.IsTrue('❎'.IsEmoji());
Assert.IsTrue(''.IsEmoji());
Assert.IsTrue(''.IsEmoji());
}
[TestMethod]
public void IsEmoji_ShouldReturnFalse_GivenNonEmoji()
{
for (var letter = 'A'; letter <= 'Z'; letter++)
{
Assert.IsFalse(letter.IsEmoji());
}
}
[TestMethod]
public void RepeatShouldBeCorrect()
{

View File

@ -6,6 +6,7 @@ namespace X10D.Tests.Text;
[TestClass]
public class CoreTests
{
#if NET5_0_OR_GREATER
[TestMethod]
public void ToJsonShouldNotBeEmpty()
{
@ -23,4 +24,5 @@ public class CoreTests
CollectionAssert.AreEqual(source, target);
CollectionAssert.AreEquivalent(source, target);
}
#endif
}

View File

@ -1,4 +1,5 @@
using System.Text;
#if NETCOREAPP3_0_OR_GREATER
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using X10D.Text;
@ -7,6 +8,25 @@ namespace X10D.Tests.Text;
[TestClass]
public class RuneTests
{
[TestMethod]
public void IsEmoji_ShouldReturnTrue_GivenBasicEmoji()
{
Assert.IsTrue(new Rune('✂').IsEmoji());
Assert.IsTrue(new Rune('✅').IsEmoji());
Assert.IsTrue(new Rune('❎').IsEmoji());
Assert.IsTrue(new Rune('').IsEmoji());
Assert.IsTrue(new Rune('').IsEmoji());
}
[TestMethod]
public void IsEmoji_ShouldReturnFalse_GivenNonEmoji()
{
for (var letter = 'A'; letter <= 'Z'; letter++)
{
Assert.IsFalse(new Rune(letter).IsEmoji());
}
}
[TestMethod]
public void RepeatShouldBeCorrect()
{
@ -37,3 +57,4 @@ public class RuneTests
Assert.ThrowsException<ArgumentOutOfRangeException>(() => new Rune('a').Repeat(-1));
}
}
#endif

View File

@ -1,5 +1,7 @@
using System.Text;
#if NET5_0_OR_GREATER
using System.Text.Json.Serialization;
#endif
using Microsoft.VisualStudio.TestTools.UnitTesting;
using X10D.Text;
@ -149,6 +151,7 @@ public class StringTests
Assert.ThrowsException<ArgumentException>(() => " ".EnumParse<DayOfWeek>());
}
#if NET5_0_OR_GREATER
[TestMethod]
public void FromJson_ShouldDeserializeCorrectly_GivenJsonString()
{
@ -162,6 +165,7 @@ public class StringTests
Assert.AreEqual(2, target.Values[1]);
Assert.AreEqual(3, target.Values[2]);
}
#endif
[TestMethod]
public void GetBytes_ShouldReturnUtf8Bytes_GivenHelloWorld()
@ -195,6 +199,44 @@ public class StringTests
Assert.ThrowsException<ArgumentNullException>(() => "Hello World".GetBytes(null!));
}
[TestMethod]
public void IsEmoji_ShouldReturnTrue_GivenBasicEmoji()
{
Assert.IsTrue("😀".IsEmoji());
Assert.IsTrue("🤓".IsEmoji());
Assert.IsTrue("🟦".IsEmoji());
Assert.IsTrue("🟧".IsEmoji());
Assert.IsTrue("🟨".IsEmoji());
Assert.IsTrue("🟩".IsEmoji());
Assert.IsTrue("🟪".IsEmoji());
Assert.IsTrue("🟫".IsEmoji());
Assert.IsTrue("📱".IsEmoji());
Assert.IsTrue("🎨".IsEmoji());
}
[TestMethod]
public void IsEmoji_ShouldReturnTrue_GivenMultiByteEmoji()
{
string[] regionalIndicatorCodes = Enumerable.Range(0, 26)
.Select(i => Encoding.Unicode.GetString(new byte[] {0x3C, 0xD8, (byte)(0xE6 + i), 0xDD}))
.ToArray();
for (var i = 0; i < 26; i++)
for (var j = 0; j < 26; j++)
{
string flag = (regionalIndicatorCodes[i] + regionalIndicatorCodes[j]);
Assert.IsTrue(flag.IsEmoji());
}
}
[TestMethod]
public void IsEmoji_ShouldReturnFalse_GivenNonEmoji()
{
Assert.IsFalse("Hello World".IsEmoji());
Assert.IsFalse("Hello".IsEmoji());
Assert.IsFalse("World".IsEmoji());
}
[TestMethod]
public void IsLower_ShouldReturnTrue_GivenLowercaseString()
{
@ -441,9 +483,11 @@ public class StringTests
Assert.AreEqual(alternative, ((string?)null).WithWhiteSpaceAlternative(alternative));
}
#if NET5_0_OR_GREATER
private struct SampleStructure
{
[JsonPropertyName("values")]
public int[] Values { get; set; }
}
#endif
}

View File

@ -1,4 +1,5 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
#if NET5_0_OR_GREATER
using Microsoft.VisualStudio.TestTools.UnitTesting;
using X10D.Time;
namespace X10D.Tests.Time;
@ -51,3 +52,4 @@ public class DoubleTests
Assert.IsTrue((_negativeOne).Weeks() < TimeSpan.Zero);
}
}
#endif

72
X10D.Unity.Tests/.gitignore vendored Normal file
View File

@ -0,0 +1,72 @@
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/
# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/
# Recordings can get excessive in size
/[Rr]ecordings/
# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*
# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*
# Visual Studio cache directory
.vs/
# Gradle cache directory
.gradle/
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db
# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta
# Unity3D generated file on crash reports
sysinfo.txt
# Builds
*.apk
*.aab
*.unitypackage
*.app
# Crashlytics generated file
crashlytics-build.properties
# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6ea315d0fd7389c41b19996891e99ae3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,267 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 705507994}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 0
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &705507993
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 705507995}
- component: {fileID: 705507994}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &705507994
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 705507993}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 1
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &705507995
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 705507993}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &963194225
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 963194228}
- component: {fileID: 963194227}
- component: {fileID: 963194226}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &963194226
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_Enabled: 1
--- !u!20 &963194227
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &963194228
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9fc0d4010bbf28b4594072e72b8655ab
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 478095eaef020f34ea189f98c9369aab
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,29 @@
#nullable enable
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
namespace X10D.Unity.Tests
{
public class ComponentTests
{
[UnityTest]
public IEnumerator GetComponentsInChildrenOnly_ShouldIgnoreParent()
{
var parent = new GameObject();
var rigidbody = parent.AddComponent<Rigidbody>();
var child = new GameObject();
child.transform.SetParent(parent.transform);
child.AddComponent<Rigidbody>();
Rigidbody[] components = rigidbody.GetComponentsInChildrenOnly<Rigidbody>();
Assert.AreEqual(1, components.Length);
Assert.AreEqual(components[0].gameObject, child);
yield break;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0619dbb274114e4aa247ed8f4e7cff03
timeCreated: 1652006240

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9674f5a2171d4c7d88cbfe9f1249bb27
timeCreated: 1652006440

View File

@ -0,0 +1,83 @@
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
using X10D.Unity.Drawing;
namespace X10D.Unity.Tests.Drawing
{
public class Color32Tests
{
private static readonly Color32 Black = new(0, 0, 0, 1);
private static readonly Color32 White = new(255, 255, 255, 1);
private static readonly Color32 Red = new(255, 0, 0, 1);
private static readonly Color32 Green = new(0, 255, 0, 1);
private static readonly Color32 Blue = new(0, 0, 255, 1);
private static readonly Color32 Cyan = new(0, 255, 255, 1);
private static readonly Color32 Magenta = new(255, 0, 255, 1);
private static readonly Color32 Yellow = new(255, 255, 0, 1);
[UnityTest]
public IEnumerator Inverted_ShouldReturnInvertedColor()
{
Assert.AreEqual(White, Black.Inverted());
Assert.AreEqual(Black, White.Inverted());
Assert.AreEqual(Red, Cyan.Inverted());
Assert.AreEqual(Cyan, Red.Inverted());
Assert.AreEqual(Green, Magenta.Inverted());
Assert.AreEqual(Magenta, Green.Inverted());
Assert.AreEqual(Yellow, Blue.Inverted());
Assert.AreEqual(Blue, Yellow.Inverted());
yield break;
}
[UnityTest]
public IEnumerator Inverted_ShouldIgnoreAlpha()
{
var expected = new Color32(0, 0, 0, 255);
var actual = new Color32(255, 255, 255, 255).Inverted();
Assert.AreEqual(expected, actual);
yield break;
}
[UnityTest]
public IEnumerator WithA0_ShouldReturnSameColor_GivenWhite()
{
var transparent = new Color32(255, 255, 255, 0);
Assert.AreEqual(transparent, White.WithA(0));
Assert.AreEqual(transparent, transparent.WithA(0));
yield break;
}
[UnityTest]
public IEnumerator WithB0_ShouldReturnYellow_GivenWhite()
{
Assert.AreEqual(Yellow, White.WithB(0));
Assert.AreEqual(Yellow, Yellow.WithB(0));
yield break;
}
[UnityTest]
public IEnumerator WithG0_ShouldReturnMagenta_GivenWhite()
{
Assert.AreEqual(Magenta, White.WithG(0));
Assert.AreEqual(Magenta, Magenta.WithG(0));
yield break;
}
[UnityTest]
public IEnumerator WithR0_ShouldReturnCyan_GivenWhite()
{
Assert.AreEqual(Cyan, White.WithR(0));
Assert.AreEqual(Cyan, Cyan.WithR(0));
yield break;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 877c5a68b0dd44c68aae01463ae26b26
timeCreated: 1652035626

View File

@ -0,0 +1,83 @@
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
using X10D.Unity.Drawing;
namespace X10D.Unity.Tests.Drawing
{
public class ColorTests
{
private static readonly Color Black = new(0, 0, 0);
private static readonly Color White = new(1, 1, 1);
private static readonly Color Red = new(1, 0, 0);
private static readonly Color Green = new(0, 1, 0);
private static readonly Color Blue = new(0, 0, 1);
private static readonly Color Cyan = new(0, 1, 1);
private static readonly Color Magenta = new(1, 0, 1);
private static readonly Color Yellow = new(1, 1, 0);
[UnityTest]
public IEnumerator Inverted_ShouldReturnInvertedColor()
{
Assert.AreEqual(White, Black.Inverted());
Assert.AreEqual(Black, White.Inverted());
Assert.AreEqual(Red, Cyan.Inverted());
Assert.AreEqual(Cyan, Red.Inverted());
Assert.AreEqual(Green, Magenta.Inverted());
Assert.AreEqual(Magenta, Green.Inverted());
Assert.AreEqual(Yellow, Blue.Inverted());
Assert.AreEqual(Blue, Yellow.Inverted());
yield break;
}
[UnityTest]
public IEnumerator Inverted_ShouldIgnoreAlpha()
{
var expected = new Color(0, 0, 0, 1);
var actual = new Color(1, 1, 1, 1).Inverted();
Assert.AreEqual(expected, actual);
yield break;
}
[UnityTest]
public IEnumerator WithA0_ShouldReturnSameColor_GivenWhite()
{
var transparent = new Color(1, 1, 1, 0);
Assert.AreEqual(transparent, White.WithA(0));
Assert.AreEqual(transparent, transparent.WithA(0));
yield break;
}
[UnityTest]
public IEnumerator WithB0_ShouldReturnYellow_GivenWhite()
{
Assert.AreEqual(Yellow, White.WithB(0));
Assert.AreEqual(Yellow, Yellow.WithB(0));
yield break;
}
[UnityTest]
public IEnumerator WithG0_ShouldReturnMagenta_GivenWhite()
{
Assert.AreEqual(Magenta, White.WithG(0));
Assert.AreEqual(Magenta, Magenta.WithG(0));
yield break;
}
[UnityTest]
public IEnumerator WithR0_ShouldReturnCyan_GivenWhite()
{
Assert.AreEqual(Cyan, White.WithR(0));
Assert.AreEqual(Cyan, Cyan.WithR(0));
yield break;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 61df0ae6778a4ab084e688f13adfc29c
timeCreated: 1652035747

View File

@ -0,0 +1,87 @@
#nullable enable
using System;
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
using X10D.Unity.Drawing;
using Random = System.Random;
namespace X10D.Unity.Tests.Drawing
{
public class RandomTests
{
[UnityTest]
public IEnumerator NextColorArgb_ShouldReturn331515e5_GivenSeed1234()
{
var random = new Random(1234);
var color = random.NextColorArgb();
Assert.AreEqual(0.373868465f, color.r, 1e-6f);
Assert.AreEqual(0.391597569f, color.g, 1e-6f);
Assert.AreEqual(0.675019085f, color.b, 1e-6f);
Assert.AreEqual(0.234300315f, color.a, 1e-6f);
yield break;
}
[UnityTest]
public IEnumerator NextColorArgb_ShouldThrow_GivenNull()
{
Random? random = null;
Assert.Throws<ArgumentNullException>(() => random!.NextColorArgb());
yield break;
}
[UnityTest]
public IEnumerator NextColor32Argb_ShouldReturn331515e5_GivenSeed1234()
{
var random = new Random(1234);
Assert.AreEqual(new Color32(21, 21, 229, 51), random.NextColor32Argb());
yield break;
}
[UnityTest]
public IEnumerator NextColor32Argb_ShouldThrow_GivenNull()
{
Random? random = null;
Assert.Throws<ArgumentNullException>(() => random!.NextColor32Argb());
yield break;
}
[UnityTest]
public IEnumerator NextColorRgb_ShouldReturn1515e5_GivenSeed1234()
{
var random = new Random(1234);
var color = random.NextColorRgb();
Assert.AreEqual(0.234300315f, color.r, 1e-6f);
Assert.AreEqual(0.373868465f, color.g, 1e-6f);
Assert.AreEqual(0.391597569f, color.b, 1e-6f);
Assert.AreEqual(1, color.a, 1e-6f);
yield break;
}
[UnityTest]
public IEnumerator NextColorRgb_ShouldThrow_GivenNull()
{
Random? random = null;
Assert.Throws<ArgumentNullException>(() => random!.NextColorRgb());
yield break;
}
[UnityTest]
public IEnumerator NextColor32Rgb_ShouldReturn1515e5_GivenSeed1234()
{
var random = new Random(1234);
Assert.AreEqual(new Color32(21, 21, 229, 255), random.NextColor32Rgb());
yield break;
}
[UnityTest]
public IEnumerator NextColor32Rgb_ShouldThrow_GivenNull()
{
Random? random = null;
Assert.Throws<ArgumentNullException>(() => random!.NextColor32Rgb());
yield break;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 28fa03c101834cd79774d8138b9d4adb
timeCreated: 1652006445

View File

@ -0,0 +1,109 @@
#nullable enable
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
namespace X10D.Unity.Tests
{
public class GameObjectTests
{
[UnityTest]
public IEnumerator GetComponentsInChildrenOnly_ShouldIgnoreParent()
{
var parent = new GameObject();
parent.AddComponent<Rigidbody>();
var child = new GameObject();
child.transform.SetParent(parent.transform);
child.AddComponent<Rigidbody>();
Rigidbody[] components = parent.GetComponentsInChildrenOnly<Rigidbody>();
Assert.AreEqual(1, components.Length);
Assert.AreEqual(components[0].gameObject, child);
yield break;
}
[UnityTest]
public IEnumerator LookAt_ShouldRotateSameAsTransform()
{
var first = new GameObject {transform = {position = Vector3.zero, rotation = Quaternion.identity}};
var second = new GameObject {transform = {position = Vector3.right, rotation = Quaternion.identity}};
Transform firstTransform = first.transform;
Transform secondTransform = second.transform;
Assert.AreEqual(Quaternion.identity, firstTransform.rotation);
Assert.AreEqual(Quaternion.identity, secondTransform.rotation);
firstTransform.LookAt(secondTransform);
Quaternion expected = firstTransform.rotation;
firstTransform.rotation = Quaternion.identity;
Assert.AreEqual(Quaternion.identity, firstTransform.rotation);
first.LookAt(second);
Assert.AreEqual(expected, firstTransform.rotation);
firstTransform.rotation = Quaternion.identity;
Assert.AreEqual(Quaternion.identity, firstTransform.rotation);
first.LookAt(second.transform);
Assert.AreEqual(expected, firstTransform.rotation);
firstTransform.rotation = Quaternion.identity;
Assert.AreEqual(Quaternion.identity, firstTransform.rotation);
first.LookAt(Vector3.right);
Assert.AreEqual(expected, firstTransform.rotation);
yield break;
}
[UnityTest]
public IEnumerator SetLayerRecursively_ShouldSetLayerRecursively()
{
var parent = new GameObject();
var child = new GameObject();
var grandChild = new GameObject();
child.transform.SetParent(parent.transform);
grandChild.transform.SetParent(child.transform);
int layer = LayerMask.NameToLayer("UI");
Assert.AreNotEqual(layer, parent.layer);
Assert.AreNotEqual(layer, child.layer);
Assert.AreNotEqual(layer, grandChild.layer);
parent.SetLayerRecursively(layer);
Assert.AreEqual(layer, parent.layer);
Assert.AreEqual(layer, child.layer);
Assert.AreEqual(layer, grandChild.layer);
yield break;
}
[UnityTest]
public IEnumerator SetParent_ShouldSetParent()
{
var first = new GameObject {transform = {position = Vector3.zero, rotation = Quaternion.identity}};
var second = new GameObject {transform = {position = Vector3.right, rotation = Quaternion.identity}};
Assert.AreEqual(null, first.transform.parent);
Assert.AreEqual(null, second.transform.parent);
first.SetParent(second);
Assert.AreEqual(second.transform, first.transform.parent);
first.transform.SetParent(null!);
Assert.AreEqual(null, first.transform.parent);
second.SetParent(first);
Assert.AreEqual(first.transform, second.transform.parent);
yield break;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1fde6c311eaec944abe1e4531a2980bc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c906e39e3c8d44c7a8dafe042fedf677
timeCreated: 1652006420

View File

@ -0,0 +1,53 @@
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
using X10D.Core;
using X10D.Unity.Numerics;
using Random = System.Random;
namespace X10D.Unity.Tests.Numerics
{
public class QuaternionTests
{
[UnityTest]
public IEnumerator ToSystemQuaternion_ShouldReturnQuaternion_WithEqualComponents()
{
var random = new Random();
float x = random.NextSingle();
float y = random.NextSingle();
float z = random.NextSingle();
float w = random.NextSingle();
var quaternion = new Quaternion(x, y, z, w);
var systemQuaternion = quaternion.ToSystemQuaternion();
Assert.AreEqual(quaternion.x, systemQuaternion.X, 1e-6f);
Assert.AreEqual(quaternion.y, systemQuaternion.Y, 1e-6f);
Assert.AreEqual(quaternion.z, systemQuaternion.Z, 1e-6f);
Assert.AreEqual(quaternion.w, systemQuaternion.W, 1e-6f);
yield break;
}
[UnityTest]
public IEnumerator ToUnityQuaternion_ShouldReturnQuaternion_WithEqualComponents()
{
var random = new Random();
float x = random.NextSingle();
float y = random.NextSingle();
float z = random.NextSingle();
float w = random.NextSingle();
var quaternion = new System.Numerics.Quaternion(x, y, z, w);
var unityQuaternion = quaternion.ToUnityQuaternion();
Assert.AreEqual(quaternion.X, unityQuaternion.x, 1e-6f);
Assert.AreEqual(quaternion.Y, unityQuaternion.y, 1e-6f);
Assert.AreEqual(quaternion.Z, unityQuaternion.z, 1e-6f);
Assert.AreEqual(quaternion.W, unityQuaternion.w, 1e-6f);
yield break;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a395fec41c5a4e9d9ffb05324e8159b0
timeCreated: 1652124913

View File

@ -0,0 +1,63 @@
#nullable enable
using System;
using System.Collections;
using NUnit.Framework;
using UnityEngine.TestTools;
using X10D.Unity.Numerics;
namespace X10D.Unity.Tests.Numerics
{
public class RandomTests
{
[UnityTest]
public IEnumerator NextUnitVector2_ShouldReturnVector_WithMagnitude1()
{
var random = new Random();
var vector = random.NextUnitVector2();
Assert.AreEqual(1, vector.magnitude, 1e-6);
yield break;
}
[UnityTest]
public IEnumerator NextUnitVector2_ShouldThrow_GivenNullRandom()
{
Random? random = null;
Assert.Throws<ArgumentNullException>(() => random!.NextUnitVector2());
yield break;
}
[UnityTest]
public IEnumerator NextUnitVector3_ShouldReturnVector_WithMagnitude1()
{
var random = new Random();
var vector = random.NextUnitVector3();
Assert.AreEqual(1, vector.magnitude, 1e-6);
yield break;
}
[UnityTest]
public IEnumerator NextUnitVector3_ShouldThrow_GivenNullRandom()
{
Random? random = null;
Assert.Throws<ArgumentNullException>(() => random!.NextUnitVector3());
yield break;
}
[UnityTest]
public IEnumerator NextRotation_ShouldThrow_GivenNullRandom()
{
Random random = null;
Assert.Throws<ArgumentNullException>(() => random!.NextRotation());
yield break;
}
[UnityTest]
public IEnumerator NextRotationUniform_ShouldThrow_GivenNullRandom()
{
Random? random = null;
Assert.Throws<ArgumentNullException>(() => random!.NextRotationUniform());
yield break;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 74577fe33f85446194c4ae2315caaace
timeCreated: 1652006301

View File

@ -0,0 +1,79 @@
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
using X10D.Core;
using X10D.Unity.Numerics;
using Random = System.Random;
namespace X10D.Unity.Tests.Numerics
{
public class Vector2Tests
{
[UnityTest]
public IEnumerator ToSystemVector_ShouldReturnVector_WithEqualComponents()
{
var random = new Random();
float x = random.NextSingle();
float y = random.NextSingle();
var vector = new Vector2(x, y);
var systemVector = vector.ToSystemVector();
Assert.AreEqual(vector.magnitude, systemVector.Length(), 1e-6f);
Assert.AreEqual(vector.x, systemVector.X, 1e-6f);
Assert.AreEqual(vector.y, systemVector.Y, 1e-6f);
yield break;
}
[UnityTest]
public IEnumerator ToUnityVector_ShouldReturnVector_WithEqualComponents()
{
var random = new Random();
float x = random.NextSingle();
float y = random.NextSingle();
var vector = new System.Numerics.Vector2(x, y);
var unityVector = vector.ToUnityVector();
Assert.AreEqual(vector.Length(), unityVector.magnitude, 1e-6f);
Assert.AreEqual(vector.X, unityVector.x, 1e-6f);
Assert.AreEqual(vector.Y, unityVector.y, 1e-6f);
yield break;
}
[UnityTest]
public IEnumerator WithX_ShouldReturnVectorWithNewX_GivenVector()
{
Assert.AreEqual(Vector2.up, Vector2.one.WithX(0));
Assert.AreEqual(Vector2.zero, Vector2.zero.WithX(0));
Assert.AreEqual(Vector2.zero, Vector2.right.WithX(0));
Assert.AreEqual(Vector2.up, Vector2.up.WithX(0));
Assert.AreEqual(Vector2.one, Vector2.one.WithX(1));
Assert.AreEqual(Vector2.right, Vector2.zero.WithX(1));
Assert.AreEqual(Vector2.right, Vector2.right.WithX(1));
Assert.AreEqual(Vector2.one, Vector2.up.WithX(1));
yield break;
}
[UnityTest]
public IEnumerator WithY_ShouldReturnVectorWithNewY_GivenVector()
{
Assert.AreEqual(Vector2.right, Vector2.one.WithY(0));
Assert.AreEqual(Vector2.zero, Vector2.zero.WithY(0));
Assert.AreEqual(Vector2.right, Vector2.right.WithY(0));
Assert.AreEqual(Vector2.zero, Vector2.up.WithY(0));
Assert.AreEqual(Vector2.one, Vector2.one.WithY(1));
Assert.AreEqual(Vector2.up, Vector2.zero.WithY(1));
Assert.AreEqual(Vector2.one, Vector2.right.WithY(1));
Assert.AreEqual(Vector2.up, Vector2.up.WithY(1));
yield break;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 83385270996049569380ae9769ff1381
timeCreated: 1652088132

View File

@ -0,0 +1,105 @@
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
using X10D.Core;
using X10D.Unity.Numerics;
using Random = System.Random;
namespace X10D.Unity.Tests.Numerics
{
public class Vector3Tests
{
[UnityTest]
public IEnumerator ToSystemVector_ShouldReturnVector_WithEqualComponents()
{
var random = new Random();
float x = random.NextSingle();
float y = random.NextSingle();
float z = random.NextSingle();
var vector = new Vector3(x, y, z);
var systemVector = vector.ToSystemVector();
Assert.AreEqual(vector.magnitude, systemVector.Length(), 1e-6f);
Assert.AreEqual(vector.x, systemVector.X, 1e-6f);
Assert.AreEqual(vector.y, systemVector.Y, 1e-6f);
Assert.AreEqual(vector.z, systemVector.Z, 1e-6f);
yield break;
}
[UnityTest]
public IEnumerator ToUnityVector_ShouldReturnVector_WithEqualComponents()
{
var random = new Random();
float x = random.NextSingle();
float y = random.NextSingle();
float z = random.NextSingle();
var vector = new System.Numerics.Vector3(x, y, z);
var unityVector = vector.ToUnityVector();
Assert.AreEqual(vector.Length(), unityVector.magnitude, 1e-6f);
Assert.AreEqual(vector.X, unityVector.x, 1e-6f);
Assert.AreEqual(vector.Y, unityVector.y, 1e-6f);
Assert.AreEqual(vector.Z, unityVector.z, 1e-6f);
yield break;
}
[UnityTest]
public IEnumerator WithX_ShouldReturnVectorWithNewX_GivenVector()
{
Assert.AreEqual(new Vector3(0, 1, 1), Vector3.one.WithX(0));
Assert.AreEqual(Vector3.zero, Vector3.zero.WithX(0));
Assert.AreEqual(Vector3.zero, Vector3.right.WithX(0));
Assert.AreEqual(Vector3.up, Vector3.up.WithX(0));
Assert.AreEqual(Vector3.forward, Vector3.forward.WithX(0));
Assert.AreEqual(Vector3.one, Vector3.one.WithX(1));
Assert.AreEqual(Vector3.right, Vector3.zero.WithX(1));
Assert.AreEqual(Vector3.right, Vector3.right.WithX(1));
Assert.AreEqual(new Vector3(1, 1, 0), Vector3.up.WithX(1));
Assert.AreEqual(new Vector3(1, 0, 1), Vector3.forward.WithX(1));
yield break;
}
[UnityTest]
public IEnumerator WithY_ShouldReturnVectorWithNewY_GivenVector()
{
Assert.AreEqual(new Vector3(1, 0, 1), Vector3.one.WithY(0));
Assert.AreEqual(Vector3.zero, Vector3.zero.WithY(0));
Assert.AreEqual(Vector3.right, Vector3.right.WithY(0));
Assert.AreEqual(Vector3.zero, Vector3.up.WithY(0));
Assert.AreEqual(Vector3.forward, Vector3.forward.WithY(0));
Assert.AreEqual(Vector3.one, Vector3.one.WithY(1));
Assert.AreEqual(Vector3.up, Vector3.zero.WithY(1));
Assert.AreEqual(new Vector3(1, 1, 0), Vector3.right.WithY(1));
Assert.AreEqual(Vector3.up, Vector3.up.WithY(1));
Assert.AreEqual(new Vector3(0, 1, 1), Vector3.forward.WithY(1));
yield break;
}
[UnityTest]
public IEnumerator WithZ_ShouldReturnVectorWithNewZ_GivenVector()
{
Assert.AreEqual(new Vector3(1, 1, 0), Vector3.one.WithZ(0));
Assert.AreEqual(Vector3.zero, Vector3.zero.WithZ(0));
Assert.AreEqual(Vector3.right, Vector3.right.WithZ(0));
Assert.AreEqual(Vector3.up, Vector3.up.WithZ(0));
Assert.AreEqual(Vector3.zero, Vector3.forward.WithZ(0));
Assert.AreEqual(Vector3.one, Vector3.one.WithZ(1));
Assert.AreEqual(Vector3.forward, Vector3.zero.WithZ(1));
Assert.AreEqual(new Vector3(1, 0, 1), Vector3.right.WithZ(1));
Assert.AreEqual(new Vector3(0, 1, 1), Vector3.up.WithZ(1));
Assert.AreEqual(Vector3.forward, Vector3.forward.WithZ(1));
yield break;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a00d613201bd497d91c9e98bca8dd6b1
timeCreated: 1652088132

View File

@ -0,0 +1,135 @@
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
using X10D.Core;
using X10D.Unity.Numerics;
using Random = System.Random;
namespace X10D.Unity.Tests.Numerics
{
public class Vector4Tests
{
[UnityTest]
public IEnumerator ToSystemVector_ShouldReturnVector_WithEqualComponents()
{
var random = new Random();
float x = random.NextSingle();
float y = random.NextSingle();
float z = random.NextSingle();
float w = random.NextSingle();
var vector = new Vector4(x, y, z, w);
var systemVector = vector.ToSystemVector();
Assert.AreEqual(vector.magnitude, systemVector.Length(), 1e-6f);
Assert.AreEqual(vector.x, systemVector.X, 1e-6f);
Assert.AreEqual(vector.y, systemVector.Y, 1e-6f);
Assert.AreEqual(vector.z, systemVector.Z, 1e-6f);
Assert.AreEqual(vector.w, systemVector.W, 1e-6f);
yield break;
}
[UnityTest]
public IEnumerator ToUnityVector_ShouldReturnVector_WithEqualComponents()
{
var random = new Random();
float x = random.NextSingle();
float y = random.NextSingle();
float z = random.NextSingle();
float w = random.NextSingle();
var vector = new System.Numerics.Vector4(x, y, z, w);
var unityVector = vector.ToUnityVector();
Assert.AreEqual(vector.Length(), unityVector.magnitude, 1e-6f);
Assert.AreEqual(vector.X, unityVector.x, 1e-6f);
Assert.AreEqual(vector.Y, unityVector.y, 1e-6f);
Assert.AreEqual(vector.Z, unityVector.z, 1e-6f);
Assert.AreEqual(vector.W, unityVector.w, 1e-6f);
yield break;
}
[UnityTest]
public IEnumerator WithW_ShouldReturnVectorWithNewW_GivenVector()
{
Assert.AreEqual(new Vector4(1, 1, 1, 0), Vector4.one.WithW(0));
Assert.AreEqual(Vector4.zero, Vector4.zero.WithW(0));
Assert.AreEqual(Vector4.zero, new Vector4(0, 0, 0, 1).WithW(0));
Assert.AreEqual(new Vector4(1, 0, 0, 0), new Vector4(1, 0, 0, 0).WithW(0));
Assert.AreEqual(new Vector4(0, 1, 0, 0), new Vector4(0, 1, 0, 0).WithW(0));
Assert.AreEqual(new Vector4(0, 0, 1, 0), new Vector4(0, 0, 1, 0).WithW(0));
Assert.AreEqual(Vector4.one, Vector4.one.WithW(1));
Assert.AreEqual(new Vector4(0, 0, 0, 1), Vector4.zero.WithW(1));
Assert.AreEqual(new Vector4(0, 0, 0, 1), new Vector4(0, 0, 0, 1).WithW(1));
Assert.AreEqual(new Vector4(1, 0, 0, 1), new Vector4(1, 0, 0, 0).WithW(1));
Assert.AreEqual(new Vector4(0, 1, 0, 1), new Vector4(0, 1, 0, 0).WithW(1));
Assert.AreEqual(new Vector4(0, 0, 1, 1), new Vector4(0, 0, 1, 0).WithW(1));
yield break;
}
[UnityTest]
public IEnumerator WithX_ShouldReturnVectorWithNewX_GivenVector()
{
Assert.AreEqual(new Vector4(0, 1, 1, 1), Vector4.one.WithX(0));
Assert.AreEqual(Vector4.zero, Vector4.zero.WithX(0));
Assert.AreEqual(new Vector4(0, 0, 0, 1), new Vector4(0, 0, 0, 1).WithX(0));
Assert.AreEqual(Vector4.zero, new Vector4(1, 0, 0, 0).WithX(0));
Assert.AreEqual(new Vector4(0, 1, 0, 0), new Vector4(0, 1, 0, 0).WithX(0));
Assert.AreEqual(new Vector4(0, 0, 1, 0), new Vector4(0, 0, 1, 0).WithX(0));
Assert.AreEqual(Vector4.one, Vector4.one.WithX(1));
Assert.AreEqual(new Vector4(1, 0, 0, 0), Vector4.zero.WithX(1));
Assert.AreEqual(new Vector4(1, 0, 0, 1), new Vector4(0, 0, 0, 1).WithX(1));
Assert.AreEqual(new Vector4(1, 0, 0, 0), new Vector4(1, 0, 0, 0).WithX(1));
Assert.AreEqual(new Vector4(1, 1, 0, 0), new Vector4(0, 1, 0, 0).WithX(1));
Assert.AreEqual(new Vector4(1, 0, 1, 0), new Vector4(0, 0, 1, 0).WithX(1));
yield break;
}
[UnityTest]
public IEnumerator WithY_ShouldReturnVectorWithNewY_GivenVector()
{
Assert.AreEqual(new Vector4(1, 0, 1, 1), Vector4.one.WithY(0));
Assert.AreEqual(Vector4.zero, Vector4.zero.WithY(0));
Assert.AreEqual(new Vector4(0, 0, 0, 1), new Vector4(0, 0, 0, 1).WithY(0));
Assert.AreEqual(new Vector4(1, 0, 0, 0), new Vector4(1, 0, 0, 0).WithY(0));
Assert.AreEqual(Vector4.zero, new Vector4(0, 1, 0, 0).WithY(0));
Assert.AreEqual(new Vector4(0, 0, 1, 0), new Vector4(0, 0, 1, 0).WithY(0));
Assert.AreEqual(Vector4.one, Vector4.one.WithY(1));
Assert.AreEqual(new Vector4(0, 1, 0, 0), Vector4.zero.WithY(1));
Assert.AreEqual(new Vector4(0, 1, 0, 1), new Vector4(0, 0, 0, 1).WithY(1));
Assert.AreEqual(new Vector4(1, 1, 0, 0), new Vector4(1, 0, 0, 0).WithY(1));
Assert.AreEqual(new Vector4(0, 1, 0, 0), new Vector4(0, 1, 0, 0).WithY(1));
Assert.AreEqual(new Vector4(0, 1, 1, 0), new Vector4(0, 0, 1, 0).WithY(1));
yield break;
}
[UnityTest]
public IEnumerator WithZ_ShouldReturnVectorWithNewZ_GivenVector()
{
Assert.AreEqual(new Vector4(1, 1, 0, 1), Vector4.one.WithZ(0));
Assert.AreEqual(Vector4.zero, Vector4.zero.WithZ(0));
Assert.AreEqual(new Vector4(0, 0, 0, 1), new Vector4(0, 0, 0, 1).WithZ(0));
Assert.AreEqual(new Vector4(1, 0, 0, 0), new Vector4(1, 0, 0, 0).WithZ(0));
Assert.AreEqual(new Vector4(0, 1, 0, 0), new Vector4(0, 1, 0, 0).WithZ(0));
Assert.AreEqual(Vector4.zero, new Vector4(0, 0, 1, 0).WithZ(0));
Assert.AreEqual(Vector4.one, Vector4.one.WithZ(1));
Assert.AreEqual(new Vector4(0, 0, 1, 0), Vector4.zero.WithZ(1));
Assert.AreEqual(new Vector4(0, 0, 1, 1), new Vector4(0, 0, 0, 1).WithZ(1));
Assert.AreEqual(new Vector4(1, 0, 1, 0), new Vector4(1, 0, 0, 0).WithZ(1));
Assert.AreEqual(new Vector4(0, 1, 1, 0), new Vector4(0, 1, 0, 0).WithZ(1));
Assert.AreEqual(new Vector4(0, 0, 1, 0), new Vector4(0, 0, 1, 0).WithZ(1));
yield break;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0d487c2046a64354b199f4de01d57391
timeCreated: 1652088132

View File

@ -0,0 +1,45 @@
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
namespace X10D.Unity.Tests
{
public class SingletonTests
{
[UnityTest]
public IEnumerator Singleton_ShouldReturnNewInstance_WhenNoInstanceExists()
{
TestBehaviour instance = Singleton<TestBehaviour>.Instance;
Assert.IsTrue(instance);
Assert.IsTrue(instance.Flag);
yield break;
}
[UnityTest]
public IEnumerator Singleton_ShouldReturnSameInstance_WhenAccessedTwice()
{
TestBehaviour instance = Singleton<TestBehaviour>.Instance;
Assert.IsTrue(instance);
Assert.AreEqual(instance, Singleton<TestBehaviour>.Instance);
yield break;
}
[UnityTest]
public IEnumerator Singleton_ShouldReturnNewInstance_WhenDestroyed()
{
TestBehaviour instance = Singleton<TestBehaviour>.Instance;
Assert.IsTrue(instance);
Object.Destroy(instance);
yield return null;
Assert.IsFalse(instance);
// ReSharper disable once HeuristicUnreachableCode
instance = Singleton<TestBehaviour>.Instance;
Assert.IsNotNull(instance);
Assert.IsTrue(instance.Flag);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5c51198d124f40859bd9298d3241d5a6
timeCreated: 1652428949

View File

@ -0,0 +1,10 @@
namespace X10D.Unity.Tests
{
internal sealed class TestBehaviour : Singleton<TestBehaviour>
{
public bool Flag
{
get => true;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: df932718d20948ecbe9b0de8aa7bbaf4
timeCreated: 1652428898

View File

@ -0,0 +1,59 @@
#nullable enable
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
namespace X10D.Unity.Tests
{
public class TransformTests
{
[UnityTest]
public IEnumerator LookAt_ShouldRotateSameAsTransform()
{
var first = new GameObject {transform = {position = Vector3.zero, rotation = Quaternion.identity}};
var second = new GameObject {transform = {position = Vector3.right, rotation = Quaternion.identity}};
Transform firstTransform = first.transform;
Transform secondTransform = second.transform;
Assert.AreEqual(Quaternion.identity, firstTransform.rotation);
Assert.AreEqual(Quaternion.identity, secondTransform.rotation);
firstTransform.LookAt(secondTransform);
Quaternion expected = firstTransform.rotation;
firstTransform.rotation = Quaternion.identity;
Assert.AreEqual(Quaternion.identity, firstTransform.rotation);
firstTransform.LookAt(second);
Assert.AreEqual(expected, firstTransform.rotation);
firstTransform.rotation = Quaternion.identity;
Assert.AreEqual(Quaternion.identity, firstTransform.rotation);
yield break;
}
[UnityTest]
public IEnumerator SetParent_ShouldSetParent()
{
var first = new GameObject {transform = {position = Vector3.zero, rotation = Quaternion.identity}};
var second = new GameObject {transform = {position = Vector3.right, rotation = Quaternion.identity}};
Assert.AreEqual(null, first.transform.parent);
Assert.AreEqual(null, second.transform.parent);
first.transform.SetParent(second);
Assert.AreEqual(second.transform, first.transform.parent);
first.transform.SetParent(null!);
Assert.AreEqual(null, first.transform.parent);
second.transform.SetParent(first);
Assert.AreEqual(first.transform, second.transform.parent);
yield break;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1f1518cdf51546288b7a16369297be5e
timeCreated: 1652005981

View File

@ -0,0 +1,23 @@
{
"name": "X10D.Unity.Tests",
"rootNamespace": "X10D.Unity",
"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll",
"X10D.dll",
"X10D.Unity.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"versionDefines": [],
"noEngineReferences": false
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 34215b8a0b1faf64487ff72821603aad
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,45 @@
{
"dependencies": {
"com.unity.collab-proxy": "1.15.17",
"com.unity.feature.development": "1.0.1",
"com.unity.ide.rider": "3.0.14",
"com.unity.ide.visualstudio": "2.0.15",
"com.unity.ide.vscode": "1.2.5",
"com.unity.test-framework": "1.1.31",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.6.4",
"com.unity.ugui": "1.0.0",
"com.unity.visualscripting": "1.7.7",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.cloth": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.umbra": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.unitywebrequesttexture": "1.0.0",
"com.unity.modules.unitywebrequestwww": "1.0.0",
"com.unity.modules.vehicles": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
}

View File

@ -0,0 +1,413 @@
{
"dependencies": {
"com.unity.collab-proxy": {
"version": "1.15.17",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.services.core": "1.0.1"
},
"url": "https://packages.unity.com"
},
"com.unity.editorcoroutines": {
"version": "1.0.0",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.feature.development": {
"version": "1.0.1",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.ide.visualstudio": "2.0.14",
"com.unity.ide.rider": "3.0.13",
"com.unity.ide.vscode": "1.2.5",
"com.unity.editorcoroutines": "1.0.0",
"com.unity.performance.profile-analyzer": "1.1.1",
"com.unity.test-framework": "1.1.31",
"com.unity.testtools.codecoverage": "1.0.1"
}
},
"com.unity.ide.rider": {
"version": "3.0.14",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.15",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.9"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.vscode": {
"version": "1.2.5",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "3.0.2",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.performance.profile-analyzer": {
"version": "1.1.1",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.3.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.nuget.newtonsoft-json": "3.0.2",
"com.unity.modules.androidjni": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.settings-manager": {
"version": "1.0.3",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.31",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.testtools.codecoverage": {
"version": "1.0.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.0.16",
"com.unity.settings-manager": "1.0.1"
},
"url": "https://packages.unity.com"
},
"com.unity.textmeshpro": {
"version": "3.0.6",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.6.4",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.modules.director": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0"
}
},
"com.unity.visualscripting": {
"version": "1.7.7",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.modules.ai": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.androidjni": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.animation": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.assetbundle": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.audio": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.cloth": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.director": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.animation": "1.0.0"
}
},
"com.unity.modules.imageconversion": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.imgui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.jsonserialize": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.particlesystem": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics2d": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.screencapture": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.subsystems": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.terrain": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.terrainphysics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.terrain": "1.0.0"
}
},
"com.unity.modules.tilemap": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics2d": "1.0.0"
}
},
"com.unity.modules.ui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.uielements": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.uielementsnative": "1.0.0"
}
},
"com.unity.modules.uielementsnative": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.umbra": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unityanalytics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.unitywebrequest": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unitywebrequestassetbundle": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
},
"com.unity.modules.unitywebrequestaudio": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.audio": "1.0.0"
}
},
"com.unity.modules.unitywebrequesttexture": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.unitywebrequestwww": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.vehicles": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.video": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
},
"com.unity.modules.vr": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
},
"com.unity.modules.wind": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.xr": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.subsystems": "1.0.0"
}
}
}
}

View File

@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!11 &1
AudioManager:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Volume: 1
Rolloff Scale: 1
Doppler Factor: 1
Default Speaker Mode: 2
m_SampleRate: 0
m_DSPBufferSize: 1024
m_VirtualVoiceCount: 512
m_RealVoiceCount: 32
m_SpatializerPlugin:
m_AmbisonicDecoderPlugin:
m_DisableAudio: 0
m_VirtualizeEffects: 1
m_RequestedDSPBufferSize: 1024

View File

@ -0,0 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!236 &1
ClusterInputManager:
m_ObjectHideFlags: 0
m_Inputs: []

View File

@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!55 &1
PhysicsManager:
m_ObjectHideFlags: 0
serializedVersion: 11
m_Gravity: {x: 0, y: -9.81, z: 0}
m_DefaultMaterial: {fileID: 0}
m_BounceThreshold: 2
m_SleepThreshold: 0.005
m_DefaultContactOffset: 0.01
m_DefaultSolverIterations: 6
m_DefaultSolverVelocityIterations: 1
m_QueriesHitBackfaces: 0
m_QueriesHitTriggers: 1
m_EnableAdaptiveForce: 0
m_ClothInterCollisionDistance: 0
m_ClothInterCollisionStiffness: 0
m_ContactsGeneration: 1
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation: 1
m_AutoSyncTransforms: 0
m_ReuseCollisionCallbacks: 1
m_ClothInterCollisionSettingsToggle: 0
m_ContactPairsMode: 0
m_BroadphaseType: 0
m_WorldBounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 250, y: 250, z: 250}
m_WorldSubdivisions: 8
m_FrictionType: 0
m_EnableEnhancedDeterminism: 0
m_EnableUnifiedHeightmaps: 1
m_DefaultMaxAngluarSpeed: 7

View File

@ -0,0 +1,8 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1045 &1
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes: []
m_configObjects: {}

View File

@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!159 &1
EditorSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_ExternalVersionControlSupport: Visible Meta Files
m_SerializationMode: 2
m_LineEndingsForNewScripts: 0
m_DefaultBehaviorMode: 0
m_PrefabRegularEnvironment: {fileID: 0}
m_PrefabUIEnvironment: {fileID: 0}
m_SpritePackerMode: 0
m_SpritePackerPaddingPower: 1
m_EtcTextureCompressorBehavior: 1
m_EtcTextureFastCompressor: 1
m_EtcTextureNormalCompressor: 2
m_EtcTextureBestCompressor: 4
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref
m_ProjectGenerationRootNamespace:
m_CollabEditorSettings:
inProgressEnabled: 1
m_EnableTextureStreamingInEditMode: 1
m_EnableTextureStreamingInPlayMode: 1
m_AsyncShaderCompilation: 1
m_EnterPlayModeOptionsEnabled: 0
m_EnterPlayModeOptions: 3
m_ShowLightmapResolutionOverlay: 1
m_UseLegacyProbeSampleCount: 0
m_SerializeInlineMappingsOnOneLine: 1

View File

@ -0,0 +1,63 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!30 &1
GraphicsSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_Deferred:
m_Mode: 1
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
m_DeferredReflections:
m_Mode: 1
m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
m_ScreenSpaceShadows:
m_Mode: 1
m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
m_LegacyDeferred:
m_Mode: 1
m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
m_DepthNormals:
m_Mode: 1
m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
m_MotionVectors:
m_Mode: 1
m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
m_LightHalo:
m_Mode: 1
m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
m_LensFlare:
m_Mode: 1
m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
m_AlwaysIncludedShaders:
- {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
m_CustomRenderPipeline: {fileID: 0}
m_TransparencySortMode: 0
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
m_DefaultRenderingPath: 1
m_DefaultMobileRenderingPath: 1
m_TierSettings: []
m_LightmapStripping: 0
m_FogStripping: 0
m_InstancingStripping: 0
m_LightmapKeepPlain: 1
m_LightmapKeepDirCombined: 1
m_LightmapKeepDynamicPlain: 1
m_LightmapKeepDynamicDirCombined: 1
m_LightmapKeepShadowMask: 1
m_LightmapKeepSubtractive: 1
m_FogKeepLinear: 1
m_FogKeepExp: 1
m_FogKeepExp2: 1
m_AlbedoSwatchInfos: []
m_LightsUseLinearIntensity: 0
m_LightsUseColorTemperature: 0
m_LogWhenShaderIsCompiled: 0
m_AllowEnlightenSupportForUpgradedProject: 0

View File

@ -0,0 +1,295 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!13 &1
InputManager:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Axes:
- serializedVersion: 3
m_Name: Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton: left
positiveButton: right
altNegativeButton: a
altPositiveButton: d
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton: down
positiveButton: up
altNegativeButton: s
altPositiveButton: w
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire1
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left ctrl
altNegativeButton:
altPositiveButton: mouse 0
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire2
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left alt
altNegativeButton:
altPositiveButton: mouse 1
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire3
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left shift
altNegativeButton:
altPositiveButton: mouse 2
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Jump
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: space
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Mouse X
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0
sensitivity: 0.1
snap: 0
invert: 0
type: 1
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Mouse Y
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0
sensitivity: 0.1
snap: 0
invert: 0
type: 1
axis: 1
joyNum: 0
- serializedVersion: 3
m_Name: Mouse ScrollWheel
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0
sensitivity: 0.1
snap: 0
invert: 0
type: 1
axis: 2
joyNum: 0
- serializedVersion: 3
m_Name: Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0.19
sensitivity: 1
snap: 0
invert: 0
type: 2
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0.19
sensitivity: 1
snap: 0
invert: 1
type: 2
axis: 1
joyNum: 0
- serializedVersion: 3
m_Name: Fire1
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 0
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire2
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 1
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire3
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 2
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Jump
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 3
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Submit
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: return
altNegativeButton:
altPositiveButton: joystick button 0
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Submit
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: enter
altNegativeButton:
altPositiveButton: space
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Cancel
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: escape
altNegativeButton:
altPositiveButton: joystick button 1
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0

View File

@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!387306366 &1
MemorySettings:
m_ObjectHideFlags: 0
m_EditorMemorySettings:
m_MainAllocatorBlockSize: -1
m_ThreadAllocatorBlockSize: -1
m_MainGfxBlockSize: -1
m_ThreadGfxBlockSize: -1
m_CacheBlockSize: -1
m_TypetreeBlockSize: -1
m_ProfilerBlockSize: -1
m_ProfilerEditorBlockSize: -1
m_BucketAllocatorGranularity: -1
m_BucketAllocatorBucketsCount: -1
m_BucketAllocatorBlockSize: -1
m_BucketAllocatorBlockCount: -1
m_ProfilerBucketAllocatorGranularity: -1
m_ProfilerBucketAllocatorBucketsCount: -1
m_ProfilerBucketAllocatorBlockSize: -1
m_ProfilerBucketAllocatorBlockCount: -1
m_TempAllocatorSizeMain: -1
m_JobTempAllocatorBlockSize: -1
m_BackgroundJobTempAllocatorBlockSize: -1
m_JobTempAllocatorReducedBlockSize: -1
m_TempAllocatorSizeGIBakingWorker: -1
m_TempAllocatorSizeNavMeshWorker: -1
m_TempAllocatorSizeAudioWorker: -1
m_TempAllocatorSizeCloudWorker: -1
m_TempAllocatorSizeGfx: -1
m_TempAllocatorSizeJobWorker: -1
m_TempAllocatorSizeBackgroundWorker: -1
m_TempAllocatorSizePreloadManager: -1
m_PlatformMemorySettings: {}

View File

@ -0,0 +1,91 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!126 &1
NavMeshProjectSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
areas:
- name: Walkable
cost: 1
- name: Not Walkable
cost: 1
- name: Jump
cost: 2
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
m_LastAgentTypeID: -887442657
m_Settings:
- serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.75
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_SettingNames:
- Humanoid

View File

@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 61
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_EnablePreReleasePackages: 0
m_EnablePackageDependencies: 0
m_AdvancedSettingsExpanded: 1
m_ScopedRegistriesSettingsExpanded: 1
m_SeeAllPackageVersions: 0
oneTimeWarningShown: 0
m_Registries:
- m_Id: main
m_Name:
m_Url: https://packages.unity.com
m_Scopes: []
m_IsDefault: 1
m_Capabilities: 7
m_UserSelectedRegistryName:
m_UserAddingNewScopedRegistry: 0
m_RegistryInfoDraft:
m_Modified: 0
m_ErrorMessage:
m_UserModificationsInstanceId: -830
m_OriginalInstanceId: -832
m_LoadAssets: 0

View File

@ -0,0 +1,7 @@
{
"m_Name": "Settings",
"m_Path": "ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json",
"m_Dictionary": {
"m_DictionaryValues": []
}
}

View File

@ -0,0 +1,56 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!19 &1
Physics2DSettings:
m_ObjectHideFlags: 0
serializedVersion: 4
m_Gravity: {x: 0, y: -9.81}
m_DefaultMaterial: {fileID: 0}
m_VelocityIterations: 8
m_PositionIterations: 3
m_VelocityThreshold: 1
m_MaxLinearCorrection: 0.2
m_MaxAngularCorrection: 8
m_MaxTranslationSpeed: 100
m_MaxRotationSpeed: 360
m_BaumgarteScale: 0.2
m_BaumgarteTimeOfImpactScale: 0.75
m_TimeToSleep: 0.5
m_LinearSleepTolerance: 0.01
m_AngularSleepTolerance: 2
m_DefaultContactOffset: 0.01
m_JobOptions:
serializedVersion: 2
useMultithreading: 0
useConsistencySorting: 0
m_InterpolationPosesPerJob: 100
m_NewContactsPerJob: 30
m_CollideContactsPerJob: 100
m_ClearFlagsPerJob: 200
m_ClearBodyForcesPerJob: 200
m_SyncDiscreteFixturesPerJob: 50
m_SyncContinuousFixturesPerJob: 50
m_FindNearestContactsPerJob: 100
m_UpdateTriggerContactsPerJob: 100
m_IslandSolverCostThreshold: 100
m_IslandSolverBodyCostScale: 1
m_IslandSolverContactCostScale: 10
m_IslandSolverJointCostScale: 10
m_IslandSolverBodiesPerJob: 50
m_IslandSolverContactsPerJob: 50
m_AutoSimulation: 1
m_QueriesHitTriggers: 1
m_QueriesStartInColliders: 1
m_CallbacksOnDisable: 1
m_ReuseCollisionCallbacks: 1
m_AutoSyncTransforms: 0
m_AlwaysShowColliders: 0
m_ShowColliderSleep: 1
m_ShowColliderContacts: 0
m_ShowColliderAABB: 0
m_ContactArrowScale: 0.2
m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

View File

@ -0,0 +1,7 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1386491679 &1
PresetManager:
m_ObjectHideFlags: 0
serializedVersion: 2
m_DefaultPresets: {}

View File

@ -0,0 +1,708 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!129 &1
PlayerSettings:
m_ObjectHideFlags: 0
serializedVersion: 23
productGUID: a5313041f8a8e9240a746c81c45bc60b
AndroidProfiler: 0
AndroidFilterTouchesWhenObscured: 0
AndroidEnableSustainedPerformanceMode: 0
defaultScreenOrientation: 4
targetDevice: 2
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: DefaultCompany
productName: X10D.Unity.Tests
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
m_ShowUnitySplashScreen: 1
m_ShowUnitySplashLogo: 1
m_SplashScreenOverlayOpacity: 1
m_SplashScreenAnimation: 1
m_SplashScreenLogoStyle: 1
m_SplashScreenDrawMode: 0
m_SplashScreenBackgroundAnimationZoom: 1
m_SplashScreenLogoAnimationZoom: 1
m_SplashScreenBackgroundLandscapeAspect: 1
m_SplashScreenBackgroundPortraitAspect: 1
m_SplashScreenBackgroundLandscapeUvs:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
m_SplashScreenBackgroundPortraitUvs:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
m_SplashScreenLogos: []
m_VirtualRealitySplashScreen: {fileID: 0}
m_HolographicTrackingLossScreen: {fileID: 0}
defaultScreenWidth: 1920
defaultScreenHeight: 1080
defaultScreenWidthWeb: 960
defaultScreenHeightWeb: 600
m_StereoRenderingPath: 0
m_ActiveColorSpace: 0
m_MTRendering: 1
mipStripping: 0
numberOfMipsStripped: 0
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
iosShowActivityIndicatorOnLoading: -1
androidShowActivityIndicatorOnLoading: -1
iosUseCustomAppBackgroundBehavior: 0
iosAllowHTTPDownload: 1
allowedAutorotateToPortrait: 1
allowedAutorotateToPortraitUpsideDown: 1
allowedAutorotateToLandscapeRight: 1
allowedAutorotateToLandscapeLeft: 1
useOSAutorotation: 1
use32BitDisplayBuffer: 1
preserveFramebufferAlpha: 0
disableDepthAndStencilBuffers: 0
androidStartInFullscreen: 1
androidRenderOutsideSafeArea: 1
androidUseSwappy: 1
androidBlitType: 0
androidResizableWindow: 0
androidDefaultWindowWidth: 1920
androidDefaultWindowHeight: 1080
androidMinimumWindowWidth: 400
androidMinimumWindowHeight: 300
androidFullscreenMode: 1
defaultIsNativeResolution: 1
macRetinaSupport: 1
runInBackground: 1
captureSingleScreen: 0
muteOtherAudioSources: 0
Prepare IOS For Recording: 0
Force IOS Speakers When Recording: 0
deferSystemGesturesMode: 0
hideHomeButton: 0
submitAnalytics: 1
usePlayerLog: 1
bakeCollisionMeshes: 0
forceSingleInstance: 0
useFlipModelSwapchain: 1
resizableWindow: 0
useMacAppStoreValidation: 0
macAppStoreCategory: public.app-category.games
gpuSkinning: 1
xboxPIXTextureCapture: 0
xboxEnableAvatar: 0
xboxEnableKinect: 0
xboxEnableKinectAutoTracking: 0
xboxEnableFitness: 0
visibleInBackground: 1
allowFullscreenSwitch: 1
fullscreenMode: 1
xboxSpeechDB: 0
xboxEnableHeadOrientation: 0
xboxEnableGuest: 0
xboxEnablePIXSampling: 0
metalFramebufferOnly: 0
xboxOneResolution: 0
xboxOneSResolution: 0
xboxOneXResolution: 3
xboxOneMonoLoggingLevel: 0
xboxOneLoggingLevel: 1
xboxOneDisableEsram: 0
xboxOneEnableTypeOptimization: 0
xboxOnePresentImmediateThreshold: 0
switchQueueCommandMemory: 0
switchQueueControlMemory: 16384
switchQueueComputeMemory: 262144
switchNVNShaderPoolsGranularity: 33554432
switchNVNDefaultPoolsGranularity: 16777216
switchNVNOtherPoolsGranularity: 16777216
switchNVNMaxPublicTextureIDCount: 0
switchNVNMaxPublicSamplerIDCount: 0
stadiaPresentMode: 0
stadiaTargetFramerate: 0
vulkanNumSwapchainBuffers: 3
vulkanEnableSetSRGBWrite: 0
vulkanEnablePreTransform: 1
vulkanEnableLateAcquireNextImage: 0
vulkanEnableCommandBufferRecycling: 1
m_SupportedAspectRatios:
4:3: 1
5:4: 1
16:10: 1
16:9: 1
Others: 1
bundleVersion: 0.1
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1
xboxOneDisableKinectGpuReservation: 1
xboxOneEnable7thCore: 1
vrSettings:
enable360StereoCapture: 0
isWsaHolographicRemotingEnabled: 0
enableFrameTimingStats: 0
useHDRDisplay: 0
D3DHDRBitDepth: 0
m_ColorGamuts: 00000000
targetPixelDensity: 30
resolutionScalingMode: 0
androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier: {}
buildNumber:
Standalone: 0
iPhone: 0
tvOS: 0
overrideDefaultApplicationIdentifier: 0
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 22
AndroidTargetSdkVersion: 0
AndroidPreferredInstallLocation: 1
aotOptions:
stripEngineCode: 1
iPhoneStrippingLevel: 0
iPhoneScriptCallOptimization: 0
ForceInternetPermission: 0
ForceSDCardPermission: 0
CreateWallpaper: 0
APKExpansionFiles: 0
keepLoadedShadersAlive: 0
StripUnusedMeshComponents: 1
VertexChannelCompressionMask: 4054
iPhoneSdkVersion: 988
iOSTargetOSVersionString: 11.0
tvOSSdkVersion: 0
tvOSRequireExtendedGameController: 0
tvOSTargetOSVersionString: 11.0
uIPrerenderedIcon: 0
uIRequiresPersistentWiFi: 0
uIRequiresFullScreen: 1
uIStatusBarHidden: 1
uIExitOnSuspend: 0
uIStatusBarStyle: 0
appleTVSplashScreen: {fileID: 0}
appleTVSplashScreen2x: {fileID: 0}
tvOSSmallIconLayers: []
tvOSSmallIconLayers2x: []
tvOSLargeIconLayers: []
tvOSLargeIconLayers2x: []
tvOSTopShelfImageLayers: []
tvOSTopShelfImageLayers2x: []
tvOSTopShelfImageWideLayers: []
tvOSTopShelfImageWideLayers2x: []
iOSLaunchScreenType: 0
iOSLaunchScreenPortrait: {fileID: 0}
iOSLaunchScreenLandscape: {fileID: 0}
iOSLaunchScreenBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreenFillPct: 100
iOSLaunchScreenSize: 100
iOSLaunchScreenCustomXibPath:
iOSLaunchScreeniPadType: 0
iOSLaunchScreeniPadImage: {fileID: 0}
iOSLaunchScreeniPadBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreeniPadFillPct: 100
iOSLaunchScreeniPadSize: 100
iOSLaunchScreeniPadCustomXibPath:
iOSLaunchScreenCustomStoryboardPath:
iOSLaunchScreeniPadCustomStoryboardPath:
iOSDeviceRequirements: []
iOSURLSchemes: []
macOSURLSchemes: []
iOSBackgroundModes: 0
iOSMetalForceHardShadows: 0
metalEditorSupport: 1
metalAPIValidation: 1
iOSRenderExtraFrameOnPause: 0
iosCopyPluginsCodeInsteadOfSymlink: 0
appleDeveloperTeamID:
iOSManualSigningProvisioningProfileID:
tvOSManualSigningProvisioningProfileID:
iOSManualSigningProvisioningProfileType: 0
tvOSManualSigningProvisioningProfileType: 0
appleEnableAutomaticSigning: 0
iOSRequireARKit: 0
iOSAutomaticallyDetectAndAddCapabilities: 1
appleEnableProMotion: 0
shaderPrecisionModel: 0
clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea
templatePackageId: com.unity.template.3d@8.1.0
templateDefaultScene: Assets/Scenes/SampleScene.unity
useCustomMainManifest: 0
useCustomLauncherManifest: 0
useCustomMainGradleTemplate: 0
useCustomLauncherGradleManifest: 0
useCustomBaseGradleTemplate: 0
useCustomGradlePropertiesTemplate: 0
useCustomProguardFile: 0
AndroidTargetArchitectures: 1
AndroidTargetDevices: 0
AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
AndroidKeystoreName:
AndroidKeyaliasName:
AndroidBuildApkPerCpuArchitecture: 0
AndroidTVCompatibility: 0
AndroidIsGame: 1
AndroidEnableTango: 0
androidEnableBanner: 1
androidUseLowAccuracyLocation: 0
androidUseCustomKeystore: 0
m_AndroidBanners:
- width: 320
height: 180
banner: {fileID: 0}
androidGamepadSupportLevel: 0
chromeosInputEmulation: 1
AndroidMinifyWithR8: 0
AndroidMinifyRelease: 0
AndroidMinifyDebug: 0
AndroidValidateAppBundleSize: 1
AndroidAppBundleSizeToValidate: 150
m_BuildTargetIcons: []
m_BuildTargetPlatformIcons: []
m_BuildTargetBatching:
- m_BuildTarget: Standalone
m_StaticBatching: 1
m_DynamicBatching: 0
- m_BuildTarget: tvOS
m_StaticBatching: 1
m_DynamicBatching: 0
- m_BuildTarget: Android
m_StaticBatching: 1
m_DynamicBatching: 0
- m_BuildTarget: iPhone
m_StaticBatching: 1
m_DynamicBatching: 0
- m_BuildTarget: WebGL
m_StaticBatching: 0
m_DynamicBatching: 0
m_BuildTargetGraphicsJobs:
- m_BuildTarget: MacStandaloneSupport
m_GraphicsJobs: 0
- m_BuildTarget: Switch
m_GraphicsJobs: 1
- m_BuildTarget: MetroSupport
m_GraphicsJobs: 1
- m_BuildTarget: AppleTVSupport
m_GraphicsJobs: 0
- m_BuildTarget: BJMSupport
m_GraphicsJobs: 1
- m_BuildTarget: LinuxStandaloneSupport
m_GraphicsJobs: 1
- m_BuildTarget: PS4Player
m_GraphicsJobs: 1
- m_BuildTarget: iOSSupport
m_GraphicsJobs: 0
- m_BuildTarget: WindowsStandaloneSupport
m_GraphicsJobs: 1
- m_BuildTarget: XboxOnePlayer
m_GraphicsJobs: 1
- m_BuildTarget: LuminSupport
m_GraphicsJobs: 0
- m_BuildTarget: AndroidPlayer
m_GraphicsJobs: 0
- m_BuildTarget: WebGLSupport
m_GraphicsJobs: 0
m_BuildTargetGraphicsJobMode:
- m_BuildTarget: PS4Player
m_GraphicsJobMode: 0
- m_BuildTarget: XboxOnePlayer
m_GraphicsJobMode: 0
m_BuildTargetGraphicsAPIs:
- m_BuildTarget: AndroidPlayer
m_APIs: 150000000b000000
m_Automatic: 1
- m_BuildTarget: iOSSupport
m_APIs: 10000000
m_Automatic: 1
- m_BuildTarget: AppleTVSupport
m_APIs: 10000000
m_Automatic: 1
- m_BuildTarget: WebGLSupport
m_APIs: 0b000000
m_Automatic: 1
m_BuildTargetVRSettings:
- m_BuildTarget: Standalone
m_Enabled: 0
m_Devices:
- Oculus
- OpenVR
openGLRequireES31: 0
openGLRequireES31AEP: 0
openGLRequireES32: 0
m_TemplateCustomTags: {}
mobileMTRendering:
Android: 1
iPhone: 1
tvOS: 1
m_BuildTargetGroupLightmapEncodingQuality:
- m_BuildTarget: Android
m_EncodingQuality: 1
- m_BuildTarget: iPhone
m_EncodingQuality: 1
- m_BuildTarget: tvOS
m_EncodingQuality: 1
m_BuildTargetGroupLightmapSettings: []
m_BuildTargetNormalMapEncoding:
- m_BuildTarget: Android
m_Encoding: 1
- m_BuildTarget: iPhone
m_Encoding: 1
- m_BuildTarget: tvOS
m_Encoding: 1
m_BuildTargetDefaultTextureCompressionFormat:
- m_BuildTarget: Android
m_Format: 3
playModeTestRunnerEnabled: 0
runPlayModeTestAsEditModeTest: 0
actionOnDotNetUnhandledException: 1
enableInternalProfiler: 0
logObjCUncaughtExceptions: 1
enableCrashReportAPI: 0
cameraUsageDescription:
locationUsageDescription:
microphoneUsageDescription:
bluetoothUsageDescription:
switchNMETAOverride:
switchNetLibKey:
switchSocketMemoryPoolSize: 6144
switchSocketAllocatorPoolSize: 128
switchSocketConcurrencyLimit: 14
switchScreenResolutionBehavior: 2
switchUseCPUProfiler: 0
switchUseGOLDLinker: 0
switchLTOSetting: 0
switchApplicationID: 0x01004b9000490000
switchNSODependencies:
switchTitleNames_0:
switchTitleNames_1:
switchTitleNames_2:
switchTitleNames_3:
switchTitleNames_4:
switchTitleNames_5:
switchTitleNames_6:
switchTitleNames_7:
switchTitleNames_8:
switchTitleNames_9:
switchTitleNames_10:
switchTitleNames_11:
switchTitleNames_12:
switchTitleNames_13:
switchTitleNames_14:
switchTitleNames_15:
switchPublisherNames_0:
switchPublisherNames_1:
switchPublisherNames_2:
switchPublisherNames_3:
switchPublisherNames_4:
switchPublisherNames_5:
switchPublisherNames_6:
switchPublisherNames_7:
switchPublisherNames_8:
switchPublisherNames_9:
switchPublisherNames_10:
switchPublisherNames_11:
switchPublisherNames_12:
switchPublisherNames_13:
switchPublisherNames_14:
switchPublisherNames_15:
switchIcons_0: {fileID: 0}
switchIcons_1: {fileID: 0}
switchIcons_2: {fileID: 0}
switchIcons_3: {fileID: 0}
switchIcons_4: {fileID: 0}
switchIcons_5: {fileID: 0}
switchIcons_6: {fileID: 0}
switchIcons_7: {fileID: 0}
switchIcons_8: {fileID: 0}
switchIcons_9: {fileID: 0}
switchIcons_10: {fileID: 0}
switchIcons_11: {fileID: 0}
switchIcons_12: {fileID: 0}
switchIcons_13: {fileID: 0}
switchIcons_14: {fileID: 0}
switchIcons_15: {fileID: 0}
switchSmallIcons_0: {fileID: 0}
switchSmallIcons_1: {fileID: 0}
switchSmallIcons_2: {fileID: 0}
switchSmallIcons_3: {fileID: 0}
switchSmallIcons_4: {fileID: 0}
switchSmallIcons_5: {fileID: 0}
switchSmallIcons_6: {fileID: 0}
switchSmallIcons_7: {fileID: 0}
switchSmallIcons_8: {fileID: 0}
switchSmallIcons_9: {fileID: 0}
switchSmallIcons_10: {fileID: 0}
switchSmallIcons_11: {fileID: 0}
switchSmallIcons_12: {fileID: 0}
switchSmallIcons_13: {fileID: 0}
switchSmallIcons_14: {fileID: 0}
switchSmallIcons_15: {fileID: 0}
switchManualHTML:
switchAccessibleURLs:
switchLegalInformation:
switchMainThreadStackSize: 1048576
switchPresenceGroupId:
switchLogoHandling: 0
switchReleaseVersion: 0
switchDisplayVersion: 1.0.0
switchStartupUserAccount: 0
switchTouchScreenUsage: 0
switchSupportedLanguagesMask: 0
switchLogoType: 0
switchApplicationErrorCodeCategory:
switchUserAccountSaveDataSize: 0
switchUserAccountSaveDataJournalSize: 0
switchApplicationAttribute: 0
switchCardSpecSize: -1
switchCardSpecClock: -1
switchRatingsMask: 0
switchRatingsInt_0: 0
switchRatingsInt_1: 0
switchRatingsInt_2: 0
switchRatingsInt_3: 0
switchRatingsInt_4: 0
switchRatingsInt_5: 0
switchRatingsInt_6: 0
switchRatingsInt_7: 0
switchRatingsInt_8: 0
switchRatingsInt_9: 0
switchRatingsInt_10: 0
switchRatingsInt_11: 0
switchRatingsInt_12: 0
switchLocalCommunicationIds_0:
switchLocalCommunicationIds_1:
switchLocalCommunicationIds_2:
switchLocalCommunicationIds_3:
switchLocalCommunicationIds_4:
switchLocalCommunicationIds_5:
switchLocalCommunicationIds_6:
switchLocalCommunicationIds_7:
switchParentalControl: 0
switchAllowsScreenshot: 1
switchAllowsVideoCapturing: 1
switchAllowsRuntimeAddOnContentInstall: 0
switchDataLossConfirmation: 0
switchUserAccountLockEnabled: 0
switchSystemResourceMemory: 16777216
switchSupportedNpadStyles: 22
switchNativeFsCacheSize: 32
switchIsHoldTypeHorizontal: 0
switchSupportedNpadCount: 8
switchSocketConfigEnabled: 0
switchTcpInitialSendBufferSize: 32
switchTcpInitialReceiveBufferSize: 64
switchTcpAutoSendBufferSizeMax: 256
switchTcpAutoReceiveBufferSizeMax: 256
switchUdpSendBufferSize: 9
switchUdpReceiveBufferSize: 42
switchSocketBufferEfficiency: 4
switchSocketInitializeEnabled: 1
switchNetworkInterfaceManagerInitializeEnabled: 1
switchPlayerConnectionEnabled: 1
switchUseNewStyleFilepaths: 0
switchUseMicroSleepForYield: 1
switchEnableRamDiskSupport: 0
switchMicroSleepForYieldTime: 25
switchRamDiskSpaceSize: 12
ps4NPAgeRating: 12
ps4NPTitleSecret:
ps4NPTrophyPackPath:
ps4ParentalLevel: 11
ps4ContentID: ED1633-NPXX51362_00-0000000000000000
ps4Category: 0
ps4MasterVersion: 01.00
ps4AppVersion: 01.00
ps4AppType: 0
ps4ParamSfxPath:
ps4VideoOutPixelFormat: 0
ps4VideoOutInitialWidth: 1920
ps4VideoOutBaseModeInitialWidth: 1920
ps4VideoOutReprojectionRate: 60
ps4PronunciationXMLPath:
ps4PronunciationSIGPath:
ps4BackgroundImagePath:
ps4StartupImagePath:
ps4StartupImagesFolder:
ps4IconImagesFolder:
ps4SaveDataImagePath:
ps4SdkOverride:
ps4BGMPath:
ps4ShareFilePath:
ps4ShareOverlayImagePath:
ps4PrivacyGuardImagePath:
ps4ExtraSceSysFile:
ps4NPtitleDatPath:
ps4RemotePlayKeyAssignment: -1
ps4RemotePlayKeyMappingDir:
ps4PlayTogetherPlayerCount: 0
ps4EnterButtonAssignment: 1
ps4ApplicationParam1: 0
ps4ApplicationParam2: 0
ps4ApplicationParam3: 0
ps4ApplicationParam4: 0
ps4DownloadDataSize: 0
ps4GarlicHeapSize: 2048
ps4ProGarlicHeapSize: 2560
playerPrefsMaxSize: 32768
ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ
ps4pnSessions: 1
ps4pnPresence: 1
ps4pnFriends: 1
ps4pnGameCustomData: 1
playerPrefsSupport: 0
enableApplicationExit: 0
resetTempFolder: 1
restrictedAudioUsageRights: 0
ps4UseResolutionFallback: 0
ps4ReprojectionSupport: 0
ps4UseAudio3dBackend: 0
ps4UseLowGarlicFragmentationMode: 1
ps4SocialScreenEnabled: 0
ps4ScriptOptimizationLevel: 0
ps4Audio3dVirtualSpeakerCount: 14
ps4attribCpuUsage: 0
ps4PatchPkgPath:
ps4PatchLatestPkgPath:
ps4PatchChangeinfoPath:
ps4PatchDayOne: 0
ps4attribUserManagement: 0
ps4attribMoveSupport: 0
ps4attrib3DSupport: 0
ps4attribShareSupport: 0
ps4attribExclusiveVR: 0
ps4disableAutoHideSplash: 0
ps4videoRecordingFeaturesUsed: 0
ps4contentSearchFeaturesUsed: 0
ps4CompatibilityPS5: 0
ps4GPU800MHz: 1
ps4attribEyeToEyeDistanceSettingVR: 0
ps4IncludedModules: []
ps4attribVROutputEnabled: 0
monoEnv:
splashScreenBackgroundSourceLandscape: {fileID: 0}
splashScreenBackgroundSourcePortrait: {fileID: 0}
blurSplashScreenBackground: 1
spritePackerPolicy:
webGLMemorySize: 16
webGLExceptionSupport: 1
webGLNameFilesAsHashes: 0
webGLDataCaching: 1
webGLDebugSymbols: 0
webGLEmscriptenArgs:
webGLModulesDirectory:
webGLTemplate: APPLICATION:Default
webGLAnalyzeBuildSize: 0
webGLUseEmbeddedResources: 0
webGLCompressionFormat: 1
webGLWasmArithmeticExceptions: 0
webGLLinkerTarget: 1
webGLThreadsSupport: 0
webGLDecompressionFallback: 0
scriptingDefineSymbols: {}
additionalCompilerArguments: {}
platformArchitecture: {}
scriptingBackend: {}
il2cppCompilerConfiguration: {}
managedStrippingLevel: {}
incrementalIl2cppBuild: {}
suppressCommonWarnings: 1
allowUnsafeCode: 0
useDeterministicCompilation: 1
enableRoslynAnalyzers: 1
additionalIl2CppArgs:
scriptingRuntimeVersion: 1
gcIncremental: 1
assemblyVersionValidation: 1
gcWBarrierValidation: 0
apiCompatibilityLevelPerPlatform: {}
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: Template_3D
metroPackageVersion:
metroCertificatePath:
metroCertificatePassword:
metroCertificateSubject:
metroCertificateIssuer:
metroCertificateNotAfter: 0000000000000000
metroApplicationDescription: Template_3D
wsaImages: {}
metroTileShortName:
metroTileShowName: 0
metroMediumTileShowName: 0
metroLargeTileShowName: 0
metroWideTileShowName: 0
metroSupportStreamingInstall: 0
metroLastRequiredScene: 0
metroDefaultTileSize: 1
metroTileForegroundText: 2
metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}
metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1}
metroSplashScreenUseBackgroundColor: 0
platformCapabilities: {}
metroTargetDeviceFamilies: {}
metroFTAName:
metroFTAFileTypes: []
metroProtocolName:
vcxProjDefaultLanguage:
XboxOneProductId:
XboxOneUpdateKey:
XboxOneSandboxId:
XboxOneContentId:
XboxOneTitleId:
XboxOneSCId:
XboxOneGameOsOverridePath:
XboxOnePackagingOverridePath:
XboxOneAppManifestOverridePath:
XboxOneVersion: 1.0.0.0
XboxOnePackageEncryption: 0
XboxOnePackageUpdateGranularity: 2
XboxOneDescription:
XboxOneLanguage:
- enus
XboxOneCapability: []
XboxOneGameRating: {}
XboxOneIsContentPackage: 0
XboxOneEnhancedXboxCompatibilityMode: 0
XboxOneEnableGPUVariability: 1
XboxOneSockets: {}
XboxOneSplashScreen: {fileID: 0}
XboxOneAllowedProductIds: []
XboxOnePersistentLocalStorageSize: 0
XboxOneXTitleMemory: 8
XboxOneOverrideIdentityName:
XboxOneOverrideIdentityPublisher:
vrEditorSettings: {}
cloudServicesEnabled:
UNet: 1
luminIcon:
m_Name:
m_ModelFolderPath:
m_PortalFolderPath:
luminCert:
m_CertPath:
m_SignPackage: 1
luminIsChannelApp: 0
luminVersion:
m_VersionCode: 1
m_VersionName:
apiCompatibilityLevel: 6
activeInputHandler: 0
cloudProjectId:
framebufferDepthMemorylessMode: 0
qualitySettingsNames: []
projectName:
organizationId:
cloudEnabled: 0
legacyClampBlendShapeWeights: 0
playerDataPath:
forceSRGBBlit: 1
virtualTexturingSupportEnabled: 0

View File

@ -0,0 +1,2 @@
m_EditorVersion: 2021.3.2f1
m_EditorVersionWithRevision: 2021.3.2f1 (d6360bedb9a0)

View File

@ -0,0 +1,232 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!47 &1
QualitySettings:
m_ObjectHideFlags: 0
serializedVersion: 5
m_CurrentQuality: 5
m_QualitySettings:
- serializedVersion: 2
name: Very Low
pixelLightCount: 0
shadows: 0
shadowResolution: 0
shadowProjection: 1
shadowCascades: 1
shadowDistance: 15
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 0
blendWeights: 1
textureQuality: 1
anisotropicTextures: 0
antiAliasing: 0
softParticles: 0
softVegetation: 0
realtimeReflectionProbes: 0
billboardsFaceCameraPosition: 0
vSyncCount: 0
lodBias: 0.3
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 4
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2
name: Low
pixelLightCount: 0
shadows: 0
shadowResolution: 0
shadowProjection: 1
shadowCascades: 1
shadowDistance: 20
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 0
blendWeights: 2
textureQuality: 0
anisotropicTextures: 0
antiAliasing: 0
softParticles: 0
softVegetation: 0
realtimeReflectionProbes: 0
billboardsFaceCameraPosition: 0
vSyncCount: 0
lodBias: 0.4
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 16
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2
name: Medium
pixelLightCount: 1
shadows: 1
shadowResolution: 0
shadowProjection: 1
shadowCascades: 1
shadowDistance: 20
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 0
blendWeights: 2
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 0
softParticles: 0
softVegetation: 0
realtimeReflectionProbes: 0
billboardsFaceCameraPosition: 0
vSyncCount: 1
lodBias: 0.7
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 64
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2
name: High
pixelLightCount: 2
shadows: 2
shadowResolution: 1
shadowProjection: 1
shadowCascades: 2
shadowDistance: 40
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 1
blendWeights: 2
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 0
softParticles: 0
softVegetation: 1
realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1
vSyncCount: 1
lodBias: 1
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 256
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2
name: Very High
pixelLightCount: 3
shadows: 2
shadowResolution: 2
shadowProjection: 1
shadowCascades: 2
shadowDistance: 70
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 1
blendWeights: 4
textureQuality: 0
anisotropicTextures: 2
antiAliasing: 2
softParticles: 1
softVegetation: 1
realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1
vSyncCount: 1
lodBias: 1.5
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 1024
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2
name: Ultra
pixelLightCount: 4
shadows: 2
shadowResolution: 2
shadowProjection: 1
shadowCascades: 4
shadowDistance: 150
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 1
blendWeights: 4
textureQuality: 0
anisotropicTextures: 2
antiAliasing: 2
softParticles: 1
softVegetation: 1
realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1
vSyncCount: 1
lodBias: 2
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 4096
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
m_PerPlatformDefaultQuality:
Android: 2
Lumin: 5
Nintendo 3DS: 5
Nintendo Switch: 5
PS4: 5
PSP2: 2
Stadia: 5
Standalone: 5
WebGL: 3
Windows Store Apps: 5
XboxOne: 5
iPhone: 2
tvOS: 2

View File

@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 61
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 0}
m_Name:
m_EditorClassIdentifier: Unity.Rider.Editor:Packages.Rider.Editor:RiderScriptEditorPersistedState
lastWriteTicks: -8585496032972088364

View File

@ -0,0 +1,167 @@
{
"templatePinStates": [],
"dependencyTypeInfos": [
{
"userAdded": false,
"type": "UnityEngine.AnimationClip",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEditor.Animations.AnimatorController",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.AnimatorOverrideController",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEditor.Audio.AudioMixerController",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.ComputeShader",
"ignore": true,
"defaultInstantiationMode": 1,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Cubemap",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.GameObject",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEditor.LightingDataAsset",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": false
},
{
"userAdded": false,
"type": "UnityEngine.LightingSettings",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Material",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEditor.MonoScript",
"ignore": true,
"defaultInstantiationMode": 1,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.PhysicMaterial",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.PhysicsMaterial2D",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Rendering.PostProcessing.PostProcessResources",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Rendering.VolumeProfile",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEditor.SceneAsset",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": false
},
{
"userAdded": false,
"type": "UnityEngine.Shader",
"ignore": true,
"defaultInstantiationMode": 1,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.ShaderVariantCollection",
"ignore": true,
"defaultInstantiationMode": 1,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Texture",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Texture2D",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Timeline.TimelineAsset",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
}
],
"defaultDependencyTypeInfo": {
"userAdded": false,
"type": "<default_scene_template_dependencies>",
"ignore": false,
"defaultInstantiationMode": 1,
"supportsModification": true
},
"newSceneOverride": 0
}

View File

@ -0,0 +1,43 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!78 &1
TagManager:
serializedVersion: 2
tags: []
layers:
- Default
- TransparentFX
- Ignore Raycast
-
- Water
- UI
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
m_SortingLayers:
- name: Default
uniqueID: 0
locked: 0

View File

@ -0,0 +1,9 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!5 &1
TimeManager:
m_ObjectHideFlags: 0
Fixed Timestep: 0.02
Maximum Allowed Timestep: 0.33333334
m_TimeScale: 1
Maximum Particle Timestep: 0.03

View File

@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!310 &1
UnityConnectSettings:
m_ObjectHideFlags: 0
serializedVersion: 1
m_Enabled: 0
m_TestMode: 0
m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
m_EventUrl: https://cdp.cloud.unity3d.com/v1/events
m_ConfigUrl: https://config.uca.cloud.unity3d.com
m_DashboardUrl: https://dashboard.unity3d.com
m_TestInitMode: 0
CrashReportingSettings:
m_EventUrl: https://perf-events.cloud.unity3d.com
m_Enabled: 0
m_LogBufferSize: 10
m_CaptureEditorExceptions: 1
UnityPurchasingSettings:
m_Enabled: 0
m_TestMode: 0
UnityAnalyticsSettings:
m_Enabled: 0
m_TestMode: 0
m_InitializeOnStartup: 1
UnityAdsSettings:
m_Enabled: 0
m_InitializeOnStartup: 1
m_TestMode: 0
m_IosGameId:
m_AndroidGameId:
m_GameIds: {}
m_GameId:
PerformanceReportingSettings:
m_Enabled: 0

View File

@ -0,0 +1,12 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!937362698 &1
VFXManager:
m_ObjectHideFlags: 0
m_IndirectShader: {fileID: 0}
m_CopyBufferShader: {fileID: 0}
m_SortShader: {fileID: 0}
m_StripUpdateShader: {fileID: 0}
m_RenderPipeSettingsPath:
m_FixedTimeStep: 0.016666668
m_MaxDeltaTime: 0.05

View File

@ -0,0 +1,8 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!890905787 &1
VersionControlSettings:
m_ObjectHideFlags: 0
m_Mode: Visible Meta Files
m_CollabEditorSettings:
inProgressEnabled: 1

View File

@ -0,0 +1,10 @@
{
"m_SettingKeys": [
"VR Device Disabled",
"VR Device User Alert"
],
"m_SettingValues": [
"False",
"False"
]
}

View File

@ -0,0 +1,65 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>10.0</LangVersion>
<Optimize>true</Optimize>
<ImplicitUsings>true</ImplicitUsings>
<Authors>Oliver Booth</Authors>
<NeutralLanguage>en</NeutralLanguage>
<RepositoryUrl>https://github.com/oliverbooth/X10D</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Description>Extension methods on crack.</Description>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>icon.png</PackageIcon>
<PackageIconUrl/>
<PackageTags>dotnet extension-methods</PackageTags>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<VersionPrefix>3.1.0</VersionPrefix>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(VersionSuffix)' != '' And '$(BuildNumber)' == ''">
<Version>$(VersionPrefix)-$(VersionSuffix)</Version>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<FileVersion>$(VersionPrefix).0</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(VersionSuffix)' != '' And '$(BuildNumber)' != ''">
<Version>$(VersionPrefix)-$(VersionSuffix).$(BuildNumber)</Version>
<AssemblyVersion>$(VersionPrefix).$(BuildNumber)</AssemblyVersion>
<FileVersion>$(VersionPrefix).$(BuildNumber)</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(VersionSuffix)' == ''">
<Version>$(VersionPrefix)</Version>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<FileVersion>$(VersionPrefix).0</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Unity3D.SDK" Version="2021.1.14.1" PrivateAssets="All"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\X10D\X10D.csproj"/>
</ItemGroup>
<ItemGroup>
<None Include="..\icon.png">
<Pack>True</Pack>
<PackagePath/>
</None>
<None Include="..\LICENSE.md">
<Pack>True</Pack>
<PackagePath/>
</None>
<None Include="..\CHANGELOG.md">
<Pack>True</Pack>
<PackagePath/>
</None>
</ItemGroup>
</Project>

View File

@ -0,0 +1,21 @@
using UnityEngine;
namespace X10D.Unity;
/// <summary>
/// Extension methods for <see cref="Component" />.
/// </summary>
public static class ComponentExtensions
{
/// <summary>
/// Returns an array of components of the specified type, excluding components that live on the object to which this
/// component is attached.
/// </summary>
/// <param name="component">The component whose child components to retrieve.</param>
/// <typeparam name="T">The type of the components to retrieve.</typeparam>
/// <returns>An array <typeparamref name="T" /> representing the child components.</returns>
public static T[] GetComponentsInChildrenOnly<T>(this Component component)
{
return component.gameObject.GetComponentsInChildrenOnly<T>();
}
}

View File

@ -0,0 +1,95 @@
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using UnityEngine;
namespace X10D.Unity.Drawing;
/// <summary>
/// Drawing-related extensions for <see cref="Color32" />.
/// </summary>
public static class Color32Extensions
{
/// <summary>
/// Returns a new <see cref="Color32" /> with the red, green, and blue components inverted. Alpha is not affected.
/// </summary>
/// <param name="color">The color to invert.</param>
/// <returns>The inverted color.</returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Color32 Inverted(this Color32 color)
{
return new Color32((byte)(255 - color.r), (byte)(255 - color.g), (byte)(255 - color.b), color.a);
}
/// <summary>
/// Returns a vector whose red, green, and blue components are the same as the specified color, and whose alpha component
/// is a new value.
/// </summary>
/// <param name="color">The color to copy.</param>
/// <param name="a">The new alpha component value.</param>
/// <returns>
/// A new instance of <see cref="Color" /> whose <see cref="Color32.r" />, <see cref="Color32.g" />, and
/// <see cref="Color32.b" /> components are the same as that of <paramref name="color" />, and whose
/// <see cref="Color32.a" /> component is <paramref name="a" />.
/// </returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Color32 WithA(this Color32 color, byte a)
{
return color with {a = a};
}
/// <summary>
/// Returns a vector whose red, green, and alpha components are the same as the specified color, and whose blue component
/// is a new value.
/// </summary>
/// <param name="color">The color to copy.</param>
/// <param name="b">The new blue component value.</param>
/// <returns>
/// A new instance of <see cref="Color" /> whose <see cref="Color32.r" />, <see cref="Color32.g" />, and
/// <see cref="Color32.a" /> components are the same as that of <paramref name="color" />, and whose
/// <see cref="Color32.b" /> component is <paramref name="b" />.
/// </returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Color32 WithB(this Color32 color, byte b)
{
return color with {b = b};
}
/// <summary>
/// Returns a vector whose red, blue, and alpha components are the same as the specified color, and whose green component
/// is a new value.
/// </summary>
/// <param name="color">The color to copy.</param>
/// <param name="g">The new green component value.</param>
/// <returns>
/// A new instance of <see cref="Color32" /> whose <see cref="Color32.r" />, <see cref="Color32.g" />, and
/// <see cref="Color32.b" /> components are the same as that of <paramref name="color" />, and whose
/// <see cref="Color32.g" /> component is <paramref name="g" />.
/// </returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Color32 WithG(this Color32 color, byte g)
{
return color with {g = g};
}
/// <summary>
/// Returns a vector whose green, blue, and alpha components are the same as the specified color, and whose red component
/// is a new value.
/// </summary>
/// <param name="color">The color to copy.</param>
/// <param name="r">The new red component value.</param>
/// <returns>
/// A new instance of <see cref="Color32" /> whose <see cref="Color32.g" />, <see cref="Color32.b" />, and
/// <see cref="Color32.a" /> components are the same as that of <paramref name="color" />, and whose
/// <see cref="Color32.r" /> component is <paramref name="r" />.
/// </returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Color32 WithR(this Color32 color, byte r)
{
return color with {r = r};
}
}

View File

@ -0,0 +1,95 @@
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using UnityEngine;
namespace X10D.Unity.Drawing;
/// <summary>
/// Drawing-related extensions for <see cref="Color" />.
/// </summary>
public static class ColorExtensions
{
/// <summary>
/// Returns a new <see cref="Color" /> with the red, green, and blue components inverted. Alpha is not affected.
/// </summary>
/// <param name="color">The color to invert.</param>
/// <returns>The inverted color.</returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Color Inverted(this Color color)
{
return new Color(1f - color.r, 1f - color.g, 1f - color.b, color.a);
}
/// <summary>
/// Returns a vector whose red, green, and blue components are the same as the specified color, and whose alpha component
/// is a new value.
/// </summary>
/// <param name="color">The color to copy.</param>
/// <param name="a">The new alpha component value.</param>
/// <returns>
/// A new instance of <see cref="Color" /> whose <see cref="Color.r" />, <see cref="Color.g" />, and
/// <see cref="Color.b" /> components are the same as that of <paramref name="color" />, and whose
/// <see cref="Color.a" /> component is <paramref name="a" />.
/// </returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Color WithA(this Color color, float a)
{
return color with {a = a};
}
/// <summary>
/// Returns a vector whose red, green, and alpha components are the same as the specified color, and whose blue component
/// is a new value.
/// </summary>
/// <param name="color">The color to copy.</param>
/// <param name="b">The new blue component value.</param>
/// <returns>
/// A new instance of <see cref="Color" /> whose <see cref="Color.r" />, <see cref="Color.g" />, and
/// <see cref="Color.a" /> components are the same as that of <paramref name="color" />, and whose
/// <see cref="Color.b" /> component is <paramref name="b" />.
/// </returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Color WithB(this Color color, float b)
{
return color with {b = b};
}
/// <summary>
/// Returns a vector whose red, blue, and alpha components are the same as the specified color, and whose green component
/// is a new value.
/// </summary>
/// <param name="color">The color to copy.</param>
/// <param name="g">The new green component value.</param>
/// <returns>
/// A new instance of <see cref="Color" /> whose <see cref="Color.r" />, <see cref="Color.b" />, and
/// <see cref="Color.a" /> components are the same as that of <paramref name="color" />, and whose
/// <see cref="Color.g" /> component is <paramref name="g" />.
/// </returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Color WithG(this Color color, float g)
{
return color with {g = g};
}
/// <summary>
/// Returns a vector whose green, blue, and alpha components are the same as the specified color, and whose red component
/// is a new value.
/// </summary>
/// <param name="color">The color to copy.</param>
/// <param name="r">The new red component value.</param>
/// <returns>
/// A new instance of <see cref="Color" /> whose <see cref="Color.g" />, <see cref="Color.b" />, and
/// <see cref="Color.a" /> components are the same as that of <paramref name="color" />, and whose
/// <see cref="Color.r" /> component is <paramref name="r" />.
/// </returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Color WithR(this Color color, float r)
{
return color with {r = r};
}
}

View File

@ -0,0 +1,95 @@
using UnityEngine;
using X10D.Core;
using Random = System.Random;
namespace X10D.Unity.Drawing;
/// <summary>
/// Extension methods for <see cref="System.Random" />.
/// </summary>
public static class RandomExtensions
{
/// <summary>
/// Returns an HDR color of random components for red, green, and blue.
/// </summary>
/// <param name="random">The <see cref="System.Random" /> instance.</param>
/// <returns>A <see cref="Color" /> whose red, green, and blue components are all random, and whose alpha is 255</returns>
/// <exception cref="ArgumentNullException"><paramref name="random" /> is <see langword="null" />.</exception>
public static Color NextColorRgb(this Random random)
{
if (random is null)
{
throw new ArgumentNullException(nameof(random));
}
int seed = random.Next();
var seededRandom = new Random(seed);
float r = seededRandom.NextSingle();
float g = seededRandom.NextSingle();
float b = seededRandom.NextSingle();
return new Color(r, g, b, 1.0f);
}
/// <summary>
/// Returns an HDR color composed of random components for apha, red, green, and blue.
/// </summary>
/// <param name="random">The <see cref="System.Random" /> instance.</param>
/// <returns>A <see cref="Color" /> whose alpha, red, green, and blue components are all random.</returns>
/// <exception cref="ArgumentNullException"><paramref name="random" /> is <see langword="null" />.</exception>
public static Color NextColorArgb(this Random random)
{
if (random is null)
{
throw new ArgumentNullException(nameof(random));
}
int seed = random.Next();
var seededRandom = new Random(seed);
float a = seededRandom.NextSingle();
float r = seededRandom.NextSingle();
float g = seededRandom.NextSingle();
float b = seededRandom.NextSingle();
return new Color(r, g, b, a);
}
/// <summary>
/// Returns a color of random components for red, green, and blue.
/// </summary>
/// <param name="random">The <see cref="System.Random" /> instance.</param>
/// <returns>A <see cref="Color" /> whose red, green, and blue components are all random, and whose alpha is 255</returns>
/// <exception cref="ArgumentNullException"><paramref name="random" /> is <see langword="null" />.</exception>
public static Color32 NextColor32Rgb(this Random random)
{
if (random is null)
{
throw new ArgumentNullException(nameof(random));
}
int rgb = random.Next();
var r = (byte)(rgb >> 16 & 0xFF);
var g = (byte)(rgb >> 8 & 0xFF);
var b = (byte)(rgb & 0xFF);
return new Color32(r, g, b, 0xFF);
}
/// <summary>
/// Returns a color composed of random components for apha, red, green, and blue.
/// </summary>
/// <param name="random">The <see cref="System.Random" /> instance.</param>
/// <returns>A <see cref="Color" /> whose alpha, red, green, and blue components are all random.</returns>
/// <exception cref="ArgumentNullException"><paramref name="random" /> is <see langword="null" />.</exception>
public static Color32 NextColor32Argb(this Random random)
{
if (random is null)
{
throw new ArgumentNullException(nameof(random));
}
int argb = random.Next();
var a = (byte)(argb >> 24 & 0xFF);
var r = (byte)(argb >> 16 & 0xFF);
var g = (byte)(argb >> 8 & 0xFF);
var b = (byte)(argb & 0xFF);
return new Color32(r, g, b, a);
}
}

View File

@ -0,0 +1,317 @@
using UnityEngine;
namespace X10D.Unity;
/// <summary>
/// Extension methods for <see cref="GameObject" />.
/// </summary>
public static class GameObjectExtensions
{
/// <summary>
/// Returns an array of components of the specified type, excluding components that live on this game object.
/// </summary>
/// <param name="gameObject">The game object whose child components to retrieve.</param>
/// <typeparam name="T">The type of the components to retrieve.</typeparam>
/// <returns>An array <typeparamref name="T" /> representing the child components.</returns>
public static T[] GetComponentsInChildrenOnly<T>(this GameObject gameObject)
{
var components = new List<T>(gameObject.GetComponentsInChildren<T>());
for (var index = 0; index < components.Count; index++)
{
if (components[index] is not Component childComponent)
{
// this shouldn't happen, since you can't add a non-Component to a game object,
// but GetComponentsInChildren<T> is not constrained, so this method shouldn't be either
continue;
}
if (childComponent.transform.parent != gameObject.transform)
{
components.RemoveAt(index);
index--;
}
}
return components.ToArray();
}
/// <summary>
/// Rotates the transform component of this game object so the forward vector points at another game object.
/// </summary>
/// <param name="gameObject">The game object whose rotation will be changed.</param>
/// <param name="target">The game object to look at.</param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="gameObject" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="target" /> is <see langword="null" />.</para>
/// </exception>
public static void LookAt(this GameObject gameObject, GameObject target)
{
if (gameObject == null)
{
throw new ArgumentNullException(nameof(gameObject));
}
if (target == null)
{
throw new ArgumentNullException(nameof(target));
}
gameObject.transform.LookAt(target.transform);
}
/// <summary>
/// Rotates the transform component of this game object so the forward vector points at <paramref name="target" />.
/// </summary>
/// <param name="gameObject">The game object whose rotation will be changed.</param>
/// <param name="target">The point to look at.</param>
/// <exception cref="ArgumentNullException"><paramref name="gameObject" /> is <see langword="null" />.</exception>
public static void LookAt(this GameObject gameObject, Vector3 target)
{
if (gameObject == null)
{
throw new ArgumentNullException(nameof(gameObject));
}
gameObject.transform.LookAt(target);
}
/// <summary>
/// Rotates the transform component of this game object so the forward vector points at a specified transform.
/// </summary>
/// <param name="gameObject">The game object whose rotation will be changed.</param>
/// <param name="target">The transform to look at.</param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="gameObject" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="target" /> is <see langword="null" />.</para>
/// </exception>
public static void LookAt(this GameObject gameObject, Transform target)
{
if (gameObject == null)
{
throw new ArgumentNullException(nameof(gameObject));
}
if (target == null)
{
throw new ArgumentNullException(nameof(target));
}
gameObject.transform.LookAt(target);
}
/// <summary>
/// Rotates the transform component of this game object so the forward vector points at another game object.
/// </summary>
/// <param name="gameObject">The game object whose rotation will be changed.</param>
/// <param name="target">The game object to look at.</param>
/// <param name="worldUp">A vector specifying the upward direction.</param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="gameObject" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="target" /> is <see langword="null" />.</para>
/// </exception>
public static void LookAt(this GameObject gameObject, GameObject target, Vector3 worldUp)
{
if (gameObject == null)
{
throw new ArgumentNullException(nameof(gameObject));
}
if (target == null)
{
throw new ArgumentNullException(nameof(target));
}
gameObject.transform.LookAt(target.transform, worldUp);
}
/// <summary>
/// Rotates the transform component of this game object so the forward vector points at <paramref name="target" />.
/// </summary>
/// <param name="gameObject">The game object whose rotation will be changed.</param>
/// <param name="target">The point to look at.</param>
/// <param name="worldUp">A vector specifying the upward direction.</param>
/// <exception cref="ArgumentNullException"><paramref name="gameObject" /> is <see langword="null" />.</exception>
public static void LookAt(this GameObject gameObject, Vector3 target, Vector3 worldUp)
{
if (gameObject == null)
{
throw new ArgumentNullException(nameof(gameObject));
}
gameObject.transform.LookAt(target, worldUp);
}
/// <summary>
/// Rotates the transform component of this game object so the forward vector points at a specified transform.
/// </summary>
/// <param name="gameObject">The game object whose rotation will be changed.</param>
/// <param name="target">The transform to look at.</param>
/// <param name="worldUp">A vector specifying the upward direction.</param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="gameObject" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="target" /> is <see langword="null" />.</para>
/// </exception>
public static void LookAt(this GameObject gameObject, Transform target, Vector3 worldUp)
{
if (gameObject == null)
{
throw new ArgumentNullException(nameof(gameObject));
}
if (target == null)
{
throw new ArgumentNullException(nameof(target));
}
gameObject.transform.LookAt(target, worldUp);
}
/// <summary>
/// Sets the new layer of this game object and its children, recursively.
/// </summary>
/// <param name="gameObject">The game object whose layer, and that of its children recursively, to change.</param>
/// <param name="layer">The new layer.</param>
/// <exception cref="ArgumentNullException"><paramref name="gameObject" /> is <see langword="null" />.</exception>
public static void SetLayerRecursively(this GameObject gameObject, int layer)
{
if (gameObject == null)
{
throw new ArgumentNullException(nameof(gameObject));
}
var children = new Stack<Transform>();
var transform = gameObject.transform;
children.Push(transform);
while (children.Count > 0)
{
Transform child = children.Pop();
int childCount = child.childCount;
child.gameObject.layer = layer;
if (childCount <= 0)
{
continue;
}
for (var childIndex = 0; childIndex < childCount; childIndex++)
{
children.Push(child.GetChild(childIndex));
}
}
}
/// <summary>
/// Sets the parent of this game object.
/// </summary>
/// <param name="gameObject">The game object whose parent to change.</param>
/// <param name="parent">The new parent.</param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="gameObject" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="parent" /> is <see langword="null" />.</para>
/// </exception>
public static void SetParent(this GameObject gameObject, GameObject parent)
{
if (gameObject == null)
{
throw new ArgumentNullException(nameof(gameObject));
}
if (parent == null)
{
throw new ArgumentNullException(nameof(parent));
}
gameObject.transform.SetParent(parent.transform);
}
/// <summary>
/// Sets the parent of this game object.
/// </summary>
/// <param name="gameObject">The game object whose parent to change.</param>
/// <param name="parent">The new parent.</param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="gameObject" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="parent" /> is <see langword="null" />.</para>
/// </exception>
public static void SetParent(this GameObject gameObject, Transform parent)
{
if (gameObject == null)
{
throw new ArgumentNullException(nameof(gameObject));
}
if (parent == null)
{
throw new ArgumentNullException(nameof(parent));
}
gameObject.transform.SetParent(parent);
}
/// <summary>
/// Sets the parent of this game object.
/// </summary>
/// <param name="gameObject">The game object whose parent to change.</param>
/// <param name="parent">The new parent.</param>
/// <param name="worldPositionStays">
/// <see langword="true" /> to modify the parent-relative position, scale and rotation such that the object keeps the same
/// world space position, rotation and scale as before; otherwise, <see langword="false" />.
/// </param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="gameObject" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="parent" /> is <see langword="null" />.</para>
/// </exception>
public static void SetParent(this GameObject gameObject, GameObject parent, bool worldPositionStays)
{
if (gameObject == null)
{
throw new ArgumentNullException(nameof(gameObject));
}
if (parent == null)
{
throw new ArgumentNullException(nameof(parent));
}
gameObject.transform.SetParent(parent.transform, worldPositionStays);
}
/// <summary>
/// Sets the parent of this game object.
/// </summary>
/// <param name="gameObject">The game object whose parent to change.</param>
/// <param name="parent">The new parent.</param>
/// <param name="worldPositionStays">
/// <see langword="true" /> to modify the parent-relative position, scale and rotation such that the object keeps the same
/// world space position, rotation and scale as before; otherwise, <see langword="false" />.
/// </param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="gameObject" /> is <see langword="null" />.</para>
/// -or-
/// <para><paramref name="parent" /> is <see langword="null" />.</para>
/// </exception>
public static void SetParent(this GameObject gameObject, Transform parent, bool worldPositionStays)
{
if (gameObject == null)
{
throw new ArgumentNullException(nameof(gameObject));
}
if (parent == null)
{
throw new ArgumentNullException(nameof(parent));
}
gameObject.transform.SetParent(parent, worldPositionStays);
}
}

View File

@ -0,0 +1,35 @@
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using UnityEngine;
namespace X10D.Unity.Numerics;
/// <summary>
/// Numeric-extensions for <see cref="Quaternion" />.
/// </summary>
public static class QuaternionExtensions
{
/// <summary>
/// Converts the current quaternion to a <see cref="System.Numerics.Quaternion" />.
/// </summary>
/// <param name="quaternion">The quaternion to convert.</param>
/// <returns>The converted quaternion.</returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static System.Numerics.Quaternion ToSystemQuaternion(this Quaternion quaternion)
{
return new System.Numerics.Quaternion(quaternion.x, quaternion.y, quaternion.z, quaternion.w);
}
/// <summary>
/// Converts the current quaternion to a <see cref="Quaternion" />.
/// </summary>
/// <param name="quaternion">The quaternion to convert.</param>
/// <returns>The converted quaternion.</returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Quaternion ToUnityQuaternion(this System.Numerics.Quaternion quaternion)
{
return new Quaternion(quaternion.X, quaternion.Y, quaternion.Z, quaternion.W);
}
}

Some files were not shown because too many files have changed in this diff Show More