diff --git a/Assets/Scenes/PatScene.unity b/Assets/Scenes/PatScene.unity index dae8fb5..dc1ee7a 100644 Binary files a/Assets/Scenes/PatScene.unity and b/Assets/Scenes/PatScene.unity differ diff --git a/Assets/Scripts/Child.cs b/Assets/Scripts/Child.cs index ca953e2..37f2284 100644 --- a/Assets/Scripts/Child.cs +++ b/Assets/Scripts/Child.cs @@ -133,4 +133,13 @@ public class Child : MonoBehaviour return colliders.Length > 0; } + + void OnCollisionStay(Collision collision) + { + if (collision.gameObject.tag == "Lava") + { + // TODO: Lose a life (probably) and become immune for ~ 2 or 3 seconds + Debug.Log("Player " + _index + " is standing on lava."); + } + } } diff --git a/Assets/Scripts/Floor.cs b/Assets/Scripts/Floor.cs index 70e0792..49eb288 100644 --- a/Assets/Scripts/Floor.cs +++ b/Assets/Scripts/Floor.cs @@ -20,11 +20,13 @@ public class Floor : MonoBehaviour private void ChangeToNormalFloor() { _renderer.material = NormalMaterial; + gameObject.tag = "Floor"; // Might not be necessary since the player is most likely "dead" if he touches a non-lava floor } private void ChangeToLavaFloor() { _renderer.material = LavaMaterial; + gameObject.tag = "Lava"; // Might not be necessary since the player is most likely "dead" if he touches a non-lava floor } void OnDestroy() diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 0875a70..8e67086 100644 Binary files a/ProjectSettings/TagManager.asset and b/ProjectSettings/TagManager.asset differ