using UnityEngine;
using System.Collections;
using Framework.Entities;
using Framework.Extensions;
using System.Linq;
using System.Collections.Generic;
using Framework.InteractionSystem;
using Framework.Utility;
using Project.Sound;

namespace Project.Effects
{
    public class SteamBurstEffect : CoreBehaviour
    {
        public float time = 1f;
        public AudioClip clip;
        public float soundRange = 2f;
        private UnityTimer lifeTimer;

        // Use this for initialization
        protected override void InnerAwake()
        {
        }

        protected override void InnerStart()
        {
            this.lifeTimer = new UnityTimer(this.time, false);
            Announce(new AudioVisualDirector.SoundAction(this.transform.position, this.soundRange));
        }

        // Update is called once per frame
        protected override void InnerUpdate()
        {
            this.lifeTimer.Advance();
            if (this.lifeTimer.IsComplete())
            {
                Destroy(this.gameObject);
            }
        }
    }
}