/// <summary>
	/// 初期化
	/// </summary>
	/// <param name="data">バックログのデータ</param>
	/// <param name="target">サウンドボタン押されたときのメッセージ送信先</param>
	/// <param name="index">バックログのインデックス</param>
	public void Init(AdvBacklog data, GameObject target, int index)
	{
		text.text = data.Text;
		characterName.text = data.CharacterName;
		soundIcon.Target = target;
		soundIcon.Index = index;
		if (!data.IsVoice)
		{
			soundIcon.gameObject.SetActive(false);
		}
	}
		public bool TryPlayVoice(AdvEngine engine, AdvBacklog backlog)
		{
			if (backlog.IsVoice)
			{
				StartCoroutine(CoPlayVoice(engine, backlog.VoiceFile, backlog.CharacterLabel ));
				return true;
			}
			else
			{
				return false;
			}
		}
Example #3
0
 /// <summary>
 /// 初期化
 /// </summary>
 /// <param name="data">バックログのデータ</param>
 /// <param name="target">サウンドボタン押されたときのメッセージ送信先</param>
 /// <param name="index">バックログのインデックス</param>
 public void Init(Utage.AdvBacklog data, Action <AdvUguiBacklog> ButtonClickedEvent, int index)
 {
     this.data          = data;
     text.text          = data.Text;
     characterName.text = data.CharacterName;
     Button.onClick.AddListener(() => ButtonClickedEvent(this));
     if (!data.IsVoice)
     {
         soundIcon.SetActive(false);
         Button.interactable = false;
     }
 }
	/// <summary>
	/// 初期化
	/// </summary>
	/// <param name="data">バックログのデータ</param>
	/// <param name="target">サウンドボタン押されたときのメッセージ送信先</param>
	/// <param name="index">バックログのインデックス</param>
	public void Init(Utage.AdvBacklog data, Action<AdvUguiBacklog> ButtonClickedEvent, int index)
	{
		this.data = data;
		text.text = data.Text;
		characterName.text = data.CharacterName;
		Button.onClick.AddListener(() => ButtonClickedEvent(this));
		if (!data.IsVoice)
		{
			soundIcon.SetActive(false);
			Button.interactable = false;
		}
	}
		/// <summary>
		/// バックログ追加
		/// </summary>
		/// <param name="text">テキスト</param>
		/// <param name="characteName">キャラ名</param>
		/// <param name="voiceFile">ボイスファイル(nullでも良い)</param>

		public void Add(string text, AdvCharacterInfo characteInfo, AssetFile voiceFile)
		{
			AdvBacklog log;
			if (characteInfo == null)
			{
				log = new AdvBacklog(text, "", voiceFile, "");
			}
			else
			{
				log = new AdvBacklog(text, characteInfo.NameText, voiceFile, characteInfo.Label);
			}
			backlogs.Add(log);
			if (backlogs.Count > MaxLog)
			{
				backlogs.RemoveAt(0);
			}
		}
Example #6
0
        /// <summary>
        /// 初期化
        /// </summary>
        /// <param name="data">バックログのデータ</param>
        public void Init(Utage.AdvBacklog data)
        {
            this.data = data;

            if (isMultiTextInPage)
            {
                float defaltHeight = this.text.rectTransform.rect.height;
                this.text.text = data.Text;
                float height = this.text.preferredHeight;
                (this.text.transform as RectTransform).SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, height);

                float baseH = (this.transform as RectTransform).rect.height;
                float scale = this.text.transform.lossyScale.y / this.transform.lossyScale.y;
                baseH += (height - defaltHeight) * scale;
                (this.transform as RectTransform).SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, baseH);
            }
            else
            {
                this.text.text = data.Text;
            }

            characterName.text = data.MainCharacterNameText;

            int countVoice = data.CountVoice;

            if (countVoice <= 0)
            {
                soundIcon.SetActive(false);
                Button.interactable = false;
            }
            else
            {
                if (countVoice >= 2 || isMultiTextInPage)
                {
                    UguiNovelTextEventTrigger trigger = text.gameObject.GetComponentCreateIfMissing <UguiNovelTextEventTrigger>();
                    trigger.OnClick.AddListener((x) => OnClickHitArea(x, OnClicked));
                }
                else
                {
                    Button.onClick.AddListener(() => OnClicked(data.MainVoiceFileName));
                }
            }
        }
Example #7
0
        //読み込み
        public void OnRead(System.IO.BinaryReader reader)
        {
            //バージョンチェック
            int version = reader.ReadInt32();

            if (version == Version)
            {
                int count = reader.ReadInt32();
                for (int i = 0; i < count; ++i)
                {
                    AdvBacklog item = new AdvBacklog();
                    item.Read(reader);
                    if (!item.IsEmpty)
                    {
                        AddLog(item);
                    }
                }
            }
            else
            {
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
            }
        }
        public void OnRead(BinaryReader reader)
        {
            int num = reader.ReadInt32();

            if (num == 0)
            {
                int num2 = reader.ReadInt32();
                for (int i = 0; i < num2; i++)
                {
                    AdvBacklog log = new AdvBacklog();
                    log.Read(reader);
                    if (!log.IsEmpty)
                    {
                        this.AddLog(log);
                    }
                }
            }
            else
            {
                object[] args = new object[] { num };
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, args));
            }
        }
Example #9
0
        private void CallbackCreateItem(GameObject go, int index)
        {
            AdvBacklog data = this.BacklogManager.Backlogs[(this.BacklogManager.Backlogs.Count - index) - 1];

            go.GetComponent <AdvUguiBacklog>().Init(data);
        }