public void SetThumbnailState(bool isDownloaded, bool resetFavoriteButton = false, bool isFavorite = false, Action <bool> onFavoriteToggle = null) { _isDownloaded = isDownloaded; if (LoaderGroup) { LoaderGroup.DOFade(1, 0.5f).SetDelay(0.3f); LoaderImage.fillAmount = 0; LoaderImage.Deactivate(); if (LocalDataManager.Instance.SaveData.AllowContentDownload) { if (isDownloaded) { PlayIcon.Activate(); DownloadIcon.Deactivate(); if (OnDownloadCompleted != null) { OnDownloadCompleted.Invoke(); } if (IfDownloading != null) { IfDownloading.Invoke(false); } } else { PlayIcon.Deactivate(); DownloadIcon.Activate(); } } else { LoaderImage.Deactivate(); PlayIcon.Activate(); } if (FavToggle && resetFavoriteButton) { FavToggle.onValueChanged.RemoveAllListeners(); FavToggle.isOn = isFavorite; FavToggle.onValueChanged.AddListener((x) => { onFavoriteToggle.SafeInvoke(x); CategorySystemInfo.AudioController.TriggerAudio("OnArrow"); }); FavToggle.Activate(); } _alreadyClicked = false; } }
public void Raise() { EventParams eventParams = ParamEvent.Parameters; // string if (responseUsingString.GetPersistentEventCount() >= 1) { responseUsingString.Invoke(eventParams.StringParam); } // int if (responseUsingInt.GetPersistentEventCount() >= 1) { responseUsingInt.Invoke(eventParams.IntParam); } // float if (responseUsingFloat.GetPersistentEventCount() >= 1) { responseUsingFloat.Invoke(eventParams.FloatParam); } // bool if (responseUsingBool.GetPersistentEventCount() >= 1) { responseUsingBool.Invoke(eventParams.BoolParam); } // obj if (responseUsingObject.GetPersistentEventCount() >= 1) { responseUsingObject.Invoke(eventParams.ObjectParam); } }
public override void OnEventRaise(SimpleEvent inSimpleEvent) { if (BoolResponse.GetPersistentEventCount() > 0) { BoolResponse.Invoke(BoolEvent.Value); } }