예제 #1
0
    // unity interface. store instance as singleton reference.

    private void Awake()
    {
        if (Mqtt_Client.s_instance == null)
        {
            Mqtt_Client.s_instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(this.gameObject);
        }
    }
예제 #2
0
    private void Awake()
    {
        mqttBehaviour              = new MQTTBehaviour();
        mqttBehaviour.m_brokerURL  = m_brokerURL;
        mqttBehaviour.m_brokerPort = m_brokerPort;

        if (Mqtt_Client.s_instance == null)
        {
            Mqtt_Client.s_instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(this.gameObject);
        }
    }
예제 #3
0
    private void Awake()
    {
        mqttBehaviour = new MQTTBehaviour();
        // mqttBehaviour.m_brokerURL = m_brokerURL;
        // mqttBehaviour.m_brokerURL = (input_brokerURL.text == "") ? input_brokerURL.placeholder.GetComponent<Text>().text : input_brokerURL.text;
        mqttBehaviour.m_brokerPort = m_brokerPort;


        if (Mqtt_Client.s_instance == null)
        {
            Mqtt_Client.s_instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(this.gameObject);
        }
    }