You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
using System.Collections ;
using System.Collections.Generic ;
using UnityEngine ;
using EduCoderTool ;
using System ;
namespace DisComputer
{
/*
*@func iframe 通讯
*@author lz
*@date 2020/06/09
*
*/
public class IframeSokecter : MonoBehaviour
{
private string recieveStr ;
// Start is called before the first frame update
void Start ( )
{
WebConnecter . Singleton . startHandle + = OnRecStart ;
WebConnecter . Singleton . pauseHandle + = OnRecPause ;
WebConnecter . Singleton . unPauseHandle + = OnRecUnPause ;
WebConnecter . Singleton . finishHandle + = OnRecFinish ;
}
void OnRecStart ( )
{
MainControl . Instance . SetGameState ( MainState . Active ) ;
}
void OnRecPause ( )
{
}
void OnRecUnPause ( )
{
}
void OnRecFinish ( )
{
MainControl . Instance . SetGameState ( MainState . Idle ) ;
}
void OnRecData ( string data )
{
try {
Debug . LogFormat ( "recieve wed data string {0}" , data ) ;
recieveStr = data ;
}
catch ( Exception e )
{
Debug . Log ( "data is not correct: " + e ) ;
}
}
}
}