protected virtual void Awake()
    {
        LobbyUi = LobbyUi ?? FindObjectOfType <LobbyUi>();

        if (LobbyUi == null)
        {
            Debug.Log("Lobby window was not set. ");
        }
    }
    public override void OnStartAuthority()
    {
        base.OnStartAuthority();
        lobbyUi = FindObjectOfType <LobbyUi>();
        lobbyUi.Initialize(this);

        CmdChangeName("Name " + Random.Range(0, 12345));

        Debug.Log($"{Name} {(IsHost ? "is host" : "isn't host")}");
    }
    /// <summary>
    /// Uses property data to setup the controller view
    /// </summary>
    /// <param name="propertyData"></param>
    public virtual void Setup(LobbyPropertyData propertyData)
    {
        Lobby = Lobby ?? GetComponentInParent <LobbyUi>();

        RawData    = propertyData;
        Label.text = propertyData.Label;

        Dropdown.ClearOptions();

        Dropdown.AddOptions(propertyData.Options);
    }
Exemple #4
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Debug.Log("Instance already exists, destroying object!");
            Destroy(this);
        }

        this.startGameBtn.onClick.AddListener(GameManager.instance.RequestStartGame);
    }
    void Awake()
    {
        Lobby = Lobby ?? GetComponentInParent <LobbyUi>();

        _currentMessages = new Queue <Text>();

        // Listen to "submit on enter" events
        InputField.onEndEdit.AddListener(val =>
        {
            if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
            {
                OnSendClick();
            }
        });
    }
 protected virtual void Awake()
 {
     Properties = new GenericUIList <LobbyPropertyData>(PropPrefab.gameObject, PropertiesGroup);
     Lobby      = Lobby ?? GetComponentInParent <LobbyUi>();
 }
Exemple #7
0
 void Awake()
 {
     Lobby = Lobby ?? GetComponentInParent <LobbyUi>();
 }