diff --git a/Assets/Scripts/SkillSystem.cs b/Assets/Scripts/SkillSystem.cs index fd631ed..3c68e07 100644 --- a/Assets/Scripts/SkillSystem.cs +++ b/Assets/Scripts/SkillSystem.cs @@ -19,8 +19,8 @@ public class SkillSystem : NetworkBehaviour public Texture2D SlowDownTex = null; public Texture2D InverseControlTex = null; - private int SelfPlayerID = -1; - private int OppoPlayerID = -1; + public int SelfPlayerID = -1; + public int OppoPlayerID = -1; private float SpeedUpTimeLeft = 0; @@ -40,24 +40,28 @@ public class SkillSystem : NetworkBehaviour //} - private void Start() - { - SelfPlayerID = gameObject.GetComponent().PlayerID; - if (SelfPlayerID == 1 ) - { - OppoPlayerID = 2; - } - else - { - OppoPlayerID = 1; - } - } + //private void Start() + //{ + // if (isLocalPlayer) + // { + // SelfPlayerID = gameObject.GetComponent().PlayerID; + // if (SelfPlayerID == 1) + // { + // OppoPlayerID = 2; + // } + // else + // { + // OppoPlayerID = 1; + // } + // } + //} void UpdateSkillUI() { if (isLocalPlayer) { + for (int i=0; i<3; i++) { if (MySkills[i] != null) { @@ -92,7 +96,20 @@ void Update() // THIS SECTION WILL BE DEPRECATED AFTER MQTT INTEGRATION if (isLocalPlayer) { - + + if (SelfPlayerID == -1 || OppoPlayerID == -1) + { + SelfPlayerID = GetComponent().PlayerID; + if (SelfPlayerID == 1) + { + OppoPlayerID = 2; + } + else + { + OppoPlayerID = 1; + } + } + string playerMode = GetComponent().mode; if (Input.GetKeyDown(KeyCode.Alpha1) && MySkills[0] != null && playerMode == "Attack Mode") @@ -133,7 +150,7 @@ void Update() GetComponent().accelerationMultiplier = 10; SpeedUpTimeLeft -= Time.deltaTime; UpdatePlayerStatus(SelfPlayerID, 0, true); - } + } else if ((SelfPlayerID == 1 && !statusTracker.player1_slowdown) || (SelfPlayerID == 2 && !statusTracker.player2_slowdown)) { GetComponent().maxSpeed = GetComponent().OriginalMaxSpeed; @@ -141,8 +158,6 @@ void Update() UpdatePlayerStatus(SelfPlayerID, 0, false); SpeedUpTimeLeft = 0; } - - } } @@ -223,6 +238,7 @@ private void ReleaseSkill(string skill) [Command(requiresAuthority = false)] private void UpdatePlayerStatus(int playerID, int type, bool setTo) { + Debug.Log($"PlayerStatus: {playerID}"); StatusTracker statusTracker = GameObject.FindGameObjectWithTag("StatusTracker").GetComponent(); diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index ad897e4..23b519c 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,7 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 23 + serializedVersion: 24 productGUID: cf115d1544fc7774487863e774a7d67c AndroidProfiler: 0 AndroidFilterTouchesWhenObscured: 0 @@ -99,7 +99,7 @@ PlayerSettings: xboxEnableFitness: 0 visibleInBackground: 1 allowFullscreenSwitch: 1 - fullscreenMode: 1 + fullscreenMode: 3 xboxSpeechDB: 0 xboxEnableHeadOrientation: 0 xboxEnableGuest: 0 @@ -460,7 +460,6 @@ PlayerSettings: switchReleaseVersion: 0 switchDisplayVersion: 1.0.0 switchStartupUserAccount: 0 - switchTouchScreenUsage: 0 switchSupportedLanguagesMask: 0 switchLogoType: 0 switchApplicationErrorCodeCategory: @@ -502,6 +501,7 @@ PlayerSettings: switchNativeFsCacheSize: 32 switchIsHoldTypeHorizontal: 0 switchSupportedNpadCount: 8 + switchEnableTouchScreen: 1 switchSocketConfigEnabled: 0 switchTcpInitialSendBufferSize: 32 switchTcpInitialReceiveBufferSize: 64