diff --git a/Assets/Scripts/InspectorScript.cs b/Assets/Scripts/InspectorScript.cs index 8b08d06..67f7b3e 100644 --- a/Assets/Scripts/InspectorScript.cs +++ b/Assets/Scripts/InspectorScript.cs @@ -1,4 +1,11 @@ //Log Dir http://docs.unity3d.com/Manual/LogFiles.html + + +/*--------------------------------------------------------- +AnimationState-speed Doc +http://docs.unity3d.com/ScriptReference/AnimationState-speed.html +-----------------------------------------------------------*/ + using UnityEngine; using System; using System.Collections; @@ -8,7 +15,12 @@ using System.Net.Sockets; using System.Threading; public class InspectorScript : MonoBehaviour { - + + // 1 is the normal animation speed, i.e, unity reproduces it without changing the speed + // 1.5 means +50% speed. It was the most appropriate speed as reported by deaf testers + // Please, se speed method of AnimationState class in unity docs in link above + const float PLAYER_DEFAULT_SPEED = 1.5f; + public Boolean isCaptionsActive = true; string alfabeto = "0123456789,ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string aniName = ""; @@ -27,11 +39,12 @@ public class InspectorScript : MonoBehaviour { string[] strArg; void Start(){ + strArg = Environment.GetCommandLineArgs(); + if(strArg.Length == 4) - playerSpeed = 1+((float.Parse(strArg[3]))/100); - else - playerSpeed = 1.5f; + playerSpeed = float.Parse(strArg[3]); + serverSemaphore = new Semaphore (0, 1); glosaQueue = new Queue(); subtitleQueue = new Queue(); @@ -121,7 +134,12 @@ public class InspectorScript : MonoBehaviour { } } foreach(AnimationState animState in COMPONENT_ANIMATION){ - animState.speed = playerSpeed; + + // Expects to receive this speed limitation [ 0 < speed <=1 ] + if(playerSpeed > 0 && playerSpeed <= 1) + animState.speed = 1 + playerSpeed; // explained on PLAYER_DEFAULT_SPEED declaration + else // uses the default speed; + animState.speed = PLAYER_DEFAULT_SPEED; } } // sendToPlayer } // InspectorIscript \ No newline at end of file -- libgit2 0.21.2