Example #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        Debug.Log(other.gameObject);

        CurrentArea currentObject = other.gameObject.GetComponent <CurrentArea>();

        //Debug.Log(currentObject);

        if (currentObject != null)
        {
            Debug.Log("Entered on " + box.name);

            currentObject.setArea(this);

            // Agora.io Implimentation
            IRtcEngine mRtcEngine  = IRtcEngine.GetEngine(AgoraInterfaceScript.appId);
            var        channelName = box.name;
            mRtcEngine.LeaveChannel();
            mRtcEngine.JoinChannel(channelName, "extra", 0); // join the channel with given match name
            Debug.Log("joining channel:" + channelName);
        }
    }