using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using UnityEngine.EventSystems;

public class GrowingButton : MonoBehaviour, IPointerClickHandler
{

    [SerializeField] GameObject cellPrefab;
    CellConnection connectionToParent;
    BaseCell parent;


    void Update()
    {
        transform.parent.position = parent.transform.position;
    }

    public void Initialize(BaseCell parent, CellConnection connection)
    {
        this.connectionToParent = connection;
        this.parent = parent;
    }

    public void OnPointerClick(PointerEventData data)
    {
        parent.GrowCell(connectionToParent, cellPrefab);
    }

}
