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

public class PlayerPossess : MonoBehaviour
{
    public GameObject bulletPrefab;
    private PossessBullet wisp;

    private void Update()
    {
        if (Input.GetMouseButtonDown(1) && wisp == null)
        {
            UnitController player = PlayerManager.I.unit;
            Vector3 spawnPoint = new Vector3(player.gameObject.transform.position.x, 1f, player.gameObject.transform.position.z);

            // var spawnPoint = player.transform.localToWorldMatrix.MultiplyVector(spawnOffset);
            GameObject bullet = Pool.Get(bulletPrefab, spawnPoint, player.gameObject.transform.rotation);
            wisp = bullet.GetComponent<PossessBullet>();
            // bullet.gameObject.GetOrAddComponent<PossessBullet>();
        }
    }
}
