Dialogue System for Unity文档中英对照版(简雨原创翻译)完结篇(内置脚本使用,脚本API)

37 篇文章 1 订阅

这一篇是Dialogue System for Unity翻译的最后一篇了,本来这一篇是夹在前六篇里面的一个章节,之所以提出来是因为是我认为这一篇是整个Dialogue System for Unity使用的核心,只有学好这一篇的内容,Dialogue System for Unity才可以得心用手的使用,这一篇的翻译也与其他前几篇不同,前几篇大量使用机翻,之后只是把一些翻译特别别扭的才改了一下,平顺了一下句子,没有根据上下文做意译,但本篇不同,翻译要比前面细致很多,尽量做到看过的小伙伴可以掌握Dialogue System for Unity内置脚本的使用。

Sequencer Command Reference

This page describes the built-in sequencer commands. You can also define your own commands as described on theSequencer page.

音序器命令参考

本页描述内置的音序器的命令。你也可以定义自己的命令在音序器页面描述。

Built-In Command List

内置命令列表

  • Animation()
  • AnimatorBool()
  • AnimatorController()
  • AnimatorFloat()
  • AnimatorInt()
  • AnimatorLayer()
  • AnimatorTrigger()
  • AnimatorPlay()
  • Audio()
  • AudioWait()
  • AudioWWW()
  • Camera()
  • Delay()
  • Fade()
  • LoadLevel()
  • LookAt()
  • MoveTo()
  • None()
  • QTE()
  • SendMessage()
  • SetActive()
  • SetEnabled()
  • SetPortrait()
  • ShowAlert()
  • SwitchCamera()
  • TextInput()
  • Voice()
  • WaitForMessage()
  • Zoom2D()

Third Party Support:

  • AC()
  • Behavior()
  • BehaviorVariable()
  • FaceFX()
  • FSMEvent()
  • KGFMapIcon()
  • uSeq()
  • RPG Kit commands are documented in the RPG Kit Sequencer Commands section.

Syntax

The general syntax of a sequencer command is:

[required] command ( [parameters] ) [@seconds]

Or:

[required] command ( [parameters] ) [@Message(message)]

  • required: This optional keyword specifies that the command must run even if the player cancels the sequence.
  • command: The command to play (e.g., "Camera" in Camera(Closeup)).
  • parameters: The parameters for the command (e.g,. "Closeup" in Camera(Closeup)).
  • @seconds: The optional time at which to play the command; otherwise it plays immediately.
  • @Message(message): The message to wait for before playing the command; otherwise it plays immediately.
  • ->Message(endmessage): A message to send to the sequencer when the command completes.

Separate commands with a semicolon (;).

语法

音序器的命令的语法是:

