forked from YARC-Official/YARG
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recover rewrite branch (YARC-Official#515)
* 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
1 parent
e171156
commit de31672
Showing
156 changed files
with
1,115 additions
and
8,996 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
2 changes: 1 addition & 1 deletion
2
Assets/Plugins/MoonscraperChartParser.meta → Assets/Plugins/Editor.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...craperChartParser/Events/DrumRoll.cs.meta → ...ts/Plugins/Editor/YARGCoreBuilder.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
51 changes: 0 additions & 51 deletions
51
Assets/Plugins/MoonscraperChartParser/ChartEditorExtentions/NoteFunctions.cs
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
Assets/Plugins/MoonscraperChartParser/ChartEditorExtentions/NoteFunctions.cs.meta
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.