Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Assets/Editor/Image Effects/CameraMotionBlurEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CameraMotionBlurEditor extends Editor
var serObj : SerializedObject;

var filterType : SerializedProperty;
var preview : SerializedProperty;
var preview_ : SerializedProperty;
var previewScale : SerializedProperty;
var movementScale : SerializedProperty;
var jitter : SerializedProperty;
Expand All @@ -28,7 +28,7 @@ class CameraMotionBlurEditor extends Editor

filterType = serObj.FindProperty ("filterType");

preview = serObj.FindProperty ("preview");
preview_ = serObj.FindProperty ("preview");
previewScale = serObj.FindProperty ("previewScale");

movementScale = serObj.FindProperty ("movementScale");
Expand Down Expand Up @@ -89,8 +89,8 @@ class CameraMotionBlurEditor extends Editor

EditorGUILayout.Separator ();

EditorGUILayout.PropertyField (preview, new GUIContent("Preview"));
if (preview.boolValue)
EditorGUILayout.PropertyField (preview_, new GUIContent("Preview"));
if (preview_.boolValue)
EditorGUILayout.PropertyField (previewScale, new GUIContent(""));

serObj.ApplyModifiedProperties();
Expand Down
50 changes: 33 additions & 17 deletions Assets/julius/Script/Julius_Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ private bool open_julius_server(){
try{
julius_process = System.Diagnostics.Process.Start(info);
}catch(System.ComponentModel.Win32Exception w){
Debug.Log("Not Found." + w);
Debug.Log("Process Not Found. " + w);
Debug.Log("Path: " + info.WorkingDirectory + info.FileName);
message = "Not Found.";
return_num = 0;
return false;
Expand All @@ -98,7 +99,15 @@ private void kill_julius_server(){
/*juliusサーバーへ接続する*/
private bool initialize_julius_client(){
//TCP/IPの初期化&juliusサーバーへ接続
tcpip = new TcpClient(IPAddress,port);
//TcpClientは例外を返す場合がある
try
{
tcpip = new TcpClient(IPAddress, port);
}
catch
{
tcpip = null;
}
//クライアントが取得出来たかどうか
if (tcpip == null) {
Debug.Log("Connect Fall.");
Expand Down Expand Up @@ -128,14 +137,18 @@ private void close_julius(){

/*サーバーが起動するまで時間があるので少し待つ*/
private IEnumerator start_julius_server(){
Debug.Log ("Julius Initialize...");
message = "Julius Initialize...";
return_num = 1;
yield return new WaitForSeconds(wait_time);
Debug.Log ("Connect start");
message = "Connect start";
return_num = 1;
connect = initialize_julius_client();
while (!connect)
{
Debug.Log("Julius Initialize...");
message = "Julius Initialize...";
return_num = 1;
yield return new WaitForSeconds(wait_time);
Debug.Log("Connect start");
message = "Connect start";
return_num = 1;

connect = initialize_julius_client();
}
}
//--------------------------------------------------------------------

Expand All @@ -146,9 +159,11 @@ private void get_stream(){//**マルチスレッド関数**
//マルチスレッドの速度?
Thread.Sleep(0);
//ストリームの受信
net.Read(data, 0, data.Length);
stream = System.Text.Encoding.Default.GetString(data);
//Debug.Log (stream);
//受け取ったバイト数だけを文字列として解析する
//streamは前の状態が残っているため、受け取ったバイト数が前回より少ないときに同じ文字列が認識されてしまう
int charCount = net.Read(data, 0, data.Length);
stream = System.Text.Encoding.Default.GetString(data, 0, charCount);
Debug.Log (stream);

//Debug.Log ("tmp_s : "+words)
tmp = string.Empty;
Expand All @@ -169,7 +184,7 @@ private void send_stream(string msg){

/*ストリーム情報から正規表現を利用して文字列を抽出する*/
private string XML_search(string stream){
string tmp = string.Empty;
string tmp_l = string.Empty;

//正規表現
xml_data = new Regex(regular);
Expand All @@ -178,13 +193,13 @@ private string XML_search(string stream){
while(sampling.Success){//最後まで抽出
//結合処理
for(int i = 1;i<sampling.Groups.Count;i++){//なぜかi = 1にしたらうまく行った
tmp += sampling.Groups[i].Value;
tmp_l += sampling.Groups[i].Value;
}
//順次抽出していく
sampling = sampling.NextMatch();
}
//最終的に結合した文字列を返す
return tmp;
return tmp_l;
}
//--------------------------------------------------------------

Expand Down Expand Up @@ -248,7 +263,8 @@ void Update () {
}

//終了処理と同時に実行される
void OnApplicationQuit() {
void OnDestroy()
{
if (connect) {
//juliusサーバーを切断
close_julius();
Expand Down