[requiredcommand ( [parameters) [@seconds]

Or:

[requiredcommand ( [parameters) [@Message(message)]

要求:此可选关键字指定的命令必须执行即使玩家取消序列。

指挥:指挥演奏(例如,“相机”相机(特写))。

参数:命令的参数(例如,。”特写镜头”相机(特写))。

@秒:可选的,时间在其中发挥的命令;否则起立即。

@消息(消息):消息等待打命令之前;否则起立即。

->消息(endmessage):一个消息发送给程序的命令完成时。

单独的命令,用分号(;)----解:命令之间用分号隔开

Example 1: Fight Sequence

This is an example fight sequence involving animation, sound, and camera work.

Camera(Closeup); Animation(Punch); Camera(Wide,listener,1)@2; Audio(Oof,listener)@2.5; required Animation(Crumple,listener)@2.5

The sequence does this:

  1. Immediately cuts to a closeup of the speaker
  2. Immediately plays the speaker's Punch animation
  3. At the 2-second mark, smoothly pans the camera to a wide shot of the listener over the course of 1 second
  4. At the 2.5-second mark, plays the "Oof!" audio clip on the listener
  5. At the 2.5-second mark, plays the listener's Crumple animation (even if the player cancels the sequence)

Note that we specified that the crumple animation is required; this ensures that the listener ends up in the correct position (crumpled on the ground) even if the player cancels (skips) the cutscene. Very often, the lastCamera() command in a sequence will be marked required to make sure the camera is set up for the next line of dialogue.

例1:战斗序列

这是一个战斗序列例子,涉及动画,声音,和相机的工作。

Camera(Closeup); Animation(Punch); Camera(Wide,listener,1)@2; Audio(Oof,listener)@2.5; required Animation(Crumple,listener)@2.5

这样序列的说明:

立即关闭摄像机特写;立即开始拳动画;在两秒位置做标记,利用1秒钟对听众进行摄像机广角镜头照射;在2.5秒处做标记,播放listener的Oof声音剪辑;播放listener的崩溃动画(即使取消序列)

请注意,我们指定的缓冲动画是必需的;这确保听众结束了在正确的位置(倒在地上)即使玩家取消(跳过)动画。通常,在一个序列的最后camera()命令将被标记为需要确保相机设置为线下对话。

解:我们上面这行脚本做了什么东西呢?我们试想一下,两个人对打,其中一个人在开始阶段出拳,两秒钟时一个广角镜头照射到两个人,2.5秒时拳头打在对手身上

对手发出oof叫声,然后同时倒地,这些结束后,剧情暂时停止。

Example 2: Waiting for Messages

This example uses the "@Message()" syntax to keep a command queued until the sequencer receives a message.

SendMessage(Bomb, StartCountdown); SetActive(Bomb, false)@Message(Kaboom); SetActive(Explosion)@Message(Kaboom)

The sequence does this:

  1. Immediately sends the message "StartCountdown" to the object named Bomb. Assume that the Bomb has a method namedStartCountdown() that counts down and then sends the message "Kaboom" message as shown in the code below.
  2. When the sequencer receives "Kaboom" it:
    • Sets the Bomb inactive (i.e., hides it).
    • Sets the Explosion particle effect object active.

void StartCountdown() {
    StartCoroutine(CountDownAndExplode(5));
}

 

IEnumerator CountDownAndExplode(float seconds) {
    yield return new WaitForSeconds(5);
    Sequencer.Message("Kaboom");
}
Note that the CountDownAndExplode method above uses the static class method Sequencer.Message() to send the message to the sequencer(s) on the Dialogue Manager object.

例2:等待消息

本示例使用“@ message()”语法来保持命令排队到音序器接收到一个消息。

SendMessage(Bomb, StartCountdown); SetActive(Bomb, false)@Message(Kaboom); SetActive(Explosion)@Message(Kaboom)

这样的序列:

立即发送消息”startcountdown”对象炸弹。假设炸弹已命名的方法startcountdown(),然后发送信息“爆炸”的消息,如下面的代码所示。

当接收到“爆炸”的音序器:◦设置炸弹无效(即,隐藏它)。

爆炸粒子效果目标的主动(爆炸了)。

注意以上countdownandexplode方法使用静态类方法的音序器。message()发送消息到音序器(S)的对话管理器对象。

Example 3: Sending Messages

This example uses the "->Message()" syntax, which sends a message when a command completes, and the "@Message()" syntax, which waits until the sequencer receives a message.

Animation(Punch)->Message(Punched); required Animation(Crumple,listener)@Message(Punched)

The sequence above plays the speaker's Punch animation. At the end of the animation, it sends the message "Punched" to the sequencer.

The second Animation() command is configured to wait for the "Punched" message. When it receives this message, it plays the listener's Crumple animation.

Here's another example, turning on a light:

Animation(FlipLightswitch)->Message(LightOn); SetActive(Lamp, true)@Message(LightOn) 

例3:发送消息

本示例使用“-> message()”语法,它发送一个消息,一个命令完成时,和“@ message()”语法,等到音序器接收到一个消息。

Animation(Punch)->Message(Punched); required Animation(Crumple,listener)@Message(Punched)

上述的序列是说话人的挥拳动画。动画结束时,它发送消息“挥拳”的音序器。

第二animation()命令配置等待“挥拳”的消息。当它接收到该消息,它起着听者的崩坏动画。

这里的另一个例子,打开灯:

Animation(FlipLightswitch)->Message(LightOn); SetActive(Lamp, true)@Message(LightOn) 

lamp 点亮这个为true当接收到lightOn这个消息

Built-In Commands

内置的命令

Animation()

Syntax: Animation(animation[, subject[,animations...]])

Description: Plays (cross-fades) legacy animation(s).

Parameters:

  • animation: The name of a legacy animation in the subject Animation component.
  • subject: (Optional) The object that will play the animation. Can be speaker, listener, or the name of a game object in the scene. Default:speaker.
  • animations...: (Optional) Any number of legacy animations to play in sequence when the first animation is done. Usually the last animation returns to idle.

Examples:

  • Animation(NervousIdle) (Plays the speaker's "NervousIdle" animation)
  • Animation(Laugh, listener) (Plays the listener's "Laugh" animation)
  • Animation(RemoveHat, Sir Lancelot, Bow, ReplaceHat, Idle) (Plays a sequence of animations. Sir Lancelot removes his hat, bows, replaces hit hat, and returns to his idle animation.)

Animation()

语法:Animation(动画[,隶属于[,动画...]])

描述:起(淡入淡出)传统动画(S)。

参数:

动画:主题的动画组件的传统动画的名字。

隶属于:(可选)将播放动画的对象。可演讲者,听众,或场景中的游戏对象的名称。默认值:说话者。

动画……:(可选)任何数量的传统动画播放顺序当第一动画完成。通常最后的动画返回到空闲。

例子:

Animation(NervousIdle) 播放说话人的“nervousidle”动画

Animation(Laugh, listener)播放听者“Laugh”的动画

Animation(RemoveHat, Sir Lancelot, Bow, ReplaceHat, Idle) 扮演一个序列动画。兰斯洛特先生脱掉他的帽子,鞠躬,戴回帽子,回到他的空闲动画

AnimatorBool()

Syntax: AnimatorBool(animatorParameter[,value[,subject]])

Description: Sets a Mecanim Boolean animator parameter.

Parameters:

  • animatorParameter: The name of a Boolean parameter in a Mecanim Animator.
  • value: (Optional) Can be true or false. Default:true.
  • subject: (Optional) The object with the Animator component. Can be speaker, listener, or the name of a game object in the scene. Default:speaker.

Example: AnimatorBool(Laughing, true, listener) (Sets the "Laughing" parameter totrue on the listener's Animator)

AnimatorBool()

语法: AnimatorBool( 参数 [,可用 [,隶属 ]] )

描述:设置一个布尔动画 Mecanim系统参数。记得我在剧情系统前面说的动画系统可能用的到吗,我们并不是要用代码,而是用里面设计好的动作Mecanim

参数:

动画参数:Mecanim系统动画布尔参数的名称。

价值:(可选)可以为真或假。默认值:真。

隶属:(可选)与动画组件的对象。可演讲者,听众,或场景中的游戏对象的名称。默认值:说话者。

例子:

 AnimatorBool(Laughing, true, listener) 设置listener身上绑定Mecanim系统中Laughing的参数为true

AnimatorController()

Syntax: AnimatorController(controllerName[,subject])

Description: Sets the Mecanim runtime animator controller for a subject's Animator.

Parameters:

  • controllerName: The path to an animator controller that can be loaded from a Resources folder.
  • subject: (Optional) The object with the Animator component. Can be speaker, listener, or the name of a game object in the scene. Default:speaker.

Example: AnimatorController(AnimCtlrs/SwimmingController, listener) (Makes the listener use the animator controller named "AnimCtlrs/SwimmingController" located inside a Resources folder)

AnimatorController()

语法: AnimatorController(控制名称 [,隶属 ] )

描述:设置Mecanim系统运行动画控制器动画。

参数:控制器的名字:一个动画控制器,可以从资源文件夹中加载路径。

隶属:(可选)动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:说话者。

例子:AnimatorController(AnimCtlrs/SwimmingController, listener)让listener使用动画控制器位于资源文件夹animctlrs / 下的swimmingcontroller

AnimatorFloat()

Syntax: AnimatorFloat(animatorParameter[,value[,subject[, duration]])

Description: Sets a Mecanim float animator parameter.

Parameters:

  • animatorParameter: The name of a float parameter in a Mecanim Animator.
  • value: (Optional) Can be true or false. Default:true.
  • subject: (Optional) The object with the Animator component. Can be speaker, listener, or the name of a game object in the scene. Default:speaker.
  • duration: (Optional) The duration in seconds to smoothly change to the value. If omitted, the value is set immediately.

Example: AnimatorFloat(Speed, 2, speaker, 0.5) (Increases the speaker's Speed parameter to 2.0 over 0.5 seconds)

AnimatorFloat()

语法:AnimatorFloat(参数[,价值[,隶属[,持续时间]])

描述:设置一个浮点型动画Mecanim系统参数。

参数:动画参数,在Mecanim系统中float参数的名称。

价值:(可选)可以为真或假。默认值:真。

隶属:(可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。

持续时间:(可选)持续的时间顺利转变为控制。如果省略,将其值设置立即。

例子:AnimatorFloat(Speed, 2, speaker, 0.5)在0.5秒内把speaker速度提高到2

AnimatorInt()

Syntax: AnimatorInt(animatorParameter[,value[, subject]])

Description: Sets a Mecanim integer animator parameter.

Parameters:

  • animatorParameter: The name of an integer parameter in a Mecanim Animator.
  • value: (Optional) Integer value. Default: 1.
  • subject: (Optional) The object with the Animator component. Can be speaker, listener, or the name of a game object in the scene. Default:speaker.

Example: AnimatorInt(Mode, 2, Fred) (Sets the "Mode" parameter to2 on Fred's Animator.)

AnimatorInt()

语法:AnimatorInt(参数[,价值[,隶属])

设置一个整数的动画Mecanim系统参数。

参数:动画参数,在Mecanim系统中int参数的名称。

价值:(可选)定义数值。默认值:1。

隶属:(可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。

ExampleAnimatorInt(Mode, 2, Fred)设置“模式”参数为2,在Fred的动画中

AnimatorLayer()

Syntax: AnimatorLayer(layerIndex[, weight[, subject[, duration]]])

Description: Sets the weight of a Mecanim animator layer.

Parameters:

  • layerIndex: The layer index. Default: 1.
  • weight: (Optional) The new weight. Default: 1.
  • subject: (Optional) The object with the Animator component. Can be speaker, listener, or the name of a game object in the scene. Default:speaker.

Example: AnimatorLayer(1, 1, speaker, 0.5) 

AnimatorLayer()

语法:AnimatorLayer(层序列[,权重[, 隶属[,持续时间]]])
描述:在Mecanim的动画层中设置权重
参数:
层序列:层的索引,默认为1
权重:一个新的权重,默认为1
隶属:(可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。
ExampleAnimatorLayer(1, 1, speaker, 0.5) 设置layers 1的权重到1,在0.5秒内,权重的概念请自行学习(也可能后面会提到,其实在前面ai的代码中就有贴出使用,不过没有讲解)

AnimatorTrigger()

Syntax: AnimatorTrigger(animatorParameter[,subject])

Description: Sets a trigger parameter.

Parameters:

  • animatorParameter: The name of an integer parameter in a Mecanim Animator.
  • subject: (Optional) The object with the Animator component. Can be speaker, listener, or the name of a game object in the scene. Default:speaker.

Example: AnimatorTrigger(Jump, Fred) (Sets the "Jump" trigger on Fred's Animator.)

AnimatorTrigger()

语法: AnimatorTrigger( 参数 [,隶属 ] )

描述:设置触发条件

参数:

动画参数:Mecanim系统整数参数

隶属:(可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。

ExampleAnimatorTrigger(Jump, Fred) 设置jump命令在fred身上

AnimatorPlay()

Syntax: AnimatorPlay(stateName[, subject])

Description: Plays a state.

Parameters:

  • stateName: The name of state in a Mecanim Animator.
  • subject: (Optional) The object with the Animator component. Can be speaker, listener, or the name of a game object in the scene. Default:speaker.

Example: AnimatorPlay(Idle, Fred) (Plays the "Idle" state on Fred's Animator.)

AnimatorPlay()

语法: AnimatorPlay( 状态名称 [,隶属 ] )

描述:播放一个状态

参数:Mecanim系统动画所属状态名称

隶属:(可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。

ExampleAnimatorPlay(Idle, Fred) 播放fred的idle动画

Audio()

Syntax: Audio(clip[, subject])

Description: Loads a clip from Resources into the subject's audio source component and plays it.

Parameters:

  • clip: The path to an audio clip inside a Resources folder.
  • subject: (Optional) The object that will play the animation. Can be speaker, listener, or the name of a game object in the scene. Default:speaker.

Note:: If the subject is null, this command uses the audio source on the Dialogue Manager object, adding an audio source component if necessary.

Example: Audio(Hahaha, listener) (Plays the "Hahaha" audio clip on the listener's audio source component)

Audio()

语法:Audio(声音剪辑[,隶属])

描述:从Resources中读取一个声音剪辑播放

参数:

声音剪辑:在一个资源文件夹中的音频剪辑路径。

隶属:(可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。

注:如果隶属是空的,这个命令使用音频源的对话管理器对象,如果需要添加一个音频源组件。

ExampleAudio(Hahaha, listener)播放listener身上的“哈哈哈”的音频剪辑

AudioWait()

Syntax: AudioWait(clip[, subject])

Description: Loads a clip from Resources into the subject's audio source component, plays it, and waits until the audio clip is done playing.

Parameters:

  • clip: The path to an audio clip inside a Resources folder.
  • subject: (Optional) The object that will play the animation. Can be speaker, listener, or the name of a game object in the scene. Default: speaker.

Note:: If the subject is null, this command uses the audio source on the Dialogue Manager object, adding an audio source component if necessary.

Example: AudioWait(Hahaha, listener) (Plays the "Hahaha" audio clip on the listener's audio source component and doesn't exit until the clip is done)

AudioWait()

语法: AudioWait( 剪辑 [, 隶属 ] )

描述:加载一个剪辑从资源,并等待音频剪辑播放完成。

参数:

声音剪辑:在一个资源文件夹中的音频剪辑路径。

隶属:(可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。

注:如果隶属是空的,这个命令使用音频源的对话管理器对象,如果需要添加一个音频源组件。

Example: AudioWait(Hahaha, listener)播放listener身上的“哈哈哈”的音频剪辑,直到播放结束

AudioWWW()

Syntax: AudioWWW(clip URLs...[, subject])

Description: Retrieves audio clip(s) from URLs and plays them in sequence on the subject's audio source component, waiting until the audio clips are done playing.

Parameters:

  • clip...: The URLs to an audio clips. Note: Unity only loads OGG files from URLs, so your audio clips must be in .ogg format.
  • subject: (Optional) The object that will play the animation. Can be speaker, listener, or the name of a game object in the scene. Default: speaker.

Note:: If the subject is null, this command uses the audio source on the Dialogue Manager object, adding an audio source component if necessary.

Example: AudioWWW(http://mygame.com/hello.ogg, listener) (Retrieves and plays "hello.ogg" on the listener's audio source component and doesn't exit until the clip is done)

AudioWWW()

语法: AudioWWW(剪辑链接 ... [, 隶属 ] )

描述:下载音频链接,等到下载完播放

参数:音频剪辑的URL。注:统一只加载Ogg文件的URL,这样你的音频剪辑必须OGG格式。

隶属:(可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。

注:如果隶属是空的,这个命令使用音频源的对话管理器对象,如果需要添加一个音频源组件。

Example AudioWWW(http://mygame.com/hello.ogg, listener)  检索并播放“你好。ogg”并且不退出直到剪辑下载完成播放

Camera()

Syntax: Camera(angle[, subject[, duration]])

Description: Moves the camera to a specified angle on a subject.

Parameters:

  • angle: The name of a camera angle (child transform) defined in the sequencer's camera angle object. If the angle isn't defined in the camera angle object, this command looks for a game object in the scene and moves the camera to that game object's transform. These special keywords are also available:
    • default: Uses the default camera angle defined on the actor's GameObject. To define this angle, add a Default Camera Angle component to the GameObject. (Window > Dialogue System > Component > Supplemental > Default Camera Angle) If the GameObject doesn't have a Default Camera Angle component, it uses the angle named "Closeup".
    • original: Use the original pre-conversation camera position. (You should not define angles named 'default' or 'original' since they are reserved keywords.) Default: default.
  • subject: (Optional) The transform to focus on. Can be speaker, listener, or the name of a game object in the scene. Default: speaker.
  • duration: (Optional) Smoothly move the camera over this many seconds. If omitted, cut immediately.

Note: The Camera() command works with 3D perspective cameras. For 2D orthographic cameras, use Zoom2D().

See Also: Camera Angle Prefab, Default Camera Angles, Zoom2D()

Example: Camera(Wide Left, Adam, 3) (Moves the camera over 3 seconds to a wide left shot of Adam)

Camera()

语法: Camera( 角度 [, 隶属 [, 持续时间 ]] )

描述:移动相机到对象上指定的角度。

参数:

角度:定义好的角度名称,如果角度不是摄像机的角度定义对象,可自定义,这个命令是为场景中的游戏对象和移动相机,游戏对象的变换。这些特殊的关键词也可:(注,这个名称定义可以自定义,定义方法见前6篇)

      默认值:使用默认的摄像机角度对演员的对象定义。定义这个角度,添加一个默认的镜头组件到游戏对象。(Window > Dialogue System > Component > Supplemental > Default Camera Angle补充对话系统组件默认的摄像机角度)如果对象没有默认镜头组件,它使用的角度命名为“特写”。

     原始:使用原预设摄像机位置。(你不应该定义的角度命名为“默认”或“原”,因为它们是保留关键字。)默认:默认。

隶属:(可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。

持续时间:(可选)平滑地移动摄像机在这几秒。如果省略,将立即。

注:本camera()命令与三维透视相机。二维正交相机,使用zoom2d()。

参见:相机角度预置,默认的拍摄角度,zoom2d()

ExampleCamera(Wide Left, Adam, 3) 将相机移动到Adam左边,持续3秒

Delay()

Syntax: Delay(duration)

Description: Does nothing for a specified amount of time. You can use this command to keep a sequence "playing" even if nothing else is going on.

Parameters:

  • duration: The seconds to delay.

Example: Delay(2.5) (delays 2.5 seconds)

Delay()

语法Delay(持续时间)

描述

参数:设定时间,就是什么都不做

  • 持续时间: 延迟多少秒

ExampleDelay(2.5) 延迟2.5秒

Fade()

Syntax: Fade(in|out[, duration[, webcolor]])

Description: Fades the screen in or out.

Parameters:

  • in or out: Fade in or out.
  • duration: (Optional) The number of seconds over which to fade. Default: 1.
  • webcolor: (Optional) A color in the format #rrggbb to fade to/from. Default: Black.

Example: Fade(out, 1, #000000) (Fades out to black over 1 second. Equivalent to Fade(out).)

Fade()

语法Fade(入|出[, 持续时间[,颜色]])

描述: 淡入淡出

参数:

  • in or out: 淡入或出.
  • duration:(可选)秒,持续时间。默认值:1。
  • webcolor: (可选)格式# rrggbb颜色。默认值:黑色。

ExampleFade(out, 1, #000000) 淡出为黑色1秒以上。相当于褪色(出)

LoadLevel()

Syntax: LoadLevel(levelName)

Description: Loads a new level using Application.LoadLevel(). The level must have been added to your project's build settings. Before loading the new level, this command calls PersistentDataManager.Record to allow objects in the current level to record their persistent data first.

Parameters:

  • levelName: The name of the level to load.

Notes:

  • This script is located in Scripts/Supplemental/Sequencer Commands to make it easy for you to copy and modify, for example if you want to make a version that uses Unity Pro's Application.LoadLevelAsync() instead.

Example: LoadLevel(Shipyard) (Loads the level named "Shipyard")

LoadLevel()

语法LoadLevel(关卡名称)

描述

Parameters:使用Application.LoadLevel()加载一个新的关卡,在加载前要确保新关卡在build settings中定义,记录允许在当前级别的对象来记录他们的持久性数据。

  • levelName: 要加载的新关卡名.

注:

  • 这个是个脚本补充命令,可以按需求自行修改,如改为Unity Pro's Application.LoadLevelAsync()做异步加载

ExampleLoadLevel(Shipyard) 加载新关卡名称为"Shipyard"

LookAt()

Syntax: LookAt([target[, subject[, duration]]])

Description: Rotates a subject to look at a target, over a specified duration of time. Note: Frequently, you may want to make the conversants face each other when starting a conversation. To do this, add LookAt() commands to the first dialogue entry in the conversation.

If no arguments are provided, the speaker and listener immediately look at each other.

Parameters:

  • target: (Optional) The transform to look at.
  • subject: (Optional) The object to rotate. Can be speaker, listener, or the name of a game object in the scene. Default: speaker.
  • duration: (Optional) The number of seconds over which to smoothly rotate. If omitted, the subject rotates immediately.

Examples:

  • LookAt() (Makes the speaker and listener immediately look at each other)
  • LookAt(listener) (Makes the speaker immediately rotate to look at the listener)
  • LookAt(Car, Bill, 2) (Makes Bill rotate toward Car over 2 seconds)

LookAt()

语法: LookAt([标记[, 隶属[, 持续时间]]])

描述: 在一段时间内,围绕一个target焦点, 注:通常conversants面对对方开始交谈时使用,要做到这一点,加lookat()命令第一对话加入谈话。

如果没有提供参数,说话人和听话人马上看对方。

参数:

  • target: (可选)的变换来看看。
  • subject(可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。
  • duration: (可选)秒,顺利旋转数。如果省略,主体旋转立即。

Examples:

  • LookAt() 使说话者与听者马上看对方
  • LookAt(listener) 看听众
  • LookAt(Car, Bill, 2) 让bill围绕car看持续两秒

MoveTo()

Syntax: MoveTo(target[, subject[, duration]])

Description: Moves a subject to the same position and rotation as a target, over a specified duration of time.

Parameters:

  • target: The transform to move to.
  • subject: (Optional) The object to move. Can be speaker, listener, or the name of a game object in the scene. Default: speaker.
  • duration: (Optional) The number of seconds over which to smoothly move the subject. If omitted, the subject moves immediately.

Example: MoveTo(Moonwell, Wisp, 3) (Moves the Wisp to the Moonwell over 3 seconds)

MoveTo()

语法: MoveTo(标记[, 隶属[, 持续时间]])

描述: 将向标记地点移动在规定时间内

参数:

  • target: 目标.
  • subject: (可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。
  • duration: (可选)秒,以平稳移动主体的数量。如果省略,话题马上行动。

Example: MoveTo(Moonwell, Wisp, 3) 在3秒内向Moonwell移动

None()

Syntax: None()

Description: A null command that does nothing.

Example: None()


None()

语法: None()

描述: 一个空的命令,不。

Example: None()

QTE()

Syntax: QTE(index, duration, luaVariable, luaValue)

Description: Presents an opportunity for a Quick Time Event (QTE). The opportunity lasts for the specified duration. If the player triggers the QTE, a Lua variable is set to a specified value; otherwise it's set to a blank string.

Parameters:

  • index: The 0-based index number of the QTE indicator defined in the dialogue UI. Before using this command, you should add QTE indicators to your dialogue UI, and specify the QTE input trigger buttons in the Dialogue Manager's display settings.
  • duration: The duration in seconds to display the QTE indicator. If the duration elapses without the player triggering the QTE, the indicator disappears and the QTE can't be triggered.
  • luaVariable: Lua variable to set if the player triggers the QTE.
  • luaValue: Lua value to set the variable to if the QTE is triggered. If not triggered, the variable is set to a blank string.

Example: QTE(0, 2, Punch_NPC, yes)

This example presents a two-second QTE opportunity for the player to punch the NPC. If the player inputs the QTE trigger in time, the Lua variable Variable["Punch_NPC"] will be set to "Yes". If this is in a conversation, then one of the links from the dialogue entry can check the value in its condition. If it's set, the entry can execute the QTE.

For a complete example, examine the "Private Hart" conversation in the Feature Demo.

QTE()

语法QTE(索引, 持续时间lua变量lua值)

描述:介绍了快速时间事件契机(QTE)。机会持续指定的时间。如果玩家触发QTE,Lua变量设置为指定的值;否则设置为空字符串。

参数:

  • 索引: 0指数在对话界面定义QTE指示。在使用这个命令,你应该添加QTE指标你对话界面,并在对话管理器的显示设置指定QTE输入触发按钮。
  • duration: 在几秒钟的时间来显示QTE指示。如果持续时间结束没有玩家触发QTE,指示消失,QTE不能触发。
  • luaVariable: Lua 变量设置如果玩家触发QTE。
  • luaValue: Lua value 设置变量如果QTE触发。如果不触发,该变量设置为空字符串。

ExampleQTE(0, 2, Punch_NPC, yes)

这个例子提供了一二秒的QTE机会玩家把NPC。如果玩家投入时间引发QTE,Lua变量[“punch_npc”]将被设置为“是”。如果这是一个对话,然后从对话进入链接可以检查值的条件。如果它设置,进入执行QTE。

一个完整的实例,对特征演示“私人哈特”对话。

SendMessage()

Syntax: SendMessage(methodName[, arg[, subject]])

Description: Calls GameObject.SendMessage(methodName, arg, DontRequireReceiver) on the subject.

Parameters:

  • methodName: The message to send.
  • arg: (Optional) An argument to pass with the message.
  • subject: (Optional) The object to send the message to. Can be speaker, listener, or the name of a game object in the scene. Default: speaker.

Note: This is a versatile, general-purpose command. You can communicate with any other GameObject in the scene. Combined with the WaitForMessage() command, you can devise back-and-forth communication.

Example: SendMessage(TakeDamage, 50, listener) (Calls listener.SendMessage("TakeDamage", "50"), to tell the listener to take 50 damage. The listener should have a method named TakeDamage(string damage))

SendMessage()

语法SendMessage(方法名[,主题[,隶属]])

描述: 调用对象。

参数:

  • methodName: 方法名
  • arg: (可选) 一个消息的主题(变量).
  • subject(可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。

注:这是一个通用的,通用的命令。你可以在场景中的任何其他对象的沟通。结合the waitformessage()命令,你可以来回通信设计。

ExampleSendMessage(TakeDamage, 50, listener) ,告诉听众承受50的伤害。听众应该有一种takedamage方法,包括一个数值参数

SetActive()

Syntax: SetActive(gameObject[, value])

Description: Sets a game object active or inactive.

Parameters:

  • gameObject: The game object to set, which cannot be speaker or listener, since they're involved in the conversation.
  • value: (Optional) true, false, or flip (negate the current value).

Notes: This command first searches for active game objects in the scene. Failing that, it searches for inactive game objects in the scene, but the root parent of the object must be active. Failing that, it searches all loaded objects; this could find an inactive root object, but it could just as easily find a loaded prefab that isn't actually in the scene. Unfortunately Unity doesn't provide a way to distinguish between these.

Example: SetActive(Force Field, false) (Deactivates the force field)

SetActive()

语法: SetActive(物体[, 可用])

描述: 设置物体是否可用.

参数:

  • gameObject: 设置游戏的对象,但不可以是对话参与者,因为他们参与谈话。
  • value: (可选)真的,假的,或翻转(否定的当前值)。

Notes: 此命令通过活跃的游戏场景中的物体。否则,它搜索无效的游戏场景中的对象,但是对象的根父母必须主动。否则,它会搜索所有加载的对象;这可以找到一个无效的根对象,但它可以很容易地找到一个加载预置实际上不在现场。不幸的是,Unity不区分这些提供了一种方法。

Example: SetActive(Force Field, false) 关闭力场

SetEnabled()

Syntax: SetEnabled(component[, value[, subject]])

Description: Enables or disables a component.

Parameters:

  • component: The name of a component on the subject.
  • value: (Optional) true, false, or flip (negate the current value)
  • subject: (Optional) The subject that owns the component. Can be speaker, listener, or the name of a game object in the scene. Default: speaker.

Example: SetEnabled(AttackAI, false, listener) (Disables the "AttackAI" component on the listener to turn off the listener's attack mode)

SetEnabled()

语法: SetEnabled(组件[, 可用[, 隶属]])

描述: 控制组件是否可用

参数:

  • component: 组件名称.
  • value: 是否可以用
  • subject: (可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。

Example: SetEnabled(AttackAI, false, listener) 禁用listener身上的AttackAI组件

SetPortrait()

Syntax: SetPortrait(actorName, textureName)

Description: Sets the portrait texture of a dialogue actor. Possible uses:

  • If the actor becomes angry, change the portrait to an angry expression
  • If you've written a conversation with a generic "Vendor" actor, you can set the portrait of the actual actor that the player is conversing with.

Parameters:

  • actorName: The name of the actor in the dialogue database.
  • textureName: The path to a texture inside a Resources folder, or default to use the original texture defined in the dialogue database, or pic=# (no spaces) to use one of the actor's portrait images as defined in the database (similar to the [pic=#] tag as described in the Supported Dialogue Markup Tags).

Notes:

  • The actor continues to use the new portrait until you change it back.
  • As of version 1.2.4, this command takes visual effect immediately instead of waiting until the next subtitle.
  • Prior to version 1.1.9, this command set the portrait in the dialogue database. It now sets a field Actor[ "actorName" ].Current_Portrait that conversations look up. If it's set, this texture name is used instead of the portrait in the dialogue database. Since all Actor[] fields are saved by the Save/Load System, this is saved, and the dialogue database is left unmodified.

Example: SetPortrait(Bob, BobAngry) (Changes Bob's portrait to the texture "BobAngry")

SetPortrait()

语法: SetPortrait(头像名称, 纹理名称)

描述: 设置一个对话的演员肖像的纹理。

  • 如果演员发怒,改变画像愤怒的表达
  • 如果你跟一个人交谈,那么你可以设定各个对话的对方肖像

参数:

  • actorName:对话中的数据库名字的演员。
  • textureName: 一个资源文件夹中纹理的路径,或默认使用对话中的数据库定义的原始纹理,或PIC = #(没有空格)用一个演员的肖像图像数据库中定义的(类似于[图] = #标签在支持对话标记描述)。

注意:

  • 演员会持续使用新的画像直到你换回来。
  • 作为1.2.4版本,此命令以视觉效果立即而不是等待直到下一个字幕。
  • 1.1.9版本之前,该命令设置的画像在对话数据库。现在设置一个演员[“actorname”]。current_portrait对话抬头。如果是,这个纹理名称代替对话中数据库的肖像。因为所有的演员[ ]战场救了保存/加载系统,这是保存,和对话数据库保持不变。

Example: SetPortrait(Bob, BobAngry) 改变bob的头像纹理为BobAngry

ShowAlert()

Syntax: ShowAlert([duration])

Description: Calls DialogueManager.ShowAlert() to show the value of Variable["Alert"]. If this command is called in a conversation, Show Alerts During Conversations must be ticked.

Parameters:

  • duration: The duration in seconds to show the alert (defaults to the Dialogue Manager's value).

Example: ShowAlert()


ShowAlert()

语法: ShowAlert([持续时间])

描述: 显示警告,如果该命令是在谈话节目中的谈话称,警报必须打勾。

参数:

  • duration: .在几秒钟的时间来显示报警(默认为Dialogue Manager's的控制

Example: ShowAlert()

SwitchCamera()

Syntax: SwitchCamera([cameraName])

Description: Changes to a different sequencer camera. For example, you can switch to a camera with a different set of post-processing effects such as a grayscale effect or a blurry dreamlike effect. Note that you don't need to use SwitchCamera() to simply move the camera to preset shots in the scene. To do that, you can position empty GameObjects (or even inactive camera objects) and pass them as the angle parameter to the Camera() command. In addition, if you simply want to enable or disable a specific effect on the main sequencer camera, you can use the SetEnabled() command on it.

Parameters:

  • cameraName: The name of a camera prefab or object in the scene. If the object is in the scene, it may be deactivated but in this case it must be a child of an active object.

Example: SwitchCamera(My Sepia Camera) (Changes to a camera named "My Sepia Camera")

SwitchCamera()

语法: SwitchCamera([镜头名称])

描述: 一个不同的相机的变化。例如,你可以切换到一个摄像机和一套不同的后处理的效果,如灰度效果或模糊的梦幻般的效果。注意,你不需要使用switchcamera()简单地移动相机在场景预置镜头。这样做,你的位置空的游戏对象(甚至非相机对象)和角度参数的camera()命令传递。此外,如果你只是想启用或禁用相机的主要序列特定的效果,你可以使用它的setenabled()命令。

参数:

  • cameraName: 一个摄像机预置或场景中的对象的名称。如果对象在场景中,它可能被停用,但在这种情况下,它必须是一个活动对象的孩子。

Example: SwitchCamera(My Sepia Camera) 改变摄像机,使用名为Sepia的摄像机

Voice()

Syntax: Voice(audioClip, animation[, finalAnimation[, subject]])

Description: Plays audio and animation, and doesn't finish until both are done. Useful for playing a voice-acted line. (See also FaceFX() if you use FaceFX.)

Parameters:

  • audioClip: The path to an audio clip inside a Resources folder.
  • animation: The name of a legacy animation in the subject Animation component.
  • finalAnimation: (Optional) The name of a legacy animation to play when the animation is done. If omitted, the NPC returns to the default clip defined on the Animation component (i.e., the one that gets played when Play Automatically is ticked).
  • subject: (Optional) The object that will play the animation. Can be speaker, listener, or the name of a game object in the scene. Default: speaker.

Note: Note the order of arguments, which is different from Animation(). The ability to have shorter Voice() commands was chosen over consistency with the Animation() command.

Example: Voice(Bob/Hello, LipsyncHello, Idle, Bob) (Plays the audio clip "Bob/Hello" and animation "LipsyncHello" on Bob. When both are done, plays the "Idle" animation on Bob.)


Voice()

语法: Voice(声音剪辑, 动画[, 结束动画[, 隶属]])

描述:播放音频和动画,要同时完成,。用于播放声音行动线。(参见facefx()如果使用FaceFX。)

参数:

  • audioClip: 在一个资源文件夹中的音频剪辑路径。
  • animation: 在该主题的动画组件传统动画的名字。
  • finalAnimation:(可选)结束动画播放时的动画了。如果省略,动画会回到默认剪辑。
  • subject: (可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。

注意:注意参数的顺序,这是不同于animation()。有短voice()命令的能力是选择与animation()命令的一致性。

Example: Voice(Bob/Hello, LipsyncHello, Idle, Bob) 播放音频剪辑”鲍勃/你好“动画”lipsynchello”鲍勃。当两者都做,对鲍勃“闲置”动画。


WaitForMessage()

Syntax: WaitForMessage(message)

Description: Waits until another GameObject sends "OnSequencerMessage" with message as the parameter to the sequencer. The sequencer is located on the Dialogue Manager object unless you have manually created a different sequencer object elsewhere.

Parameters:

  • message: The message to wait for.

Note: Combined with the WaitForMessage() command, you can devise back-and-forth interaction with other GameObjects.

Example: SendMessage(StartDrilling,,Drill); WaitForMessage(StruckOil) (Sends "StartDrilling" [without any arguments] to the GameObject named Drill. Then waits until it receives OnSequencerMessage("StruckOil"). For example, the Drill could execute DialogueManager.Instance.SendMessage("OnSequencerMessage", "StruckOil"))


WaitForMessage()

语法: WaitForMessage(消息)

描述: 等到另一个对象发送“消息为音序器的参数onsequencermessage”。音序器是位于对话管理器对象除非你手动创建一个不同的序列对象的地方。

参数:

  • message:要等待的消息.

注:结合waitformessage()命令,你可以通过来回与其它对象交互。

Example: SendMessage(StartDrilling,,Drill); WaitForMessage(StruckOil) 

发送“startdrilling”[不带任何参数]。然后等待,直到它收到onsequencermessage(“struckoil”)。例如,钻头可以执行dialoguemanager。实例。SendMessage(“onsequencermessage”,“struckoil”)

Zoom2D()

Syntax: Zoom2D(subject[, size[, duration]])

Description: Does a 2D orthographic camera zoom on a subject.

Parameters:

  • subject: (Optional) The transform to focus on. Can be speaker, listener, or the name of a game object in the scene. Default: speaker.
  • size: (Optional) The orthographicSize to zoom to. Default: 16.
  • duration: (Optional) Smoothly move the camera over this many seconds. If omitted, cut immediately.

Note: The Zoom2D() command works with 2D orthographic cameras. For 3D perspective cameras, use Camera().

Example: Zoom2D(Player, 8, 2) (Zooms in to orthographicSize 8 on Player over 2 seconds)

Zoom2D()

语法: Zoom2D(隶属[, 大小[, 持续时间]])

描述: 二维投影镜头

Parameters:

  • subject: (可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。
  • size: (可选)的orthographicsize放大。默认值:16。
  • duration:(可选)平滑地移动摄像机在这几秒。如果省略,将立即。

注:本zoom2d()命令与二维正交相机。3D透视相机,使用camera()。

Example: Zoom2D(Player, 8, 2) 2秒内放大到8 player的 orthographicsize镜头

//---------------------------------大家好,我是本篇主角,我叫分割线,下面的方法都是第三方插件拓展的方法,如果只有原版插件,忽略==========

AC()

Note: Provided in Scripts/Third Party Support/Adventure Creator. Requires Adventure Creator.

Syntax: AC(cutscene[, nowait])

Description: Plays an Adventure Creator cutscene or action list.

Parameters:

  • cutscene: The name of a GameObject containing an Adventure Creator Cutscene or ActionList component.
  • nowait: (Optional) If nowait is passed as the second parameter, the cutscene runs in the background, and control passes immediately to the next stage of the conversation. Otherwise the sequencer command doesn't end until the cutscene is over.

Example:

  • AC(Try lifting) (Plays the "Try lifting" cutscene.)

AC()

:在脚本/第三方/Adventure Creator提供支持。需要Adventure Creator.

语法: AC(cutscene[, nowait])

描述: 播放一个冒险创作动画或动作列表。

参数:

  • cutscene: 一个游戏对象包含一个冒险创作动画或ActionList组件。
  • nowait: (可选)如果立即作为第二个参数传递,动画在后台运行,并控制通过立即对话的下一个阶段。否则,音序器命令并没有结束,直到游戏结束。

Example:

  • AC(Try lifting) 播放"Try lifting" 动画

Behavior()

Note: Provided in Scripts/Third Party Support/Behavior Designer. Requires Behavior Designer.

Syntax: Behavior(subject, start|stop|pause|resume)

Description: Controls a Behavior Designer behavior tree.

Parameters:

  • subject: The name of a GameObject containing a behavior tree, or speaker or listener. The behavior tree can be located on a child object.
  • start|stop|pause|resume: Control action for the behavior tree.
    • start: Starts or restarts the behavior tree.
    • stop: Stops the behavior tree.
    • pause: Pauses the behavior tree.
    • resume: Resumes the behavior tree if paused.

Example:

  • Behavior(Sergeant Graves, start) (Starts the behavior tree on Sergeant Graves)
  • Behavior(Terminal, pause) (Pauses the behavior tree on Terminal)

Behavior()

: 在脚本/第三方/Behavior Designer提供支持。需要Behavior Designer.

语法: Behavior(隶属, 开始|停止|暂停|恢复)

描述: 控制行为的行为树。

参数:

  • subject: 动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。
  • start|stop|pause|resume: 对于行为树的控制作用。
    • start: 启动或重新启动行为树。
    • stop: 停止行为树。
    • pause: 暂停行为树。
    • resume:恢复行为树如果停下来。

Example:

  • Behavior(Sergeant Graves, start) 开启Sergeant Graves的行为树
  • Behavior(Terminal, pause) 暂停 Terminal的行为树

BehaviorVariable()

Note: Provided in Scripts/Third Party Support/Behavior Designer. Requires Behavior Designer.

Syntax: BehaviorVariable(subject, variableName, value)

Description: Sets the value of a behavior tree's shared variable.

Parameters:

  • subject: The name of a GameObject containing a behavior tree, or speaker or listener. The behavior tree can be located on a child object.
  • variableName: The name of a shared variable on the behavior tree. These variable types are supported: Bool, Float, Int, String, GameObject, Object, Transform, Vector3.
  • value: The new value of the variable.

Example:

  • BehaviorVariable(Sergeant Graves, target, speaker) (On Sergeant Graves' behavior tree, sets the variable target to the speaker)
  • Behavior(Terminal, overheating, true) (On Terminal's behavior tree, sets the variable overheating to true)

BehaviorVariable()

在脚本/第三方/Behavior Designer提供支持。需要Behavior Designer.

语法: BehaviorVariable(隶属, 变量名, 数值)

描述

Parameters:设置一个行为树的共享变量的值。

  • subject: 一个游戏对象包含一个行为树的名字,或说话人或听话人。行为树可以位于一个子对象。
  • variableName: 一个共享的变量对行为树的名字。这些变量类型的支持:Bool, Float, Int, String, GameObject, Object, Transform, Vector3.
  • value:该变量的新值。

Example:

  • BehaviorVariable(Sergeant Graves, target, speaker)Sergeant Graves行为树,设置speakertarget
  • Behavior(Terminal, overheating, true) 在Terminal的行为树,设置变量overheating的值为真

FaceFX()

Note: Provided in Scripts/Third Party Support/FaceFX. Requires FaceFX.

Syntax: FaceFX(animation, audio[, subject])

Description: Plays a FaceFX line. You must first set up your character with FaceFX XML bone pose animations using the provided version of FaceFX's FaceFXControllerScript, and put the corresponding audio under a Resources folder.

Parameters:

  • animation: The name of a FaceFX animation on the subject.
  • audio: The path to the corresponding audio clip inside a Resources folder.
  • subject: (Optional) The actor speaking the line. Default: speaker.

Example:

  • FaceFX(hello,Audio/hello) (Plays the FaceFX animation "hello" and the audio asset "Audio/hello" located inside a Resources folder.)

FaceFX()

: 在脚本/第三方/FaceFX提供支持。需要FaceFX.

语法: FaceFX(动画, 音频[, 隶属])

描述: 起FaceFX线。你必须首先借助FaceFX XML骨构成动画使用提供的facefxcontrollerscript版FaceFX建立你的性格,并把相应的音频资源文件夹下。

Parameters:

  • animation: 关于这一主题的FaceFX动画的名字。
  • audio: 在一个资源文件夹对应的音频剪辑路径。
  • subject(可选)与动画组件的对象。演讲者,听众,或场景中的游戏对象的名称。默认值:演讲者。

Example:

  • FaceFX(hello,Audio/hello) FaceFX动画“你好”和音频资产“音频/你好”位于资源文件夹

FSMEvent()

Note: Provided in Scripts/Third Party Support/PlayMaker. Requires PlayMaker.

Syntax: FSMEvent(event[, subject[, fsm]])

Description: Sends an event to a PlayMaker FSM on a subject.

Parameters:

  • event: The name of the event.
  • subject: (Optional) The owner of the FSM. Default: speaker.
  • fsm: (Optional) The FSM to send the event to. If omitted, the event is sent to all FSMs on the subject.

Example:

  • FSMEvent(Updated Name Variable, Player) (Sends an event "Updated Name Variable" to the FSM(s) on the object named "Player".)

FSMEvent()

在脚本/第三方/PlayMaker提供支持。需要PlayMaker

语法: FSMEvent(事件[, 隶属[, fsm]])

描述: 发送一个事件对 PlayMaker FSM

参数:

  • event: 事件的名称。
  • subject:(可选)的FSM的主人。默认值:演讲者
  • fsm: (可选)自动发送事件。如果省略,这一事件将被发送到所有关于这一主题的有限状态机。

例子:

  • FSMEvent(Updated Name Variable, Player) 发送一个事件”更新的变量名“FSM(S)的对象命名为“玩家”

KGFMapIcon()

Note: Provided in Scripts/Third Party Support/KGFMapSystem. Requires KGFMapSystem.

Syntax: KGFMapIcon(iconName[, subject])

Description: Sets a map icon in KGFMapSystem. This icon becomes visible, and all other icons for the object become invisible. Note: The subject must have a KGFMap Icons component (Window > Dialogue System > Component > Integration > KGFMapSystem > KGF Map Icons).

Parameters:

  • iconName: The name of an icon on the subject.
  • subject: (Optional) The object whose icon to change. Default: speaker.

Note: This command is useful to change icons when the player picks up a quest during a conversation. If the player abandons the quest in the quest log window, the window will look for a field on the quest named "Abandon Sequence" and play it. You can use KGFMapIcon() commands in this sequence to turn off any icons that are no longer relevant.

Example:

  • KGFMapIcon(HasQuestIcon) (Sets the speaker's icon to the "HasQuestIcon" icon.)

KGFMapIcon()

在脚本/第三方/KGFMapSystem提供支持。需要KGFMapSystem.

语法: KGFMapIcon([图标名, 隶属])

描述: 在kgfmapsystem地图图标集。这个图标变得可见,并为对象的所有其他图标变成看不见。注意:必须要有一个kgfmap图标组件 (Window > Dialogue System > Component > Integration > KGFMapSystem > KGF Map Icons).

参数:

  • iconName: 主体上的一个图标的名称。
  • subject: (可选)对象的图标改变。默认值:演讲者

Note这个命令是改变图标,当玩家挑选对话中寻求有用。如果玩家放弃任务日志窗口的任务,该窗口将看一场探索“放弃序列”和它玩耍。你可以在这个序列使用kgfmapicon()命令关闭任何图标,都已不再重要。

Example:

  • KGFMapIcon(HasQuestIcon) 设置扬声器的图标,“hasquesticon”图标

注:下面这个插件uSequencer没有用过,具体怎么使用,作用未知,所以使用机翻

uSeq()

Note: Provided in Scripts/Third Party Support/uSequencer. Requires Well Fired's uSequencer.

Syntax: uSeq(USSequence[, once|cache[, index, object...]])

Description: Loads a uSequencer sequence from Resources and plays it. To prepare a uSequencer sequence, create it and save a prefab inside a Resources folder. Then provide the path to that prefab to this command.

By default, each uSequencer timeline container remembers the path to its affected object so it can find the object when you instantiate the prefab. However, if the object's actual path is different at runtime, you can set the affected object using the index and object parameters as described below.

Parameters:

  • USSequence: The path to a uSequencer sequence inside a Resources folder.
  • once|cache: (Optional) If once, the sequence is unloaded from memory when done playing; if cache, it's kept in memory. Use once for sequences that only play once, such as a unique one-time sequence. Use cache for generic sequences that may be used again, such as a generic body gesture. Defaults to cache. Note: Since Resources.UnloadAsset() doesn't work for certain types such as uSequencer sequence prefabs, the unload calls Resources.UnloadUnusedAssets(). This command can temporarily slow down framerate, so you may choose to simply keep the sequence in memory and let garbage collection automatically unload it later.
  • index: (Optional) The index number of a USTimelineContainer in the sequence. This parameter must be paired with an object.
  • object: (Optional): The name of an object in the scene, or speaker or listener. The affected object of the USTimelineContainer will be set to this object.
  • Note: You can provide any number of "index, object" parameters to this command.

Examples:

  • uSeq(USCutscene1) (Plays the uSequencer sequence "USCutscene1" located inside a Resources folder.)
  • uSeq(Cutscenes/Curtsey, cache, 1, speaker) (Plays the uSequencer sequence "Cutscenes/Curtsey" using the speaker as the affected object for the USTimelineContainer whose index is 1. Keeps the sequence in memory for re-use.)
  • uSeq(Cutscenes/GetToDaChoppa, once, 1, Arnold, 2, Helicopter) (Plays the uSequencer sequence "Cutscenes/GetToDaChoppa" using the game object "Arnold" as the affected object for the USTimelineContainer whose index is 1 and the game object "Helicopter" as the affected object for the USTimelineContainer whose index is 2. When done playing, removes the sequence from memory.)

uSeq()

在脚本/第三方/uSequencer提供支持。需要 uSequencer.

语法: uSeq(USSequence[, once|cache[, index, object...]])

描述:

负载从资源usequencer序列并播放它。准备一个usequencer序列,创建并保存一个预制在一个资源文件夹。然后提供路径,预制这个命令。


默认情况下,每个usequencer时间表容器记得路径影响对象可以找对象当你实例化预设。然而,如果对象的实际路径是不同的运行时,你可以使用索引和对象参数如下所述将受影响的对象。

Parameters:

  • USSequence: 在一个资源文件夹的路径usequencer序列。
  • once|cache: (可选)如果一次,顺序是从内存中卸载时做游戏;如果缓存,它保存在内存中。使用一次序列,只玩一次,如独特的一次性序列。使用缓存的通用序列,可再次使用,如一般的身体姿势。默认缓存。注:由于资源。unloadasset()不适合某些类型如usequencer序列问题,卸载unloadunusedassets()调用资源。这个命令可以暂时放慢速度,所以你可以选择简单地保持序列记忆和让垃圾收集自动卸货后。
  • index: (可选)序列中的ustimelinecontainer指数。此参数必须是成对的对象。
  • object: (可选):场景中的对象的名字,或说话人或听话人。该ustimelinecontainer受影响的对象将被设置为该对象。
  • Note: 你可以提供任意数量”指标,目标参数,此命令。

Examples:

  • uSeq(USCutscene1) 起usequencer序列”uscutscene1”位于资源文件夹
  • uSeq(Cutscenes/Curtsey, cache, 1, speaker) 起usequencer序列”的过场动画/礼”使用扬声器为影响对象的ustimelinecontainer的指数是1。保持序列内存使用。)
  • uSeq(Cutscenes/GetToDaChoppa, once, 1, Arnold, 2, Helicopter) 
起usequencer序列”的过场动画/ gettodachoppa”使用的游戏对象“阿诺德”为影响对象的ustimelinecontainer的指数是1,游戏对象的“直升机”为影响对象的ustimelinecontainer的指数是2。当玩,从内存中删除序列。







  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值