mirror of
https://github.com/ConjureETS/PillowFight.git
synced 2026-03-24 00:50:59 +00:00
Add the child being noticed when he stands on floor (need to add the
consequences though)
This commit is contained in:
parent
c0f938a59a
commit
a030642c8d
Binary file not shown.
@ -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.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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.
Loading…
x
Reference in New Issue
Block a user