From 7f68d10a200ab7b553cc60cac24f98f1bafd0ca4 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 6 Feb 2023 08:35:49 -0500 Subject: [PATCH] passing through in co-op mode --- namedropper/Assets/Scenes/Game.unity | 16 +++++++ namedropper/Assets/Scripts/Player.cs | 43 ++++++++++++++++++- namedropper/Packages/manifest.json | 14 +++--- namedropper/Packages/packages-lock.json | 34 ++++++--------- .../ProjectSettings/EditorBuildSettings.asset | 3 ++ .../ProjectSettings/Physics2DSettings.asset | 2 +- .../ProjectSettings/ProjectVersion.txt | 4 +- namedropper/ProjectSettings/TagManager.asset | 8 ++-- 8 files changed, 87 insertions(+), 37 deletions(-) diff --git a/namedropper/Assets/Scenes/Game.unity b/namedropper/Assets/Scenes/Game.unity index eb12aa8..2959e71 100644 --- a/namedropper/Assets/Scenes/Game.unity +++ b/namedropper/Assets/Scenes/Game.unity @@ -241,6 +241,10 @@ PrefabInstance: propertyPath: m_Name value: Player Dark Blue objectReference: {fileID: 0} + - target: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} + propertyPath: m_Layer + value: 6 + objectReference: {fileID: 0} - target: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_IsActive value: 1 @@ -618,6 +622,10 @@ PrefabInstance: propertyPath: m_Name value: Player Light Red objectReference: {fileID: 0} + - target: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} + propertyPath: m_Layer + value: 6 + objectReference: {fileID: 0} - target: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_IsActive value: 1 @@ -1715,6 +1723,10 @@ PrefabInstance: propertyPath: m_Name value: Player Dark Red objectReference: {fileID: 0} + - target: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} + propertyPath: m_Layer + value: 6 + objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_Pivot.x value: 0.5 @@ -2044,6 +2056,10 @@ PrefabInstance: propertyPath: m_Name value: Player Light Blue objectReference: {fileID: 0} + - target: {fileID: 9049015333349338381, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} + propertyPath: m_Layer + value: 6 + objectReference: {fileID: 0} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_Pivot.x value: 0.5 diff --git a/namedropper/Assets/Scripts/Player.cs b/namedropper/Assets/Scripts/Player.cs index 483e494..4e619bd 100644 --- a/namedropper/Assets/Scripts/Player.cs +++ b/namedropper/Assets/Scripts/Player.cs @@ -37,24 +37,63 @@ public class Player : MonoBehaviour if (GameManager.Instance.NumPlayers == 1) { - if (_playerNumber != 1) + if (_playerNumber != 2) { gameObject.SetActive(false); } } else if (GameManager.Instance.NumPlayers == 2) { - if (_playerNumber != 1 && _playerNumber != 3) + //player 1 remains on team 1 + + if (_playerNumber == 2 || _playerNumber == 4) { gameObject.SetActive(false); } + + + if (_playerNumber == 3 && GameManager.Instance.Competitive) + { + gameObject.layer = LayerMask.NameToLayer("Team 2"); + } } else if (GameManager.Instance.NumPlayers == 3) { + //player 1 remains on team 1 + if (_playerNumber == 2) { gameObject.SetActive(false); } + + if (_playerNumber == 3 && GameManager.Instance.Competitive) + { + gameObject.layer = LayerMask.NameToLayer("Team 2"); + } + + if (_playerNumber == 4 && GameManager.Instance.Competitive) + { + gameObject.layer = LayerMask.NameToLayer("Team 3"); + } + } + else if (GameManager.Instance.NumPlayers == 4 && GameManager.Instance.Competitive) + { + //player 1 remains on team 1 + + if (_playerNumber == 2) + { + gameObject.layer = LayerMask.NameToLayer("Team 2"); + } + + if (_playerNumber == 3) + { + gameObject.layer = LayerMask.NameToLayer("Team 3"); + } + + if (_playerNumber == 4) + { + gameObject.layer = LayerMask.NameToLayer("Team 4"); + } } } diff --git a/namedropper/Packages/manifest.json b/namedropper/Packages/manifest.json index b7e1b8c..81cfddf 100644 --- a/namedropper/Packages/manifest.json +++ b/namedropper/Packages/manifest.json @@ -1,16 +1,16 @@ { "dependencies": { - "com.unity.2d.animation": "5.0.10", + "com.unity.2d.animation": "5.2.0", "com.unity.2d.pixel-perfect": "4.0.1", - "com.unity.2d.psdimporter": "4.1.3", + "com.unity.2d.psdimporter": "4.3.0", "com.unity.2d.sprite": "1.0.0", - "com.unity.2d.spriteshape": "5.1.7", + "com.unity.2d.spriteshape": "5.3.0", "com.unity.2d.tilemap": "1.0.0", - "com.unity.collab-proxy": "1.15.7", - "com.unity.ide.rider": "2.0.7", + "com.unity.collab-proxy": "1.17.7", + "com.unity.ide.rider": "3.0.17", "com.unity.ide.visualstudio": "2.0.17", - "com.unity.ide.vscode": "1.2.4", - "com.unity.test-framework": "1.1.29", + "com.unity.ide.vscode": "1.2.5", + "com.unity.test-framework": "1.1.33", "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.4.8", "com.unity.ugui": "1.0.0", diff --git a/namedropper/Packages/packages-lock.json b/namedropper/Packages/packages-lock.json index ae8d313..a963bb4 100644 --- a/namedropper/Packages/packages-lock.json +++ b/namedropper/Packages/packages-lock.json @@ -1,11 +1,11 @@ { "dependencies": { "com.unity.2d.animation": { - "version": "5.0.10", + "version": "5.2.0", "depth": 0, "source": "registry", "dependencies": { - "com.unity.2d.common": "4.0.4", + "com.unity.2d.common": "4.2.0", "com.unity.mathematics": "1.1.0", "com.unity.2d.sprite": "1.0.0", "com.unity.modules.animation": "1.0.0", @@ -14,7 +14,7 @@ "url": "https://packages.unity.com" }, "com.unity.2d.common": { - "version": "4.0.4", + "version": "4.2.0", "depth": 1, "source": "registry", "dependencies": { @@ -38,12 +38,12 @@ "url": "https://packages.unity.com" }, "com.unity.2d.psdimporter": { - "version": "4.1.3", + "version": "4.3.0", "depth": 0, "source": "registry", "dependencies": { - "com.unity.2d.common": "4.0.4", - "com.unity.2d.animation": "5.0.10", + "com.unity.2d.common": "4.2.0", + "com.unity.2d.animation": "5.2.0", "com.unity.2d.sprite": "1.0.0" }, "url": "https://packages.unity.com" @@ -55,12 +55,12 @@ "dependencies": {} }, "com.unity.2d.spriteshape": { - "version": "5.1.7", + "version": "5.3.0", "depth": 0, "source": "registry", "dependencies": { "com.unity.mathematics": "1.1.0", - "com.unity.2d.common": "4.0.4", + "com.unity.2d.common": "4.2.0", "com.unity.2d.path": "4.0.2", "com.unity.modules.physics2d": "1.0.0" }, @@ -73,11 +73,10 @@ "dependencies": {} }, "com.unity.collab-proxy": { - "version": "1.15.7", + "version": "1.17.7", "depth": 0, "source": "registry", "dependencies": { - "com.unity.nuget.newtonsoft-json": "2.0.0", "com.unity.services.core": "1.0.1" }, "url": "https://packages.unity.com" @@ -90,11 +89,11 @@ "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "2.0.7", + "version": "3.0.17", "depth": 0, "source": "registry", "dependencies": { - "com.unity.test-framework": "1.1.1" + "com.unity.ext.nunit": "1.0.6" }, "url": "https://packages.unity.com" }, @@ -108,7 +107,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.vscode": { - "version": "1.2.4", + "version": "1.2.5", "depth": 0, "source": "registry", "dependencies": {}, @@ -121,13 +120,6 @@ "dependencies": {}, "url": "https://packages.unity.com" }, - "com.unity.nuget.newtonsoft-json": { - "version": "2.0.0", - "depth": 1, - "source": "registry", - "dependencies": {}, - "url": "https://packages.unity.com" - }, "com.unity.services.core": { "version": "1.0.1", "depth": 1, @@ -138,7 +130,7 @@ "url": "https://packages.unity.com" }, "com.unity.test-framework": { - "version": "1.1.29", + "version": "1.1.33", "depth": 0, "source": "registry", "dependencies": { diff --git a/namedropper/ProjectSettings/EditorBuildSettings.asset b/namedropper/ProjectSettings/EditorBuildSettings.asset index 10176f1..deb2a86 100644 --- a/namedropper/ProjectSettings/EditorBuildSettings.asset +++ b/namedropper/ProjectSettings/EditorBuildSettings.asset @@ -8,6 +8,9 @@ EditorBuildSettings: - enabled: 0 path: guid: 00000000000000000000000000000000 + - enabled: 1 + path: Assets/Scenes/Title.unity + guid: 6ee247bbdb0f38647998cd2523f264c7 - enabled: 1 path: Assets/Scenes/TopicSelect.unity guid: 91a4af9a6af9fc840b522128085513da diff --git a/namedropper/ProjectSettings/Physics2DSettings.asset b/namedropper/ProjectSettings/Physics2DSettings.asset index a942852..fbfbb9c 100644 --- a/namedropper/ProjectSettings/Physics2DSettings.asset +++ b/namedropper/ProjectSettings/Physics2DSettings.asset @@ -53,4 +53,4 @@ Physics2DSettings: m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} - m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffbfffffff7ffffffffffefffffffdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/namedropper/ProjectSettings/ProjectVersion.txt b/namedropper/ProjectSettings/ProjectVersion.txt index def2933..7c42834 100644 --- a/namedropper/ProjectSettings/ProjectVersion.txt +++ b/namedropper/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2020.3.26f1 -m_EditorVersionWithRevision: 2020.3.26f1 (7298b473bc1a) +m_EditorVersion: 2020.3.44f1 +m_EditorVersionWithRevision: 2020.3.44f1 (7f159b6136da) diff --git a/namedropper/ProjectSettings/TagManager.asset b/namedropper/ProjectSettings/TagManager.asset index 1c92a78..60292e2 100644 --- a/namedropper/ProjectSettings/TagManager.asset +++ b/namedropper/ProjectSettings/TagManager.asset @@ -11,10 +11,10 @@ TagManager: - - Water - UI - - - - - - - - + - Team 1 + - Team 2 + - Team 3 + - Team 4 - - -