void OnValidate()
 {
     if (networkDiscovery == null)
     {
         networkDiscovery = GetComponent <NetworkDiscovery>();
         UnityEditor.Events.UnityEventTools.AddPersistentListener(networkDiscovery.OnServerFound, OnDiscoveredServer);
         UnityEditor.Undo.RecordObjects(new Object[] { this, networkDiscovery }, "Set NetworkDiscovery");
     }
 }
Exemplo n.º 2
0
    void Awake()
    {
        This = this;

        TeamOneColor = new Color(1, 0, 0, 1);
        TeamTwoColor = new Color(0, 0, 1, 1);

        NM = this.GetComponent <Mirror.NetworkManager>();
        TT = this.GetComponent <Mirror.TelepathyTransport>();
        ND = this.GetComponent <Mirror.Discovery.NetworkDiscovery>();
    }