123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- 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<UIWidget>();
- 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<UIPlayAnimation>();
- 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<Sprite>(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_;
- }
|