Skip to content

Commit

Permalink
Recover rewrite branch (YARC-Official#515)
Browse files Browse the repository at this point in the history
* Added YARG.Core as submodule

* Started rewriting profile system

* Update README.md

* "Fixed" a bunch of errors (REVERT IN FUTURE)

* Moved submodule for better YARG.Core compilation

* Moved navigation stuff to `YARG.Player.Navigation`

* Fixed input strategy constructors

* Update YARG.Core to chart loader commit

* renamed profile to YargPlayer, renamed GameManager to GlobalVariables and added new one

* Rewrite profile container and update YARG.Core (YARC-Official#511)

* Update YARG.Core to chart loader commit

* renamed profile to YargPlayer, renamed GameManager to GlobalVariables and added new one

* Update YARG.Core

* Add new player classes

---------

Co-authored-by: EliteAsian <[email protected]>
  • Loading branch information
RileyTheFox and EliteAsian123 authored Jul 3, 2023
1 parent e171156 commit de31672
Show file tree
Hide file tree
Showing 156 changed files with 1,115 additions and 8,996 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,6 @@ Packages/com.thenathannator.plasticband/
# Other
Assets/Nyx
Assets/Settings/TestPlayInfo.asset
Assets/Settings/TestPlayInfo.asset.meta
Assets/Settings/TestPlayInfo.asset.meta
Assets/Plugins/YARG.Core/YARG.Core.dll
Assets/Plugins/YARG.Core/YARG.Core.dll.meta
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Assets/Plugins/YARG.Core"]
path = YARG.Core
url = https://github.com/YARC-Official/YARG.Core

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

File renamed without changes.
File renamed without changes.
92 changes: 92 additions & 0 deletions Assets/Plugins/Editor/YARGCoreBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.Compilation;
using UnityEngine;

namespace Editor
{
public class YARGCoreBuilder: IPreprocessBuildWithReport
{
private const string DLL_PATH = "Assets/Plugins/YARG.Core/YARG.Core.dll";

// Call automatically on build
public int callbackOrder => -10000;
public void OnPreprocessBuild(BuildReport report)
{
BuildYARGCoreDLL();
}

[MenuItem("YARG/Rebuild YARG.Core", false)]
public static void BuildYARGCoreDLL()
{
Debug.Log("Rebuilding YARG.Core...");

// Get all of the script files
string projectRoot = Directory.GetParent(Application.dataPath)?.ToString();
string submodulePath = Path.Join(projectRoot, "YARG.Core", "YARG.Core");
var paths = new List<string>();
GetAllFiles(submodulePath, paths);

// Create the assembly with all of the scripts
Debug.Log($"Found {paths.Count} script files.");
var assembly = new AssemblyBuilder(DLL_PATH, paths.ToArray())
{
// Exclude the (maybe) already build DLL
excludeReferences = new[]
{
DLL_PATH
},
};

// Called on main thread
assembly.buildFinished += (assemblyPath, compilerMessages) =>
{
var errorCount = compilerMessages.Count(m => m.type == CompilerMessageType.Error);
var warningCount = compilerMessages.Count(m => m.type == CompilerMessageType.Warning);

Debug.Log("Done rebuilding YARG.Core!");
Debug.Log($"Errors: {errorCount} - Warnings: {warningCount}");

if (errorCount == 0)
{
AssetDatabase.ImportAsset(assemblyPath);
}
};

// Start build of assembly
if (!assembly.Build())
{
Debug.LogError("Failed to start build of the YARG.Core assembly!");
return;
}

// Wait
while (assembly.status != AssemblyBuilderStatus.Finished)
{
System.Threading.Thread.Sleep(10);
}
}

private static void GetAllFiles(string directory, List<string> outputFiles)
{
// Get all files in folder
foreach (var path in Directory.GetFiles(directory))
{
if (Path.GetExtension(path) == ".cs")
{
outputFiles.Add(path);
}
}

// Recursively call for all folders in that directory
foreach (var path in Directory.GetDirectories(directory))
{
GetAllFiles(path, outputFiles);
}
}
}
}

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

This file was deleted.

This file was deleted.

77 changes: 0 additions & 77 deletions Assets/Plugins/MoonscraperChartParser/EnumX.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Plugins/MoonscraperChartParser/EnumX.cs.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Plugins/MoonscraperChartParser/Events.meta

This file was deleted.

66 changes: 0 additions & 66 deletions Assets/Plugins/MoonscraperChartParser/Events/BPM.cs

This file was deleted.

12 changes: 0 additions & 12 deletions Assets/Plugins/MoonscraperChartParser/Events/BPM.cs.meta

This file was deleted.

Loading

0 comments on commit de31672

Please sign in to comment.