Dialogue System for Unity文档中文对照版(简雨原创翻译)第二篇(我们开始仙剑demo的剧情)

37 篇文章 1 订阅

DialogueDatabase

To usethe Dialogue System, you need to create a dialogue database containing lines ofdialogue (conversations) and related information. A dialogue database contains:

ProjectInfo: Description,author, version – information typically only used internally by the gamedeveloper.

Actors: Conversation participants (PCs,NPCs, interactive objects).

Items/Quests: Information about"items" in Chat Mapper. Under the hood, these are just data fields.When using theQuest Log System, items are used to store questinformation. (The table name "Quest" is an alias for the Item table.)If you're not using the Quest Log System, you're free to store whatever kind ofinformation you want in here.

Locations: A "location" in ChatMapper. The Dialogue System doesn't use locations for anything in particular.You're free to store whatever kind of information you want in them.

Variables: Lua user variables. You canaccess these variables in your dialogue entries' conditions and user scripts aswell as in trigger conditions. User variables let you check and change state(for example, updating a quest or an NPC relationship). See: Lua.

Conversations: Dialogue trees between twoactors. A conversation is made of Dialogue Entries (spoken lines) connected byLinks.

Thereare several ways to create a dialogue database:

Selectthe menu item Window > Dialogue System > Asset > Create >Dialogue Database and use the built-inDialogue Editor.

Converta Using Chat Mapper project usingChat Mapper Converter,

Convertan articy:draft project using articy:draft Converter, or

Converta Neverwinter Nights 1 or 2 project using Aurora Toolset (Neverwinter Nights) Converter, or

Converta spreadsheet in CSV format using the menu item Window > Dialogue System> Tools > Converters > CSV Converter. SeePixelCrushers.DialogueSystem.Editors.CSVConverterWindow for instructions.

对话的数据库

使用的对话系统,你需要创建一个包含行对话对话数据库(对话)和相关信息。一个对话数据库包含:

?项目简介:描述,作者,版本–信息通常只用于内部的游戏开发公司。

?演员:会话参与者(PCS,NPC,互动对象)。

 

?项目/任务:关于“项目”的聊天器。引擎盖下,这些都是数据域。使用日志系统时,项目是用来存储任务的信息。(表名“探索”是为项目表的别名。)如果你不使用日志系统,你可以自由地存储任何你想要的信息。

?地点:一个“位置”的聊天器。对话系统不使用的位置,尤其是什么。你可以自由地存储任何你想要的信息。

?变量:lua用户变量。你可以访问这些变量在您的对话内容的条件和用户脚本以及触发条件。用户变量让你检查和状态改变(例如,更新的任务的关系)。参见:Lua。

?对话:对话树之间的两个演员。对话是对话的条目(台词)连接的链接。

有创建一个对话数据库的几种方法:

1。选择菜单项窗口>> > >对话系统的对话创造资产数据库,使用内置的对话编辑。

2。将使用映射器使用聊天聊天制图项目,

3。将一个articy:使用articy草案起草项目:转换器,或

4。将无冬之夜1或2使用极光工具项目(无冬之夜)转换器,或

5。将电子表格的CSV格式使用菜单项窗口>>工具>变换>对话系统的CSV格式转换器。看到pixelcrushers.dialoguesystem.editors.csvconverterwindow指令。You can also write your own importer using a simpletemplate in Scripts/Editors/Converters/ConverterWindowTemplate.cs.

GeneralNotes

At aminimum, you should define at least two Actors (usually the Player and an NPC)and one Conversation.

TheDialogue System will try to match the characters' game object names with theirActor names in the dialogue database. It's simplest to keep these the same.Otherwise you can use an Override Actor Name component.

Ifyou're using the Quest Log System, define your quests as Items.Otherwise you're free to store whatever information you want in Items. Ifyou're using the Quest Log System and you haven't copied the provided templateproject, add these fields to your Item template:

State: (Text, default="unassigned") The current state of the quest.

SuccessDescription:(Text, optional) The description to use when the quest has been successfullycompleted.

FailureDescription:(Text, optional) The description to use when the quest has failed.

Notethat in Chat Mapper and the Dialogue System, space characters and hyphens getreplaced with underscores in Lua variables. This is described in more detail inthe sectionImportant Note About Table Indices. For example, "My Quest" becomes "My_Quest" when referencing the Item[]table. For example:

Item["My_Quest"].State = "active"

TheDialogue System doesn't use Locations for anything specific. You can storewhatever information you want in them.

TheDialogue System will create the following user variables if they don't exist:

Alert: (Text) You can assign text tothis variable. At the end of the conversation, the dialogue UI will displaythat text. You can use this to give the player information. For example, to letthe player know that they just acquired a new quest, add a User Script such as:

Variable["Alert"] = "New Quest: Kill 5Rats"

Actor: (Text) The name of the currentActor. In the Dialogue System, you can configure a conversation to trigger forany character, not just the character defined in your Chat Mapper project. Youcan read the value ofVariable["Actor"] to get the name of the currentActor. This is useful for general-purpose conversations such as withshopkeepers.

Conversant: (Text) Similarly, this is thename of the current Conversant (see Actor above).

Thefirst dialogue node of every conversation should be START. This is the default.

Definecutscene sequences in a custom Dialogue Entry field named Sequence, inthis form:

Action(parameters)[@seconds]

If youleave a Sequence field blank, the Dialogue System will use the default sequencedefined in the Dialogue Manager's display settings. Frequently, you will wantto make the conversants face each other at the beginning of a conversation. Todo this, add these commands to the sequence:

LookAt(listener,speaker); LookAt(speaker,listener)

See Sequencer, or Sequencer Command Reference for a full command reference.

You canalso define an additional sequence named Response Menu Sequence thatwill play in the background after the dialogue entry's text has been deliveredand the response menu is being shown. If the player makes a selection in theresponse menu while the response menu sequence is playing, the response menusequence will end and the next dialogue entry's sequence will begin on the sameframe. If both sequences include Camera() commands, you may need to add a finalrequired Camera() command that runs a short time after the end. For example,adding this to the end of the response menu sequence:Camera(Closeup,PrivateHart,0.1)@99999will guarantee that it ends with a closeup on Private Hart. Alternatively, youcould include a delay in the next dialogue entry's sequence to ensure that itruns after the response menu sequence is completely stopped (e.g,.Camera(Closeup,speaker,0.1)).

If yourproject uses lip sync, see How to Set Up Lip Sync.

TheDialogue System natively supports language localization. To set uplocalization, seeLocalization.

一般注释

?至少,你应该至少定义两个演员(通常是玩家和NPC)和一个会话。

?对话系统将尝试匹配的人物的游戏对象名称,在对话中数据库的演员的名字。这是最简单的把这些相同的。否则,你可以使用一个替代演员的名字成分。

?如果你使用的日志系统,定义你的任务物品。否则你的免费存储任何你想要的信息在项目。如果你使用的日志系统和你没有复制所提供的模板项目,把这些领域你的项目模板:

?状态:(文本,默认为“未分配”)任务的当前状态。

?成功的描述:(文本,可选)描述时所使用的任务已顺利完成。

?故障描述:(文本,可选)描述时所使用的任务失败了。

?请注意,在聊天的制图和对话系统,空间特征和连字符被替换下划线在Lua变量。这是更详细地描述在表指标的部分重要提示。例如,“我的任务”变成了“my_quest”引用项目[ ]表时。例如:

项目[“my_quest”]。国家=“主动”?对话系统不使用任何特定的位置。你可以把任何你想要的信息在他们。

?对话系统将创建下列用户变量,如果他们不存在:

?警告:您可以指定文本(text)这个变量。会谈结束时,对话界面将显示文本。你可以用这个来给玩家的信息。例如,让玩家知道他们刚刚获得了一个新的任务,如添加一个用户脚本:

变量[“警报”] =“新任务:杀死5只老鼠”?演员:(文本)的演员的名字。在对话系统,您可以配置一个会话的任何字符触发,不只是在你的聊天制图项目定义的字符。你可以读到的变量[“演员”]的价值得到当前的演员的名字。这个通用的谈话如店主是有用的。

?熟悉:(文本)同样,这是当前的名称(见演员以上)。

?每一个对话的对话的第一个节点应该开始。这是默认的。

?在一个自定义对话输入字段命名序列定义动画序列,这种形式:

行动(参数)[“秒]如果你离开一个序列领域的空白,对话系统将使用在对话管理器的显示设置定义的默认序列。通常,你会想的conversants面对对方在开始一段谈话。要做到这一点,将这些命令序列:

看看(听众,演讲者);查看(演讲,听众)看到音序器,或音序器命令参考一个完整的命令参考。

?您还可以定义一个额外的序列,命名为响应菜单序列,将对话后输入的文本已交付和响应菜单被显示在背景中播放。如果玩家有选择响应菜单而响应菜单顺序播放,响应菜单序列将结束和下一个对话输入序列将在同一帧开始。如果两个序列包括camera()命令,您可能需要添加一个最终需要的camera()命令运行结束后很短的时间。例如,添加到响应菜单序列结束:相机(镜头,私人哈特,0.1)@ 99999将保证它结束了对私人哈特特写。另外,你可以在接下来的对话输入序列的延迟保证它运行后,响应菜单序列是完全停止(如,。相机(镜头,扬声器,0.1))。

?如果你的项目采用假唱,看看如何建立唇同步。

?对话系统本身支持语言本地化。建立本土化,看到定位。

Built-InDialogue Editor

Inaddition to using a number of converters for other authoring tools, you can usethe Dialogue System's full-featured, built-inDialogue Editor. Documentation for the Dialogue Editoris fairly extensive, so it has its own page in this user manual.

Thereare three ways to open the Dialogue Editor:

Double-clicka dialogue database in the Project view,

Selecta dialogue database and click Edit... in the inspector, or

Selectthe menu item Window > Dialogue System > Tools > Dialogue Editor.

 

建立在对话编辑

除了使用一些其他编辑工具转换器,您可以使用对话系统的功能,内置的对话编辑。为对话编辑文件是相当广泛的,所以它有自己的网页在用户手册。

有三种方式打开对话编辑:

在项目视图中1.double-click对话数据库,

2。选择一个数据库,然后单击“编辑”对话…在检查,或

3。选择菜单项窗口>对话系统>工具>对话编辑。

SupportedDialogue Markup Tags

ChatMapper Tags

You canuse the following Chat Mapper tags in your dialogue text:

•[f]: (Force) Display the response menu even ifthis is the only response. Normally if there is only once response the DialogueSystem will automatically choose it without displaying the response menu. The[f] tag allows you to override this behaviour.

•[a]: (Action) Display the text in italics inthe response menu.

