GeoJam2021/Assets/Scripts/MenuZoom.cs

40 lines
839 B
C#
Raw Normal View History

2021-07-22 20:09:52 +02:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MenuZoom : MonoBehaviour
{
public Camera cam;
public GameObject objects;
2021-07-22 21:52:18 +02:00
bool flag1 = true;
bool flag2 = false;
2021-07-22 20:09:52 +02:00
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
2021-07-22 21:52:18 +02:00
if (flag1){
if(cam.orthographicSize > 1f){
cam.orthographicSize -= 0.1f;
2021-07-22 20:09:52 +02:00
}
2021-07-22 21:52:18 +02:00
else{
flag1 = false;
flag2 = true;
objects.SetActive(true);
}
}
if(flag2){
if(cam.orthographicSize < 5f){
cam.orthographicSize += 0.06f;
}
else{
flag2 = false;
2021-07-22 20:09:52 +02:00
}
}
}
}