using UnityEngine;
using System.Collections;

public class RenderTrigger 
{
    public delegate void FireTrigger();

    private FireTrigger fireTrigger;
    private float triggerTime;
    private bool triggered = false;

    public RenderTrigger(FireTrigger fireTriggerAt, float triggerAt)
    {
        fireTrigger = fireTriggerAt;
        triggerTime = triggerAt;
    }

    public void CheckDrop(float completion)
    {
        if (triggered || completion < triggerTime)
            return;

        triggered = true;
        fireTrigger();
    }

}
