Goat and Pit

This commit is contained in:
2026-01-23 16:27:57 +01:00
parent 047073fe8a
commit e16413b2da
5 changed files with 53 additions and 40 deletions
+13
View File
@@ -0,0 +1,13 @@
using System;
using UnityEngine;
public class Goal : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
if (other.tag == "IceBlock")
{
Debug.Log("Win");
}
}
}
+2
View File
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d66d4e72f6fa56b4788ea9a4017bfb8f
+24 -11
View File
@@ -1,17 +1,30 @@
using System;
using UnityEngine;
public class Pit : MonoBehaviour
{
public PlayerMove player;
public IceBlockPush ice;
public PlayerMove player;
public IceBlockPush ice;
//
// // Update is called once per frame
// void Update()
// {
// if (Input.GetKeyDown(KeyCode.Space))
// {
// player.Reset();
// ice.Reset();
// }
// }
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
player.Reset();
ice.Reset();
}
}
private void OnTriggerEnter(Collider other)
{
if (other.GetComponent<PlayerMove>())
{
player.Reset();
}
else if(other.GetComponent<IceBlockPush>())
{
ice.Reset();
}
}
}