예제 #1
0
    private void Awake()
    {
        Team = Team.None;
        if (Instance != null)
        {
            Debug.Log(Util.C($"Multiple NetworkControllers!!!", Color.red));
            throw new Exception();
        }

        Instance = this;

        discovery.Register(this);
        discovery.Initialize();
        Debug.Log("Discovery as client in awake");
        discovery.StartAsClient();
        manager.Register(this);
        inputListeners = new HashSet <InputListener>();
        broadcastTable = new Dictionary <string, Team>();
        InitHostHandlers();
        InitAndRegisterSpawnable();
        DontDestroyOnLoad(this);
        gameState = GameState.Lobby;
    }