Added files

This commit is contained in:
Josiah
2026-01-31 19:38:59 -06:00
20 changed files with 15 additions and 0 deletions
+1
View File
@@ -184,3 +184,4 @@ MonoBehaviour:
targetRefreshInterval: 0.4
consumeDistance: 0.35
wanderInterval: 1.2
trickPrefab: {fileID: 700000000, guid: 8bf8957665594a718535d06aba0cdee7, type: 3}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+14
View File
@@ -10,6 +10,7 @@ public class TrickController : MonoBehaviour
[SerializeField] private float targetRefreshInterval = 0.4f;
[SerializeField] private float consumeDistance = 0.35f;
[SerializeField] private float wanderInterval = 1.2f;
[SerializeField] private TrickController trickPrefab;
private Rigidbody2D body;
private Transform target;
@@ -144,15 +145,28 @@ public class TrickController : MonoBehaviour
continue;
}
var spawnPosition = hit.transform.position;
Destroy(hit.gameObject);
if (target == hit.transform)
{
target = null;
}
SpawnTrick(spawnPosition);
break;
}
}
private void SpawnTrick(Vector3 position)
{
if (trickPrefab != null)
{
Instantiate(trickPrefab, position, Quaternion.identity);
return;
}
Instantiate(gameObject, position, Quaternion.identity);
}
public void SetCarried(bool carried)
{
isCarried = carried;