44 lines
722 B
C#
44 lines
722 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
[Serializable]
|
|
public class collectsoundscript : MonoBehaviour
|
|
{
|
|
[NonSerialized]
|
|
public static int leverswitch;
|
|
|
|
public int trigger;
|
|
|
|
public Transform Player;
|
|
|
|
public GameObject animated;
|
|
|
|
public Transform dooractivater;
|
|
|
|
public Transform collect;
|
|
|
|
public Transform spawnpoint;
|
|
|
|
public collectsoundscript()
|
|
{
|
|
trigger = 1;
|
|
}
|
|
|
|
public virtual void OnTriggerEnter(Collider other)
|
|
{
|
|
leverswitch = trigger;
|
|
Player.parent = null;
|
|
UnityEngine.Object.Instantiate(collect, spawnpoint.position, spawnpoint.rotation);
|
|
bool flag = false;
|
|
}
|
|
|
|
public virtual void OnTriggerExit(Collider other)
|
|
{
|
|
UnityEngine.Object.Destroy(gameObject);
|
|
}
|
|
|
|
public virtual void Main()
|
|
{
|
|
}
|
|
}
|