Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ef21043
Removed .slnx and .CI.sln; removed *.csproj; added build and format c…
TaggedDev Jul 26, 2026
ac27647
Combined building desktop into a single file
TaggedDev Jul 26, 2026
82462e4
Undo previous commit: split win/linux builds
TaggedDev Jul 26, 2026
d76d0d5
Updated formatting ci to use roslyn/stylecop
TaggedDev Jul 26, 2026
49ef102
Updated resolver installaion on github actions
TaggedDev Jul 26, 2026
72c161a
Windows build update. Code format update
TaggedDev Jul 26, 2026
ac9b32f
Added codex folder
TaggedDev Jul 26, 2026
447953e
Simplified workflow
TaggedDev Jul 26, 2026
d328654
Updated windows build ci
TaggedDev Jul 26, 2026
00f41b8
Updated build-desktop.yml
TaggedDev Jul 27, 2026
aca5ab1
build-desktop for pull request on branch main
TaggedDev Jul 27, 2026
6a3c625
Fixed code inspection for [Attributes] and new line; fixed public fie…
TaggedDev Aug 2, 2026
ffcc2ab
Split the type filter files
TaggedDev Aug 2, 2026
55efbfc
Removed "must have documentation on ctor argument"
TaggedDev Aug 2, 2026
52ea0da
Added comments to .editorconfig
TaggedDev Aug 2, 2026
dc0c711
Updated CurrentPlayerProgress.cs to match the formatting style
TaggedDev Aug 2, 2026
05d339c
Split the States into the 3 different files
TaggedDev Aug 2, 2026
baa775a
Renamed static data related .cs files
TaggedDev Aug 2, 2026
3ec9e88
Renamed GameWindowStaticData.cs
TaggedDev Aug 2, 2026
9d3f930
Removed Test asmdef
TaggedDev Aug 2, 2026
44ee412
Allow delegate = {}; syntax
TaggedDev Aug 2, 2026
5e7cbce
Updated EoF config
TaggedDev Aug 2, 2026
a7868c4
Removed assets/packages/** from normalization
TaggedDev Aug 2, 2026
f80441e
Updated code format
TaggedDev Aug 2, 2026
329854e
yml fix
TaggedDev Aug 2, 2026
70d56e2
Updated yml format check file
TaggedDev Aug 2, 2026
acb959d
Ignoring sln in formatcheck
TaggedDev Aug 2, 2026
ff6eb19
Updated run sln name
TaggedDev Aug 2, 2026
8f70de8
Formatting (again)
TaggedDev Aug 2, 2026
016d881
Merge pull request #6 from 4RTNV/clean-up
TaggedDev Aug 2, 2026
7bbe5bc
Update readme.md
TaggedDev Aug 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"commands": [
"dotnet-format"
]
},
"jetbrains.resharper.globaltools": {
"version": "2026.1.4",
"commands": [
"jb"
]
}
}
}
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,9 @@ dotnet_diagnostic.SA1128.severity = none # allow public ClassName : this() witho
dotnet_diagnostic.SA1101.severity = none # disable obligatory this.fieldName
dotnet_diagnostic.SA1401.severity = error # fields always private
dotnet_diagnostic.SA1503.severity = none # allow no braces
dotnet_diagnostic.SA1134.severity = none # allow [attributes] private OneLineWithField
dotnet_diagnostic.SA1127.severity = none # generic type constrains must be on the new line
dotnet_diagnostic.SA1611.severity = none # all ctor args must be documented
dotnet_diagnostic.SA1117.severity = none # allow arguments to be wrapped, not chopped
dotnet_diagnostic.SA1130.severity = none # allow = delegate {}; syntax, not only lambda

17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,20 @@
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text
*.sh text eol=lf


* text=auto

*.cs text eol=lf
*.asmdef text eol=lf
*.asmref text eol=lf
*.json text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.sh text eol=lf

*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf

/Assets/Packages/** -text
40 changes: 40 additions & 0 deletions .github/workflows/build-desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build project

on:
pull_request:
branches:
- main

jobs:
build-desktop:
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
- StandaloneWindows # Build a Windows standalone.
- StandaloneWindows64 # Build a Windows 64-bit standalone.
- StandaloneLinux64 # Build a Linux 64-bit standalone.
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
- uses: actions/upload-artifact@v4
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
146 changes: 64 additions & 82 deletions .github/workflows/code-format.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,70 @@
name: Code Quality
name: Code format

on:
pull_request: {}
workflow_dispatch: {}
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read
contents: read

jobs:
formatting-and-analyzers:
name: Formatting and analyzers
runs-on: windows-latest

env:
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
DOTNET_NOLOGO: "1"
UNITY_VERSION: "6000.5.4f1"
RESHARPER_TOOLS_VERSION: "2026.1.4"

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: "8.0.x"

- name: Setup Unity
uses: RageAgainstThePixel/unity-setup@v2.6.0
with:
unity-version: ${{ env.UNITY_VERSION }}

- name: Resolve Unity editor path
shell: pwsh
run: |
$candidates = @(
$env:UNITY_EDITOR_PATH,
$env:UNITY_PATH,
"C:\Program Files\Unity\Hub\Editor\$env:UNITY_VERSION\Editor"
) | Where-Object { $_ }

$unityEditorPath = $candidates | Where-Object {
Test-Path (Join-Path $_ "Data\Managed\UnityEngine\UnityEngine.dll")
} | Select-Object -First 1

if (-not $unityEditorPath) {
Write-Error "Unity $env:UNITY_VERSION was not found. Install Unity on the runner or set UNITY_EDITOR_PATH to the Editor directory."
exit 1
}

"UNITY_EDITOR_PATH=$unityEditorPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Host "UNITY_EDITOR_PATH=$unityEditorPath"

- name: Install ReSharper command line tools
shell: pwsh
run: |
dotnet tool install JetBrains.ReSharper.GlobalTools `
--tool-path .\.tools `
--version $env:RESHARPER_TOOLS_VERSION

- name: Run cleanup profile
shell: pwsh
run: |
.\.tools\jb.exe cleanupcode UnityTemplateURP.CI.sln `
--profile="Scitalis: Reformat Code" `
--settings="UnityTemplateURP.sln.DotSettings" `
--include="Assets/_Project/Scripts/**" `
--verbosity=WARN

- name: Verify no formatting diff
shell: pwsh
run: |
$diff = git diff --name-only -- Assets/_Project/Scripts

if ($diff) {
Write-Error "Code cleanup changed files. Run Rider Silent Reformat and Cleanup or jb cleanupcode locally, then commit the result."
$diff | ForEach-Object { Write-Host "Changed: $_" }
git diff -- Assets/_Project/Scripts
exit 1
}

Write-Host "Formatting check passed."

- name: Build with analyzers
shell: pwsh
run: dotnet build UnityTemplateURP.CI.sln -warnaserror -p:CI=true
format-check:
name: Rider formatting check
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"

- name: Restore JetBrains tools
run: dotnet tool restore

- name: Run Rider formatter
shell: bash
run: |
format_root="$(mktemp -d)"

mkdir -p "$format_root/Assets/_Project"
cp -a Assets/_Project/Scripts "$format_root/Assets/_Project/Scripts"
cp .editorconfig "$format_root/.editorconfig"
cp UnityTemplateURP.sln.DotSettings "$format_root/Rider.DotSettings"

mapfile -d '' cs_files < <(
find "$format_root/Assets/_Project/Scripts" \
-type f \
-name '*.cs' \
-print0
)

if [ "${#cs_files[@]}" -eq 0 ]; then
echo "No C# files found."
exit 1
fi

dotnet tool run jb cleanupcode \
"${cs_files[@]}" \
--profile="Built-in: Reformat Code" \
--settings="$format_root/Rider.DotSettings" \
--no-updates

rsync -a \
"$format_root/Assets/_Project/Scripts/" \
Assets/_Project/Scripts/

- name: Check formatting diff
shell: bash
run: |
if ! git diff --exit-code -- Assets/_Project/Scripts; then
echo "::error::C# formatting does not match Rider formatting rules."
exit 1
fi
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
/[Uu]ser[Ss]ettings/
*.log

.codex

# By default unity supports Blender asset imports, *.blend1 blender files do not need to be commited to version control.
*.blend1
*.blend1.meta
Expand Down Expand Up @@ -71,8 +73,7 @@ ExportedObj/
*.csproj
*.unityproj
*.sln
!_Project.*.csproj
!UnityTemplateURP.CI.sln
*.slnx
*.suo
*.tmp
*.user
Expand Down
12 changes: 4 additions & 8 deletions Assets/_Project/Scripts/Data/ObservableDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@ namespace _Project.Data
{
public class ObservableDictionary<TKey, TValue> : Dictionary<TKey, TValue>
{
public EventHandler<TKey> ItemAdded;
public EventHandler<TKey> ItemRemoved;

public ObservableDictionary() : base()
{
}
private EventHandler<TKey> _itemAdded;
private EventHandler<TKey> _itemRemoved;

public new void Add(TKey key, TValue value)
{
base.Add(key, value);
ItemAdded?.Invoke(null, key);
_itemAdded?.Invoke(null, key);
}

public new bool Remove(TKey key)
{
var removed = base.Remove(key);
if (removed) ItemRemoved(null, key);
if (removed) _itemRemoved(null, key);

return removed;
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/_Project/Scripts/Data/SerializeableType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ private static bool TryGetType(string typeString, out Type type)
// public static implicit operator Type(SerializeableType sType) => sType.Type;

// Implicit conversion from Type to SerializableType
//public static implicit operator SerializeableType(Type type) => new() { Type = type };
// public static implicit operator SerializeableType(Type type) => new() { Type = type };
}
}
39 changes: 0 additions & 39 deletions Assets/_Project/Scripts/Data/TypeFilterAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,47 +1,8 @@
using System;
using System.Linq;
using UnityEngine;

namespace _Project.Data
{
public static class TypeFilterExtension
{
/// <summary>
/// Checks if a given type inherits or implements a specified base type
/// </summary>
/// <param name="type">To be checked type</param>
/// <param name="baseType">The ancestor type</param>
/// <returns>True if type implements base type</returns>
public static bool InheritsOrImplements(this Type type, Type baseType)
{
type = ResolveGenericType(type);
baseType = ResolveGenericType(baseType);

while (type != typeof(object))
{
if (baseType == type || HasAnyInterfaces(type, baseType)) return true;

type = ResolveGenericType(type.BaseType);
if (type == null) return false;
}

return false;
}

private static bool HasAnyInterfaces(Type type, Type interfaceType)
{
return type.GetInterfaces().Any(i => ResolveGenericType(i) == interfaceType);
}

private static Type ResolveGenericType(Type type)
{
if (type is not { IsGenericType: true }) return type;

var genericType = type.GetGenericTypeDefinition();
return genericType != type ? genericType : type;
}
}

public class TypeFilterAttribute : PropertyAttribute
{
public TypeFilterAttribute(Type filterType)
Expand Down
43 changes: 43 additions & 0 deletions Assets/_Project/Scripts/Data/TypeFilterExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.Linq;

namespace _Project.Data
{
public static class TypeFilterExtension
{
/// <summary>
/// Checks if a given type inherits or implements a specified base type
/// </summary>
/// <param name="type">To be checked type</param>
/// <param name="baseType">The ancestor type</param>
/// <returns>True if type implements base type</returns>
public static bool InheritsOrImplements(this Type type, Type baseType)
{
type = ResolveGenericType(type);
baseType = ResolveGenericType(baseType);

while (type != typeof(object))
{
if (baseType == type || HasAnyInterfaces(type, baseType)) return true;

type = ResolveGenericType(type.BaseType);
if (type == null) return false;
}

return false;
}

private static bool HasAnyInterfaces(Type type, Type interfaceType)
{
return type.GetInterfaces().Any(i => ResolveGenericType(i) == interfaceType);
}

private static Type ResolveGenericType(Type type)
{
if (type is not { IsGenericType: true }) return type;

var genericType = type.GetGenericTypeDefinition();
return genericType != type ? genericType : type;
}
}
}
3 changes: 3 additions & 0 deletions Assets/_Project/Scripts/Data/TypeFilterExtension.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading