예제 #1
0
        /// <summary>
        /// UI Input
        /// CallbackContext.Phase:
        ///		Started - OnButtonDown
        ///		Performed - same as above?
        ///		Canceled - OnButtonUp
        /// </summary>
        public void OnConfirm(CallbackContext value)
        {
            if (value.phase == InputActionPhase.Started)
            {
                switch (currentEvent.eventType)
                {
                case ScenimaticEvent.ScenimaticEventType.Query:

                    int selectionIndex = queryPanel.GetSelectedIndex();
                    Debug.Log("Index: " + selectionIndex);
                    if (currentEvent.outputGUIDs.Count > 1)
                    {                             // only a ControlFlow Query can have more than one outputGUID!
                        Debug.Log("OutputGUID: " + currentEvent.outputGUIDs[selectionIndex]);
                        string outConnGUID = currentEvent.outputGUIDs[selectionIndex];
                        var    conn        = guidConnectionOutputs[outConnGUID];

                        nextGUID = guidConnectionInputs[conn.connectedToGUIDs[0]].GUID;
                        Debug.Log(nextGUID);
                    }
                    else
                    {
                        string selected = queryPanel.GetSelectedItem();
                        guidPassedVariables.Add(currentEvent.outputGUIDs[0], selected);
                    }

                    queryPanel.Clear();

                    NextEventInQueue();
                    break;

                case ScenimaticEvent.ScenimaticEventType.Dialog:
                    if (dialogPanel.Confirm())
                    {
                        NextEventInQueue();
                    }
                    break;
                }
            }
        }