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

public class GraphOptionMenu : BackButton
{
    [SerializeField] GameObject changeColorScreen;
    [SerializeField] GameObject inputFomulaScreen;
    [SerializeField] GameObject plotScaleScreen;
    [SerializeField] GameObject removeGraphScreen;

    private GraphData graphData;
    private int index;

    public void Initialize(GraphData data, int num)
    {
        graphData = data;
        index = num;
    }

    public void pressedChangeColorButton()
    {
        allSetActiveFalse();
        changeColorScreen.GetComponent<ChangeColorScreen>().Initialize(graphData);
        changeColorScreen.SetActive(true);
    }

    public void pressedChangeFormulaButton()
    {
        allSetActiveFalse();
        inputFomulaScreen.GetComponent<GraphAdderWindow>().Initialize(graphData , index);
        inputFomulaScreen.SetActive(true);
    }

    public void pressedPlotScaleButton()
    {
        allSetActiveFalse();
        plotScaleScreen.GetComponent<PlotScale>().Initialize(graphData);
        plotScaleScreen.SetActive(true);
    }

    public void pressedRemoveGraphButton()
    {
        allSetActiveFalse();
        removeGraphScreen.GetComponent<RemoveGraph>().Initialize(graphData , index);
        removeGraphScreen.SetActive(true);
    }

    private void allSetActiveFalse()
    {
        changeColorScreen.SetActive(false);
        inputFomulaScreen.SetActive(false);
        plotScaleScreen.SetActive(false);
        removeGraphScreen.SetActive(false);
    }

}
