示例#1
0
        /// <summary>
        /// Makes the specified target say the specified reply, and returns the length of the audio clip corresponding to the current language.
        /// </summary>
        /// <param name="reply">The reply to say.</param>
        /// <param name="target">The actor that will say the reply.</param>
        /// <returns>Returns the length of the audio clip corresponding to the current language.</returns>
        public virtual float SayReply(Reply reply, ActorIdentifier target)
        {
            if (reply == null)
            {
                throw new System.Exception("ERROR: the reply cannot be null!");
            }
            else if (target == null)
            {
                throw new System.Exception("ERROR: the target cannot be null for the reply " + reply.name);
            }
            else if (!actorsDic.ContainsKey(target))
            {
                throw new System.Exception("ERROR: unable to find the target specified in your dialog for the reply " + reply.name + " in the list" +
                                           "of the actors for your dialog. Please make sure all the actors are specified in your DialogPlayer.");
            }

            if (forcedLanguage.Length > 0)
            {
                return(actorsDic[target].SayReply(reply, this, forcedLanguage));
            }
            return(actorsDic[target].SayReply(reply, this));
        }
 public void Load()
 {
     Reply  = Resources.Load <Replies.Reply>(ReplyResourcePath);
     Target = Resources.Load <ActorIdentifier>(TargetResourcePath);
 }