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

public class SecondLevelTrigger : MonoBehaviour
{
    //public Transform m_targetTrans;
    //private Vector3 m_pos = new Vector3(0.09f, 1.3f, -0.54f);
    //private Quaternion m_rotation = Quaternion.Euler(-15,256, -2.594f);

    //private void OnTriggerEnter(Collider other)
    //{
    //    if (other.gameObject.CompareTag("Target"))
    //    {
    //        BattleCtrl.instance.levelManager.curLevel.chainRopeView.CatchObjEnterTarget();
    //        BattleCtrl.instance.OnBattleWin();
    //        m_targetTrans.localPosition = m_pos;
    //        m_targetTrans.localRotation = m_rotation;
    //    }
    //}
    public Transform m_playerTrans;
    private bool m_bControl = true;
    private float m_speed = 1.0f;
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("Player") && m_bControl)
        {
            m_bControl = false;
            BattleCtrl.instance.OnBattleWin();
        }
    }
    private void Update()
    {
        if(BattleCtrl.instance.isEndBattle)
        {
            return;
        }
        if(BattleCtrl.instance.battleUI.IsLeftEmtryBomb && !BattleCtrl.instance.battleUI.IsBombButtonCanInteractable)
        {
            m_playerTrans.Translate(Vector3.forward * Time.deltaTime * m_speed, Space.Self);
        }
    }
}
