Remove X10D.Unity project from repo

This commit is contained in:
Oliver Booth 2022-02-14 16:50:07 +00:00
parent 191cbbe97c
commit f9b4c56f05
4 changed files with 0 additions and 276 deletions

View File

@ -1,63 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<Authors>Oliver Booth</Authors>
<NeutralLanguage>en</NeutralLanguage>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<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 unity</PackageTags>
<Version>2.6.0</Version>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<PackageVersion>2.6.0</PackageVersion>
<AssemblyVersion>2.6.0</AssemblyVersion>
<FileVersion>2.6.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<None Include="..\icon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="..\LICENSE.md">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Unity3D.SDK" Version="2020.3.12.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\X10D\X10D.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Resource.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resource.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resource.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@ -1,64 +0,0 @@
using System;
using JetBrains.Annotations;
using UnityEngine;
namespace X10D.Unity
{
/// <summary>
/// Extension methods for <see cref="GameObject" />.
/// </summary>
public static class GameObjectExtensions
{
/// <summary>
/// Rotates the <see cref="Transform" /> component on the current <see cref="GameObject" /> such that is is facing another
/// <see cref="GameObject" />.
/// </summary>
/// <param name="gameObject">The current game object.</param>
/// <param name="other">The target.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="gameObject" /> is null
/// - or -
/// <paramref name="other" /> is null.
/// </exception>
public static void LookAt([NotNull] this GameObject gameObject, [NotNull] GameObject other)
{
if (gameObject is null)
{
throw new ArgumentNullException(nameof(gameObject));
}
if (other is null)
{
throw new ArgumentNullException(nameof(other));
}
gameObject.LookAt(other.transform);
}
/// <summary>
/// Rotates the <see cref="Transform" /> component on the current <see cref="GameObject" /> such that is is facing another
/// <see cref="Transform" />.
/// </summary>
/// <param name="gameObject">The current game object.</param>
/// <param name="other">The target.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="gameObject" /> is null
/// - or -
/// <paramref name="other" /> is null.
/// </exception>
public static void LookAt([NotNull] this GameObject gameObject, [NotNull] Transform other)
{
if (gameObject is null)
{
throw new ArgumentNullException(nameof(gameObject));
}
if (other is null)
{
throw new ArgumentNullException(nameof(other));
}
gameObject.transform.LookAt(other);
}
}
}

View File

@ -1,37 +0,0 @@
namespace X10D.Unity
{
using System;
using JetBrains.Annotations;
using UnityEngine;
/// <summary>
/// Extension methods for <see cref="Transform" />.
/// </summary>
public static class TransformExtensions
{
/// <summary>
/// Rotates the current <see cref="Transform" /> such that is is facing another <see cref="GameObject" />.
/// </summary>
/// <param name="transform">The current transform.</param>
/// <param name="other">The target.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="transform" /> is null
/// - or -
/// <paramref name="other" /> is null.
/// </exception>
public static void LookAt([NotNull] this Transform transform, [NotNull] GameObject other)
{
if (transform is null)
{
throw new ArgumentNullException(nameof(transform));
}
if (other is null)
{
throw new ArgumentNullException(nameof(other));
}
transform.LookAt(other.transform);
}
}
}

View File

