-
-
Save fuwac/af02a8d60fc653ced257cd8e31e082c0 to your computer and use it in GitHub Desktop.
宴3でSendMessage受け取り奴
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using Utage; | |
// boltスクリプト呼び出し用 | |
using Ludiq; | |
using Bolt; | |
public class UtageReceiveMessageSample : MonoBehaviour | |
{ | |
public AdvEngine engine; // Advエンジン本体 | |
public GameObject[] listNPC; // NPCいろいろ | |
//SendMessageコマンドが実行されたタイミング | |
void OnDoCommand(AdvCommandSendMessage command) | |
{ | |
switch (command.Name) | |
{ | |
// 口パク(ブレンドシェイプ) | |
case "Talk": | |
this.Talk(command); | |
break; | |
// Animatorの遷移 | |
case "Motion": | |
this.Motion(command); | |
break; | |
// よく分からんコマンド | |
default: | |
Debug.Log("Unknown Message:" + command.Name ); | |
break; | |
} | |
} | |
// 口パク(ブレンドシェイプ) | |
private void Talk(AdvCommandSendMessage command){ | |
// シートのArgs2を参照 | |
switch(command.Arg2){ | |
// アバ太 | |
case "abata": | |
// Boltのカスタムイベント「Talk」実行 | |
CustomEvent.Trigger(this.listNPC[0], "Talk"); | |
break; | |
} | |
} | |
// モーション(Animator) | |
private void Motion(AdvCommandSendMessage command){ | |
// シートのArgs2を参照 | |
switch(command.Arg2){ | |
// アバ太 | |
case "abata": | |
// Boltのカスタムイベント「Motion」実行(Args3にモーション名) | |
CustomEvent.Trigger(this.listNPC[0], "Motion", command.Arg3); | |
break; | |
} | |
} | |
//SendMessageコマンドの処理待ちタイミング | |
void OnWait(AdvCommandSendMessage command) | |
{ | |
switch (command.Name) | |
{ | |
default: | |
command.IsWait = false; | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment