Guest User

MiniMapSize.cs

a guest
May 20th, 2020
175
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class MiniMapSize : MonoBehaviour
  6. {
  7.     GameObject MinimapMesh;
  8.     // Start is called before the first frame update
  9.     void Start()
  10.     {
  11.         MinimapMesh = FindObjectOfType<MinimapMesh>().gameObject;
  12.         if (MinimapMesh != null)
  13.         {
  14.             float size = MinimapMesh.GetComponent<MeshFilter>().mesh.bounds.size.magnitude;
  15.             GetComponent<Camera>().orthographicSize = size;
  16.         }
  17.     }
  18. }
RAW Paste Data