diff --git a/Assets/Editor/Image Effects/CameraMotionBlurEditor.js b/Assets/Editor/Image Effects/CameraMotionBlurEditor.js index 3b0d356..8de93b0 100644 --- a/Assets/Editor/Image Effects/CameraMotionBlurEditor.js +++ b/Assets/Editor/Image Effects/CameraMotionBlurEditor.js @@ -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; @@ -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"); @@ -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(); diff --git a/Assets/julius/Script/Julius_Client.cs b/Assets/julius/Script/Julius_Client.cs index 7a426e4..555f149 100644 --- a/Assets/julius/Script/Julius_Client.cs +++ b/Assets/julius/Script/Julius_Client.cs @@ -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; @@ -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."); @@ -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(); + } } //-------------------------------------------------------------------- @@ -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; @@ -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); @@ -178,13 +193,13 @@ private string XML_search(string stream){ while(sampling.Success){//最後まで抽出 //結合処理 for(int i = 1;i