// Start is called before the first frame update void Start() { _rootAction = MixedRealityToolkit.GetService <OpenKitService>().EnsureRootAction("Test Root Action"); _startActionBtn.onClick.AddListener(OnActionButtonClicked); _startAction2Btn.onClick.AddListener(OnActionButton2Clicked); _startTaskBtn.onClick.AddListener(OnStartTaskButtonClicked); _destroyBtn.onClick.AddListener(OnDestroyClicked); _rootAction.ReportEvent("Added button listeners"); }
public bool TryGetRootAction(string actionName, out IRootAction action) { if (_rootActionDictionary.ContainsKey(actionName)) { action = _rootActionDictionary[actionName]; return(true); } action = null; return(false); }
public void LeaveRootAction(IRootAction action) { if (action != null && _rootActionDictionary.ContainsValue(action)) { LeaveRootAction(_rootActionDictionary.Where(v => v.Value == action).First().Key); } else { action?.LeaveAction(); } }