add live camera support
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user