github moment
This commit is contained in:
parent
7549940ca0
commit
9f8520d744
7 changed files with 30 additions and 32 deletions
|
|
@ -108,24 +108,22 @@ public class Trap : MonoBehaviour
|
|||
{
|
||||
if (Physics.CheckSphere(transform.position + trapInteractionRadiusOffset, trapInteractionRadius, player))
|
||||
{
|
||||
|
||||
playerInRange = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
playerInRange = false;
|
||||
}
|
||||
|
||||
if (Physics.CheckSphere(transform.position + trapInteractionRadiusOffset, trapInteractionRadius, player))
|
||||
if (Physics.CheckSphere(transform.position + trapInteractionRadiusOffset, trapInteractionRadius, robber))
|
||||
{
|
||||
|
||||
playerInRange = true;
|
||||
robberInRange = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
playerInRange = false;
|
||||
robberInRange = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -151,31 +149,11 @@ public class Trap : MonoBehaviour
|
|||
|
||||
if (robberInRange)
|
||||
{
|
||||
isActivated = true;
|
||||
Debug.Log("The robber has set off the trap.");
|
||||
isActivated = true;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4035f67d046dbfd6970a5a856089b9d70a961f9377cfc6c48dfb8972f39e3399
|
||||
size 1345480
|
||||
oid sha256:76a03ceb76ac55a6a7ce702493ecb7980630cd59fbb17f4ef3a3c5bbdf66dc9c
|
||||
size 1350376
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7ac302ce60dcf6c00b222ba6c06041b6d6f813de098c77e626ba38d7a2538393
|
||||
oid sha256:1cb518fc145c6c4843f4bc3cc7babef9319ed99acdca040ae072d6937b86c561
|
||||
size 228908
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"com.unity.animation.rigging": "1.0.3",
|
||||
"com.unity.cinemachine": "2.6.9",
|
||||
"com.unity.ide.rider": "2.0.7",
|
||||
"com.unity.ide.visualstudio": "2.0.11",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,24 @@
|
|||
{
|
||||
"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": {
|
||||
"version": "2.6.9",
|
||||
"depth": 0,
|
||||
|
|
@ -47,8 +66,8 @@
|
|||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.mathematics": {
|
||||
"version": "1.1.0",
|
||||
"depth": 1,
|
||||
"version": "1.2.1",
|
||||
"depth": 2,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.com"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ TagManager:
|
|||
- Player
|
||||
- Water
|
||||
- UI
|
||||
-
|
||||
- Robber
|
||||
-
|
||||
-
|
||||
-
|
||||
|
|
|
|||
Loading…
Reference in a new issue