Add the child being noticed when he stands on floor (need to add the

consequences though)
This commit is contained in:
Patrice Vignola 2015-08-22 05:48:22 -04:00
parent c0f938a59a
commit a030642c8d
4 changed files with 11 additions and 0 deletions

Binary file not shown.

View File

@ -133,4 +133,13 @@ public class Child : MonoBehaviour
return colliders.Length > 0; 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.");
}
}
} }

View File

@ -20,11 +20,13 @@ public class Floor : MonoBehaviour
private void ChangeToNormalFloor() private void ChangeToNormalFloor()
{ {
_renderer.material = NormalMaterial; _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() private void ChangeToLavaFloor()
{ {
_renderer.material = LavaMaterial; _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() void OnDestroy()

Binary file not shown.