43 lines
699 B
C#
43 lines
699 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
[Serializable]
|
|
public class triggertree : MonoBehaviour
|
|
{
|
|
[NonSerialized]
|
|
public static int leverswitch;
|
|
|
|
public int trigger;
|
|
|
|
public Transform Player;
|
|
|
|
public GameObject animated;
|
|
|
|
public Transform dooractivater;
|
|
|
|
public AudioClip fallsound;
|
|
|
|
public triggertree()
|
|
{
|
|
trigger = 1;
|
|
}
|
|
|
|
public virtual void OnTriggerEnter(Collider other)
|
|
{
|
|
leverswitch = trigger;
|
|
Player.parent = null;
|
|
animated.GetComponent<Animation>().Play("fall");
|
|
GetComponent<AudioSource>().PlayOneShot(fallsound);
|
|
bool flag = false;
|
|
}
|
|
|
|
public virtual void OnTriggerExit(Collider other)
|
|
{
|
|
UnityEngine.Object.Destroy(gameObject);
|
|
}
|
|
|
|
public virtual void Main()
|
|
{
|
|
}
|
|
}
|