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

public class LittleOctopusCollider : MonoBehaviour
{
    public GameObject Spawner;
    public GameObject Playah;
    void Start()
    {
        Spawner = GameObject.FindGameObjectWithTag("Spawnmanager");
        Playah = GameObject.FindGameObjectWithTag("Player");
    }
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
         
            Debug.Log("Player Hit");
            Destroy(this.gameObject);
            other.SendMessage("TakeDamage");
            
            // damage player
            //Spawner.GetComponent<SpawnManager>().remainingAlive--;
            //
        }

        if (other.gameObject.CompareTag("Playerbullet"))
        {
            Debug.Log("Player bullet Hit");
            Destroy(this.gameObject);
            Destroy(other.gameObject);
           // Spawner.GetComponent<SpawnManager>().remainingAlive--;
            Playah.GetComponent<PlayerScore>().AddScore(3);
            // damage player

            //
        }
    }
}
