From 03a33b50ef75ad00ca8e115866122a674c75cb91 Mon Sep 17 00:00:00 2001 From: GotoFinal Date: Tue, 12 May 2020 21:59:51 +0200 Subject: [PATCH] Fix for new SDK --- Assets/GotoUdon/Editor/GotoUdonEditor.cs | 4 +- Assets/GotoUdon/Editor/UpdaterEditor.cs | 3 ++ Assets/GotoUdon/VRC/VRCDestructible.cs | 67 +----------------------- Assets/GotoUdon/VRC/VRCPlayer.cs | 2 - 4 files changed, 7 insertions(+), 69 deletions(-) diff --git a/Assets/GotoUdon/Editor/GotoUdonEditor.cs b/Assets/GotoUdon/Editor/GotoUdonEditor.cs index ff68605..40fef52 100644 --- a/Assets/GotoUdon/Editor/GotoUdonEditor.cs +++ b/Assets/GotoUdon/Editor/GotoUdonEditor.cs @@ -11,8 +11,8 @@ public class GotoUdonEditor : EditorWindow { - public const string VERSION = "v1.1.2"; - public const string ImplementedSDKVersion = "2020.04.25.12.49"; + public const string VERSION = "v1.1.3"; + public const string ImplementedSDKVersion = "2020.05.06.12.14"; public static string CurrentSDKVersion => VRC.Core.SDKClientUtilities.GetSDKVersionDate(); [MenuItem("Window/GotoUdon/Debugger Tools")] diff --git a/Assets/GotoUdon/Editor/UpdaterEditor.cs b/Assets/GotoUdon/Editor/UpdaterEditor.cs index 8e757de..f39566b 100644 --- a/Assets/GotoUdon/Editor/UpdaterEditor.cs +++ b/Assets/GotoUdon/Editor/UpdaterEditor.cs @@ -78,6 +78,9 @@ private void DrawSdkUpdateComponent() string newestSdkVersion = NormalizeVrChatSDKVersion(releaseInfo.Version); string currentSdkVersion = NormalizeVrChatSDKVersion(GotoUdonEditor.CurrentSDKVersion); + // I give up + if (currentSdkVersion.EndsWith("05.06") && newestSdkVersion.EndsWith("05.12")) return; + if (releaseInfo.UnityPackage != null && SimpleGUI.InfoBox( VersionUtils.IsRightNewerThanLeft(currentSdkVersion, newestSdkVersion), diff --git a/Assets/GotoUdon/VRC/VRCDestructible.cs b/Assets/GotoUdon/VRC/VRCDestructible.cs index d8baef2..bb87f67 100644 --- a/Assets/GotoUdon/VRC/VRCDestructible.cs +++ b/Assets/GotoUdon/VRC/VRCDestructible.cs @@ -1,71 +1,8 @@ -using System; -using UnityEngine; -using VRC.SDKBase; +using VRC.SDKBase; namespace GotoUdon.VRC { - public class VRCDestructible : MonoBehaviour, IVRC_Destructible + public class VRCDestructible : VRC_DestructibleStandard { - private VRC_CombatSystem _vrcCombatSystem; - public float maxHealth; - public float currentHealth; - public object[] state; - private VRCPlayer _vrcPlayer; - private bool _setup = false; - - public void Setup() - { - state = new object[0]; - _vrcCombatSystem = VRC_CombatSystem.GetInstance(); - maxHealth = _vrcCombatSystem.maxPlayerHealth; - currentHealth = _vrcCombatSystem.maxPlayerHealth; - SimulatedVRCPlayer simulatedVrcPlayer = GetComponent(); - if (simulatedVrcPlayer != null) - { - _vrcPlayer = simulatedVrcPlayer.VRCPlayer; - _vrcCombatSystem.onSetupPlayer(_vrcPlayer); - } - } - - public object[] GetState() - { - return state; - } - - public void SetState(object[] state) - { - this.state = state; - } - - public float GetMaxHealth() - { - return maxHealth; - } - - public float GetCurrentHealth() - { - return currentHealth; - } - - public void ApplyDamage(float damage) - { - if (!_setup) return; - currentHealth -= damage; - if (_vrcPlayer != null) - { - _vrcCombatSystem.onPlayerDamaged(_vrcPlayer); - if (currentHealth <= 0) - { - _vrcCombatSystem.onPlayerKilled(_vrcPlayer); - } - } - } - - public void ApplyHealing(float healing) - { - if (!_setup) return; - currentHealth = Math.Min(currentHealth + healing, maxHealth); - _vrcCombatSystem.onPlayerHealed(_vrcPlayer); - } } } \ No newline at end of file diff --git a/Assets/GotoUdon/VRC/VRCPlayer.cs b/Assets/GotoUdon/VRC/VRCPlayer.cs index f8efac2..2920be8 100644 --- a/Assets/GotoUdon/VRC/VRCPlayer.cs +++ b/Assets/GotoUdon/VRC/VRCPlayer.cs @@ -256,8 +256,6 @@ private static void CombatSetup(VRCPlayer player) { vrcDestructible = player.gameObject.AddComponent(); } - - vrcDestructible.Setup(); } private static float GetGravityStrength(VRCPlayer player)