Skip to content

Commit 0e70a6b

Browse files
committed
Merged upstream and moved demo mode into cli argument
1 parent 655df77 commit 0e70a6b

File tree

5 files changed

+48
-44
lines changed

5 files changed

+48
-44
lines changed

Assets/Scripts/Weapons/Dart/Dart.cs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,23 @@ private void ShootADart(DartProjectile prefab, GameObject player, Vector3 direct
159159

160160
private Vector3 CalculateDirection(GameObject player)
161161
{
162-
if (Gamepad.current != null)
162+
// Use gamepad right stick if it's actively being used
163+
var stickDirection = _lookAction.ReadValue<Vector2>();
164+
if (stickDirection.magnitude >= 0.1f)
163165
{
164-
var direction = _lookAction.ReadValue<Vector2>();
165-
if (direction.magnitude < 0.1f)
166-
{
167-
// Don't change it if we're not aiming
168-
return _shootingDirection;
169-
}
166+
return stickDirection;
167+
}
170168

171-
return direction;
169+
// On desktop, fall through to mouse aiming
170+
if (Application.platform != RuntimePlatform.Android &&
171+
Application.platform != RuntimePlatform.IPhonePlayer)
172+
{
173+
var mousePosition = Camera.main.ScreenToWorldPoint(_mouseAction.ReadValue<Vector2>());
174+
var targetDirection = mousePosition - player.transform.position;
175+
return targetDirection;
172176
}
173-
174-
var mousePosition = Camera.main.ScreenToWorldPoint(_mouseAction.ReadValue<Vector2>());
175-
var targetDirection = mousePosition - player.transform.position;
176-
177-
return targetDirection;
177+
178+
// On mobile with no stick input, keep current direction
179+
return _shootingDirection;
178180
}
179181
}

Assets/Scripts/Weapons/Schnitzel/Schnitzel.cs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,24 @@ public IEnumerator ShootSchnitzels(GameObject player)
6262

6363
private Vector3 CalculateDirection(GameObject player)
6464
{
65-
if (Gamepad.current != null)
65+
// Use gamepad right stick if it's actively being used
66+
var stickDirection = _lookAction.ReadValue<Vector2>();
67+
if (stickDirection.magnitude >= 0.1f)
6668
{
67-
var direction = _lookAction.ReadValue<Vector2>();
68-
if (direction.magnitude < 0.1f)
69-
{
70-
// Don't change it if we're not aiming
71-
return _shootingDirection;
72-
}
73-
74-
return direction;
69+
return stickDirection;
7570
}
76-
77-
var mousePosition = Camera.main.ScreenToWorldPoint(_mouseAction.ReadValue<Vector2>());
78-
var targetDirection = mousePosition - player.transform.position;
79-
80-
return targetDirection;
71+
72+
// On desktop, fall through to mouse aiming
73+
if (Application.platform != RuntimePlatform.Android &&
74+
Application.platform != RuntimePlatform.IPhonePlayer)
75+
{
76+
var mousePosition = Camera.main.ScreenToWorldPoint(_mouseAction.ReadValue<Vector2>());
77+
var targetDirection = mousePosition - player.transform.position;
78+
return targetDirection;
79+
}
80+
81+
// On mobile with no stick input, keep current direction
82+
return _shootingDirection;
8183
}
8284

8385
private void ShootOneSchnitzel(SchnitzelProjectile prefab, GameObject player, Vector3 direction)

