18 lines
467 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MinimapSize : MonoBehaviour
{
GameObject MinimapMesh;
public void SetSize()
{
MinimapMesh = FindObjectOfType<MinimapMesh>().gameObject;
if (MinimapMesh != null)
{
float size = MinimapMesh.GetComponent<MeshFilter>().mesh.bounds.size.magnitude;
GetComponent<Camera>().orthographicSize = size*0.5f;
}
}
}