add
This commit is contained in:
55
Assets/3rd/Contacts/MssageReceiver.cs
Executable file
55
Assets/3rd/Contacts/MssageReceiver.cs
Executable file
@@ -0,0 +1,55 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
//helper class
|
||||
//it listen for messages comming from plugin
|
||||
public class MssageReceiver : MonoBehaviour {
|
||||
|
||||
void OnInitializeDone( string message )
|
||||
{
|
||||
Contacts.OnInitializeDone ();
|
||||
}
|
||||
|
||||
void OnInitializeFail( string message )
|
||||
{
|
||||
Debug.LogError( "OnInitializeFail : " + message );
|
||||
Contacts.OnInitializeFail (message);
|
||||
}
|
||||
|
||||
void Log( string message )
|
||||
{
|
||||
Debug.Log( "internal log : " + message );
|
||||
}
|
||||
|
||||
void Error( string error )
|
||||
{
|
||||
Debug.LogError( "internal error : " + error );
|
||||
}
|
||||
|
||||
void OnContactReady( string id )
|
||||
{
|
||||
|
||||
debug( "OnContactReady: " + id);
|
||||
|
||||
if( string.IsNullOrEmpty( id ))
|
||||
return;
|
||||
|
||||
int index = int.Parse( id);
|
||||
Contacts.GetContact( index );
|
||||
}
|
||||
|
||||
/*void OnContactReady( string data )
|
||||
{
|
||||
return;
|
||||
//debug( data );
|
||||
byte[] bytes = System.Text.Encoding.UTF8.GetBytes( data );
|
||||
Contact c = new Contact();
|
||||
c.FromBytes( bytes );
|
||||
Contacts.ContactsList.Add( c );
|
||||
}*/
|
||||
|
||||
void debug( string message )
|
||||
{
|
||||
//Debug.Log( message );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user