using System;
using UnityEngine;

public class OneActionComponent : MonoBehaviour {

    private Action action;
    private bool hasAction = false;

    public void SetAction(Action action){
        hasAction = true;
        this.action = action;
    }

    void Update(){
        if(hasAction){
            action();
            Destroy(gameObject);
        }
    }
}
