using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Bomb : MonoBehaviour
{
    public Rigidbody rigidbody;
    public Collider col;
    public List<HitCheck> hitCheck;
    public int cntPenetrate = 20;
    public void OnInitialized(Character owner, int layerEnemy)
    {
        rigidbody.velocity = Vector3.zero;

        for (int i = 0; i < hitCheck.Count; i++)
            hitCheck[i].Initialized(owner, layerEnemy, cntPenetrate, null);

        //if (rigidbody != null)
        //{
        //    Vector3 pos = transform.position;
        //    Vector3 pos2 = Util.PointCreate(0.1f, 0.5f);
        //    pos += pos2;
        //    pos.y = 2f;
        //    transform.position = pos;

        //    pos = Util.PointCreate(30f, 100f);
        //    pos.y = 450;

        //    //Vector3 pos = Vector3.zero;
        //    //pos.y = 100;

        //    rigidbody.AddForce(pos);
        //}
        Invoke("LockRelease", 0.5f);
    }

    void LockRelease()
    {
        col.enabled = true;
        rigidbody.velocity = Vector3.zero;
    }
}