You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
701 B
33 lines
701 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class UI : MonoBehaviour
|
|
{
|
|
|
|
private CanvasGroup UICanvas;
|
|
private float alpha = 0;
|
|
private float speed = 10;
|
|
|
|
void Start()
|
|
{
|
|
UICanvas = this.GetComponent<CanvasGroup>();
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
UICanvas.alpha = Mathf.Lerp(UICanvas.alpha, alpha, speed * Time.deltaTime);
|
|
}
|
|
|
|
public void EnterUIShow()
|
|
{
|
|
alpha = 1;
|
|
GameObject.Find("Main Camera").GetComponent<CameraOrbit>().canScroll = false;
|
|
}
|
|
|
|
public void ExitUIHide()
|
|
{
|
|
alpha = 0;
|
|
GameObject.Find("Main Camera").GetComponent<CameraOrbit>().canScroll = true;
|
|
}
|
|
} |