Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class MiniMapSize : MonoBehaviour
- {
- GameObject MinimapMesh;
- public float ExtraSize = 0.5f;
- // Start is called before the first frame update
- void Start()
- {
- MinimapMesh = FindFirstObjectByType<MinimapMesh>().gameObject;
- if (MinimapMesh != null)
- {
- float size = MinimapMesh.GetComponent<MeshFilter>().mesh.bounds.extents.magnitude;
- GetComponent<Camera>().orthographicSize = size + ExtraSize;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment