add live camera support

This commit is contained in:
CroakFang
2023-07-23 17:48:49 +08:00
parent bcb4b00985
commit a13cac6ede
42 changed files with 5252 additions and 717 deletions
@@ -10,9 +10,39 @@ public class LiveViewerUI : MonoBehaviour
public UnityEngine.UI.Slider ProgressBar;
public RectTransform BottonUITransform;
float targetHeight = 0;
float height;
private void Awake()
{
height = BottonUITransform.rect.height;
targetHeight = 0;
Invoke(nameof(HideSlider), 1.5f);
Instance = this;
//TrueProgressBar = (UnityEngine.UIElements.Slider)ProgressBar;
}
public void OnMouse(bool isEnter)
{
if (isEnter)
{
targetHeight = 0;
CancelInvoke();
}
else
{
Invoke(nameof(HideSlider), 2.5f);
}
}
private void FixedUpdate()
{
BottonUITransform.anchoredPosition = Vector2.Lerp(BottonUITransform.anchoredPosition, new Vector2(0, targetHeight), Time.fixedDeltaTime * 5);
}
private void HideSlider()
{
targetHeight = -height;
}
}