32 lines
669 B
C#
32 lines
669 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ThunderController : MonoBehaviour
|
|
{
|
|
public ThunderAtk thunderAtk;
|
|
public Player player;
|
|
public float frequency = 2f;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
InitThunder();
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public void NextLightAtk() {
|
|
Invoke(nameof(InitThunder),frequency);
|
|
}
|
|
|
|
void InitThunder() {
|
|
ThunderAtk atk;
|
|
atk = Instantiate(thunderAtk,new Vector3(player.transform.position.x,0,0), Quaternion.identity);
|
|
}
|
|
|
|
}
|