void Start() { if (GameManager.Instance.type.Equals(ConnectionType.SERVER)) { s.Server(GameManager.Instance.IP); os.Server(GameManager.Instance.IP); AddPlayer(); shootButton.onDown.AddListener(StartShooting); shootButton.onUp.AddListener(StopShooting); playButton.onClick.AddListener(StartGame); panelsManager.ShowLobbyPanel(); seed = Random.Range(0, Int32.MaxValue); dungeonGeneration.SetServer(this); spawner.SetServer(this); spawner.seed = seed; dungeonGeneration.Generate(seed); spawner.rooms = dungeonGeneration.rooms; } else { Destroy(this.gameObject); Destroy(this); } }
void Start() { if (GameManager.Instance.type.Equals(ConnectionType.CLIENT)) { //Debug.LogError("Client connected with ip: " + GameManager.Instance.IP); c.Client(GameManager.Instance.IP); shootButton.onDown.AddListener(StartShooting); shootButton.onUp.AddListener(StopShooting); playButton.gameObject.SetActive(false); panelsManager.ShowLobbyPanel(); } else { Destroy(this.gameObject); Destroy(this); } }