Hi there. So I am using the VR Samples package to develop for the GearVR and have implemented a time gaze function by amending the SelectionRadial.cs as per this thread.
However, doing it this way, it’s hardly functional for what I want to achieve, as the selection radial is not resetting at all when looking at different objects, i.e. with a selection fill time of say 3, if I am looking at door1 for 2secs and then decide to rather go through door2, I’ll load into door2’s level after only 1 sec of looking at it.
I guess I need to implement some way to actively stop the selection radial and to restart afresh? The below is already part of the code but does not seem to work for gaze input. There were also some people questioning this in the above mentioned thread but unfortunately nobody found a fix as of yet.
public void Hide()
{
m_Selection.gameObject.SetActive(false);
m_IsSelectionRadialActive = false;
m_Selection.fillAmount = 0f; // This effectively resets the radial for when it's shown again.
}
private IEnumerator FillSelectionRadial()
{
m_RadialFilled = false;
float timer = 0f;
m_Selection.fillAmount = 0f;
while (timer < m_SelectionDuration)
{
m_Selection.fillAmount = timer / m_SelectionDuration;
timer += Time.deltaTime;
yield return null;
}
m_Selection.fillAmount = 1f;
m_IsSelectionRadialActive = false;
m_RadialFilled = true;
if (OnSelectionComplete != null)
OnSelectionComplete();
}
public IEnumerator WaitForSelectionRadialToFill ()
{
m_RadialFilled = false;
Show ();
while (!m_RadialFilled)
{
yield return null;
}
Hide ();
}
private void HandleDown()
{
if (m_IsSelectionRadialActive)
{
m_SelectionFillRoutine = StartCoroutine(FillSelectionRadial());
}
}
private void HandleUp()
{
if (m_IsSelectionRadialActive)
{
if(m_SelectionFillRoutine != null)
StopCoroutine(m_SelectionFillRoutine);
m_Selection.fillAmount = 0f;
}
}
}