Commit ee7fb1fd564315acc34b63e950aa48c604893027
1 parent
599982d7
Exists in
master
and in
1 other branch
Ambiente para primeiros testes
Showing
11 changed files
with
310 additions
and
126 deletions
Show diff stats
Assets/Scene.unity
@@ -87,6 +87,24 @@ NavMeshSettings: | @@ -87,6 +87,24 @@ NavMeshSettings: | ||
87 | cellSize: .166666657 | 87 | cellSize: .166666657 |
88 | manualCellSize: 0 | 88 | manualCellSize: 0 |
89 | m_NavMeshData: {fileID: 0} | 89 | m_NavMeshData: {fileID: 0} |
90 | +--- !u!1 &24119727 stripped | ||
91 | +GameObject: | ||
92 | + m_PrefabParentObject: {fileID: 128494, guid: e81531d8e82eb2b44990f09c5291ae1d, type: 2} | ||
93 | + m_PrefabInternal: {fileID: 1966450184} | ||
94 | +--- !u!114 &24119728 | ||
95 | +MonoBehaviour: | ||
96 | + m_ObjectHideFlags: 0 | ||
97 | + m_PrefabParentObject: {fileID: 0} | ||
98 | + m_PrefabInternal: {fileID: 0} | ||
99 | + m_GameObject: {fileID: 24119727} | ||
100 | + m_Enabled: 1 | ||
101 | + m_EditorHideFlags: 0 | ||
102 | + m_Script: {fileID: 11500000, guid: 19dfd08232552c5489d556fbce180d14, type: 3} | ||
103 | + m_Name: | ||
104 | + m_EditorClassIdentifier: | ||
105 | + folder: | ||
106 | + frameRate: 30 | ||
107 | + sizeMultiplier: 1 | ||
90 | --- !u!1001 &1610759364 | 108 | --- !u!1001 &1610759364 |
91 | Prefab: | 109 | Prefab: |
92 | m_ObjectHideFlags: 0 | 110 | m_ObjectHideFlags: 0 |
@@ -267,7 +285,8 @@ Prefab: | @@ -267,7 +285,8 @@ Prefab: | ||
267 | propertyPath: m_RootOrder | 285 | propertyPath: m_RootOrder |
268 | value: 3 | 286 | value: 3 |
269 | objectReference: {fileID: 0} | 287 | objectReference: {fileID: 0} |
270 | - m_RemovedComponents: [] | 288 | + m_RemovedComponents: |
289 | + - {fileID: 11445724, guid: e81531d8e82eb2b44990f09c5291ae1d, type: 2} | ||
271 | m_ParentPrefab: {fileID: 100100000, guid: e81531d8e82eb2b44990f09c5291ae1d, type: 2} | 290 | m_ParentPrefab: {fileID: 100100000, guid: e81531d8e82eb2b44990f09c5291ae1d, type: 2} |
272 | m_IsPrefabParent: 0 | 291 | m_IsPrefabParent: 0 |
273 | --- !u!1001 &1999141633 | 292 | --- !u!1001 &1999141633 |
Assets/Scripts/CameraCapture.cs
@@ -17,53 +17,29 @@ public class CameraCapture : MonoBehaviour{ | @@ -17,53 +17,29 @@ public class CameraCapture : MonoBehaviour{ | ||
17 | public int sizeMultiplier = 1; | 17 | public int sizeMultiplier = 1; |
18 | string[] strArg; | 18 | string[] strArg; |
19 | 19 | ||
20 | - GameObject ICARO; | ||
21 | - Animation COMPONENT_ANIMATION; | ||
22 | - | ||
23 | void Start( ){ | 20 | void Start( ){ |
24 | - | 21 | + Debug.Log ("Folders can be found inside "+Application.persistentDataPath); |
25 | strArg = Environment.GetCommandLineArgs(); | 22 | strArg = Environment.GetCommandLineArgs(); |
26 | folder = strArg[1]; | 23 | folder = strArg[1]; |
27 | 24 | ||
28 | - if( strArg.Length == 5 ) | ||
29 | - frameRate = int.Parse(strArg[4]); | 25 | + if( strArg.Length == 4 ) frameRate = int.Parse(strArg[3]); |
30 | 26 | ||
31 | Debug.Log ("Folders can be found inside "+Application.persistentDataPath); | 27 | Debug.Log ("Folders can be found inside "+Application.persistentDataPath); |
32 | 28 | ||
33 | - ICARO = GameObject.FindGameObjectWithTag("avatar"); | ||
34 | - COMPONENT_ANIMATION = ICARO.GetComponent<Animation>(); | ||
35 | - | ||
36 | // Set the playback framerate! | 29 | // Set the playback framerate! |
37 | // (real time doesn't influence time anymore) | 30 | // (real time doesn't influence time anymore) |
38 | Time.captureFramerate = frameRate; | 31 | Time.captureFramerate = frameRate; |
39 | 32 | ||
40 | -// Find a folder that doesn't exist yet by appending numbers! | ||
41 | -//realFolder = folder; | ||
42 | - | ||
43 | -/** int count = 1;while (System.IO.Directory.Exists(Application.persistentDataPath+"/"+realFolder)){realFolder = folder + count; count++;}*/ | 33 | + // Find a folder that doesn't exist yet by appending numbers! |
34 | + //realFolder = folder; | ||
44 | 35 | ||
45 | // Create the folder | 36 | // Create the folder |
46 | System.IO.Directory.CreateDirectory(Application.persistentDataPath+"/"+folder); | 37 | System.IO.Directory.CreateDirectory(Application.persistentDataPath+"/"+folder); |
47 | folder = Application.persistentDataPath+"/"+folder; | 38 | folder = Application.persistentDataPath+"/"+folder; |
39 | + } // Start | ||
48 | 40 | ||
41 | + void Update( ){ | ||
42 | + var name = string.Format ("{0}/frame_{1}.png", folder, Time.frameCount); | ||
43 | + Application.CaptureScreenshot (name, sizeMultiplier); | ||
49 | } | 44 | } |
50 | - | ||
51 | - bool ehPossivelEncerrar = false; | ||
52 | - | ||
53 | - void Update( ){ | ||
54 | - | ||
55 | - if(COMPONENT_ANIMATION.isPlaying){ ehPossivelEncerrar = true; | ||
56 | - | ||
57 | - //name is "realFolder/shot 0005.png" | ||
58 | - //var name = string.Format("{0}/shot {1:D04}.png", realFolder, Time.frameCount); | ||
59 | - var name = string.Format("{0}/frame_{1}.png", folder, Time.frameCount); | ||
60 | - | ||
61 | - | ||
62 | - //Capture the screenshot | ||
63 | - //Application.CaptureScreenshot(name, sizeMultiplier); | ||
64 | - Application.CaptureScreenshot(name, sizeMultiplier); | ||
65 | - | ||
66 | - }else if( ehPossivelEncerrar ) Application.Quit( ); | ||
67 | - | ||
68 | - } | ||
69 | -} | ||
70 | \ No newline at end of file | 45 | \ No newline at end of file |
46 | +} // class | ||
71 | \ No newline at end of file | 47 | \ No newline at end of file |
Assets/Scripts/CameraCapture.cs.meta
1 | fileFormatVersion: 2 | 1 | fileFormatVersion: 2 |
2 | -guid: 023d7e19ccd84ee4cbca92ab3fd2c385 | ||
3 | -timeCreated: 1435101899 | ||
4 | -licenseType: Pro | 2 | +guid: 19dfd08232552c5489d556fbce180d14 |
3 | +timeCreated: 1436287786 | ||
4 | +licenseType: Free | ||
5 | MonoImporter: | 5 | MonoImporter: |
6 | serializedVersion: 2 | 6 | serializedVersion: 2 |
7 | defaultReferences: [] | 7 | defaultReferences: [] |
Assets/Scripts/InspectorScript.cs
1 | -//Log Dir http://docs.unity3d.com/Manual/LogFiles.html | 1 | +//Log Dir http://docs.unity3d.com/Manual/LogFiles.html |
2 | using UnityEngine; | 2 | using UnityEngine; |
3 | - | ||
4 | using System; | 3 | using System; |
5 | using System.Collections; | 4 | using System.Collections; |
6 | using System.Collections.Generic; | 5 | using System.Collections.Generic; |
7 | using System.Runtime.InteropServices; | 6 | using System.Runtime.InteropServices; |
8 | - | 7 | +using System.Net.Sockets; |
8 | +using System.Threading; | ||
9 | 9 | ||
10 | public class InspectorScript : MonoBehaviour { | 10 | public class InspectorScript : MonoBehaviour { |
11 | - | 11 | + |
12 | public Boolean isCaptionsActive = true; | 12 | public Boolean isCaptionsActive = true; |
13 | 13 | ||
14 | string alfabeto = "0123456789,ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | 14 | string alfabeto = "0123456789,ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
15 | - string stringPre; string[] stringPos; | ||
16 | string aniName = ""; | 15 | string aniName = ""; |
17 | - string[] strArg; | ||
18 | - public String glosa; | ||
19 | - | ||
20 | AnimationClip aniClip; | 16 | AnimationClip aniClip; |
21 | - | 17 | + AnimationClip defaultClip; |
22 | GameObject ICARO; | 18 | GameObject ICARO; |
23 | Animation COMPONENT_ANIMATION; | 19 | Animation COMPONENT_ANIMATION; |
24 | - | ||
25 | - void Start( ){ | ||
26 | - | ||
27 | - strArg = Environment.GetCommandLineArgs(); | ||
28 | - glosa = strArg[2]; | ||
29 | - | 20 | + Server server; |
21 | + Semaphore serverSemaphore; | ||
22 | + Thread t, tPlayer; | ||
23 | + Queue<String> glosaQueue; | ||
24 | + Queue<SubtitleInfo> subtitleQueue; | ||
25 | + bool finalizeFlag; | ||
26 | + Time time; | ||
27 | + | ||
28 | + void Start(){ | ||
29 | + serverSemaphore = new Semaphore (0, 1); | ||
30 | + glosaQueue = new Queue<String>(); | ||
31 | + subtitleQueue = new Queue<SubtitleInfo>(); | ||
32 | + finalizeFlag = false; | ||
33 | + server = new Server (serverSemaphore, this); | ||
34 | + t = new Thread(new ThreadStart(server.startServer)); | ||
35 | + t.Start (); | ||
36 | + tPlayer = new Thread(new ThreadStart(playerRun)); | ||
37 | + serverSemaphore.WaitOne (); // Waits until connection with client is established in server.startServer() method | ||
30 | ICARO = GameObject.FindGameObjectWithTag("avatar"); | 38 | ICARO = GameObject.FindGameObjectWithTag("avatar"); |
31 | COMPONENT_ANIMATION = ICARO.GetComponent<Animation>(); | 39 | COMPONENT_ANIMATION = ICARO.GetComponent<Animation>(); |
32 | - | ||
33 | - addAlpha( ); | ||
34 | - | ||
35 | - playFromFile( ); | ||
36 | - | ||
37 | - } | 40 | + addAlpha (); |
41 | + sendToPlayer (""); | ||
42 | + tPlayer.Start(); | ||
43 | + } // Start | ||
38 | 44 | ||
39 | void addAlpha( ){ | 45 | void addAlpha( ){ |
40 | - | ||
41 | foreach( char letter in alfabeto ){ | 46 | foreach( char letter in alfabeto ){ |
42 | - | ||
43 | aniClip = Resources.Load<AnimationClip> ("ANIMS/alpha/"+letter); | 47 | aniClip = Resources.Load<AnimationClip> ("ANIMS/alpha/"+letter); |
44 | - | ||
45 | - if( aniClip ) COMPONENT_ANIMATION.AddClip(aniClip, ""+letter); | ||
46 | - else Debug.Log("Anim "+aniName+" not found"); | ||
47 | - | 48 | + if( aniClip ) |
49 | + COMPONENT_ANIMATION.AddClip(aniClip, ""+letter); | ||
50 | + else | ||
51 | + Debug.Log("Anim "+aniName+" not found"); | ||
48 | } | 52 | } |
49 | - | ||
50 | }//addAlpha | 53 | }//addAlpha |
51 | - | ||
52 | - | ||
53 | - | ||
54 | - void animStop( ){ | ||
55 | - | ||
56 | - COMPONENT_ANIMATION.Stop(); | ||
57 | - | ||
58 | - aniClip = Resources.Load<AnimationClip>("ANIMS/anims/_default"); | ||
59 | - COMPONENT_ANIMATION.CrossFadeQueued("_default", 0.6F, QueueMode.CompleteOthers, PlayMode.StopAll ); | ||
60 | - | ||
61 | 54 | ||
55 | + public void setFinalizeFlag(bool b){ | ||
56 | + finalizeFlag = b; | ||
57 | + } | ||
58 | + public void addGlosaQueue(String str){ | ||
59 | + glosaQueue.Enqueue (str); | ||
62 | } | 60 | } |
61 | + public void addSubtitleQueue(SubtitleInfo si){ | ||
62 | + subtitleQueue.Enqueue (si); | ||
63 | + } | ||
64 | + | ||
65 | + // Gets glosa from queue to animate them | ||
66 | + void playerRun(){ | ||
67 | + do { | ||
68 | + if(subtitleQueue.Count > 0){ | ||
69 | + long pts = subtitleQueue.Peek().getPts(); | ||
70 | + if (Time.time > (pts/1000)){ // em segundos | ||
71 | + String glosa = subtitleQueue.Dequeue().getGlosa (); | ||
72 | + sendToPlayer (glosa); | ||
73 | + } | ||
74 | + } | ||
75 | + try{ | ||
76 | + Thread.Sleep(100); // waits a little while | ||
77 | + } | ||
78 | + catch(ThreadInterruptedException e){ | ||
79 | + Console.WriteLine(e.Source); | ||
80 | + } | ||
81 | + if(finalizeFlag) // Core told to finalize | ||
82 | + if(subtitleQueue.Count == 0) // if there is no glosa to animate | ||
83 | + break; | ||
84 | + } while(true); | ||
85 | + while (COMPONENT_ANIMATION.isPlaying) { | ||
86 | + try{ | ||
87 | + Thread.Sleep(500); | ||
88 | + } | ||
89 | + catch(ThreadInterruptedException e){ | ||
90 | + Console.WriteLine(e.Source); | ||
91 | + } | ||
92 | + } | ||
93 | + server.sendFinalizeToCore (); // all frames saved | ||
94 | + server.closeConnections (); | ||
95 | + Application.Quit (); | ||
96 | + } // playerRun | ||
63 | 97 | ||
64 | - void playFromFile(){ | 98 | + void sendToPlayer(String glosa){ |
99 | + String[] stringPos; | ||
65 | 100 | ||
66 | - COMPONENT_ANIMATION.Stop( ); | ||
67 | - | ||
68 | - | ||
69 | - if(glosa != null) | ||
70 | - stringPre = " _default "+glosa+" _default "; | ||
71 | - else Application.Quit(); | ||
72 | - | ||
73 | - stringPos = stringPre.Split(' '); | ||
74 | - | 101 | + glosa +=" _default"; |
102 | + glosa = glosa.ToUpper (); | ||
103 | + stringPos = glosa.Split(' '); | ||
104 | + | ||
105 | + // Looks for animation | ||
75 | foreach( string aniName in stringPos ){ | 106 | foreach( string aniName in stringPos ){ |
76 | - | ||
77 | aniClip = Resources.Load<AnimationClip>("ANIMS/anims/"+aniName); | 107 | aniClip = Resources.Load<AnimationClip>("ANIMS/anims/"+aniName); |
78 | - | ||
79 | if( aniClip ){ | 108 | if( aniClip ){ |
80 | - | ||
81 | COMPONENT_ANIMATION.AddClip(aniClip, aniName); | 109 | COMPONENT_ANIMATION.AddClip(aniClip, aniName); |
82 | COMPONENT_ANIMATION.CrossFadeQueued( aniName, 0.6F, QueueMode.CompleteOthers );//0.4 | 110 | COMPONENT_ANIMATION.CrossFadeQueued( aniName, 0.6F, QueueMode.CompleteOthers );//0.4 |
83 | - | ||
84 | - //COMPONENT_ANIMATION.RemoveClip( aniName ); | ||
85 | - | ||
86 | - }else | 111 | + } |
112 | + else{ // Spells, if not found | ||
87 | foreach(char letter in aniName) | 113 | foreach(char letter in aniName) |
88 | COMPONENT_ANIMATION.CrossFadeQueued(""+letter, 0.6F, QueueMode.CompleteOthers); | 114 | COMPONENT_ANIMATION.CrossFadeQueued(""+letter, 0.6F, QueueMode.CompleteOthers); |
89 | - | ||
90 | - }//foreach string aniName | ||
91 | - | ||
92 | - aniClip = Resources.Load<AnimationClip>("ANIMS/anims/_default"); | ||
93 | - COMPONENT_ANIMATION.AddClip(aniClip, "_default"); | ||
94 | - | ||
95 | - } | ||
96 | - | ||
97 | - | ||
98 | - | ||
99 | - /* | ||
100 | - void OnGUI(){ | ||
101 | - if( GUI.Button ( new Rect( 10, 10, 100, 50 ), "VAI PORRA" ) ){//BOTAO DE TESTE DestroyPorra(); //BOTAO DE TESTE | ||
102 | - | ||
103 | - } | ||
104 | - } | ||
105 | - */ | ||
106 | - | ||
107 | - | ||
108 | -} | ||
109 | \ No newline at end of file | 115 | \ No newline at end of file |
116 | + } | ||
117 | + } | ||
118 | + } // sendToPlayer | ||
119 | +} // InspectorIscript | ||
110 | \ No newline at end of file | 120 | \ No newline at end of file |
Assets/Scripts/Legenda.cs
@@ -18,15 +18,13 @@ public class Legenda : MonoBehaviour { | @@ -18,15 +18,13 @@ public class Legenda : MonoBehaviour { | ||
18 | 18 | ||
19 | Boolean flagSubtitle = false; | 19 | Boolean flagSubtitle = false; |
20 | string[] strArg; | 20 | string[] strArg; |
21 | - | ||
22 | void Start( ){ | 21 | void Start( ){ |
23 | - | ||
24 | strArg = Environment.GetCommandLineArgs(); | 22 | strArg = Environment.GetCommandLineArgs(); |
25 | 23 | ||
26 | ICARO = GameObject.FindGameObjectWithTag("avatar"); | 24 | ICARO = GameObject.FindGameObjectWithTag("avatar"); |
27 | COMPONENT_ANIMATION = ICARO.GetComponent<Animation>(); | 25 | COMPONENT_ANIMATION = ICARO.GetComponent<Animation>(); |
28 | 26 | ||
29 | - if(strArg[3].Equals("1")) { | 27 | + if(strArg[2].Equals("1")) { |
30 | flagSubtitle = true; | 28 | flagSubtitle = true; |
31 | LEGENDA = gameObject.GetComponent<Text>(); | 29 | LEGENDA = gameObject.GetComponent<Text>(); |
32 | } | 30 | } |
@@ -34,7 +32,7 @@ public class Legenda : MonoBehaviour { | @@ -34,7 +32,7 @@ public class Legenda : MonoBehaviour { | ||
34 | } | 32 | } |
35 | 33 | ||
36 | void Update( ){ | 34 | void Update( ){ |
37 | - | 35 | + // possible a < semaphore > to wait for animation to play |
38 | if(COMPONENT_ANIMATION.isPlaying && flagSubtitle) | 36 | if(COMPONENT_ANIMATION.isPlaying && flagSubtitle) |
39 | LEGENDA.text = GetCurrentPlayingAnimationClip( ); | 37 | LEGENDA.text = GetCurrentPlayingAnimationClip( ); |
40 | 38 | ||
@@ -44,7 +42,7 @@ public class Legenda : MonoBehaviour { | @@ -44,7 +42,7 @@ public class Legenda : MonoBehaviour { | ||
44 | 42 | ||
45 | foreach( AnimationState anim in COMPONENT_ANIMATION ) | 43 | foreach( AnimationState anim in COMPONENT_ANIMATION ) |
46 | if( COMPONENT_ANIMATION.IsPlaying( anim.name ) ) | 44 | if( COMPONENT_ANIMATION.IsPlaying( anim.name ) ) |
47 | - if( !(anim.name.Split(' ')[0].Equals("_default")) ) | 45 | + if( !(anim.name.Split(' ')[0].Equals("_DEFAULT")) ) |
48 | return anim.name.Split(' ')[0]; | 46 | return anim.name.Split(' ')[0]; |
49 | 47 | ||
50 | return null; | 48 | return null; |
@@ -0,0 +1,127 @@ | @@ -0,0 +1,127 @@ | ||
1 | +/********************** | ||
2 | +********LAVID********** | ||
3 | +*******VLibras********* | ||
4 | +*------------------------------------------------------------------------ | ||
5 | +*Description: | ||
6 | +*Server gets strings(glosa) from Core (client) by TCP connection and runs the animations | ||
7 | +*until a final tag is found. | ||
8 | +*------------------------------------------------------------------------ | ||
9 | +*Author: Claudiomar Araujo # claudiomar.araujo@lavid.ufpb.br | ||
10 | +*------------------------------------------------------------------------ | ||
11 | +***********************/ | ||
12 | + | ||
13 | +using UnityEngine; | ||
14 | +using System; | ||
15 | +using System.IO; | ||
16 | +using System.Net; | ||
17 | +using System.Net.Sockets; | ||
18 | +using System.Text; | ||
19 | +using System.Threading; | ||
20 | + | ||
21 | +public class Server : MonoBehaviour { | ||
22 | + TcpClient client; | ||
23 | + NetworkStream stream; | ||
24 | + TcpListener server; | ||
25 | + Semaphore serverSemaphore; | ||
26 | + InspectorScript inspector; | ||
27 | + Int32 port = 5555; | ||
28 | + | ||
29 | + public Server(Semaphore ss, InspectorScript inspec){ | ||
30 | + serverSemaphore = ss; | ||
31 | + inspector = inspec; | ||
32 | + } // constructor | ||
33 | + | ||
34 | + public void startServer(){ | ||
35 | + try{ | ||
36 | + IPAddress localAddr = IPAddress.Parse("127.0.0.1"); | ||
37 | + server = new TcpListener (localAddr, port); | ||
38 | + server.Start(); // Starts listening for incoming connection requests. | ||
39 | + client = server.AcceptTcpClient(); // Accepts a pending connection request. | ||
40 | + stream = client.GetStream(); | ||
41 | + | ||
42 | + serverSemaphore.Release (); // Releases InspectorScript.Start() [Connection] | ||
43 | + getPTSFromCore(); | ||
44 | + } | ||
45 | + catch(SocketException e){ | ||
46 | + Debug.Log(e); | ||
47 | + closeConnections(); | ||
48 | + Application.Quit(); | ||
49 | + } | ||
50 | + catch(IOException e){ | ||
51 | + Debug.Log(e); | ||
52 | + closeConnections(); | ||
53 | + Application.Quit(); | ||
54 | + } | ||
55 | + catch(Exception e){ | ||
56 | + Debug.Log(e); | ||
57 | + closeConnections(); | ||
58 | + Application.Quit(); | ||
59 | + } | ||
60 | + } // startServer | ||
61 | + | ||
62 | + // Receives glosa and pts from Core | ||
63 | + void getPTSFromCore(){ | ||
64 | + try{ | ||
65 | + Byte[] bytes = new Byte[1024]; | ||
66 | + String data=null; | ||
67 | + String[] dataSplited; | ||
68 | + int i; | ||
69 | + Byte[] sendToCore; | ||
70 | + long pts=0; | ||
71 | + String glosa=""; | ||
72 | + | ||
73 | + /*Loop to receive all the data from Core | ||
74 | + util get the string "FINALIZE\0" | ||
75 | + '\0' for c++*/ | ||
76 | + while((i = stream.Read(bytes, 0, bytes.Length))!=0){ | ||
77 | + | ||
78 | + data = System.Text.UTF8Encoding.UTF8.GetString(bytes, 0, i); | ||
79 | + sendToCore = System.Text.UTF8Encoding.UTF8.GetBytes("OK\0"); // allows Core to send next stream | ||
80 | + stream.Write(sendToCore, 0, sendToCore.Length); | ||
81 | + dataSplited = data.Split('#'); | ||
82 | + glosa = dataSplited[0]; | ||
83 | + if(glosa.Equals("FINALIZE")){ | ||
84 | + try{ | ||
85 | + Thread.Sleep(2500); | ||
86 | + } | ||
87 | + catch(ThreadInterruptedException e){ | ||
88 | + Console.WriteLine(e.Source); | ||
89 | + } | ||
90 | + inspector.setFinalizeFlag(true); | ||
91 | + break; | ||
92 | + } | ||
93 | + else{ | ||
94 | + pts = Convert.ToInt64(dataSplited[1]); | ||
95 | + } | ||
96 | + if(!glosa.Equals("FINALIZE")){ | ||
97 | + inspector.addSubtitleQueue(new SubtitleInfo(glosa, pts)); | ||
98 | + } | ||
99 | + } | ||
100 | + bytes = new Byte[1024]; | ||
101 | + glosa=""; | ||
102 | + } | ||
103 | + catch(Exception e){ | ||
104 | + throw new Exception(e.Source); | ||
105 | + } | ||
106 | + } // getPTSFromCore | ||
107 | + | ||
108 | + public void sendFinalizeToCore(){ | ||
109 | + Byte[] sendToCore = System.Text.UTF8Encoding.UTF8.GetBytes("FINALIZE\0"); // ativar para o core | ||
110 | + stream.Write(sendToCore, 0, sendToCore.Length); | ||
111 | + } | ||
112 | + public void closeConnections(){ | ||
113 | + try{ | ||
114 | + client.Close(); | ||
115 | + stream.Close(); | ||
116 | + server.Stop(); | ||
117 | + } | ||
118 | + catch(SocketException e){ | ||
119 | + Debug.Log(e); | ||
120 | + closeConnections(); | ||
121 | + } | ||
122 | + catch(IOException e){ | ||
123 | + Debug.Log(e); | ||
124 | + closeConnections(); | ||
125 | + } | ||
126 | + } // closeConnections | ||
127 | +} | ||
0 | \ No newline at end of file | 128 | \ No newline at end of file |
@@ -0,0 +1,12 @@ | @@ -0,0 +1,12 @@ | ||
1 | +fileFormatVersion: 2 | ||
2 | +guid: 1abee030b3e6a1e4dafe0f8046e0874b | ||
3 | +timeCreated: 1435354195 | ||
4 | +licenseType: Free | ||
5 | +MonoImporter: | ||
6 | + serializedVersion: 2 | ||
7 | + defaultReferences: [] | ||
8 | + executionOrder: 0 | ||
9 | + icon: {instanceID: 0} | ||
10 | + userData: | ||
11 | + assetBundleName: | ||
12 | + assetBundleVariant: |
@@ -0,0 +1,19 @@ | @@ -0,0 +1,19 @@ | ||
1 | +using UnityEngine; | ||
2 | +using System.Collections; | ||
3 | +using System; | ||
4 | + | ||
5 | +public class SubtitleInfo : MonoBehaviour { | ||
6 | + String glosa; | ||
7 | + long pts; | ||
8 | + | ||
9 | + public SubtitleInfo(String glosa, long pts){ | ||
10 | + this.glosa = glosa; | ||
11 | + this.pts = pts; | ||
12 | + } | ||
13 | + public String getGlosa(){ | ||
14 | + return glosa; | ||
15 | + } | ||
16 | + public long getPts(){ | ||
17 | + return pts; | ||
18 | + } | ||
19 | +} |
@@ -0,0 +1,12 @@ | @@ -0,0 +1,12 @@ | ||
1 | +fileFormatVersion: 2 | ||
2 | +guid: fbd6d009606677d4fb97900a030812bb | ||
3 | +timeCreated: 1436189460 | ||
4 | +licenseType: Free | ||
5 | +MonoImporter: | ||
6 | + serializedVersion: 2 | ||
7 | + defaultReferences: [] | ||
8 | + executionOrder: 0 | ||
9 | + icon: {instanceID: 0} | ||
10 | + userData: | ||
11 | + assetBundleName: | ||
12 | + assetBundleVariant: |
ProjectSettings/ProjectSettings.asset
@@ -3,17 +3,14 @@ | @@ -3,17 +3,14 @@ | ||
3 | --- !u!129 &1 | 3 | --- !u!129 &1 |
4 | PlayerSettings: | 4 | PlayerSettings: |
5 | m_ObjectHideFlags: 0 | 5 | m_ObjectHideFlags: 0 |
6 | - serializedVersion: 6 | 6 | + serializedVersion: 7 |
7 | AndroidProfiler: 0 | 7 | AndroidProfiler: 0 |
8 | defaultScreenOrientation: 4 | 8 | defaultScreenOrientation: 4 |
9 | targetDevice: 2 | 9 | targetDevice: 2 |
10 | - targetGlesGraphics: -1 | ||
11 | - targetIOSGraphics: -1 | ||
12 | targetResolution: 0 | 10 | targetResolution: 0 |
13 | accelerometerFrequency: 60 | 11 | accelerometerFrequency: 60 |
14 | companyName: LAViD | 12 | companyName: LAViD |
15 | productName: VLibrasPlayer | 13 | productName: VLibrasPlayer |
16 | - cloudProjectId: | ||
17 | defaultCursor: {fileID: 0} | 14 | defaultCursor: {fileID: 0} |
18 | cursorHotspot: {x: 0, y: 0} | 15 | cursorHotspot: {x: 0, y: 0} |
19 | m_ShowUnitySplashScreen: 0 | 16 | m_ShowUnitySplashScreen: 0 |
@@ -26,7 +23,6 @@ PlayerSettings: | @@ -26,7 +23,6 @@ PlayerSettings: | ||
26 | m_ActiveColorSpace: 0 | 23 | m_ActiveColorSpace: 0 |
27 | m_MTRendering: 1 | 24 | m_MTRendering: 1 |
28 | m_MobileMTRendering: 0 | 25 | m_MobileMTRendering: 0 |
29 | - m_UseDX11: 1 | ||
30 | m_Stereoscopic3D: 0 | 26 | m_Stereoscopic3D: 0 |
31 | iosShowActivityIndicatorOnLoading: -1 | 27 | iosShowActivityIndicatorOnLoading: -1 |
32 | androidShowActivityIndicatorOnLoading: -1 | 28 | androidShowActivityIndicatorOnLoading: -1 |
@@ -81,6 +77,7 @@ PlayerSettings: | @@ -81,6 +77,7 @@ PlayerSettings: | ||
81 | metroEnableIndependentInputSource: 0 | 77 | metroEnableIndependentInputSource: 0 |
82 | metroEnableLowLatencyPresentationAPI: 0 | 78 | metroEnableLowLatencyPresentationAPI: 0 |
83 | xboxOneDisableKinectGpuReservation: 0 | 79 | xboxOneDisableKinectGpuReservation: 0 |
80 | + virtualRealitySupported: 0 | ||
84 | productGUID: 337d486bd080bd046a98a1104f14a673 | 81 | productGUID: 337d486bd080bd046a98a1104f14a673 |
85 | AndroidBundleVersionCode: 1 | 82 | AndroidBundleVersionCode: 1 |
86 | AndroidMinSdkVersion: 9 | 83 | AndroidMinSdkVersion: 9 |
@@ -123,6 +120,7 @@ PlayerSettings: | @@ -123,6 +120,7 @@ PlayerSettings: | ||
123 | iOSLaunchScreenCustomXibPath: | 120 | iOSLaunchScreenCustomXibPath: |
124 | AndroidTargetDevice: 0 | 121 | AndroidTargetDevice: 0 |
125 | AndroidSplashScreenScale: 0 | 122 | AndroidSplashScreenScale: 0 |
123 | + androidSplashScreen: {fileID: 0} | ||
126 | AndroidKeystoreName: | 124 | AndroidKeystoreName: |
127 | AndroidKeyaliasName: | 125 | AndroidKeyaliasName: |
128 | AndroidTVCompatibility: 1 | 126 | AndroidTVCompatibility: 1 |
@@ -159,6 +157,7 @@ PlayerSettings: | @@ -159,6 +157,7 @@ PlayerSettings: | ||
159 | - m_BuildTarget: WebGL | 157 | - m_BuildTarget: WebGL |
160 | m_StaticBatching: 1 | 158 | m_StaticBatching: 1 |
161 | m_DynamicBatching: 1 | 159 | m_DynamicBatching: 1 |
160 | + m_BuildTargetGraphicsAPIs: [] | ||
162 | webPlayerTemplate: APPLICATION:Default | 161 | webPlayerTemplate: APPLICATION:Default |
163 | m_TemplateCustomTags: {} | 162 | m_TemplateCustomTags: {} |
164 | actionOnDotNetUnhandledException: 1 | 163 | actionOnDotNetUnhandledException: 1 |
@@ -220,6 +219,7 @@ PlayerSettings: | @@ -220,6 +219,7 @@ PlayerSettings: | ||
220 | ps4ApplicationParam2: 0 | 219 | ps4ApplicationParam2: 0 |
221 | ps4ApplicationParam3: 0 | 220 | ps4ApplicationParam3: 0 |
222 | ps4ApplicationParam4: 0 | 221 | ps4ApplicationParam4: 0 |
222 | + ps4GarlicHeapSize: 2048 | ||
223 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ | 223 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ |
224 | ps4pnSessions: 1 | 224 | ps4pnSessions: 1 |
225 | ps4pnPresence: 1 | 225 | ps4pnPresence: 1 |
@@ -231,6 +231,7 @@ PlayerSettings: | @@ -231,6 +231,7 @@ PlayerSettings: | ||
231 | psp2NPTrophyPackPath: | 231 | psp2NPTrophyPackPath: |
232 | psp2NPSupportGBMorGJP: 0 | 232 | psp2NPSupportGBMorGJP: 0 |
233 | psp2NPAgeRating: 12 | 233 | psp2NPAgeRating: 12 |
234 | + psp2NPTitleDatPath: | ||
234 | psp2NPCommsID: | 235 | psp2NPCommsID: |
235 | psp2NPCommunicationsID: | 236 | psp2NPCommunicationsID: |
236 | psp2NPCommsPassphrase: | 237 | psp2NPCommsPassphrase: |
@@ -245,6 +246,7 @@ PlayerSettings: | @@ -245,6 +246,7 @@ PlayerSettings: | ||
245 | psp2PatchOriginalPackage: | 246 | psp2PatchOriginalPackage: |
246 | psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui | 247 | psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui |
247 | psp2KeystoneFile: | 248 | psp2KeystoneFile: |
249 | + psp2MemoryExpansionMode: 0 | ||
248 | psp2DRMType: 0 | 250 | psp2DRMType: 0 |
249 | psp2StorageType: 0 | 251 | psp2StorageType: 0 |
250 | psp2MediaCapacity: 0 | 252 | psp2MediaCapacity: 0 |
@@ -360,8 +362,7 @@ PlayerSettings: | @@ -360,8 +362,7 @@ PlayerSettings: | ||
360 | blackberrySquareSplashScreen: {fileID: 0} | 362 | blackberrySquareSplashScreen: {fileID: 0} |
361 | tizenProductDescription: | 363 | tizenProductDescription: |
362 | tizenProductURL: | 364 | tizenProductURL: |
363 | - tizenCertificatePath: | ||
364 | - tizenCertificatePassword: | 365 | + tizenSigningProfileName: |
365 | tizenGPSPermissions: 0 | 366 | tizenGPSPermissions: 0 |
366 | tizenMicrophonePermissions: 0 | 367 | tizenMicrophonePermissions: 0 |
367 | stvDeviceAddress: | 368 | stvDeviceAddress: |
@@ -380,6 +381,7 @@ PlayerSettings: | @@ -380,6 +381,7 @@ PlayerSettings: | ||
380 | XboxOnePackagingOverridePath: | 381 | XboxOnePackagingOverridePath: |
381 | XboxOneAppManifestOverridePath: | 382 | XboxOneAppManifestOverridePath: |
382 | XboxOnePackageEncryption: 0 | 383 | XboxOnePackageEncryption: 0 |
384 | + XboxOnePackageUpdateGranularity: 2 | ||
383 | XboxOneDescription: | 385 | XboxOneDescription: |
384 | XboxOneIsContentPackage: 0 | 386 | XboxOneIsContentPackage: 0 |
385 | XboxOneEnableGPUVariability: 0 | 387 | XboxOneEnableGPUVariability: 0 |
@@ -405,13 +407,22 @@ PlayerSettings: | @@ -405,13 +407,22 @@ PlayerSettings: | ||
405 | iOS::Architecture: 2 | 407 | iOS::Architecture: 2 |
406 | iOS::ScriptingBackend: 0 | 408 | iOS::ScriptingBackend: 0 |
407 | boolPropertyNames: | 409 | boolPropertyNames: |
410 | + - WebGL::analyzeBuildSize | ||
408 | - WebGL::dataCaching | 411 | - WebGL::dataCaching |
412 | + - WebGL::useEmbeddedResources | ||
409 | - XboxOne::enus | 413 | - XboxOne::enus |
414 | + WebGL::analyzeBuildSize: 0 | ||
410 | WebGL::dataCaching: 0 | 415 | WebGL::dataCaching: 0 |
416 | + WebGL::useEmbeddedResources: 0 | ||
411 | XboxOne::enus: 1 | 417 | XboxOne::enus: 1 |
412 | stringPropertyNames: | 418 | stringPropertyNames: |
413 | - WebGL::emscriptenArgs | 419 | - WebGL::emscriptenArgs |
414 | - WebGL::template | 420 | - WebGL::template |
415 | WebGL::emscriptenArgs: | 421 | WebGL::emscriptenArgs: |
416 | WebGL::template: APPLICATION:Default | 422 | WebGL::template: APPLICATION:Default |
417 | - firstStreamedLevelWithResources: 0 | 423 | + firstStreamedSceneWithResources: 0 |
424 | + cloudProjectId: | ||
425 | + projectId: | ||
426 | + projectName: | ||
427 | + organizationId: | ||
428 | + cloudEnabled: 0 |
ProjectSettings/ProjectVersion.txt