示例#1
0
    void HandlePlayerOptions(IAction decision)
    {
        _waitingForPlayer = true;
        if (decision != null)
        {
            if (decision.Key.ToString() == "Speak")
            {
                //                                          NTerm: 0     1     2     3     4
                // If it is a speaking action it is composed by Speak ( [ms], [ns] , [m}, [sty])
                var currentState = decision.Name.GetNTerm(1);
                var nextState    = decision.Name.GetNTerm(2);
                var meaning      = decision.Name.GetNTerm(3);
                var style        = decision.Name.GetNTerm(4);


                // Returns a list of all the dialogues given the parameters
                var dialog = _iat.GetDialogueActions(currentState, (Name)"*", (Name)"*", (Name)"*");

                foreach (var d in dialog)
                {
                    d.Utterance = _playerRpc.ProcessWithBeliefs(d.Utterance);
                }

                AddDialogueButtons(dialog, decision.Target);
            }

            else
            {
                Debug.LogWarning("Unknown action: " + decision.Key);
            }
        }
    }