❤❤Fungus新課程即將發布,快寫問卷拿優惠❤❤
顯示具有 Hierarchy 標籤的文章。 顯示所有文章
顯示具有 Hierarchy 標籤的文章。 顯示所有文章

2016年8月20日 星期六

回覆讀者:如何在Unity裡用Fungus顯示對話文字的時候,同時播放對應的語音

回覆讀者:如何在Unity裡用Fungus顯示對話文字的時候,同時播放對應的語音
Unity Fungus Tutorial:
How To Play Voice and Display Dialog In The Same Time With Fungus Plug-in in Unity



開新專案
Open a New Project

Ctrl+ 9 開啟資源商店 ,輸入Fungus下載這個插件 插件網址
Ctrl+9 Open asset store and search Fungus plugin to install

1.必備一個舞台
There must be a Stage
Tools-->Fungus-->Create-->Stage

2.必備一個角色
There must be a Character
Tools-->Fungus-->Create-->Character

3.必備一個flowchart
There must be a Flowchart
Tools-->Fungus-->Create-->Flowchart

4.開啟Flowchart視窗
Open Flowchart Window
Tools-->Fungus-->Flowchart Window

5.角色改名
rename the Character


6.點擊New Block 新增一個SayCommand對話指令
press New Block and add a SayCommand

7.SayCommand對話指令的角色指定為Character物件(Amy)
Assign the Character box to Character gameobject(Amy)

8.語音檔案指定到 voice Over Clip裡
同時輸入要顯示的對話文字 
Assign voice clip and input your dialog text


=====播出眾人回應的語音=====
=====optional: people's feedback in voice

9.新增一個PlaySound指令
add a new PlaySound Command


10.再新增兩三個,同時指定其他人的語音
然後Wait Until Finished不要打勾 ,兩個Play Sound的語音就會同時播放
而不是一個接一個播放
then duplicate it into two PlaySound Commands, and assign the rest voices
,then uncheck WaitUntilFinished box,that means these 2 PlaySound commands will be play in the same time, instead of one by one.

=============
下載專案Download The Project

2016年6月28日 星期二

Unity 階層視窗自動排序物件 Unity 5 Hierarchy Auto-Sorting objects




===
有位熱心網友指出其實不用自己貼代碼
在Edit\preferences\General裡打勾Enable Alpha Numeric sorting
就可以自動照字母順序排列了

若您有逆向排序的需求 還是可以參考下面的做法
===
 開一個c#的程式腳本貼入下面的代碼 或直接下載放到assets裡
"Copy and paste the code below into your new c# script
or put this file  in the assets folder

===============================

using UnityEngine;
using UnityEditor;

public class A_to_Z : BaseHierarchySort
    {

    public override int Compare ( GameObject lhs , GameObject rhs )
        {
        if ( lhs == rhs )  return  0;
        if ( lhs == null ) return -1;
        if ( rhs == null ) return  1;

        return EditorUtility.NaturalCompare ( lhs.name , rhs.name );
        }
    }

public class Z_to_A : BaseHierarchySort
    {

    public override int Compare ( GameObject lhs , GameObject rhs )
        {
        if ( lhs == rhs )  return  0;
        if ( lhs == null ) return  -1;
        if ( rhs == null ) return 1;

        return EditorUtility.NaturalCompare ( rhs.name , lhs.name );
        }
    }


你的階層圖就會多出一個星星按鈕
Then your Hierarchy will appear a new star button

可選擇A to Z順向排序或選擇Z to A 逆向排序物件
You can choose sorting objects by A to Z or Z to A