Packages/manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"dependencies": {
3-
"com.unity.collab-proxy": "2.10.2",
3+
"com.unity.collab-proxy": "2.11.3",
44
"com.unity.feature.2d": "2.0.2",
5-
"com.unity.ide.rider": "3.0.38",
5+
"com.unity.ide.rider": "3.0.39",
66
"com.unity.ide.visualstudio": "2.0.26",
7-
"com.unity.inputsystem": "1.17.0",
8-
"com.unity.mobile.android-logcat": "1.4.6",
7+
"com.unity.inputsystem": "1.18.0",
8+
"com.unity.mobile.android-logcat": "1.4.7",
99
"com.unity.multiplayer.center": "1.0.1",
1010
"com.unity.render-pipelines.universal": "17.3.0",
1111
"com.unity.test-framework": "1.6.0",

Packages/packages-lock.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"dependencies": {
33
"com.unity.2d.animation": {
4-
"version": "13.0.2",
4+
"version": "13.0.4",
55
"depth": 1,
66
"source": "registry",
77
"dependencies": {
8-
"com.unity.2d.common": "12.0.1",
8+
"com.unity.2d.common": "12.0.2",
99
"com.unity.2d.sprite": "1.0.0",
1010
"com.unity.collections": "2.4.3",
1111
"com.unity.modules.animation": "1.0.0",
@@ -27,7 +27,7 @@
2727
"url": "https://packages.unity.com"
2828
},
2929
"com.unity.2d.common": {
30-
"version": "12.0.1",
30+
"version": "12.0.2",
3131
"depth": 2,
3232
"source": "registry",
3333
"dependencies": {
@@ -99,11 +99,11 @@
9999
"url": "https://packages.unity.com"
100100
},
101101
"com.unity.2d.tooling": {
102-
"version": "1.0.0",
102+
"version": "1.0.2",
103103
"depth": 1,
104104
"source": "registry",
105105
"dependencies": {
106-
"com.unity.2d.common": "12.0.1",
106+
"com.unity.2d.common": "12.0.2",
107107
"com.unity.modules.uielements": "1.0.0"
108108
},
109109
"url": "https://packages.unity.com"
@@ -119,7 +119,7 @@
119119
"url": "https://packages.unity.com"
120120
},
121121
"com.unity.collab-proxy": {
122-
"version": "2.10.2",
122+
"version": "2.11.3",
123123
"depth": 0,
124124
"source": "registry",
125125
"dependencies": {},
@@ -149,19 +149,19 @@
149149
"depth": 0,
150150
"source": "builtin",
151151
"dependencies": {
152-
"com.unity.2d.animation": "13.0.2",
152+
"com.unity.2d.animation": "13.0.4",
153153
"com.unity.2d.pixel-perfect": "5.1.1",
154154
"com.unity.2d.psdimporter": "12.0.1",
155155
"com.unity.2d.sprite": "1.0.0",
156156
"com.unity.2d.spriteshape": "13.0.0",
157157
"com.unity.2d.tilemap": "1.0.0",
158158
"com.unity.2d.tilemap.extras": "6.0.1",
159159
"com.unity.2d.aseprite": "3.0.1",
160-
"com.unity.2d.tooling": "1.0.0"
160+
"com.unity.2d.tooling": "1.0.2"
161161
}
162162
},
163163
"com.unity.ide.rider": {
164-
"version": "3.0.38",
164+
"version": "3.0.39",
165165
"depth": 0,
166166
"source": "registry",
167167
"dependencies": {
@@ -179,7 +179,7 @@
179179
"url": "https://packages.unity.com"
180180
},
181181
"com.unity.inputsystem": {
182-
"version": "1.17.0",
182+
"version": "1.18.0",
183183
"depth": 0,
184184
"source": "registry",
185185
"dependencies": {
@@ -195,7 +195,7 @@
195195
"url": "https://packages.unity.com"
196196
},
197197
"com.unity.mobile.android-logcat": {
198-
"version": "1.4.6",
198+
"version": "1.4.7",
199199
"depth": 0,
200200
"source": "registry",
201201
"dependencies": {},

ProjectSettings/ProjectVersion.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 6000.3.3f1
2-
m_EditorVersionWithRevision: 6000.3.3f1 (ef04196de0d6)
1+
m_EditorVersion: 6000.3.8f1
2+
m_EditorVersionWithRevision: 6000.3.8f1 (1c7db571dde0)

0 commit comments

Comments
 (0)