•[em#]...[/em#]: (Emphasis) Applies an emphasissetting to the text. The Dialogue System currently only observes one [em#]emphasis per dialogue entry and applies it to the whole dialogue entry unlessyou tick Use Rich Text and use a rich text-enabled GUI system such as UnityGUI.

•[var=varName]: (Variable) Replaces the tagwith the value of a variable defined in the Variable[] table. If your variablename has blank spaces or hyphens, you must replace them with underscores. Forexample, if your variable is named "My Job-Title", use: "I needa doctor, not a [var=My_Job_Title]!"•[pic=#], [pica=#], and [picc=#]: ChatMapper picture tag indices override the actor's portrait for the dialogueentry. The tag indices correspond to the actor's list of portrait images. picand pica (actor) refer to the speaker. You can also temporarily use one of thelistener's portraits using picc (conversant).

•Chat Mapper pipes (|) split into separatedialogue entries.

NewTags

TheDialogue System defines these new tags that are not present in Chat Mapper. Youcan add them to Chat Mapper text, but Chat Mapper won't do any specialprocessing on them. The Dialogue System>, however, will process them asdescribed:

•[position #]: Specifies the response buttonposition for a dialogue entry. If this dialogue entry is shown in a playerresponse menu, it will always be in the specified position. Example:"[position 6]I hate puppies." (In this example, "evil"options are always displayed in position 6 of our response menu UI.) Note thatthe position tag uses a blank space character, not an equals sign ('=').

•[lua(code)]: Replaces the tag with the returnvalue of the Lua code. Example: "Hello, [lua(Variable['Actor'])]!"(Greet the player.) For more information about Lua, see Lua.

RandomElement()Function

TheDialogue System provides a Lua function RandomElement(). You can use this incombination with the [lua()] tag to insert a random element from a list intoyour dialogue text.

Thesyntax of RandomElement is:

•RandomElement( string )

Wherestring is a string of elements separated by the horizontal bar character ('|').

RandomElement()Example

Say youhave an NPC that greets the character with a random honorific title. In yourdialogue database, click on the Variables tab and define a variable namedHonorifics that contains this list:

•Variable["Honorifics"] ="Esteemed|Revered|Great|Magnificent"

Then inthe dialogue entry, set the text to:

•Dialogue Text: Greetings,[lua(RandomElement(Variable["Honorifics"]))] One!

Theresult is that the NPC will randomly use one of the element in the Honorificslist, such as "Greetings, Esteemed One!" or "Greetings, GreatOne!"

Thesource string doesn't have to be set at design time. You can generate itdynamically during gameplay. You can use RandomElement() for other purposes,too, such giving the player a random item upon completion of a quest, or evenchoosing a random quest out of a list.

支持对话标记

聊天制图标签

 

你可以使用下面的聊天制图标签在您的对话文本:

[f]:(力)即使这是唯一的反应显示响应菜单。通常,如果只有一次反应的对话系统将自动选择它而不显示响应菜单。的[F]标签允许你重写此行为。

[a]:(行动)显示文本的斜体响应菜单。

[em#]...[/em#]:(重点)将重点设置文本。对话系统目前只观察一个[电磁]每#强调对话输入并将其应用于整个对话进入除非你勾用丰富的文本并使用富文本功能的GUI系统如统一的GUI。

·         ?[var=varName]:(变量)中的变量[ ]表中定义的一个变量的值代替标签。如果你的变量名有空格或字符,你必须用下划线。例如,如果你的变量被命名为“我的职位”,使用:
·         "I need a doctor, not a [var=My_Job_Title]!"

[pic=#], [pica=#], and [picc=#]:聊天制图图片标签指数覆盖的演员的肖像的对话进入。标记指数相对应的人像照片的演员名单。PIC和皮卡(演员)指的是说话人。你也可以暂时使用一个听者的肖像使用PICC(熟悉的)。

?聊天器管(|)分割成独立的对话作品。

新的标签

对话系统定义了这些新的标签不聊天器目前。你可以将它们添加到映射的文本聊天,而聊天映射不做任何特殊处理他们。对话系统>,然而,将他们所描述的过程:

[position #]:指定对话#输入响应按钮的位置。如果这一对话进入在玩家的反应所示的菜单,它总是会在指定的位置。例如:“[ 6 ]的位置我恨的小狗。”(在这个例子中,“恶”选项总是显示在位置6的反应界面。)注意位置标签使用空白字符,不等号(“=”)。

[lua(code)]:随着Lua代码返回值代替标签。例如:“你好,[ lua(变量[ 'actor”])]!”(迎接运动员。)关于Lua Lua的更多信息,参见。

RandomElement()Function

 

对话系统提供一个Lua函数randomelement()。你可以使用这个lua()]与[标签组合随机插入元素的列表到你的对话文本。

randomelement的语法是:

?RandomElement( string )

在串是一个字符串的字符分隔的元素(单杠的|’)。

RandomElement()Example

说你有个NPC迎接特征与一个随机的尊称。你在对话中的数据库,点击变量标签定义的变量命名敬语包含此列表:

?Variable["Honorifics"] ="Esteemed|Revered|Great|Magnificent"

然后在对话输入,设置文本:

?Dialogue Text: Greetings,[lua(RandomElement(Variable["Honorifics"]))] One!

 

结果是,NPC会随机使用一个列表中的元素的敬语,如“问候,尊敬的人!”或“问候,伟大的人!”

源字符串不需要在设计时设置。您可以生成动态的游戏中。你可以使用randomelement()用于其他目的,太,这样给玩家在一个任务完成的随机项,或者选择一个随机的任务的列表

UniqueID Tool

If you only use one dialogue database, you can skip this section.

Internally, every asset in a dialogue database (actor, item,conversation, etc.) has an ID number. Within a single database, these IDs areusually unique for each type of asset. However, it's likely that an ID used inone database may also be used in another database. If you load both databasesat runtime, the IDs will conflict. The Dialogue System won't know which assetyou're referring to with a given ID. To prevent this, use the Unique ID Tool:Window> Dialogue System > Tools > Unique ID Tool.

Simply add the databases for which you want to guarantee unique IDs, andclick Process.

The "+" button adds a new slot that you can assign adatabase to. TheFolder button adds all databases in the current folder.TheAll button will search the entire project and add all databases.This may take some time in a large project.


If you tick Verbose Logging, the tool will log all ID numberchanges in the console.

独特的ID工具

如果你只使用一个对话的数据库,你可以跳过这一节。

在内部,在对话数据库的各种资产(演员,项目,谈话,等)有一个编号。在一个单一的数据库,这些ID通常是独特的为每个类型的资产。然而,它可能ID用于在一个数据库,也可以用另一个数据库。如果你加载数据库运行时,IDS将冲突。对话系统不知道你指的是与一个给定的ID。为了防止这种资产,使用独特的ID工具窗口>对话系统>工具>独特的ID工具。

只需添加您要为其担保的唯一ID的数据库,然后单击过程。

“+”按钮,添加一个新的插槽,你可以指定一个数据库。文件夹按钮将当前文件夹中的所有数据库。所有的按钮将搜索整个项目并将所有数据库。这可能需要一些时间,在一个大的项目。

如果你详细的记录,该工具将登录控制台所有身份证号码的变化。

 

DialogueUI

Thedialogue UI is the primary user interface for the Dialogue System. It displays:

•Conversation subtitles

•Response menus

•Quick time events

•Alerts

Theother user interface is the bark UI, described on the Bark System page.

TheDialogue System supports Unity GUI and NGUI out of the box.

Itsmodular design allows you to seamlessly integrate any GUI system byimplementing a simple C# interface.

对话UI的对话系统的主要用户界面。它显示:

?对话字幕

?响应菜单

?快速时间事件

?警报

其他用户界面是用户界面上的树皮,树皮系统页面描述。

对话系统支持统一的GUI和深入的盒子。

它的模块化设计,可以无缝地集成任何GUI系统通过实现一个简单的C #接口。

Anatomyof a Dialogue UI

Theprovided Dialogue UI implementations use the following elements. The size andplacement of the elements below are entirely customizable. The image below isjust a conceptual example.

一个对话UI解剖

提供对话界面实现使用下列要素。下面的元素的大小和位置是完全可定制的。下面的图片是一个概念的例子。

NPCSubtitle: The line of text spoken by the NPC as it's being spoken. The contentcomes from the dialogue entry's Dialogue Text, or Menu Text if Dialogue Text isempty.

NPCPortrait:The NPC's portrait texture and name. The portrait texture comes fromthe portrait image assigned to the actor in the dialogue database. The namecomes from the conversant GameObject's name, or its Override Actor Namecomponent if present.

NPCSubtitle Reminder:The line of text that was just spoken by theNPC, usually shown while presenting the player response menu, so the player canremember what he or she is responding to.

ResponseMenu: The menu of responses that the player can choose from. These are thedialogue entries that branch from the NPC's last line and whose conditions aretrue.

Timer: if the timer is enabled, thiselement counts down during the response menu. If the player doesn't choose aresponse before the time runs out, the Dialogue System automatically chooses adefault response.

PC Subtitle: The line of text spoken by the PC as it's being spoken.

PC Portrait: The PC's portrait texture and name.

NPC字幕:文本所说的人大为正说的线。内容来自对话进入的对话文本,或菜单文本如果对话文本为空。

NPCPortrait,画像:纹理和名称。纵向纹理来自指定的对话中的演员的肖像图像数据库。这个名字来自熟悉的游戏对象的名字,或其替代演员的名字成分如果存在。

NPC字幕提醒:文本是由刚刚说过的线,通常会显示玩家在响应菜单提示,所以玩家可以记住他或她是响应。

响应菜单:反应,玩家可以从菜单中选择。这些对话项分支从人大的最后一行,其条件是真实的。

定时器:如果计时器启用,这个元素计数下降的响应菜单中。如果玩家没有选择的响应在时间耗尽之前,对话系统自动选择一个默认响应。

电脑字幕:文本所使用的PC机作为它被说的线。

PC的肖像:PC的肖像的纹理和名称。

EveryUI can position these elements in different places, add additional elements, oromit elements. The positions in the image above aren't important; the image isjust to give you an idea of what a dialogue UI is composed of. The Dialogue Manager'sdisplaySettings can also affect which elements are shown at any given time.

每一个用户可以在不同的地方,这些元素的位置,添加额外的元素,或者删除元素。在不重要的位置的图像;图像只是给你一个什么样的想法,一个对话界面组成的。对话管理器的displaysettings也可以影响要素在任何给定的时间显示。

ElementsNot Shown In Diagram

Forsimplicity, the image above doesn't show:

•Continue Buttons: Optional buttons you canconfigure to enable skipahead/continue on subtitles. See Continue Buttons formore information.

•Quick Time Event (QTE) Buttons: Optionalbuttons you can configure for quick time events. See QTE() for moreinformation.

•Alert Message: Controls used during gameplayto deliver gameplay messages.

不显示在图元素

为简单起见,在没有显示图像:

?继续按钮:可选的按钮,您可以配置使skipahead /继续字幕。更多信息见继续按钮。

?快速时间事件(QTE)按钮:可选的按钮,您可以配置的快速时间事件。更多信息见qte()。

?警告:控制使用在游戏提供游戏的消息。

WhenElements Are Active

Whenthe NPC is delivering a line, these elements are usually active:

当元素的活性,这些元素通常是积极的:

the Dialogue System presents the player response menu, these elements are usuallyactive:

当对话系统提出了玩家响应菜单,这些元素通常是积极的:


the PCis delivering a line, these elements are usually active:

当电脑输送线,这些元素通常是积极的:


NoteAbout Actor Names

If theNPC or PC has an Override Actor Name component (accessible through Window >Dialogue System > Component > Supplemental), the override name is used. Otherwise,if the NPC or PC is associated with a GameObject (the default unless youmanually call DialogueManager.StartConversation() from code without providingGameObjects), it will use the GameObject's name. If no GameObject isassociated, it will use the name defined in the dialogue database.

 

Exception:Bark Dialogue UI

TheBark Dialogue UI is an exception to this layout. Instead, it uses theparticipants' Bark UIs to display the conversation.

 

 

关于演员的名字记

 

如果电脑有一个替代演员的名字成分(可以通过对话窗口>系统>组件>补充),覆盖用的名字。否则,如果PC是一个游戏对象关联的(默认除非dialoguemanager。手动调用你startconversation()代码不提供对象),它将使用的游戏对象的名字。如果没有游戏对象是相关的,它会用在对话中定义的数据库名称。

 

例外:树皮对话界面

 

树皮对话UI是这种布局的例外。相反,它使用参与者的树皮UI显示对话。

UnityDialogue UI

Scriptreference: PixelCrushers.DialogueSystem.UnityGUI.UnityDialogueUI

 

TheUnity GUI dialogue UI system is designed to be very efficient (with a minimumof draw calls and overhead) and allow you to design your interface with a lotof flexibility. The variety of provided Unity Dialogue UI prefabs demonstratewhat you can do with this system.

 

UnityGUI Prefabs

Theeasiest way to change the appearance of your dialogue is to assign a differentprefab to the Dialogue Manager's Display Settings. Several prefabs areavailable in Prefabs/Unity Dialogue UIs:

 

•Default: The default UI, which uses a defaultUnity GUI look; also includes a quest log window

•Celtic: An elegant UI with a Celtic knot theme

•Circle: A clean, circular gold-colored UItheme

•Computer: A computer terminal themed UI

•JRPG: A classic Japanese RPG themed UI; alsoincludes a quest log window

•JRPG2: A UI styled on social JRPGs

•Letterbox: A movie style UI that presentssubtitles and responses in top & bottom black margins

•Mobile: A simple UI suitable for small screens

•Necromancer: A UI based on the Necromancer GUIreleased by Jason Wentzel at Iron Bound Studios; also includes a quest logwindow

•Nuke: A UI "inspired by" Bethesda'sFallout 3.

•Sci-fi: A futuristic, science fiction-themedUI; also includes a quest log window

•Streamlined: A streamlined UI that leavesplenty of space for cutscene action

•Wheel: A subtle blue "dialoguewheel" themed UI; also includes a quest log window

•Wheel2: A bolder "dialogue wheel"themed UI; also includes a quest log window

You canalso add an instance of a prefab to your scene and customize it further. (Note:The GUI Root of prefabs are inactive, so you'll have to activate it in yourscene object to see the GUI layout in the Game View.)

 

If youdo customize a prefab, assign the instance in the scene to the DialogueManager's display settings, or save it as another prefab. You can assign a newGUI Skin to the GUI Root's Gui Skin property and/or change the layout asdescribed below.

 

Someexamples of why you might want to customize a prefab are:

 

•Some prefabs don't ship with versions thatinclude continue buttons. You might want to add continue buttons.

•Most prefabs don't have sounds assigned forbutton hovering and clicking or typewriter effects. You might want to assignaudio clips.

统一的对话界面

 

脚本参考:pixelcrushers.dialoguesystem.unitygui.unitydialogueui

 

UnityGUI对话界面系统的设计是非常有效的(最低绘制调用开销),让你有很强的灵活性,你的接口设计。各种各样的对话提供统一界面问题表明你可以做这个系统。

 

UnityGUI预设

 

改变你的对话出现的最简单的方法是指定一个不同的预设的对话管理器的显示设置。几个问题可在预制/团结对话界面:

 

?默认值:默认的用户界面,使用默认的统一的图形用户界面的外观;还包括一个任务日志窗口

 

?凯尔特人:一个凯尔特结主题优雅的用户界面

 

?圈:一个干净的,圆形的金色UI主题

 

?计算机:计算机终端为主题的用户界面

 

?JRPG:典型的日本RPG题材的UI;还包括一个任务日志窗口

 

?jrpg2:UI设计对社会的jrpgs

 

?信箱:电影风格的用户界面,提出了字幕,在顶部和底部的黑色边缘响应

 

?移动:一种适用于小屏幕上简单的UI

 

?巫师:UI以杰森Wentzel在铁工作室发布死灵法师的GUI;还包括一个任务日志窗口

 

?核:UI”启发“贝塞斯达的辐射3。

 

?科幻:未来,科幻小说的主题UI;还包括一个任务日志窗口

 

?流线型的流线型的用户界面:留有足够的空间用于动画的动作

 

?轮:一种微妙的蓝色“对话轮”为主题的用户界面;还包括一个任务日志窗口

 

?wheel2:一个大胆的“对话轮”为主题的用户界面;还包括一个任务日志窗口

 

您还可以添加一个预制到你的场景实例和定制,进一步。(注:预设的GUI根是不活跃的,所以你要激活你的场景中的对象在游戏中看到的界面布局视图。)

 

如果你的自定义预设,指定实例的场景中的对话管理器的显示设置,或将它保存为一个预设。你可以指定一个新的图形用户界面皮肤的GUI根的GUI皮肤性质和/或更改布局如下。

 

一些例子,为什么你可能想自定义预设是:

 

?有些问题不船舶的版本,包括继续按钮。你可能想添加继续按钮。

 

?大多数问题没有声音给按钮悬停和点击或打字机的影响。你可能要指定音频剪辑。

Keyboard/GamepadNavigation

键盘/键盘导航


Toenable keyboard and gamepad navigation:

 

1.Inspectthe Response Panel in your UI object. If your UI is a prefab, drag it into thescene so you can edit it.

2.Inthe Response Panel's Navigation section, tick Enabled. This will let younavigate with keys and gamepads.

3.Ifyour response buttons aren't already assigned to Order, assign them in theorder that they should be navigated.

4.Bydefault, Unity GUI clicks the currently-focused control when Space is pressed.Set Click to change this behaviour. Set Button Click to set the name of auser-defined button (e.g., gamepad button) that will also click thecurrently-focused control.

5.ThePrevious & Next keys navigate back and forth.

6.TheAxis settings specify which gamepad axis controls navigation, and how fast.

7.AdjustMouse Wheel Sensitivity to tune the speed that the mouse wheel navigatesthrough responses.

为使键盘和手柄的导航:

 

1。检查你的UI对象的响应小组。如果你的用户界面是一个预置的,把它拖到场景中,你可以编辑它。

 

2。在响应面板的导航部分,勾选启用。这会让你有按键和游戏板导航。

 

3。如果你的按钮,是不是已经分配给订单,将它们分配的顺序应该是导航。

 

4。默认情况下,统一的GUI点击当前集中控制时,空间压。设置一下改变行为。设置按钮来设置一个自定义按钮的名称(例如,手柄按钮),也将按目前的重点控制。

 

5。前和下键来回导航。

 

6。轴设置指定手柄轴控制导航,以及如何快速。

 

7。调整鼠标滚轮的灵敏度调整速度,鼠标滚轮导航通过反应。

CreatingUnity Dialogue UI Layouts

创造统一对话UI布局

Tocreate your own layout:

 

1.Createa GameObject with a Unity Dialogue UI component, which you can add by selectingthe menu item Window > Dialogue System > Components > UI > UnityGUI > Unity Dialogue UI.

2.Add achild GameObject with a GUI Root component by selecting Window > DialogueSystem > Components > UI > Unity GUI > GUI Root.

◦Assigna GUI Skin to the Gui Skin property.

3.Addchild GameObjects to the GUI Root object. Attach GUI Control components to themusing the menu Window > Dialogue System > Components > UI > UnityGUI > Controls. Examine one of the prefabs to get an idea of the layout. Seethe GUI Controls section below for descriptions of the controls.

4.Inthe Unity Dialogue UI component, assign the GUI Control properties. At aminimum, you must assign these controls:

◦AlertLine

◦NPCSubtitle Line

◦PCSubtitle Line

◦One ormore Response Menu Buttons

5.Notethat portrait images are GUILabels. This allows you to define, if you chooseto, a custom GUI style that uses a frame image with a transparent center. (Inthis case, set the label text to a blank space to bypass Unity's automaticculling of empty labels.) The Dialogue UI will draw the character portraitimage first, and then the label. This will draw the label's frame image on topof the portrait image.

•If you're going to require the player to clicka "continue" button to progress past the current subtitle, set thesubtitle panel's Continue Button and in the Dialogue Manager's Display Settingsset "Continue Button" to something other than Never. The includedprefab UIs do not include continue buttons, but you can make a copy and addthem manually if desired.

◦If you'reusing the typewriter effect and you want the continue button to skip the effectforward, use the Continue Button Fast Forward component.

◦If youwant the player to be able to click anywhere on the screen to continue, makethe continue button invisible and cover the whole screen.

1.Ifyou're going to require the player to choose a response before a timer runsout, also add a timer control, and set the timer value in the DialogueManager's Display Settings.

2.Alertscan have, in addition to the alert line, an optional parent panel that cancontain any other controls that you want to show, including an optionalcontinue/close button. If you add a panel or continue button, make sure to addthem to the corresponding UnityDialogueUI properties.

创建自己的布局:

 

1。创建一个统一的对话UI组件的游戏对象,你可以添加通过选择菜单项对话窗口>系统> > > > UI部件统一团结对话界面GUI。

 

2。添加一个选择窗口>> > >界面对话系统组成统一的GUI GUI GUI组件>根根子游戏对象。

 

?指定一个GUI图形用户界面皮肤性质的皮肤。

 

3。添加到桂根对象的子对象。在GUI控制组件来使用菜单“窗口>> > >界面对话系统组成统一的GUI >对照。的检查一个问题得到的布局构想。看到GUI控件部分下面的控制的描述。

 

4。在统一的对话UI组件,将GUI控件的属性。至少,你必须将这些控件:

 

?警戒线

 

?NPC字幕行

 

?电脑字幕行

 

?一个或多个响应菜单按钮

 

5。注意肖像图像guilabels。这允许您定义,如果你选择,一个自定义的GUI风格,使用帧图像的透明中心。(在这种情况下,设置标签文本空白旁路Unity自动剔除空标签。)的对话界面会画人物肖像的形象第一,然后标签。这将在顶部的肖像图像标签的帧图像。

 

?如果你打算要求玩家点击“继续”按钮来进步过去的当前设置字幕,字幕小组继续按钮,在对话管理器的显示设置“继续”按钮以外的东西没有。包括预制UIS不包括继续按钮,但你可以复制和手动添加的话。

 

?如果你用打字机的效果,你要继续按钮跳过了使用效果,继续按钮快进组件。

 

?如果你希望玩家可以点击屏幕上的任何地方继续,使“继续”按钮不可见的,覆盖整个屏幕。

 

1。如果你打算要求玩家在计时器到期选择响应,也可以添加一个定时器控制,并设置定时器的值在对话管理器的显示设置。

 

2。警报会,除了警戒线,一个可选的母面板可以包含任何其他您想要显示的控件,包括一个可选的继续/关闭按钮。如果你添加一个面板或继续按钮,确保将它们添加到相应的unitydialogueui性质。

GUIControls

GUIcontrols update in the Game View at edit-time, so you can edit your GUI layoutsinteractively. You'll see changes as you make them.

GUI控件

 

GUI控件更新在游戏视图中编辑的时间,所以你可以编辑你的GUI布局交互。你会看到的变化,你让他们。

PositioningControls

 

Allcontrols are positioned inside their parent. The position and size of a controlare specified by a Scaled Rect. Scaled Rects give you a lot of flexibility inpositioning your controls. You can specify units in two scales:

 

•Pixel: Units are measured in pixels

•Normalized: Units are in the range 0 to 1,where 1 means the whole area (e.g., the entire screen width), and 0.5 meanshalf of the area (e.g., half the width of the screen). The control's area isrelative to the size of its parent's area. So if the parent fills half thescreen, then a normalized value of 1 means half the screen, not the wholescreen.

Theposition is also specified by an Origin and Alignment:

 

•Origin: A point inside the parent's area

•Alignment: What corner of the control isaligned to the Origin point

Inaddition, you can tell a control to automatically fit itself relative to itssiblings by assigning Fit properties:

 

•Above: Position yourself directly above theassigned control

•Below: Position yourself directly below theassigned control

•Left Of: Position yourself directly to theleft of the assigned control

•Right Of: Position yourself directly to theleft of the assigned control

Finally,the depth property determines whether controls get drawn on top of orunderneath other controls. To take advantage of depth, make sure the parentcontrol's Depth Sort Children property is ticked.

 

定位控制

 

所有控件都放置在它们的父。与控制的大小由一个缩放矩形指定位置。缩放矩形给你更多的灵活性,定位你的控制。你可以在两个尺度指定单位:

 

?像素:像素单元的测量

 

?标准:单位范围在0到1,其中1是指整个区域(例如,整个屏幕的宽度),和0.5的面积的一半(例如,屏幕宽度的一半)。控制面积大小有关其父母的地区。所以如果父填补一半屏幕,然后归一化值1意味着一半的屏幕,而不是整个屏幕。

 

位置也由一个指定的起源和对齐:

 

?起源:在父母的区一点

 

?对齐:的控制角对准原点

 

此外,你可以告诉一个控制自动适应本身相对其兄弟姐妹分配合适的性能:

 

?上图:定位自己指定的控制直接在上面

 

?在自己的位置,直接在指定的控制

 

?左:自己的位置,直接到指定的控制左

 

?右:自己的位置,直接到指定的控制左

 

最后,深度属性确定控件是否会在上面或下面的其他控件。利用深度,确保父母控制孩子的深度排序属性项。

GUIControls

 

These GUIControls are available:

 

•GUI Root: The top level control. You shouldonly have one of these in a layout, and it should be on the topmost GUI Controlgame object.

•GUI Image: Draws a texture. GUI Images can beanimated. See Animated Images.

•GUI Label: Draws a text and/or image label.Images assigned to GUI Labels can be animated. See Animated Images.

•GUI Button: Draws a button. Provides thesefeatures beyond a regular GUI.Button:

◦DisabledText: A texture to display when the button is disabled (GUI styles don'tinherently provide this)

◦Key:Keyboard shortcut for the button.

◦Target:A game object to notify when the button is clicked.

◦Message:A message to send to the target. Defaults to "OnClick".

◦Parameter:An optional parameter to send with the message.

◦Additionalimages for disabled, normal, hover, and pressed states. These images can beoutside the button's regular rectangle area. See the Unity Wheel2 Dialogue UIfor an example.

◦Youcan also assign optional audio clips to play when the player hovers over abutton with the mouse or clicks it.

•GUI Progress Bar: A progress bar; also used asa timer bar if your response menu has a timeout.

•GUI Control: An invisible control (used tohold a collection of child controls).

•GUI Scroll View: A scroll view area. Childcontrols are displayed inside the scroll area.

•GUI Window: A GUI Window.

•GUI Text Field: A text input field. If youwant to prompt for text input during conversations, see Text Field UI.

GUI控件

 

这些控件是可用的:

 

?归根:顶层控制。你应该只在一个布局有其中的一个,它应该在最上面的GUI控制游戏对象。

 

?图形:绘制一个纹理。图形图像可以是动画。看动画。

 

?标签:图形绘制文字和/或图像标签。分配给GUI标签图像可以是动画。看动画。

 

?GUI按钮:绘制一个按钮。提供了这些功能,除了常规的GUI按钮:

 

?禁用的文本:按钮被禁用时,纹理显示(GUI风格本身不提供)

 

?关键:对于按钮的键盘快捷键。

 

?目标:一个游戏对象通知当单击该按钮时。

 

?消息:消息发送到目标。缺省值为“onclick”。

 

?参数:一个可选参数发送消息。

 

?额外的图像为残疾人,正常,悬停,并压状态。这些图像可以按钮的规则的矩形区域之外。看到团结wheel2对话界面为例。

 

?您也可以指定可选的音频剪辑的播放时播放器徘徊在一个与鼠标或点击按钮。

 

?GUI的进度条:一个进度条;也用作定时器吧如果你响应菜单超时。

 

?GUI控制:一种无形的控制(用于保存的子控件集合)。

 

?GUI滚动视图:滚动视图区。子控件内的滚动区域显示。

 

?GUI窗口:一个图形用户界面窗口。

 

?GUI文本域:一个文本输入字段。如果你想提示的文本输入的谈话中,看到的文本字段的UI。

Localization

 

If youuse Localization, you can assign a localized text table to any control that hasa text property. If you do, then the control will use the initial value of thetext property as the lookup value in the localized text table.

定位

 

如果你使用的定位,你可以指定一个本地化的文本表的任何控制,具有文本属性。如果你这样做了,然后控制使用文本属性的初始值在本地化的文本表中查找值。

GUIEffects

 

You canadd GUI effects to your controls to modify they way they appear. Currently theeffects play when the control becomes active. In the future, additionaltriggers such as closing, hovering, etc., may also be supported. To add aneffect, select it from Window > Dialogue System > Components > UI >Unity GUI > Effects.

 

TheseGUI Effects are available:

 

•Fade: Fades the control in and/or out.

•Slide: Slides the control onscreen from aspecified edge.

•Typewriter: Adds the text content character bycharacter, as if it were being typed in realtime. This effect uses its ownCharacters Per Second setting instead of the Dialogue Manager's. You can alsoassign an optional audio clip to play on each character.

•Flash: Flashes the control off and on. Theprefabs use this effect for QTE indicators.

•Timer: Add to a progress bar control to makeit count down from 1 (full) to 0 (empty) over a specified duration.

•Continue Button Fast Forward: Changes thebehaviour of the continue button (if you use one) so that the first click skipsto the end of the typewriter effect, and the second click actually continues tothe next stage in the conversation.

图形用户界面的影响

 

您可以添加GUI影响到您的控件来更改他们的出现。目前影响打球的时候,控制变得活跃。在未来,更多的触发,如关闭,徘徊,等,也可以支持。添加一个效果,从窗口> > > >界面对话系统组成统一的GUI>效果选择。

 

这些界面的影响是可用的:

 

?消失:褪色的控制和/或出。

 

?幻灯片:幻灯片从指定的边缘控制屏幕上的。

 

?打字机:添加文本字符的字符,如果它被输入的实时。这个效果使用自己的每秒字符设置而不是对话经理的。你还可以指定一个可选的音频剪辑的播放每个字符。

 

?闪光灯:闪光控制和关闭。预制件使用此效果为QTE的指标。

 

?定时器:添加到一个进度条控件,使其从1倒数(全)到0(空)在指定的时间。

 

?继续按钮快进:变化的“继续”按钮的行为(如果你使用一个),第一次点击跳到打字机效应结束,并点击第二个实际上继续谈话中的下一个阶段。

AnimatedImages

You canconfigure GUI Labels and GUI Images to perform cel-based animation. You can usethis to animate portrait images in your dialogue UIs. To do this:

Preparea "spritesheet" texture with frames of animation all in one rowhorizontally. All frames should be the same width. For example, if you havefour 32x32 frames, the image should be 128x32 (32 * 4 = 128). 

(Source:Public domain sprites from http://pd.sprites-inc.co.uk/Crossover/Space_Cowboy/kiba3ns.png)

Ifyou're using this as an animation portrait image, assign the texture to theactor's Portrait Image in the dialogue database.

On theGUILabel or GUIImage component, assign the spritesheet texture.

Expand ImageAnimation.

Tick Animation.

Set FrameWidth to the width of a single frame of animation (e.g., 32).

Set FramesPer Second to control how quickly the animation cycles through the frames.For example, if you set this to 4, then each frame will be shown for 0.25seconds.

您可以配置GUI标签和GUI图像进行基于CEL动画。你可以使用这个动画形象在你的对话界面。这样做的:

 

准备一个“动画帧spritesheet”的纹理在一排的水平。所有的帧宽度应一致。例如,如果你有四个32x32框架,图像应128(32 * 4 = 128)。

 

(来源:公共领域的精灵从http://pd.sprites-inc.co.uk/crossover/space_cowboy/kiba3ns.png)

 

如果你使用这个作为动画人物形象,将纹理的演员的肖像图像数据库的对话。

 

对改或guiimage组件,将spritesheet纹理。

 

扩大图像动画。

 

蜱动画。

 

设置帧宽度对单帧动画的宽度(例如,32)。

 

设置帧每秒可以控制如何快速循环通过帧动画。例如,如果您设置为4,那么每一帧将显示为0.25秒。


ContinueButtons

If you'regoing to require the player to click a "continue" button to progresspast the current subtitle, set the subtitle panel's Continue Button. On theDialogue Manager object, set Display Settings > Continue Button to somethingother than Never. The included prefab UIs do not include continue buttons, butyou can make a copy and add them manually if desired.

You canalso configure a continue button for the alert panel.

继续按钮

 

如果你打算要求玩家点击“继续”按钮来进步过去当前字幕,字幕小组继续按钮设置。在对话管理器对象,设置显示设置>继续按钮以外的东西没有。包括预制UIS不包括继续按钮,但你可以复制和手动添加的话。

 

您也可以配置一个持续报警面板按钮。

 

ContinueButton Fast Forward

Ifyou're using the typewriter effect and continue buttons, you may want thecontinue button to only skip the effect forward if the effect is still typing.And, if the effect is done, the continue button should behave normally byprogressing to the next stage of the conversation. To do this:

 

1.Addthe Continue Button Fast Forward component to your Continue Button(s): Window> Dialogue System > Component > UI > Unity GUI > Controls >Effect > Continue Button Fast Forward.

2.Assignthe dialogue UI and the label with the typewriter effect.

3.Changethe button's message to OnFastForward and the target to the button itself.

继续按钮快进

 

如果你用打字机效果、继续按钮,您可以继续按钮只跳过前如果效果还是打字。而且,如果效果了,继续”按钮的行为通常由进展到下一阶段的谈话。这样做的:

 

1。将继续按钮快进选择继续按钮(S):对话窗口>系统>组件> >> >对照统一的GUI界面效果>继续按钮快进。

 

2。将对话UI和打字机效果的标签。

 

3。改变按钮的消息onfastforward和目标按钮。


NGUIDialogue UI

Scriptreference: PixelCrushers.DialogueSystem.NGUI.NGUIDialogueUI

 

TheNGUI Dialogue UI works in much the same manner as the Unity Dialogue UI. Themajor difference is that you create your UI layout using NGUI's tools ratherthan creating Unity GUI controls.

 

You canassign the Dialogue UI in the Dialogue Manager's Display Settings from a choiceof prefabs in the NGUI Prefabs folder.

 

You canalso add an instance of a prefab to your scene and customize it further usingNGUI's tools.

 

If youdo customize a prefab, assign the instance in the scene to the DialogueManager's display settings, or save it as another prefab.

 

To createyour own layout:

 

1.Createa GameObject with an NGUI Dialogue UI component by selecting the menu itemWindow > Dialogue System > Components > UI > NGUI > Dialogue UI.

2.Createyour NGUI interface as a child of the NGUI Dialogue UI GameObject – that is,place a UIRoot directly underneath the GameObject.

3.Assignan NGUI Response Button component ((Window > Dialogue System > Components> UI > NGUI > Response Button)) to each response button. Then assignthe component's Ngui Button and Ngui Label properties.

•In the NGUI Dialogue UI component, assign theUI control properties. At a minimum, you must assign these controls:

◦UIRoot

◦DialoguePanel

◦NPCSubtitle Line

◦PCSubtitle Line (if you will be showing NPC subtitles)

◦One ormore Response Menu Buttons

◦AlertLine

•If you're going to require the player tochoose a response before a timer runs out, also add an NGUI UISlider for thetimer control, and set the timer property in the Dialogue Manager's DisplaySettings.

•Alerts can have, in addition to the alertline, an optional parent panel that can contain any other controls that youwant to show, including an optional continue/close button. If you add a panelor continue button, make sure to add them to the corresponding NGUIDialogueUIproperties.

•If you want to add continue buttons to requirethe player to click past subtitles and/or alert messages, use the same steps asfor Unity GUI Continue Buttons. Point the button's handler to the dialogue UI,and select the OnContinue method.

 

深入对话界面

 

脚本参考:pixelcrushers.dialoguesystem.ngui.nguidialogueui

 

的深入对话UI作品一样团结对话界面。主要的区别是,你创造你的UI布局深入的工具而不是创造统一的GUI控件。

 

你可以指定对话UI对话中经理的显示器设置在NGUI prefabs文件夹选择预设。

 

您还可以添加一个预制到你的场景实例和定制,进一步深入的工具。

 

如果你的自定义预设,指定实例的场景中的对话管理器的显示设置,或将它保存为一个预设。

 

创建自己的布局:

 

1。创建一个NGUI对话UI组件通过选择菜单项对话窗口>系统> >> > UI组件深入对话UI对象。

 

2。创造你NGUI接口作为一个的深入对话UI对象–是孩子,把uiroot直接下方的物体。

 

3。指定一个NGUI响应按钮组件((窗口>> > >对话系统组件UI NGUI >响应按钮))的每个响应按钮。然后指定组件的NGUI按钮和标签性能的深入。

 

?在深入对话UI组件,将UI控件属性。至少,你必须将这些控件:

 

?根

 

?对话面板

 

?NPC字幕行

 

?电脑字幕行(如果你将显示NPC字幕)

 

?一个或多个响应菜单按钮

 

?警戒线

 

?如果你打算要求玩家在计时器到期选择响应,也增加了定时器控制一个NGUI uislider,并设置定时器的财产在对话管理器的显示设置。

 

?警报可以有,除了警戒线,一个可选的母面板可以包含任何其他您想要显示的控件,包括一个可选的继续/关闭按钮。如果你添加一个面板或继续按钮,确保将它们添加到相应的nguidialogueui性质。

 

?如果你想添加继续按钮要求玩家点击过去的字幕和/或警报信息,使用相同的步骤,为统一的GUI继续按钮。点按钮的处理程序的对话界面,并选择OnContinue方法。

DaikonForge Dialogue UI

Scriptreference: PixelCrushers.DialogueSystem.DaikonForgeGUI.DaikonForgeDialogueUI

 

TheDaikon Forge Dialogue UI works in much the same manner as the Unity DialogueUI. The major difference is that you create your UI layout using Daikon ForgeGUI's tools rather than creating Unity GUI controls.

 

You canassign the Dialogue UI in the Dialogue Manager's Display Settings from theprefabs in the Daikon Forge UI Prefabs folder.

 

You canalso add an instance of a prefab to your scene and customize it further usingDaikon Forge GUI's tools.

 

If youdo customize a prefab, assign the instance in the scene to the DialogueManager's display settings, or save it as another prefab.

 

Tocreate your own layout:

 

1.Createa GameObject with a Daikon Forge Dialogue UI component by selecting the menuitem Window > Dialogue System > Components > UI > Daikon Forge GUI> Dialogue UI.

2.Createyour Daikon Forge interface as a child of the Daikon Forge Dialogue UIGameObject – that is, place a Df GUIManager (UI Root) directly underneath theGameObject.

3.Assigna Daikon Forge Response Button component (Window > Dialogue System >Components > UI > Daikon Forge GUI > Response Button) to each responsebutton.

•In the Daikon Forge Dialogue UI component,assign the UI control properties. At a minimum, you must assign these controls:

◦DfGUIManager

◦DialoguePanel

◦NPCSubtitle Line or NPC Subtitle Rich Text Line (rich text takes precedence)

◦PCSubtitle Line or PC Subtitle Rich Text Line (if you will be showing PC subtitles)

◦One ormore Response Menu Buttons

◦AlertLine

•If you add a dfTweenFloat to the Alert Panel(or Alert Line if you don't use a panel) and set the property to"Opacity", the UI will automatically fade the alert in and out whendisplaying.

•If you're going to require the player tochoose a response before a timer runs out, also add a dfProgressBar for thetimer control, and set the timer property in the Dialogue Manager's DisplaySettings.

•Alerts can have, in addition to the alertline, an optional parent panel that can contain any other controls that youwant to show, including an optional continue/close button. If you add a panelor continue button, make sure to add them to the correspondingDaikonForgeDialogueUI properties.

•If you want to add continue buttons to requirethe player to click past subtitles and/or alert messages, use the same steps asfor Unity GUI Continue Buttons. Add a dfEventBinding to the button, and pointthe Event Handler to the dialogue UI's OnContinue method:

对话界面

 

脚本参考:pixelcrushers.dialoguesystem.daikonforgegui.daikonforgedialogueui

 

对话UI作品一样团结对话界面。主要的区别是,你创建使用大你的UI布局打造GUI的工具而不是创造统一的GUI控件。

 

你可以在对话管理器的显示设置指定对话UI在大屋打造的UI prefabs文件夹。

 

您还可以添加一个预制到你的场景实例和定制,进一步利用萝卜伪造GUI工具。

 

如果你的自定义预设,指定实例的场景中的对话管理器的显示设置,或将它保存为一个预设。

 

创建自己的布局:

 

1。创建一个大熔炉对话UI组件通过选择菜单项对话窗口>> > >大根系统组件用户界面GUI >对话UI对象铸就。

 

2。创建您的大熔炉接口作为一个对话的UI对象–铸就的萝卜,孩子,放置一个DF guimanager(根)直接下方的物体。

 

3。指定一个大熔炉响应按钮组件(窗口> > > >对话系统组件UI萝卜GUI >响应铸就每个响应按钮按钮)。

 

?在大熔炉对话UI组件,将UI控件属性。至少,你必须将这些控件:

 

?DF guimanager

 

?对话面板

 

?字幕文本字幕行线(富文本优先)

 

?电脑字幕行或PC字幕文本行(如果你会显示电脑字幕)

 

?一个或多个响应菜单按钮

 

?警戒线

 

?如果你添加一个dftweenfloat警报的面板(或警戒线如果你不使用面板)和设置属性为“不透明”,用户界面会自动消失,当显示警报。

 

?如果你打算要求玩家在计时器到期选择响应,并添加一个定时器控制dfprogressbar,并设置定时器的财产在对话管理器的显示设置。

 

?警报可以有,除了警戒线,一个可选的母面板可以包含任何其他您想要显示的控件,包括一个可选的继续/关闭按钮。如果你添加一个面板或继续按钮,确保将它们添加到相应的daikonforgedialogueui性质。

 

?如果你想添加继续按钮要求玩家点击过去的字幕和/或警报信息,使用相同的步骤,为统一的GUI继续按钮。添加一个dfeventbinding的按钮,和点事件处理程序的对话UI的OnContinue方法:


2DToolkit Dialogue UI

Scriptreference: PixelCrushers.DialogueSystem.TK2D.TK2DDialogueUI

 

The 2DToolkit Dialogue UI works in much the same manner as the Unity Dialogue UI. Themajor difference is that you create your UI layout using 2D Toolkit rather thancreating Unity GUI controls.

 

You canassign the Dialogue UI in the Dialogue Manager's Display Settings from theprefabs in the TK2D Prefabs folder.

 

You canalso add an instance of a prefab to your scene and customize it further using2D Toolkit. In fact, if you plan to use portrait images for your actors, youshould add an instance to the scene so you can assign a sprite collection touse for the portrait images. (See below for more information.)

 

If youdo customize a prefab, assign the instance in the scene to the DialogueManager's display settings, or save it as another prefab.

 

Tocreate your own layout:

 

1.Createa GameObject with a TK2DDialogue UI component by selecting the menu item Window> Dialogue System > Components > UI > Daikon Forge GUI >Dialogue UI.

2.Createyour TK2D interface as a child of the TK2DDialogue UI GameObject. The root ofthe interface should be a tk2dUILayout. The prefabs use layer 8 for all UIcomponents.

3.Assigna TK2DResponse Button component (Window > Dialogue System > Components> UI > TK2D > Response Button) to each response button.

•In the TK2DDialogue UI component, assign theUI control properties. At a minimum, you must assign these controls:

◦UIRootLayout

◦NPCSubtitle Line

◦PCSubtitle Line (if you will be showing PC subtitles)

◦One ormore Response Menu Buttons

◦AlertLine

•If you add a TK2DFader (Window > DialogueSystem > Components > UI > TK2D > Fader) to the Alert Panel and/orLine, the UI will fade it in and out when displaying. Note in the prefabs thatNPC Subtitle Line has a fader, but NPC Subtitle Reminder Line doesn't.

•If you're going to require the player tochoose a response before a timer runs out, also add a tk2dProgressBar for thetimer control, add a TK2DTimer (Window > Dialogue System > Components> UI > TK2D > Timer), and set the timer property in the DialogueManager's Display Settings.

•If you want to add continue buttons to requirethe player to click past subtitles and/or alert messages, use the same steps asfor Unity GUI Continue Buttons. Point the button's handler to the dialogue UI,and select the OnContinue method.

•Alerts can have, in addition to the alertline, an optional parent panel that can contain any other controls that youwant to show, including an optional continue/close button. If you add a panelor continue button, make sure to add them to the corresponding TK2DDialogueUIproperties.

•Your scene also needs a camera object withtk2dCamera and tk2dUICamera, and a tk2dUIManager. If you use the same format asthe prefabs, make sure the tk2dUICamera is configured to use layer 8 so it candetect clicks on the controls (which are on layer 8).

ActorPortraits: In the 2D Toolkit dialogue UI, portrait images don't use the actor'stexture in the dialogue database. Instead, they use a sprite collection toreduce draw calls. In the TK2DDialogue UI, set the sprite collection containingthe textures. Each portrait in the collection should match the actor's name asdefined in the dialogue database.

 

For anysprites in your UI (QTE indicators are good candidates), you can use atk2dSpriteAnimator to animate them. (The included prefabs simply display thebasic sprite on the screen.) If you use a tk2dSpriteAnimator, tick PlayAutomatically to make sure the animation plays whenever the QTE indicator isshown.

 

二维对话UI工具包

 

脚本参考:pixelcrushers.dialoguesystem.tk2d.tk2ddialogueui

 

二维工具包对话UI作品一样团结对话界面。主要的区别是,你创建的二维工具而不是创造统一的GUI控件UI布局。

 

你可以指定对话UI对话中经理的显示器设置在tk2d prefabs文件夹的问题。

 

您还可以添加一个预制到你的场景实例和定制,进一步用二维工具包。事实上,如果你计划你的演员使用的形象,你应该加一个实例到现场,所以你可以分配一个精灵收集用于肖像摄影。(更多信息见下文。)

 

如果你的自定义预设,指定实例的场景中的对话管理器的显示设置,或将它保存为一个预设。

 

创建自己的布局:

 

1。创建一个菜单项的选择窗口>> > >对话系统组件界面GUI >对话UI萝卜伪造tk2ddialogue UI组件的对象。

 

2。创建您的tk2d接口作为一个的tk2ddialogueUI对象的孩子。接口的根应该是一个tk2duilayout。预制件使用8层所有的UI组件。

 

3。指定一个tk2dresponse按钮组件(窗口>> > >界面对话系统组件tk2d >响应按钮)每个响应按钮。

 

?在tk2ddialogue UI组件,将UI控件属性。至少,你必须将这些控件:

 

?uiroot布局

 

?NPC字幕行

 

?电脑字幕行(如果你会显示电脑字幕)

 

?一个或多个响应菜单按钮

 

?警戒线

 

?如果你添加一个tk2dfader(窗口> > > >界面对话系统组件tk2d>推子)的报警面板和/或线,用户界面会褪色它时显示出。在字幕行有一个推杆的预设的注意,但人大字幕提示行不行。

 

?如果你打算要求玩家在计时器到期选择响应,并添加一个定时器控制tk2dprogressbar,添加一个tk2dtimer(窗口> >> >界面对话系统组件tk2d >计时器),并设置定时器的财产在对话管理器的显示设置。

 

?如果你想添加继续按钮要求玩家点击过去的字幕和/或警报信息,使用相同的步骤,为统一的GUI继续按钮。点按钮的处理程序的对话界面,并选择OnContinue方法。

 

?警报可以有,除了警戒线,一个可选的母面板可以包含任何其他您想要显示的控件,包括一个可选的继续/关闭按钮。如果你添加一个面板或继续按钮,确保将它们添加到相应的tk2ddialogueui性质。

 

?你的场景也需要一tk2dcamera和tk2duicamera摄像头的物体,和一个tk2duimanager。如果你使用相同的格式问题,确保tk2duicamera配置为使用8层,它可以检测在控制卡(这是在8层)。

 

演员的肖像:在二维工具包对话界面,形象也在对话中的数据库没有演员的纹理使用。相反,他们使用一个精灵收集减少绘制调用。在tk2ddialogue UI,集包含纹理精灵收藏。集合中的每个人物的演员的名字在对话数据库定义的匹配。

 

在你的UI任何精灵(QTE的指标是很好的候选人),你可以使用一个tk2dspriteanimator激励他们。(包括预制简单地显示在屏幕上。基础雪碧)如果你使用一个tk2dspriteanimator,勾选自动播放使动画播放每当QTE指示器显示。

 

BarkDialogue UI

Scriptreference: PixelCrushers.DialogueSystem.BarkDialogueUI

 

TheBark Dialogue UI allows you to run a conversation using characters' bark UIsinstead of the regular dialogue UI. In some cases you may find this preferableto chaining barks using BarkOnDialogueEvent.

 

In theexample scene located in Examples/Bark Example/Bark Conversation, Private Hart:

 

•Now has a bark UI

•Has an Override Display Settings componentthat:

◦Uses adialogue UI named BarkDialogueUI (described below)

◦EnablesPC subtitles (so we can see the player's barks)

◦Setsthe default sequence to Delay({{end}}) so it doesn't touch the camera.

BarkDialogueUIis an empty GameObject that contains the BarkDialogueUI script.

 

TheBarkDialogueUI implementation of IDialogueUI simply uses the participants' barkUIs to display lines in a conversation. If the player has multiple responses,it automatically chooses the first response.

 

In theexample, a new GameObject named Private Hart Conversation Trigger is thetrigger for the conversation. When the player enters the trigger area, theconversation starts. Stop Conversation On Trigger Exit is ticked, so if theplayer leaves the trigger area the conversation still stop.

 

Also inthe example, the Player:

 

•Now has a bark UI

•Only disables gameplay control for theterminal and dead guard, not for the conversation with Private Hart.

树皮对话界面

 

脚本参考:pixelcrushers.dialoguesystem.barkdialogueui

 

树皮对话的界面允许你运行一个会话使用的字符的树皮而不是常规的对话UI界面。在某些情况下,您可能会发现这比使用链接barkondialogueevent树皮。

 

在示例场景设在例子/例子/树皮树皮谈话,私人哈特:

 

?现在有一个叫UI

 

?有一个替代的显示设置组件:

 

?使用一个对话UI叫barkdialogueui(如下所述)

 

?使电脑字幕(所以我们可以看到球员的树皮)

 

?设置默认序列的延迟({ { } }结束)所以不碰相机。

 

barkdialogueui是一个空的游戏对象包含barkdialogueui脚本。

 

的idialogueui的barkdialogueui实施只是利用参与者的树皮UI对话中显示线。如果玩家有多个响应,它会自动选择第一个反应。

 

在这个例子中,一个新的游戏对象命名的私人谈话是对谈话哈特触发触发器。当玩家进入触发区,开始交谈。停止触发退出对话打勾,如果球员离开触发区仍然停止谈话。

 

也在这个例子中,玩家:

 

?现在有一个叫UI

 

?只有禁用的游戏控制终端和死亡的保护,不与私人哈特谈话。

Customizingthe Dialogue UI

CreatingYour Own Dialogue UI

TheDialogue System can work with any component that implements the IDialogueUIinterface, such as UnityDialogueUI and NGUIDialogueUI. This means that, if youalready have an existing GUI component, you can add the IDialogueUI interfacemethods to it. You don't have to create a separate component.

 

However,it's very easy to create your own dialogue UI component using the providedtemplate. To create your own dialogue UI component:

 

1.Copythe template found in Scripts/Templates/TemplateDialogueUI.cs.

2.Deletethe lines containing the text [REMOVE THIS LINE].

3.Renamethe class from TemplateDialogueUI to the name of your dialogue UI.

4.Implementthe methods as described in the comments for each one.

SeeScripts/Supplemental/Unity GUI/Unity Dialogue UI/UnityDialogueUI.cs for theimplementation that uses Unity GUI.

 

SeeScripts/Third Party Support/NGUI for an implementation that uses NGUI, orScripts/Third Party Support/Daikon Forge GUI for one that uses Daikon ForgeGUI.

 

Finally,create a game object with your dialogue UI component and assign that gameobject (or prefab) to the Dialogue Manager's Display Settings.

自定义对话界面

 

创造你自己的对话界面

 

对话系统可以与任何组件实现的idialogueui接口工作,如unitydialogueui和nguidialogueui。这意味着,如果你已经有一个现有的GUI组件,你可以给它添加idialogueui接口方法。你不需要创建一个单独的组件。

 

然而,它的使用提供的模板创建自己的对话UI部件很容易。创造你自己的对话UI组件:

 

1。复制模板脚本/模板/templatedialogueui.cs发现。

 

2。删除含有文本[线删除线]。

 

3。重命名类从templatedialogueui你的对话界面名称。

 

4实施方法。在每一个评论描述。

 

看到脚本/补充/统一的GUI /团结对话UI / unitydialogueui.cs,使用统一的GUI实现。

 

看到脚本/第三的一种实现使用NGUI党/ NGUI支持,或脚本/第三方支持/萝卜伪造一个使用伪造的GUIGUI萝卜。

 

最后,创建一个与你的对话UI组件的游戏对象和指定的游戏对象(或活动)的对话管理器的显示设置。

SubclassingAn Existing Dialogue UI System

You mayfind it more convenient to create a subclass of an existing dialogue UI system.This allows you to inherit all of its functionality and simply add or replace yourown customizations on top of it.

 

Forexample, DaikonForgeDialogueUI is derived from AbstractDialogueUI. AllAbstractDialogueUI methods are virtual.

 

You cancreate a subclass of DaikonForgeDialogueUI that overrides the ShowResponsesmethod with your additional code. To use it, on your dialogue UI GameObject,drag the new subclass into the Daikon Forge Dialogue UI component's Scriptfield.

 

Belowis an example that includes stubs for extra processing on subtitles as well asresponse menus:

 

子类化现有的对话界面系统

 

你可能会发现它创建一个现有的对话界面系统的一个子类更方便。这允许你继承其所有的功能,只需添加或更换在它自己的自定义。

 

例如,daikonforgedialogueui来自abstractdialogueui。所有abstractdialogueui方法是虚拟的。

 

您可以创建daikonforgedialogueui重写showresponses方法与您的其他代码的一个子类。使用它,在你的对话UI对象,拖动到新的子类萝卜对话UI组件的脚本领域铸就。

 

下面是一个例子,包括存根额外处理字幕以及响应菜单:

Overridingthe Dialogue UI for Specific Conversants

You maywant to override the dialogue UI or display settings for specific conversants –for example, to use a computer-themed UI when interacting with computerterminals, or to use a spooky UI when talking with undead NPCs.

To dothis, add an Override Dialogue UI or Override Display Settings component to theconversant. (If a conversant has both types of components, the OverrideDialogue UI component takes precedence.) You can access these components fromthe menu Dialogue System > Component > UI > Override.

重写特定的conversants对话界面

你可能想要为特定的conversants–例如重写对话UI和显示设置,使用电脑主题的用户界面与计算机终端进行交互时,或使用一个幽灵般的UI不死NPC交谈时。

要做到这一点,加上一个重写对话UI或重写显示设置组件的熟悉。(如果一个熟悉的成分,这两种类型的覆盖对话UI部件优先。)你可以从菜单中对话系统>组件> >重写UI访问这些组件。

Text FieldUI

If youwant to prompt the player for text input during conversations, you need tocreate a GameObject containing a component that implements ITextFieldUI, suchas UnityTextFieldUI.

Thisobject should be active in the scene, although child objects needn't be active.If you use UnityTextFieldUI, you should add and assign child objects for thetext field and, optionally, a label. You can also add buttons to accept and/orcancel the input. These should send "OnAccept" or "OnCancel"messages to the UnityTextFieldUI object.

See theexample scene in Examples/Feature Demo/Text Input Example.

You canfind a template for implementing your own ITextFieldUI in Scripts/Templates.

文本域的用户界面

如果你想促使玩家进行文字输入的谈话中,你需要创建一个游戏物体包含一个组件来实现itextfieldui,如unitytextfieldui。

这个对象应该在场景中是活跃的,虽然子对象不必主动。如果你使用unitytextfieldui,你应该添加和分配的子对象的文本域和,任选地,一个标签。您还可以添加按钮来接受和/或取消输入。这些应该把“onaccept”或“可视”信息的unitytextfieldui对象。

看例子场景的例子/功能演示/文本输入的例子。

你可以在你自己的脚本执行/模板itextfieldui找到一个模板。

NGUIText Field UI

See theexample scene in Third Party Support/NGUI/Examples/Feature Demo Using NGUI WithText Input.

Whenbuilding your own TextField UI, follow the GUI structure of the example TextField UI GameObject. In particular:

•Add an NGUITextFieldUI component to your TextField UI GameObject.

•At a minimum, assign a UIInput to the TextField property. This can be a child object.

•The UIInput must notify the Text Field UIGameObject with the method NGUITextFieldUI/AcceptTextInput as shown below:

深入文本字段的UI

看示例场景中的第三方支持/ NGUI /例子/特征深入文本输入的演示。

建立你自己的文本界面时,遵循的示例文本字段的UI对象的界面结构。特别是:

?添加一个nguitextfieldui组件到你的文本字段的UI对象。

?至少,分配一个UIInput的文本字段属性。这是一个孩子的对象。

?的UIInput必须通知文本字段的UI对象与方法nguitextfieldui / accepttextinput如下所示:


DF-GUIText Field UI

See theexample scene in Third Party Support/Daikon Forge/Examples/Feature Demo UsingDaikon Forge GUI With Text Input.

 

Whenbuilding your own TextField UI, follow the GUI structure of the example TextField UI GameObject. In particular:

 

•Add a DaikonForgeTextFieldUI component to yourText Field UI GameObject.

•The TextBox and/or accept button must notifythe Text Field UI GameObject with the methodDaikonForgeTextFieldUI/AcceptTextInput.

df-gui文本域的用户界面

 

看示例场景中的第三方支持/萝卜伪造/例子/功能使用伪造的GUI萝卜文本输入的演示。

 

建立你自己的文本界面时,遵循的示例文本字段的UI对象的界面结构。特别是:

 

?添加一个daikonforgetextfieldui组件到你的文本字段的UI对象。

 

?文本框和/或接受按钮必须通知文本字段的UI对象与方法daikonforgetextfieldui /accepttextinput。

Triggers

Triggersare components that control Dialogue System activity. They allow you startconversations, barks, and sequences when certain events happen, such as the PChitting the "Use" button on an NPC or entering the NPC's triggerarea. Triggers can also execute actions at the start and/or end ofconversations, barks, and sequences.

 

Everytrigger component has a Condition, a Trigger, and parameters that specify whatto do when triggered.

 

You canadd a trigger using the menu Window > Dialogue System > Component >Triggers. Typically you'll add triggers to your interactive objects such asNPCs.

 

Note:The easiest way to set up general NPC conversation and bark triggers is to usethe NPC Setup Wizard, available in Window > Dialogue System > Tools >Wizards.

触发器

 

触发器组件,控制对话系统的活动。他们允许你开始交谈,树皮,当某些事件发生的顺序,如PC击中“全国人大或人大触发进入使用面积”按钮。触发器也可以在谈话,开始和/或结束执行行动,树皮,和序列。

 

每一个触发组件有一个条件,触发器,和参数指定该怎么办时,触发。

 

您可以添加一个触发使用菜单“窗口>对话系统>组件>触发器。通常你会触发你互动的对象,如NPC。

 

注:最简单的方法建立通用NPC对话和树皮触发是使用NPC安装向导,在对话窗口>系统>工具>向导提供。

Conditions

You canspecify conditions that are required in order for triggers to fire. Conditionsare quite powerful, as they allow you specify different activities based on thestate of the game. A condition consists of:

 

•Lua Conditions: A list of Lua statements thatmust all evaluate to true. Example: Variable["Credits"] > 50

•Quest Conditions: A list of quests that mustall be in the specified states

◦QuestName: The name of the quest as defined in the Item[] table (i.e., the name ofthe Item)

◦QuestStatus: A mask of accepted states. You can select more than one acceptablestate

•Accepted Tags: A list of tags. The tag of thegame object that is acting on this trigger or handler must be in the list. If thelist is empty, there is no tag condition.

•Accepted Game Objects: A list of game objects.The game object that is acting on this trigger or handler must be in the list.If the list is empty, there is no game object condition.

Acondition is true only if all of its sub-conditions are true.

 

条件

 

您可以指定所需要的条件为引发火灾。条件是非常强大的,因为它们允许你指定基于游戏状态的不同的活动。一个条件包括:

 

?Lua条件:列出Lua语句都必须为true。例如:变量[“信用”] > 50

 

?任务条件:列表中的任务都必须在指定的状态

 

?任务名称:的任务在项目[ ]表中定义的名称(即,该项目的名称)

 

?任务状态:面具的接受状态。你可以选择一个以上的可接受的状态

 

?接受标签:标签列表。这是通过触发器或处理程序的游戏对象的标签必须在列表中。如果列表是空的,没有附加条件。

 

?接受的游戏对象的游戏对象的列表。这是通过触发器或处理游戏对象必须在列表中。如果列表是空的,没有游戏对象的条件。

 

只有当它的所有子条件为真的条件为真。

ConversationTrigger

TheConversation Trigger component starts a conversation. It has these properties:

 

•Conversation: The title of the conversation torun when triggered.

•Condition: Conditions that must be true forthe trigger to fire.

•Conversant: The conversant of conversation;defaults to this game object.

•Actor: The actor of the conversation; defaultsto the game object that tripped the trigger, which is usually the PC.

•Trigger: The event that causes the trigger tofire. See About Trigger Events for details about each event. In brief, theyare:

◦OnStart:When the level or game object is loaded.

◦OnEnable:When the trigger component is enabled or re-enabled.

◦OnUse:When the actor sends an "OnUse" message. You can send this messagefrom another trigger or write a controller script that sends the"OnUse" message, or use the Selector component used in the ExampleScenes.

◦OnTriggerEnter:When the actor enters the game object's trigger collider area.

Charactersusually have an existing collider, such as a CharacterController. To avoidadding a second collider to the same object, you can create a child object withthe trigger collider. In this case, add the Conversation Trigger to the childobject and assign the main game object to the Conversant property. Thescreenshot below shows a child object named "AI" that contains thetrigger collider and Conversation Trigger for an NPC.

对话触发

 

对话触发组件开始谈话。它具有这些属性:

 

?对话:标题的会话运行时触发。

 

?条件:必须为触发器是真实的条件。

 

?熟悉:谈话的熟悉这个游戏对象的缺陷。

 

?演员:谈话的演员;违约到游戏物体绊倒触发,这是通常的PC。

 

?触发:导致触发器触发的事件。看到有关每个事件的细节的触发事件。总之,他们是:

 

?onstart:当水平或游戏对象加载。

 

?onenable:当触发组件启用或重新启用。

 

?onuse:当演员发送一个“onuse”的消息。你可以把这条消息来自另一个触发或写一个控制器脚本发送的“onuse”的消息,或用在例如场景选择器组件。

 

?ontriggerenter:当演员进入游戏对象触发碰撞区。

 

人物通常会有一个现有的对撞机,如charactercontroller。为了避免添加一个对撞机到相同的对象,你可以创建一个触发器对撞机的子对象。在这种情况下,添加会话触发子对象和分配的主要游戏对象的熟悉性。下面的截图显示子对象命名为“艾”包含一个NPC对话触发和触发对撞机。

Notealso that the Usable component sets the Override Name to "PrivateHart". Otherwise when you run conversations the Dialogue System will referto the actor's name as "AI".

You cansee this in action on Private Hart in the Feature Demo.


还要注意的是可用的组件集覆盖的名称为“私人哈特”。否则当你运行的对话的对话系统是指演员的名字为“人工智能”。

 

你可以看到这对私人哈特行动在功能演示。

AboutTrigger Events

Using"OnTriggerEnter"

If theTrigger is set to OnTriggerEnter, the Conversation Trigger needs to receive anOnTriggerEnter() or OnTriggerEnter2D() message from Unity. In general, therequirements are:

 

•Either the Player or NPC needs a collider with"Is Trigger" ticked. Usually this is the NPC.

•The other actor needs a collider.

•The collision layers should be set up in Unityso the collider and trigger will register collisions.

Charactersusually already have a non-trigger collider, such as a CharacterController, forregular gameplay activity. You can add a trigger collider to the same object;when Unity asks, select Add instead of Replace. Or you can put the triggercollider on a child object, such as Private Hart's "AI" child objectin the Feature Demo. This child object has a trigger collider and aConversation Trigger. The Conversation Trigger's conversant points to the mainPrivate Hart object. The purpose of the "AI" child object is to keepall the Dialogue System components neatly tucked away on a child object. Butyou could just as easily put them all on the main Private Hart object.

 

If StopConversation On Trigger Exit is ticked, then (regardless of what kind oftrigger the Conversation Trigger uses), the conversation will stop if the gameobject receives an OnTriggerExit message. This can be useful if you allow theplayer to move during conversations; if the player moves outside the triggerarea, the conversation will stop. An alternative is the Stop Conversation IfToo Far component, which can be useful if you find that OnTriggerEnter andOnTriggerExit events aren't firing consistently.

 

触发事件

 

使用“ontriggerenter”

 

如果触发设置为ontriggerenter对话触发,需要接受ontriggerenter()或ontriggerenter2d()消息从统一。在一般情况下,要求:

 

?无论是球员还是NPC需要对撞机“触发”打勾。通常这是全国人民代表大会。

 

?其他的演员都需要一个对撞机。

 

?碰撞层应建立在统一的对撞机和触发器将寄存器的碰撞。

 

人物通常已经有了一个非触发对撞机,如charactercontroller,定期的游戏活动。您可以添加一个触发碰撞到相同的对象;当统一要求,选择添加而不是取代。你也可以把触发对撞机上的子对象,如私人哈特的“人工智能”的子对象的功能演示。这孩子对象有一个触发碰撞和对话触发。对话触发的熟悉点的主要私人哈特对象。目的的“爱”孩子的目标是让所有的对话系统组件整齐地走在子对象。但你可以把他们都在主要的私人哈特对象。

 

如果停止对话触发退出打勾,然后(无论什么样的触发对话触发使用),对话如果游戏对象接收一个信息停止ontriggerexit。这可以让球员移动的谈话中是有用的;如果玩家的动作触发区外,谈话会停止。另一种是停止谈话,如果太远的成分,可如果你发现ontriggerenter和ontriggerexit事件不是射击始终。

Using"OnUse"

Whenthe trigger event is "OnUse", the trigger component starts theconversation when it receives an "OnUse" message. You can send thismessage from another trigger or write a controller script that sends the"OnUse" message, such as the Selector component used in the ExampleScenes. You can also send OnUse from a cutscene sequence using theSendMessage() sequencer command.

 

ForOnUse, the NPC needs a collider that will response to raycasts from thePlayer's Selector. You'll need to set the Selector's layermask so raycasts willdetect the NPC's collider.

 

TheSelector component is just one way to send an OnUse() message to the NPC. Youcan write your own scripts to send the same message to the NPC if you want totrigger conversations using a different targeting scheme than the Selector,which targets NPCs in the middle of the camera view.

使用“onuse”

 

当触发事件是“onuse”,扳机组件开始谈话,当它接收到一个“onuse”的消息。你可以把这条消息来自另一个触发或写一个控制器脚本发送的“onuse”的消息,如用在例如场景选择器组件。你也可以给onuse从动画序列使用sendmessage()音序器命令。

 

为onuse,NPC需要对撞机,将响应从该玩家的选择raycasts。你需要设置选择器的图层蒙版,raycasts将检测人大对撞机。

 

选择器组件只是一个手段,发送一个消息给onuse()人大。你可以写你自己的脚本,如果你想触发对话使用不同的定位方案比选发送相同的消息给全国人大,其目标NPC在相机视图中。

Using"OnStart" and "OnEnable"

UseOnStart to start a conversation on the first frame that the trigger's gameobject has been created and the trigger component has been enabled. Thistrigger event only occurs once during the lifetime of its game object.

 

UseOnEnable to start a conversation whenever the trigger component is enabled orre-enabled. Unlike OnStart, this trigger event occurs every time you disableand re-enable the trigger component or deactivate and re-activate its gameobject.

 

BothOnStart and OnEnable start the conversation after waiting one frame. Thisallows all other components to complete their Start() and OnEnable() methodsfirst. For example, an NPC might need to set up its model, position, andanimation in its Start() method. By waiting one frame, the trigger allows theNPC to finish its setup before starting the conversation.

使用“之前”和“onenable”

 

使用onstart在第一帧开始对话,触发的游戏对象被创建,扳机组件已启用。这个触发事件只发生一次的游戏在对象生命期。

 

使用onenable开始谈话时,扳机组件启用或重新启用。不像之前,这个触发事件发生时,每一次你禁用和重新启用或停用并重新激活触发组件的游戏对象。

 

两onstart和onenable等待一帧之后开始谈话。这允许所有其他组件来完成他们的start()和onenable()方法。例如,一个NPC可能需要建立其模型,位置,并在其start()方法动画。等待一帧,触发允许NPC来完成安装程序开始之前的谈话。

 

BarkTriggers

BarkTrigger

TheBark Trigger component makes a character bark. It has these properties:

 

•Conversation: The title of the conversationthat contains the bark lines.

•Condition: Conditions that must be true forthe trigger to fire.

•Conversant: The barker; defaults to this gameobject.

•Bark Order: How to cycle through the barklines.

◦Random:Choose a random line.

◦Sequential:Run through each line in turn, looping back to the first line when the end isreached.

•Allow During Conversations: (Not shown inscreenshot) Allows barks to occur during conversations. Normally, if aconversation is active, NPCs won't bark.

•Target: (Optional) The character being barkedat. The target receives "OnBarkStart" and "OnBarkEnd"messages, which you can use to handle special actions – for example, perhapsmaking the target character turn to face the barker.

•Trigger: The event that causes the trigger tofire. See About Trigger Events for more details about trigger events.

•Cache Barked Lines: Caches bark lines.

树皮触发器

 

树皮触发

 

树皮树皮触发的成分作了一个字符。它具有这些属性:

 

?对话:包含树皮线头衔的谈话。

 

?条件:必须为触发器是真实的条件。

 

?熟悉:巴克;违约这游戏对象。

 

?树皮:如何循环通过皮纹。

 

?随机选择一个随机的线。

 

?顺序:通过依次线,循环回第一行的时候结束。

 

?允许在对话:(不显示截图)允许树皮发生在谈话。通常,如果一个对话活动,NPC不会叫。

 

?目标:(可选)字对着。目标接收到onbarkstart”和“onbarkend”的信息,你可以用它来处理例如专项行动–,也许使目标性状转身面对巴克。

 

?触发:导致触发器触发的事件。看到更多的细节有关的触发事件的触发事件。

 

?缓存:缓存线皮纹树皮。

Bark OnIdle

TheBark On Idle component makes a character bark automatically at randomintervals. You can use this component to add a lot of life to your games.Different barks can trigger based on the state of the game, making your NPCsseem aware of what's going on.

 

•Conversation: The title of the conversationthat contains the bark lines.

•Condition: Conditions that must be true forthe trigger to fire.

•Conversant: The barker; defaults to this gameobject.

•Bark Order: How to cycle through the barklines.

◦Random:Choose a random line.

◦Sequential:Run through each line in turn, looping back to the first line when the end isreached.

•Min Seconds and Max Seconds: The duration towait between barks.

•Target: (Optional) The character being barkedat.

•Trigger: The event that causes the trigger tofire.

•Cache Barked Lines: Caches bark lines.

树皮上的空闲

 

在空闲组件的树皮使字符树皮自动在随机的时间间隔。你可以使用这个组件到您的游戏增添了不少生活。不同的皮可以触发基于游戏的状态,使你的NPC似乎知道发生了什么。

 

?对话:包含树皮线头衔的谈话。

 

?条件:必须为触发器是真实的条件。

 

?熟悉:巴克;违约这游戏对象。

 

?树皮:如何循环通过皮纹。

 

?随机选择一个随机的线。

 

?顺序:通过依次线,循环回第一行的时候结束。

 

?min和max秒秒持续时间等之间的树皮。

 

?目标:(可选)字对着。

 

?触发:导致触发器触发的事件。

 

?缓存:缓存线皮纹树皮。

IfCache Bark Lines is ticked, the NPC's list of bark lines are cached during thefirst bark. This can reduce stutter when barking on slower mobile devices, butthe drawbacks are that barks are not reevaluated every bark as the statechanges, barks use no em formatting codes, and sequences are not played withbarks.

 

Formore information about barks: Bark System

有关缓存皮纹

 

如果缓存线是在树皮,树皮纹人大名单被缓存在第一皮。这可以减少口吃时吠在速度较慢的移动设备,但缺点是,树皮不重新评估每皮皮的状态变化,没有使用EM格式化代码,和序列不玩皮。

 

有关更多信息:皮制皮

SequenceTrigger

Everydialogue entry can have an associated cutscene sequence. However, you can alsoplay sequences outside of conversations using the Sequence Trigger component.

 

•Sequence: The sequence to play. See Sequencerand Sequencer Command Reference.

•Speaker: (Optional) The speaker, for sequencecommands that reference a speaker; defaults to this game object.

•Listener: (Optional) The listener, forsequences that reference a listener; defaults to the game object that trippedthe trigger.

•Condition: Conditions that must be true forthe trigger to fire.

•Trigger: The event that causes the trigger tofire. See About Trigger Events for more details about trigger events.

序列触发

 

每个对话入口可以有关联的动画序列。然而,你也可以播放序列以外的谈话中使用序列触发组件。

 

?顺序:顺序播放。看到音序器和音序器命令参考。

 

?主讲人:(可选)扬声器,序列命令参考扬声器;违约这游戏对象。

 

?听众:(可选)的听众,听众,参考序列;违约到游戏物体绊倒触发。

 

?条件:必须为触发器是真实的条件。

 

?触发:导致触发器触发的事件。看到更多的细节有关的触发事件的触发事件。

 

QuestTrigger

TheQuest Trigger component sets a quest status when the game object receives aspecified trigger event, such as OnStart, OnTriggerEnter, or OnUse. Forexample, you can add a quest trigger and a static trigger collider to an area.When the player enters the trigger area, the component can set a quest statusto success.

 

•Condition: Conditions that must be true forthe trigger to fire.

•Trigger: The event that causes the trigger tofire.

◦OnStart:When the level or game object is loaded.

◦OnUse:When the actor sends an "OnUse" message. You can send this messagefrom another trigger or write a controller script that sends the"OnUse" message, or use the Selector component used in the ExampleScenes.

◦OnTriggerEnter:When the actor enters the game object's trigger collider area.

•Quest Name: The name of the quest as definedin your dialogue database.

•Quest State: The new state of the quest to usewhen the trigger event occurs.

•Alert Message: An optional gameplay alertmessage to show when the trigger event occurs.

 

任务触发

 

任务触发组件设置一个任务状态时,游戏对象接收一个指定的触发事件,如onStart,ontriggerenter,或onuse。例如,您可以添加一个任务触发器触发和静态对撞机的一个地区。当玩家进入触发区,组件可以设置一个追求成功的状态。

 

?条件:必须为触发器是真实的条件。

 

?触发:导致触发器触发的事件。

 

?onstart:当水平或游戏对象加载。

 

?onuse:当演员发送一个“onuse”的消息。你可以把这条消息来自另一个触发或写一个控制器脚本发送的“onuse”的消息,或用在例如场景选择器组件。

 

?ontriggerenter:当演员进入游戏对象触发碰撞区。

 

?任务名称:的追求,在你的对话数据库定义的名称。

 

?任务的状态:新的任务时所使用的触发事件发生时。

 

?警告:一个可选的游戏警报消息显示当触发事件发生时。

OtherTriggers

Thesetriggers execute actions at the beginning and/or end of dialogue events(conversations, barks, and sequences). Using just these components, you cancontrol quite a lot of gameplay and in fact make essentially fully-functionalgames without any scripting.

 

Theexamples provided below each component barely scratch the surface of ways youcan use them; the possibilities are up to your imagination.

其他的触发器

 

这些触发器在对话事件的开始和/或结束执行行动(谈话,树皮,和序列)。使用这些组件,您可以控制很多的游戏,事实上使基本上是全功能的游戏没有任何脚本。

 

提供的例子下面的每个组件几乎划伤的方法可以使用他们的表面;可能性是取决于你的想象力。

Bark OnDialogue Event

•Purpose: Barks when a dialogue event occurs.

•Example Use: Make a companion NPC bark "Idon't trust him" after the PC converses with a mercenary.

在对话事件树皮

 

?用途:树皮当对话的事件发生。

?例如使用:让伴侣NPC树皮”,我不信任他,“后PC同一个雇佣兵。

Lua OnDialogue Event

•Purpose: Runs Lua code when a dialogue eventoccurs.

•Example Use: Adjust some Lua values at thebeginning or end of a conversation.

Lua对对话的事件

?目的:运行lua代码时的对话事件发生。

 

?例子:调整在会话的开始或结束部分的Lua值。

RangeTrigger

•Purpose: Activates/deactivates game objectsand components in response to OnTriggerEnter and OnTriggerExit.

•Example Use: Enable Bark On Idle only when theplayer is within range of an NPC.

范围触发

 

?目的:激活/去激活的游戏对象和组件的响应ontriggerenter和ontriggerexit。

 

?例如使用:使树皮闲置只有当玩家在一个全国范围的。

SendMessage On Dialogue Event

•Purpose: Sends a message to a game object.

•Example Use: Send a "TakeDamage"message to an NPC if a conversation ends with a cutscene sequence where the PCpunches him.

发送消息的对话事件

 

?目的:将消息发送到一个游戏对象。

 

?例子:发送一个“takedamage”消息发送到一个NPC如果谈话结束一个动画序列在PC打他。

SetActive On Dialogue Event

•Purpose: Sets game objects active or inactive.(Compare with Set Enabled On Dialogue Event)

•Example Use: Deactivate a force field if thePC just successfully finished a conversation with the force field's controlpanel.

设置活动的对话事件

 

?目的:建立游戏对象的积极或消极的。(与设置对话事件启用)

 

?例子:停用力场如果电脑刚刚成功地完成了力场的控制面板的谈话。

SetAnimation On Dialogue Event

•Purpose: Plays an animation clip on a dialogueevent.

•Example Use: Force a Legacy-animated characterto idle when starting a conversation.

设置动画的对话事件

 

?目的:对一个对话事件动画剪辑。

 

?例子:力遗产的动画人物空闲会话开始时。

SetAnimator State On Dialogue Event

•Purpose: Sets an animator state on a dialogueevent.

•Example Use: Force a Mecanim character to idlewhen starting a conversation.

设置动画状态对对话的事件

 

?目的:设置一个对话事件一个动画状态。

 

?例如使用:力mecanim字符闲置会话开始时。

 

SetEnabled On Dialogue Event

•Purpose: Sets MonoBehaviours enabled ordisabled. (Compare with Set Active On Dialogue Event)

•Example: In the example scenes, the PCdisables its player control MonoBehaviours when starting conversations andre-enables them when ending conversations. This prevents the player fromwalking away from the conversation.

设置事件使对话

 

?目的:建立MonoBehaviours启用或禁用。(设置活动的对话事件比较)

 

?例如:在示例场景,PC禁用玩家控制MonoBehaviours当交谈并重新使他们在结束谈话。这可以防止玩家离开的谈话。

SetComponent Enabled On Dialogue Event

•Purpose: Sets components enabled or disabled.This trigger was added on customer request because Set Enabled On DialogueEvent works with MonoBehaviours. Renderers and colliders aren't MonoBehaviours.This triggers allows you to enable and disable them.

设置组件的事件使对话

 

?目的:建立组件启用或禁用。此触发器添加客户要求由于设置对话事件与MonoBehaviours启用。渲染和碰撞不是MonoBehaviours。此触发器允许您启用或禁用它们。

SetQuest State On Dialogue Event

•Purpose: Sets a quest state.

•Example Use: Say the player has a quest toirritate Old Man Farnsworth. If Old Man Farnsworth barks "Get off my lawn,kid!" to the player, then you could use this trigger OnBarkEnd to mark thequest as successful and also optionally show a gameplay alert message.

设置任务的状态对对话的事件

 

?目的:设置任务的状态。

 

?例子:说玩家寻求刺激的老人住宅。如果老人法恩斯沃思叫“离开我的草坪,孩子!”的球员,那么你可以用这个来触发onbarkend标记的追求成功并显示警告消息的一个游戏。

ShowCursor On Conversation

•Purpose: Shows the mouse cursor whenconversations start. When the conversation ends, this component will restorethe mouse cursor to its previous state.

•Example Use: Attach this to your player actorif regular gameplay hides the cursor. Otherwise the player won't be able toselect responses with the mouse.

显示光标在谈话

 

?目的:显示鼠标光标的谈话开始的时候。当谈话结束,该组件将鼠标光标移动到其以前的状态。

 

?例子:附加到你的球员的演员如果经常玩游戏隐藏光标。否则,玩家不能使用鼠标选择反应。

 

StartConversation On Dialogue Event

•Purpose: Starts a conversation.

•Example Use: When a mother barks to her son,"Say hello to our guest," the son can start a conversation with thePC.

开始对话的话

 

?目的:启动一个会话。

 

?例子:当母亲叫她的儿子,“我们的客人打招呼,”儿子可以开始交谈。

 

StartSequence On Dialogue Event

•Purpose: Starts a sequence.

•Example Use: When a soldier barks "Medic!I'm hit!" you can start a sequence in which the medic runs to the soldier.

开始对话的事件序列

 

?目的:从一个序列。

 

?例如:当一个士兵用树皮”医生!我被击中了!”你可以从一个序列中,医生跑到士兵。

StopConversation If Too Far

•Purpose: Monitors the distance between conversationparticipants and stops the conversation if it exceeds a specified maximumdistance.

•Example Use: If you allow the player to moveduring conversations, you can use this component to automatically stopconversations when the player moves away from the NPC.

To usethese triggers:

 

1.Add atrigger to a game object using the menu item Window > Dialogue System >Component > Triggers.

2.Setthe Trigger that will cause the component to do its thing.

3.Setthe size of the On Start list. This list will contain actions to perform whenthe trigger starts.

◦Defineeach On Start action.

◦Eachaction has its own Condition, so you can control which actions to take based onthe current state of the game.

4.Setthe size of the On End list. This list will contain actions to perform when thetrigger ends.

◦Defineeach On End action.

◦Eachaction has its own Condition.

停止谈话,如果太远

 

?目的:监测之间的对话参与者的距离和停止谈话,如果超过指定的最大距离。

 

?例子:如果你允许玩家移动的谈话中,你可以使用这个组件来自动停止谈话,当玩家离开NPC的动作。

 

使用这些触发器:

 

1。添加触发器使用菜单项对话窗口>系统>组件>游戏对象触发。

 

2。设置触发器将导致组件做自己的事情。

 

3。设置在启动列表的大小。此列表将包含要执行的操作时,触发器启动。

 

?定义每个开始行动。

 

?每一个动作都有其自己的状态,所以可以控制要基于当前的游戏状态的行动。

 

4。集的最终列表的大小。此列表将包含要执行的操作时,触发器结束。

 

?定义每个结束动作。

 

?每一个动作都有其自己的条件。

 

Sequencer

 

Overview

TheDialogue System includes a cutscene sequencer that you can use both insideconversations and out. It plays a string of sequence commands. These commandscan move the camera, play animations and audio, activate game objects andcomponents, and more. Since they're text strings, these sequences are verycompact, and they're quick and easy for dialogue authors to add as they writedialogue.

 

SeeSequencer Command Reference for a list of built-in commands and their syntax.

 

You canuse the provided template to add your own custom commands as well. In fact, ifyou don't want to specify your sequences in text strings, you can use ascrubbing sequence editor such as Well Fired's uSequencer and simply call theuSequencer sequence by using the provided uSeq() command.

概述

 

对话系统包括一个cutscene音序器,你可以使用内部的对话了。它具有一系列顺序命令。这些命令可以移动相机,游戏动画,音频,激活的游戏对象和组件,和更多。因为他们的文本字符串,这些序列是非常紧凑的,和他们快速和容易的对话作者添加为他们写的对话。

 

看到一个名单,内置命令的语法顺序命令参考。

 

你可以使用所提供的模板来添加您自己的自定义命令和。事实上,如果你不想在文本字符串指定您的序列,可以使用一个洗涤序列编辑器如解雇的usequencer只需调用usequencer序列利用所提供的useq()命令。

SequencesIn Conversations

Eachdialogue entry has a sequence, specified in the entry's Sequence field. You canuse the sequence to position the camera, control lighting, play animations andsounds, etc. (Note: Prior to version 1.0.6, the Video File field was used. TheSequence field is used now.)

 

Ingeneral, you'll want to point the camera toward the speaker near the beginningof the sequence, perform some actions or at least delay to give the player achance to read the subtitle, and then point the camera at the listener. This isjust a suggestion; of course you're free to design your sequences however youenvision.

 

Inconversations, the sequencer values "speaker" and"listener" are automatically set to the correct participants for eachdialogue entry. You can reference them in your sequencer commands.

 

If youdon't specify a sequence, the Dialogue System will generate a default one foryou as specified in the Dialogue Manager's Display Settings. By default, thissequence simply does a closeup of the speaker, delays for a duration specifiedby the Subtitle Chars Per Second field, and then does a closeup on thelistener.

序列中的对话

 

每个对话项都有一个序列,在输入序列”字段中指定的。你可以使用序列位置的摄像机,灯光,播放动画和声音,等。(注:版本1.0.6,之前使用的视频文件的字段。顺序字段用于现在。)

 

在一般情况下,你就想点相机朝附近的序列,从扬声器,执行一些动作或至少延迟给球员一个机会读字幕,然后点的相机在听众。这只是一个建议;当然你可以自由设计自己的序列,然而你的设想。

 

在谈话中,音序器的值“喇叭”和“听众”将自动设置为正确的参与者进入每个对话。您可以参考它们在你的音序器的命令。

 

如果你不指定一个序列,对话系统将为您的对话管理器的显示设置指定生成一个默认的。默认情况下,此序列做特写的扬声器,持续时间为每第二场字幕字符指定的延迟,并对听者的特写。

 

How toSet Up Lip Sync

TheDialogue System was originally developed for a voice-acted RPG, so support forvoice acting is a core design feature. The Dialogue System doesn't analyzeaudio or generate lip sync animation. Use a tool such as FaceFX, iClone, orMixamo's FacePlus for that. In the Dialogue System, you can associate acutscene sequence with every line of dialogue. (If you're using localization,you can associate sequences for each language, too.)

 

Ifyou're using FaceFX's XML curves, just use the FaceFX() command.

 

Ifyou're using FacePlus, iClone, or another tool to generate FBX animations, howyou use them in cutscene sequences depends on how you set up your avatar. Somedevelopers set up a Humanoid Mecanim rig for the body and leave the face underLegacy animation control. In this case, use the Voice() sequencer command,which plays a legacy animation clip in conjunction with an audio (voiceover)file. Other developers put the face under Mecanim control, too, in which caseyou'll have an animation layer for the head. Simply use one of the many Mecanimsequencer commands, such as AnimatorPlay() or AnimatorTrigger(), to start thefacial animation, and Audio() to start the voiceover audio.

 

If yourproject has many lines of dialogue, you can simplify the management of lines byusing 'entrytag' as described below in the section Using entrytag To SimplifySequences.

如何建立唇同步

 

对话系统最初是为一个声音是RPG,所以配音的支持是一个核心的设计特点。对话系统不分析音频或生成口形动画。使用工具,如FaceFX,iClone,或Mixamo的faceplus。在对话系统,可以将动画序列的每一行的对话。(如果你使用的定位,可以将序列的每一种语言,太。)

 

如果你使用FaceFX XML曲线,只使用facefx()命令。

 

如果你使用的faceplus,iClone,或另一个工具生成的FBX动画,你如何使用它们在动画序列取决于你如何建立你的阿凡达。一些开发商建立身体的人形mecanim钻机和动画控制下留了一脸的遗产。在这种情况下,使用voice()音序器的命令,这与音频连接起传统的动画剪辑(画外音)文件。其他开发商将面临mecanim控制,太,在这种情况下,你会有一个为头的动画层。只需使用一个mecanim音序器的命令,如animatorplay()或animatortrigger(),启动人脸动画,和audio()开始画外音。

 

如果你的项目有多行的对话,你可以用以下entrytag”一节中使用entrytag简化序列简化线管理。

 

LipSync Example

Thefollowing example describes how to make an NPC named Private Hart say,"Yes, sir!" with lip sync using the Voice() sequencer command.

 

In yourproject, you should create one or more Resources folders. Put your audio clipsomewhere in a Resources folder:

唇同步的例子

 

下面的示例说明如何让人大为私人哈特说,“是的,先生!”唇同步使用voice()音序器命令。

 

在你的项目,你应该创建一个或多个资源文件夹。把你的音频剪辑在一个资源文件夹中的某个地方:


Add thelip sync animation clip to your character's legacy Animation component. Notethat a character can have a legacy Animation component and a Mecanim Animatorcomponent as long as they control separate bones. In the Zombie Demo(http://www.pixelcrushers.com/dialogue-system-zombie-demo/), the characters'bodies are controlled by Mecanim, and their faces are controlled by legacyanimation.

添加口形动画剪辑到你的角色的传统动画组件。请注意,一个字符可以有一个传统的动画组件和mecanim动画组件只要控制单独的骨头。在僵尸的演示(HTTP:/ / www.pixelcrushers。COM /对话系统僵尸演示/),人物的身体是由mecanim,和他们的脸的传统动画控制。


On thedialogue entry where Private Hart says, "Yes, sir!" add the Voice()command to the Sequence field. The first parameter is the audio clip. If you'veorganized your audio clips into subfolders (for example, a subfolder for eachcharacter), make sure to include the subfolder path. The second parameter isthe animation clip. Remember that this must in the list of animations in yourcharacter's Animation component.

在对话进入私人哈特说,“是的,先生!”添加voice()命令序列字段。第一个参数是音频剪辑。如果你组织你的音频剪辑到子文件夹(例如,子文件夹的每一个字符),请务必包括子文件夹的路径。第二个参数是动画剪辑。记住,这必须在你的角色的动画组件的动画列表。




  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值