static void CheckForLocalPlayer(NetworkIdentity identity) { if (identity == localPlayer) { // Set isLocalPlayer to true on this NetworkIdentity and trigger OnStartLocalPlayer in all scripts on the same GO identity.connectionToServer = readyConnection; identity.OnStartLocalPlayer(); if (LogFilter.Debug) { Debug.Log("ClientScene.OnOwnerMessage - player=" + identity.name); } } }
static void CheckForLocalPlayer(NetworkIdentity identity) { if (identity == localPlayer) { if (readyConnection.identity != null && readyConnection.identity != identity) { readyConnection.identity.SetNotLocalPlayer(); } // supposed to be local player, so make it the local player! // Set isLocalPlayer to true on this NetworkIdentity and trigger OnStartLocalPlayer in all scripts on the same GO identity.connectionToServer = readyConnection; identity.OnStartLocalPlayer(); if (LogFilter.Debug) { Debug.Log("ClientScene.OnOwnerMessage - player=" + identity.name); } } }