void Start() { string url = "https://mykin-server.com"; string serverAddress = "GAFWSBEOGCCYVEC5YZUILDEDGHO27PODVTQJ45DSFBODKRXQ42MVLIZZ"; kinWrapper = GameObject.Find("KinWrapper").GetComponent <KinWrapper>(); kinWrapper.Initialize(ListenKin, url, serverAddress); }
void MaintainOneInstance() { if (kinWrapper == null) { kinWrapper = this; DontDestroyOnLoad(this);//prevent object destruction across scenes so we don't have to re-initialize and make the user wait } else { Destroy(gameObject); //only allow one instance of this object } }