void OnInfoPanelDestroyed(object sender, SerializeableExhibit exhibit) { ApiRequest request = new ApiRequest(RequestType.recommend) { ExhibitId = exhibit.id }; this.Api.MakeRequest(request); }
private void OnInfoPanelDestroy(object sender, SerializeableExhibit exhibit) { GameObject infoPanelObj = sender as GameObject; InfoPanel ip = infoPanelObj.GetComponent <InfoPanel>(); InfoIcon icon; if (_panels.TryGetValue(ip.Exhibit.id, out infoPanelObj) && _icons.TryGetValue(ip.Exhibit.id, out icon)) { ip.InfoPanelDestroy -= OnInfoPanelDestroy; icon.SetEnabled(true); _icons.Remove(ip.Exhibit.id); _panels.Remove(ip.Exhibit.id); this.InfoPanelDestroyed?.Invoke(this, exhibit); } }
public void SetExhibit(SerializeableExhibit exhibit) { GameObject infoObj; InfoIcon icon; if (_panels.TryGetValue(DEFAULT_KEY, out infoObj) && _icons.TryGetValue(DEFAULT_KEY, out icon)) { infoObj.GetComponent <InfoPanel>().SetLoadingState(false); infoObj.GetComponent <InfoPanel>().Exhibit = exhibit; icon.SetEnabled(true); _panels.UpdateKey(DEFAULT_KEY, exhibit.id); _icons.UpdateKey(DEFAULT_KEY, exhibit.id); } else { Debug.LogWarning("No exhibit found for this gameObject"); } }