-
Notifications
You must be signed in to change notification settings - Fork 6
Upgrade for current VRChat SDK on alpha #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: alpha
Are you sure you want to change the base?
Changes from all commits
448f50e
3edbce7
c09ab17
d26e2e1
29ea5ad
ad2fc19
49671d8
52124ae
8f77009
46e220b
e7fc935
2bd5950
220918e
dd2ac73
58ddfad
677a05f
4554592
5dcc13f
68f6a81
4bfcfa7
f83d06c
8b63400
19e5fcb
9449ee9
0d52f92
8257d2e
954f10d
c59c1e3
c636ff2
2e780ee
001a111
3b0d12a
1328c8e
e6752eb
be130b6
b0d35de
2e03928
be0fb1b
a64dd85
ec68421
0008774
9344f77
d441f51
542c8c5
7e9bff6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "version": 1, | ||
| "isRoot": true, | ||
| "tools": { | ||
| "tktco.udonsharplinter": { | ||
| "version": "0.3.1", | ||
| "commands": [ | ||
| "udonsharp-lint" | ||
| ] | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| name: Check | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| static-checks: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "22" | ||
| - uses: reviewdog/action-actionlint@v1 | ||
| with: | ||
| fail_level: error | ||
| - name: Run static checks | ||
| run: bash scripts/run-static-checks.sh | ||
|
|
||
| udonsharp-lint: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: | | ||
| 8.0.x | ||
| 6.0.x | ||
| - name: Restore dotnet tools | ||
| run: dotnet tool restore | ||
| - name: Run UdonSharp Linter | ||
| run: dotnet tool run udonsharp-lint Packages |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: UdonSharp Lint | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| DOTNET_ROLL_FORWARD: LatestMajor | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: "8.x" | ||
| - name: Install UdonSharp Linter | ||
| run: dotnet tool restore | ||
| - name: Run UdonSharp Linter | ||
| run: dotnet tool run udonsharp-lint Packages |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,7 +67,7 @@ public void SFEXT_O_Explode() | |
|
|
||
| public void SFEXT_G_Explode() | ||
| { | ||
| if (!EntityControl.LastAttacker || !EntityControl.LastAttacker.Using || Time.time - airVehicle.LastHitTime >= 5) return; | ||
| if (!EntityControl.LastAttacker || !EntityControl.LastAttacker.Using || Time.time - EntityControl.PilotExitTime >= 5) return; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
|
|
||
| if (onKilled <= 0 || !airVehicle.Taxiing && (airVehicle.Occupied || Time.time - EntityControl.PilotExitTime < 5)) | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| #if UNITY_EDITOR | ||
| using System.Linq; | ||
| using UdonSharp; | ||
| using UnityEditor; | ||
| using UnityEngine; | ||
| using UnityEngine.SceneManagement; | ||
| using SaccFlightAndVehicles; | ||
| using VRC.SDKBase.Editor.BuildPipeline; | ||
|
|
||
| namespace EsnyaSFAddons | ||
| { | ||
| public static class ESFASceneSetupEditorUtility | ||
| { | ||
| public static void SetupAll() | ||
| { | ||
| foreach (var setup in SceneManager.GetActiveScene().GetRootGameObjects() | ||
| .SelectMany(o => o.GetComponentsInChildren<ESFASceneSetup>(true))) | ||
| { | ||
| Setup(setup); | ||
| } | ||
| } | ||
|
|
||
| public static void Setup(ESFASceneSetup setup) | ||
| { | ||
| if (!setup) return; | ||
|
|
||
| var rootObjects = setup.gameObject.scene.GetRootGameObjects(); | ||
| var killsBoard = rootObjects.SelectMany(o => o.GetComponentsInChildren<SaccScoreboard_Kills>(true)).FirstOrDefault(); | ||
|
|
||
| foreach (var entity in rootObjects.SelectMany(o => o.GetComponentsInChildren<SaccEntity>(true))) | ||
| { | ||
| var airVehicle = entity.ExtensionUdonBehaviours.FirstOrDefault(e => e is SaccAirVehicle); | ||
| var extensions = setup.injectExtentions.Select(template => | ||
| { | ||
| var obj = Object.Instantiate(template.gameObject, entity.transform); | ||
| var extension = obj.GetComponent(template.GetType()) as UdonSharpBehaviour; | ||
| obj.name = template.gameObject.name; | ||
|
|
||
| extension.SetProgramVariable("EntityControl", entity); | ||
| extension.SetProgramVariable("AirVehicle", airVehicle); | ||
|
|
||
| EditorUtility.SetDirty(extension); | ||
|
|
||
| return extension; | ||
| }); | ||
|
|
||
| if (killsBoard) | ||
| { | ||
| var killTracker = entity.GetExtention(UdonSharpBehaviour.GetUdonTypeName<SAV_KillTracker>()) as SAV_KillTracker; | ||
| if (killTracker) | ||
| { | ||
| killTracker.KillsBoard = killsBoard; | ||
| EditorUtility.SetDirty(killTracker); | ||
| } | ||
|
|
||
| var killPenalty = entity.GetExtention(UdonSharpBehaviour.GetUdonTypeName<SFEXT_KillPenalty>()) as SFEXT_KillPenalty; | ||
| if (killPenalty) | ||
| { | ||
| killPenalty.KillsBoard = killsBoard; | ||
| EditorUtility.SetDirty(killPenalty); | ||
| } | ||
| } | ||
|
|
||
| if (setup.injectExtentions.Length > 0) | ||
| { | ||
| entity.ExtensionUdonBehaviours = entity.ExtensionUdonBehaviours.Concat(extensions).ToArray(); | ||
| } | ||
|
|
||
| EditorUtility.SetDirty(entity); | ||
| } | ||
|
|
||
| foreach (var airVehicle in rootObjects.SelectMany(o => o.GetComponentsInChildren<SaccAirVehicle>(true))) | ||
| { | ||
| airVehicle.SeaLevel = setup.seaLevel; | ||
| airVehicle.RepeatingWorld = setup.repeatingWorld; | ||
| airVehicle.RepeatingWorldDistance = setup.repeatingWorldDistance; | ||
| EditorUtility.SetDirty(airVehicle); | ||
| } | ||
|
|
||
| var windchanger = rootObjects.Select(o => o.GetComponentInChildren<SAV_WindChanger>()).FirstOrDefault(c => c); | ||
| foreach (var windsock in rootObjects.SelectMany(o => o.GetComponentsInChildren<Windsock>(true))) | ||
| { | ||
| windsock.windChanger = windchanger; | ||
| EditorUtility.SetDirty(windsock); | ||
| } | ||
|
|
||
| Object.DestroyImmediate(setup, true); | ||
| } | ||
| } | ||
|
|
||
| public class ESFASceneSetupBuildCallback : IVRCSDKBuildRequestedCallback | ||
| { | ||
| public int callbackOrder => 11; | ||
|
|
||
| public bool OnBuildRequested(VRCSDKRequestedBuildType requestedBuildType) | ||
| { | ||
| ESFASceneSetupEditorUtility.SetupAll(); | ||
| return true; | ||
|
Comment on lines
+91
to
+98
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
After moving setup logic out of Useful? React with 👍 / 👎. |
||
| } | ||
| } | ||
| } | ||
| #endif | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.