test commit

This commit is contained in:
niko
2026-10-11 20:26:48 +02:00
parent 4dbd3c0ab3
commit 6fee00e7ff
2187 changed files with 760371 additions and 2 deletions
+36
View File
@@ -0,0 +1,36 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
public class TreeFallTrigger : MonoBehaviour
{
AudioSource source;
Animation anim;
bool fell = false;
private void Awake()
{
source = GetComponent<AudioSource>();
anim = GetComponent<Animation>();
if (!anim)
anim = GetComponentInParent<Animation>();
}
private void OnTriggerEnter(Collider other)
{
if (Random.Range(0, 100) < 50) return;
if (other.CompareTag("Player") && !fell)
{
fell = true;
if (!anim || !source) return;
anim.Play("fall");
source.Play();
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: ef339f08da140604cb439333b2b4beba