Newer
Older
Plot_On_Reality / Assets / Originals / Scripts / GraphManagement / GraphOptionMenu.cs
t-nagao on 1 Feb 2023 1 KB first
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);
    }

}