Adam Ramberg e4c489c88e WIP
2020-03-11 21:11:27 +01:00

21 lines
516 B
C#

using UnityAtoms.BaseAtoms;
using UnityAtoms.FSM;
using UnityEngine;
public class EnemyShooting : MonoBehaviour
{
[SerializeField]
private FiniteStateMachineReference _enemyState;
[SerializeField]
private GameObject _projectile;
void Awake()
{
_enemyState.Machine.OnStateCooldown("ATTACKING", (value) =>
{
var spawnPos = transform.position + transform.right;
Instantiate(_projectile, spawnPos, transform.rotation);
}, gameObject);
}
}