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

public class ScGraphInfo : MonoBehaviour
{
    [SerializeField] GameObject[] moneyObjs;
    [SerializeField] GameObject[] worksObjs;
    [SerializeField] GameObject[] honorObjs;
    [SerializeField] GameObject[] relationObjs;
    // Start is called before the first frame update
    void Start()
    {
        PrepareData();
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    void PrepareData()
    {
        PlayerVO myPlayer = GameDataService.Instance.myPlayer;
        ShowData(moneyObjs, myPlayer.money);
        ShowData(worksObjs, myPlayer.work);
        ShowData(honorObjs, myPlayer.honor);
        ShowData(relationObjs, myPlayer.relationship);
    }

    void ShowData(GameObject[] objs, float score)
    {
        for (int i = 0; i < objs.Length; i++)
        {
            objs[i].gameObject.SetActive(false);
        }
        if (score < 35)
        {
            objs[0].gameObject.SetActive(true);
        }else if (score < 71)
        {
            objs[1].gameObject.SetActive(true);
        }
        else
        {
            objs[2].gameObject.SetActive(true);
        }
    }
}
