Why on earth do i get two of the same function happening.
When i start the app and Host, then click the disconnect button, i get the OnStopHost override method happening 2 times. This only happens on the first time Hosting in the current session. Any times hosting beyond that it only fires once.
Debug.Log 1
Implement OnStopHost Operations Here
UnityEngine.Debug:Log(Object)
Debug.Log 2
Implement Stop Host operations here.
UnityEngine.Debug:Log(Object)
Debug.Log3
Implement OnStopHost Operations Here
UnityEngine.Debug:Log(Object)
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
public class A3DNetworkManager : NetworkManager {
NetworkClient nClient = new NetworkClient();
public Canvas[] gameMenuItems;
private void Awake()
{
inputField_ServerIP.onValueChanged.AddListener(InputField_ServerIPChanged);
//logLevel = LogFilter.FilterLevel.Developer;
autoCreatePlayer = false;
}
private void Start()
{
}
private void Update()
{
}
public override void OnStartHost()
{
Debug.Log("Implement OnStartHost Operations Here");
}
public void OnStartClient()
{
Debug.Log("Implement OnStartClient Operations Here");
}
public void OnStartServer()
{
Debug.Log("Implement OnStartServer Only Operations Here");
}
public override void OnStopHost()
{
Debug.Log("Implement OnStopHost Operations Here");
}
public void OnStopClient()
{
}
public void OnStopServer()
{
}
public void OnClientReadyMessage()
{
}
public void StartLANHost()
{
gameMenuItems[0].enabled = false;
gameMenuItems[1].enabled = true;
nClient = StartHost();
Debug.Log("Implement Start Host operations here.");
}
public void StopLANHost()
{
gameMenuItems[1].enabled = false;
gameMenuItems[0].enabled = true;
Shutdown();
Debug.Log("Implement Stop Host operations here.");
}
public void StartLANClient()
{
nClient = StartClient();
Debug.Log("Implement Start Client operations here.");
}
public void StopLANClient()
{
Shutdown();
}
public void StartServerOnly()
{
Debug.Log("Implement Start Server operations here.");
}
public void StopServerOnly()
{
}
public InputField inputField_ServerIP;
public void InputField_ServerIPChanged(string _serverIP)
{
networkAddress = _serverIP;
}
}
as you can see, i’m just trying to figure out the beginner stuff here, but WHY would that trigger two times? Its odd that if i just hit host again, then disconnect again, only one message from each method is output. But that first time… well, its like magic (to quote the king of pop , lol);