/// <summary> /// Created a base oject then calls the GetGithubJson coroutine using the VCInterop, /// calls the LatestPluginInfoEvent once the data has been retrieved /// </summary> /// <param name="plugin"></param> /// <param name="interop"></param> /// <param name="vCheck"></param> public LatestPluginInfo(IGithubInfoPlugin plugin, VcInterop interop, LatestPluginInfoEvent vCheck) { Plugin = plugin; IsLatestVersion = false; HasVersionBeenSet = false; _ue = vCheck; LatestVersion = string.Empty; ReleasePage = null; interop.StartCoroutine(Util.GetGithubJson(interop, Plugin, SetLatestVersion)); //starts a coroutine to retrieve the latest plugin version }
void Init() { if (_versionCheckerInterop == null) { _versionCheckerInterop = ModMenuUi.Instance.gameObject.AddComponent <VcInterop>(); } if (OnPluginInfoAdded == null) { OnPluginInfoAdded = new LatestPluginInfoEvent(); } if (_onInfoSet == null) { _onInfoSet = new LatestPluginInfoEvent(); //initializes the event _onInfoSet.AddListener(OnSet); //adds OnSet as the listener } }