@ -1,112 +0,0 @@
using UnityEngine;
namespace X10D.Unity
{
/// <summary>
/// Extension methods for <see cref="Vector3" />.
/// </summary>
public static class Vector3Extensions
{
/// <summary>
/// Rounds a <see cref="Vector3" /> by calling <see cref="SingleExtensions.Round" /> on each of the components.
/// </summary>
/// <param name="vector">The vector to round.</param>
/// <param name="nearest">The nearest value.</param>
/// <returns><paramref name="vector" /> rounded to the nearest <paramref name="nearest" />.</returns>
public static Vector3 Round(this Vector3 vector, float nearest = 1)
{
return new Vector3(vector.x.Round(nearest), vector.y.Round(nearest), vector.z.Round(nearest));
}
/// <summary>
/// Returns a vector whose Y and Z components match that of a provided vector, and sets the X component to a provided value.
/// </summary>
/// <param name="vector">The input vector.</param>
/// <param name="x">The new X value.</param>
/// <returns>
/// Returns a <see cref="Vector3" /> whose Y and Z components match that of <paramref name="vector" />,
/// but with the <see cref="Vector3.x" /> component set to <paramref name="x" />.
/// </returns>
public static Vector3 WithX(this Vector3 vector, float x)
{
return new Vector3(x, vector.y, vector.z);
}
/// <summary>
/// Returns a vector whose Z component matches that of a provided vector, and sets the X and Y components to provided values.
/// </summary>
/// <param name="vector">The input vector.</param>
/// <param name="x">The new X value.</param>
/// <param name="y">The new Y value.</param>
/// <returns>
/// Returns a <see cref="Vector3" /> whose Z component matches that of <paramref name="vector" />,
/// but with the <see cref="Vector3.x" /> and <see cref="Vector3.y" /> components set to <paramref name="x" /> and
/// <paramref name="y" /> respectively.
/// </returns>
public static Vector3 WithXY(this Vector3 vector, float x, float y)
{
return new Vector3(x, y, vector.z);
}
/// <summary>
/// Returns a vector whose Y component matches that of a provided vector, and sets the X and Z components to provided values.
/// </summary>
/// <param name="vector">The input vector.</param>
/// <param name="x">The new X value.</param>
/// <param name="z">The new Z value.</param>
/// <returns>
/// Returns a <see cref="Vector3" /> whose Y component matches that of <paramref name="vector" />,
/// but with the <see cref="Vector3.x" /> and <see cref="Vector3.z" /> components set to <paramref name="x" /> and
/// <paramref name="z" /> respectively.
/// </returns>
public static Vector3 WithXZ(this Vector3 vector, float x, float z)
{
return new Vector3(x, vector.y, z);
}
/// <summary>
/// Returns a vector whose X and Z components match that of a provided vector, and sets the Y component to a provided value.
/// </summary>
/// <param name="vector">The input vector.</param>
/// <param name="y">The new Y value.</param>
/// <returns>
/// Returns a <see cref="Vector3" /> whose X and Z components match that of <paramref name="vector" />,
/// but with the <see cref="Vector3.y" /> component set to <paramref name="y" />.
/// </returns>
public static Vector3 WithY(this Vector3 vector, float y)
{
return new Vector3(vector.x, y, vector.z);
}
/// <summary>
/// Returns a vector whose X component matches that of a provided vector, and sets the Y and Z components to provided values.
/// </summary>
/// <param name="vector">The input vector.</param>
/// <param name="y">The new Y value.</param>
/// <param name="z">The new Z value.</param>
/// <returns>
/// Returns a <see cref="Vector3" /> whose X component matches that of <paramref name="vector" />,
/// but with the <see cref="Vector3.y" /> and <see cref="Vector3.z" /> components set to <paramref name="y" /> and
/// <paramref name="z" /> respectively.
/// </returns>
public static Vector3 WithYZ(this Vector3 vector, float y, float z)
{
return new Vector3(vector.x, y, z);
}
/// <summary>
/// Returns a vector whose X and Y components match that of a provided vector, and sets the Z component to a provided value.
/// </summary>
/// <param name="vector">The input vector.</param>
/// <param name="z">The new Z value.</param>
/// <returns>
/// Returns a <see cref="Vector3" /> whose X and Y components match that of <paramref name="vector" />,
/// but with the <see cref="Vector3.z" /> component set to <paramref name="z" />.
/// </returns>
public static Vector3 WithZ(this Vector3 vector, float z)
{
return new Vector3(vector.x, vector.y, z);
}
}
}