void Start() { if (safeZone == null) { Debug.LogWarning("Arm operation requires the safe-zone to be specified"); _touchActive = false; } // Hide all but the default menu // active any disabled menus (disabled for practical reasons in-editor) if (defaultMenu != null) { var menus = GetComponentsInChildren <PhysicsMenu>(true); foreach (var menu in menus) { menu.gameObject.SetActive(true); menu.Hide(); } defaultMenu.Show(); _currentMenu = defaultMenu; } // Initialize hand choice to set value HandChoice = _handChoice; }
public void SwitchTo(PhysicsMenu menu) { _switchTimer = WaitAndSwitch(1.0f, menu); StartCoroutine(_switchTimer); RecordingManager.Log(string.Format( "EVENT: menu_transition from=<{0}> to=<{1}>", name, menu.name)); }
public IEnumerator WaitAndSwitch(float time, PhysicsMenu menu) { yield return(new WaitForSeconds(0.25f)); Hide(); yield return(new WaitForSeconds(time)); GetComponentInParent <PhysicsInputManager>().CurrentMenu = menu; menu.Show(); }