36 lines
738 B
C#
36 lines
738 B
C#
using UnityEngine;
|
|
|
|
public class WaterTopFX : MonoBehaviour
|
|
{
|
|
public GameObject[] topFxPrefabs;
|
|
|
|
public float radius = 10f;
|
|
|
|
public float waterHeight;
|
|
|
|
private void Start()
|
|
{
|
|
waterHeight = GameObject.FindWithTag("Water").transform.position.y;
|
|
base.transform.position = new Vector3(base.transform.position.x, waterHeight, base.transform.position.z);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.B))
|
|
{
|
|
CreateFx();
|
|
}
|
|
}
|
|
|
|
private void CreateFx()
|
|
{
|
|
Object.Instantiate(topFxPrefabs[0], base.transform.position, Quaternion.identity, base.transform).GetComponent<TopFx>().Play();
|
|
}
|
|
|
|
private void OnDrawGizmos()
|
|
{
|
|
Gizmos.color = Color.yellow;
|
|
Gizmos.DrawWireSphere(base.transform.position, radius);
|
|
}
|
|
}
|