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

public class Mirror_reflection : MonoBehaviour
{
    [SerializeField] private GameObject mirror;
    [SerializeField] private RoscanModelUnity model;

    // initialization position of mirror
    private void Start()
    {
        mirror.transform.localPosition = new Vector3(0, 200f, 0);
    }

    /// <summary> Create mirror and make it child to main camera - created when model is opened </summary>
    public void CreateMirror()
    {
        // Camera.main.transform.DetachChildren();
        mirror.transform.parent = null;

        Quaternion initRotation = Camera.main.transform.rotation;
        mirror.transform.localRotation = initRotation;
        Vector3 tempSize = model.getSizeOfModel();
        mirror.transform.localScale = new Vector3(tempSize.x * 5, tempSize.y * 5, 20);

        mirror.transform.parent = Camera.main.transform;
    }

}
