38 lines
671 B
C#
38 lines
671 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class SHS : MonoBehaviour
|
|
{
|
|
Vector3 startP;
|
|
|
|
GameObject overlop;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
startP = transform.position;
|
|
overlop = null;
|
|
}
|
|
|
|
public string getOverlop()
|
|
{
|
|
return overlop ? overlop.name : "";
|
|
}
|
|
|
|
public void Restart() {
|
|
overlop = null;
|
|
transform.position = startP;
|
|
}
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
overlop = other.gameObject;
|
|
}
|
|
|
|
private void OnTriggerExit(Collider other)
|
|
{
|
|
overlop = null;
|
|
}
|
|
}
|