void Awake() { if (!singleton) singleton = this; else Destroy(this.gameObject); }
// Use this for initialization void Start() { Cursor.lockState = CursorLockMode.None; Cursor.visible = true; if (Screen.fullScreen == true) { this.fullscreenToggle.isOn = true; } this.volumeSlider.minValue = 0f; this.volumeSlider.maxValue = 1f; if (PlayerPrefs.HasKey("Volume")) { this.RetrieveVolume(); } if (!nss) //nss = GameObject.Find("NetworkManager").GetComponent<NetworkStartScript>(); nss = NetworkStartScript.singleton; if (nss && btClient && btHost) { btHost.onClick.AddListener(delegate { nss.LaunchServer(); }); btClient.onClick.AddListener(delegate { nss.LaunchClient(); }); } inputFieldMatcName.onValueChanged.AddListener(ValueChangeCheck); if (PlayerPrefs.HasKey("VisitedLevels") == false) { PlayerPrefs.SetInt("VisitedLevels", 0); } }