using System; using PrivateMaidMode; using UnityEngine; using wf; public class PrivateEventListUnit : MonoBehaviour { public DataBase.BG.Event.PointData.Information infomation { get; private set; } public bool isViewMode { get { return this.isViewMode_; } set { this.isViewMode_ = value; this.isEnabled = this.isEnabled; } } public bool isEnabled { get { return this.button.enabled; } set { Color color = (!value) ? this.button.disabledColor : this.button.defaultColor; UIWidget component = this.button.tweenTarget.GetComponent(); if (component != null) { component.color = color; } if (this.iconSprite != null) { this.iconSprite.color = color; } if (this.alreadyReadSprite != null) { this.alreadyReadSprite.color = color; } bool enabled = value; if (this.isViewMode_) { enabled = false; } this.button.enabled = enabled; UIPlayAnimation component2 = this.button.tweenTarget.GetComponent(); if (component2 != null) { component2.enabled = enabled; } } } public bool isAlreadyReaded { get { return this.alreadyReadSprite.alpha == 0f; } set { this.alreadyReadSprite.alpha = (float)((!value) ? 1 : 0); } } public void SetInformation(DataBase.BG.Event.PointData.Information infomation, Transform conditonParent, UIWFConditionList conditonPanel) { this.infomation = infomation; this.conditonParent = conditonParent; this.conditonPanel = conditonPanel; this.titleLabel.text = infomation.title; Utility.SetLocalizeTerm(this.titleLabel, infomation.titleTerm, false); string path = string.Empty; DataBase.BG.Event.PointData.Information.IconType iconType = infomation.iconType; if (iconType != DataBase.BG.Event.PointData.Information.IconType.H) { if (iconType != DataBase.BG.Event.PointData.Information.IconType.NTR) { path = "ScenePrivate/Textures/privatemaid_icon_normal"; } else { path = "ScenePrivate/Textures/privatemaid_icon_ntr"; } } else { path = "ScenePrivate/Textures/privatemaid_icon_h"; } this.iconSprite.sprite2D = Resources.Load(path); } public void OnClickButton() { if (!this.isEnabled || this.onClickEvent == null) { return; } this.onClickEvent(); } public void OnHoverOver() { if (this.conditonParent == null || this.conditonPanel == null || this.infomation == null) { return; } this.conditonParent.gameObject.SetActive(true); this.conditonPanel.SetTexts(this.infomation.conditions.ToArray(), 500); if (!this.isEnabled) { GameMain.Instance.SoundMgr.PlaySystem(SoundMgr.SeType.Hover); } } public void OnHoverOut() { if (this.conditonParent == null || this.conditonPanel == null || this.infomation == null) { return; } this.conditonParent.gameObject.SetActive(false); } [SerializeField] private UI2DSprite iconSprite; [SerializeField] private UI2DSprite alreadyReadSprite; [SerializeField] private UILabel titleLabel; [SerializeField] private UIButton button; [SerializeField] private UIEventTrigger eventTrigger; public Action onClickEvent; private UIWFConditionList conditonPanel; private Transform conditonParent; private bool isViewMode_; }