private void SetStateHelper(EVRSuitManager.ConnectionState currentState) { switch (currentState) { case EVRSuitManager.ConnectionState.NONE: GetComponent <Selectable>().interactable = None; break; case EVRSuitManager.ConnectionState.ATTACHED: GetComponent <Selectable>().interactable = Attached; break; case EVRSuitManager.ConnectionState.DETACHED: GetComponent <Selectable>().interactable = Detached; break; case EVRSuitManager.ConnectionState.CONNECTED: GetComponent <Selectable>().interactable = Conected; break; case EVRSuitManager.ConnectionState.DISCONNECTED: GetComponent <Selectable>().interactable = Disconnected; break; case EVRSuitManager.ConnectionState.CALIBRATING: GetComponent <Selectable>().interactable = Calibrating; break; case EVRSuitManager.ConnectionState.STREAMING: GetComponent <Selectable>().interactable = Streaming; break; } }
private System.Collections.IEnumerator DelayAndSetState(EVRSuitManager.ConnectionState currentState) { yield return(new WaitForSeconds(3)); SetStateHelper(currentState); }
public void SetState(EVRSuitManager.ConnectionState currentState) { // Implement an artificial delay GetComponent <Selectable>().interactable = false; StartCoroutine(DelayAndSetState(currentState)); }