github moment

This commit is contained in:
NIMFER 2021-08-28 14:00:17 +02:00
parent 7549940ca0
commit 9f8520d744
7 changed files with 30 additions and 32 deletions

View file

@ -108,24 +108,22 @@ public class Trap : MonoBehaviour
{ {
if (Physics.CheckSphere(transform.position + trapInteractionRadiusOffset, trapInteractionRadius, player)) if (Physics.CheckSphere(transform.position + trapInteractionRadiusOffset, trapInteractionRadius, player))
{ {
playerInRange = true; playerInRange = true;
} }
else else
{ {
playerInRange = false; playerInRange = false;
} }
if (Physics.CheckSphere(transform.position + trapInteractionRadiusOffset, trapInteractionRadius, player)) if (Physics.CheckSphere(transform.position + trapInteractionRadiusOffset, trapInteractionRadius, robber))
{ {
playerInRange = true; robberInRange = true;
} }
else else
{ {
playerInRange = false; robberInRange = false;
} }
} }
@ -151,31 +149,11 @@ public class Trap : MonoBehaviour
if (robberInRange) if (robberInRange)
{ {
isActivated = true;
Debug.Log("The robber has set off the trap."); Debug.Log("The robber has set off the trap.");
isActivated = true;
GetComponent<MeshRenderer>().sharedMaterial = unsetMaterial; GetComponent<MeshRenderer>().sharedMaterial = unsetMaterial;
} }
} }
void OnTriggerStay(Collider other)
{
if (other.tag == "Player")
{
playerInRange = true;
}
else
{
playerInRange = false;
}
if (other.tag == "Robber" && isSet)
{
robberInRange = true;
}
else
{
robberInRange = false;
}
}
} }

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:4035f67d046dbfd6970a5a856089b9d70a961f9377cfc6c48dfb8972f39e3399 oid sha256:76a03ceb76ac55a6a7ce702493ecb7980630cd59fbb17f4ef3a3c5bbdf66dc9c
size 1345480 size 1350376

Binary file not shown.

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:7ac302ce60dcf6c00b222ba6c06041b6d6f813de098c77e626ba38d7a2538393 oid sha256:1cb518fc145c6c4843f4bc3cc7babef9319ed99acdca040ae072d6937b86c561
size 228908 size 228908

View file

@ -1,5 +1,6 @@
{ {
"dependencies": { "dependencies": {
"com.unity.animation.rigging": "1.0.3",
"com.unity.cinemachine": "2.6.9", "com.unity.cinemachine": "2.6.9",
"com.unity.ide.rider": "2.0.7", "com.unity.ide.rider": "2.0.7",
"com.unity.ide.visualstudio": "2.0.11", "com.unity.ide.visualstudio": "2.0.11",

View file

@ -1,5 +1,24 @@
{ {
"dependencies": { "dependencies": {
"com.unity.animation.rigging": {
"version": "1.0.3",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.burst": "1.3.4",
"com.unity.test-framework": "1.1.14"
},
"url": "https://packages.unity.com"
},
"com.unity.burst": {
"version": "1.3.4",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.mathematics": "1.2.1"
},
"url": "https://packages.unity.com"
},
"com.unity.cinemachine": { "com.unity.cinemachine": {
"version": "2.6.9", "version": "2.6.9",
"depth": 0, "depth": 0,
@ -47,8 +66,8 @@
"url": "https://packages.unity.com" "url": "https://packages.unity.com"
}, },
"com.unity.mathematics": { "com.unity.mathematics": {
"version": "1.1.0", "version": "1.2.1",
"depth": 1, "depth": 2,
"source": "registry", "source": "registry",
"dependencies": {}, "dependencies": {},
"url": "https://packages.unity.com" "url": "https://packages.unity.com"

View file

@ -13,7 +13,7 @@ TagManager:
- Player - Player
- Water - Water
- UI - UI
- - Robber
- -
- -
- -