void Awake() { if (Instance == null) { Instance = this; } }
// Start is called before the first frame update void Start() { customDiscoveryScript = GameObject.FindGameObjectWithTag("NetworkManager").GetComponent <CustomNetworkDiscovery>(); thisButton = GetComponent <Button>(); thisButton.onClick.AddListener(customDiscoveryScript.FindServers); }
private void Start() { //Refrence to the network discovery was not set networkDiscovery = GetComponent <CustomNetworkDiscovery>(); int[] options = new int[] { 60, 30 }; NetworkManager.singleton.serverTickRate = options[PlayerPrefs.GetInt("TickRate")]; }
public void Start() { // Network Discovery m_discovery = GetComponent <CustomNetworkDiscovery>(); m_discovery.CustomInitialize(); s_singleton = this; }
private void Awake() { // Assign Globals uiFrame = _uiFrame; discovery = _discovery; guideSync = _guideSync; POIpositionScalingFactor = _POIpositionScalingFactor; cache = new Cache(); Signals.Get <ShowContentSignal>().AddListener(OnShowContent); }
private void Start() { if (Instance != null) { Debug.LogError("Multiple NetworkWrapper objects exist."); Destroy(gameObject); return; } Instance = this; discovery = GetComponent <CustomNetworkDiscovery>(); manager = GetComponent <CustomNetworkManager>(); }
private void Awake() { base.Initialize(); if (singleton != null && singleton != this) { Destroy(singleton.gameObject); } singleton = this; //StartCoroutine(CleanupExpiredEntries()); StopBroadcast(); base.StartAsClient(); }
private void Start() { characterIndex = 0; DontDestroyOnLoad(gameObject); if (isServer) { CmdSpawnGameManager(); InvokeRepeating("FindGameManager", 0.1f, 1f); } networkManager = GameObject.Find("NetworkManager").GetComponent <CustomNetworkManager>(); networkDiscovery = GameObject.Find("NetworkManager").GetComponent <CustomNetworkDiscovery>(); }
void Start() { netDiscovery = GetComponent <CustomNetworkDiscovery>(); netDiscovery.Initialize(); if (!runAsServer) { SetupClient(); } else { SetupServer(); } }
//#if UNITY_ANDROID // public void Awake() // { // Debug.Log("On android!"); // hostRoomButton.gameObject.SetActive(false); // } //#elif UNITY_EDITOR // //public void Awake() // //{ // // Debug.Log("In editor!"); // // hostRoomButton.gameObject.SetActive(true); // //} //#elif UNITY_STANDALONE_WIN // public void Awake() // { // Debug.Log("Standalone windows!"); // //hostRoomButton.gameObject.SetActive(false); // } //#endif #endregion //Disable host button for android users (clients) // Start is called before the first frame update void Start() { Debug.Log("MenuButtons: Script initialised."); //custom network discovery script customNetworkDiscovery = GameObject.FindGameObjectWithTag("NetworkManager").GetComponent <CustomNetworkDiscovery>(); //Add event listeners for all the buttons hostRoomButton.onClick.AddListener(customNetworkDiscovery.StartHost); findRoomButton.onClick.AddListener(customNetworkDiscovery.FindServers); tryAgainButton.onClick.AddListener(customNetworkDiscovery.FindServers); joinRoomButton.onClick.AddListener(customNetworkDiscovery.ConnectToServer); }
// Start is called before the first frame update void Start() { Debug.Log("ConnectToServerButton: Script initialised"); //custom network discovery script customDiscoveryScript = GameObject.FindGameObjectWithTag("NetworkManager").GetComponent <CustomNetworkDiscovery>(); //button thisButton = gameObject.GetComponent <Button>(); //connect to server function added as an event listener //Only happens when the button is clickable thisButton.onClick.AddListener(customDiscoveryScript.ConnectToServer); }
private IEnumerator waitForSingleton() { while (true) { if (NetworkManager.singleton != null) { networkManager = NetworkManager.singleton; kcpTransport = networkManager.GetComponent <KcpTransport>(); customNetworkDiscovery = networkManager.GetComponent <CustomNetworkDiscovery>(); yield break; } yield return(null); } }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); return; } DontDestroyOnLoad(this); Reset(); }
protected void Construct(CustomNetworkDiscovery networkDiscovery) { NetworkDiscovery = networkDiscovery; }
private void Start() { networkDiscovery = GetComponent <CustomNetworkDiscovery>(); }
private void Start() { networkManager = CustomNetworkManager.Instance; networkDiscovery = CustomNetworkDiscovery.Instance; }