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

public class Soldier : DegreableObject
{
    // Start is called before the first frame update    
    GM Gm;
    void Start()
    {

        Gm = FindObjectOfType<GM>();

    }

    // Update is called once per frame
    void Update()
    {

    }
    public void Reborn()
    {

    }
    // public void Shoot(Vector2 mousePos)
    // {
    //     //  pew.Play();
    //     var ammo = Gm.pool.Rent();
    //     CompositeDisposable disposable = new CompositeDisposable();
    //     ammo.transform.position = this.transform.position;
    //     Observable.Return(Unit.Default).Delay(System.TimeSpan.FromSeconds(10)).Subscribe(x =>
    //     {
    //         ammo.gameObject.SetActive(false);
    //         Gm.pool.Return(ammo);
    //         disposable.Dispose();
    //     }).AddTo(disposable);
    //     var angle = gun.transform.position.ToVector2().AngleBetweenVector2(mousePos);
    //     var direction = (angle + 70).DirectionFromAngle();
    //
    //     Observable.EveryUpdate().Subscribe(x =>
    //     {
    //         ammo.transform.position += direction * Time.deltaTime * ShootingSpeed;
    //     }).AddTo(disposable);
}
