using System;
using ExitGames.Client.Photon;
public interface IGameListener
{
bool IsDebugLogEnabled { get; }
void LogDebug(Game game, string message);
void LogError(Game game, string message);
void LogError(Game game, Exception exception);
void LogInfo(Game game, string message);
void OnConnect(Game game);
void OnDisconnect(Game game, StatusCode returnCode);
}
We can then add this interface to our Login.cs as an interface and inherit these functions. These are how they look in Login.cs
#region Inherited Interfaces
#region IGameListener
public bool IsDebugLogEnabled
{
get { return true; }
}
public void LogDebug(Game game, string message)
{
Debug.Log(message);
}
public void LogError(Game game, string message)
{
Debug.Log(message);
}
public void LogError(Game game, Exception exception)
{
Debug.Log(exception.ToString());
}
public void LogInfo(Game game, string message)
{
Debug.Log(message);
}
public void OnConnect(Game game)
{
Debug.Log("connected");
}
public void OnDisconnect(Game game, StatusCode returnCode)
{
Debug.Log("disconnected");
}
#endregion
#endregion
This allows us to log any errors that occur during the course of our program running. Next time we will connect our game state and listener into our game. Stay Tuned
No comments:
Post a Comment