using DarkTonic.CoreGameKit;
using UnityEngine;

public class GameManager : MonoBehaviour
{
    public Transform facePrefab;

    public Transform facePivot;

    public Transform[] pivotList;

    private Face currentFace;

    private void Start()
    {
        Transform trans = PoolBoss.Spawn(this.facePrefab, this.facePivot.position, Quaternion.identity, this.facePivot);
        trans.localScale = Vector3.one;
        trans.localPosition = Vector3.zero;

        if (trans != null)
        {
            this.currentFace = trans.GetComponent<Face>();

            if (this.currentFace != null)
            {
                this.currentFace.makeRandomHead();
            }
        }

        for (int i = 0; i < this.pivotList.Length; i++)
        {
            trans = PoolBoss.Spawn(this.facePrefab, this.pivotList[i].position, Quaternion.identity, this.pivotList[i]);
            trans.localScale = Vector3.one;
            trans.localPosition = Vector3.zero;

            if (trans != null)
            {
                Face face = trans.GetComponent<Face>();

                if (face != null)
                {
                    face.makeOtherHeads(this.currentFace);
                }
            }
        }
    }
}