using System; using I2.Loc; using UnityEngine; using wf; namespace scoutmode { public class ScoutProgressInformation : MonoBehaviour { public ScoutProgressInformation.Stage SelectStage { get; private set; } public void SetStage(ScoutProgressInformation.Stage stage) { this.SelectStage = stage; YotogiStage.Data data = null; if (this.SelectStage == ScoutProgressInformation.Stage.ShoppingMall) { data = YotogiStage.GetData("ショッピングモール"); } else if (this.SelectStage == ScoutProgressInformation.Stage.Club) { data = YotogiStage.GetData("劇場"); } if (this.stageSprite.sprite2D != null) { UnityEngine.Object.Destroy(this.stageSprite.sprite2D.texture); } if (data != null) { this.stageNameLabel.text = data.drawName; Utility.SetLocalizeTerm(this.stageNameLabel, data.termName, false); string f_strFileName = data.thumbnailName[(!GameMain.Instance.CharacterMgr.status.isDaytime) ? 1 : 0]; Texture2D texture2D = ImportCM.CreateTexture(f_strFileName); this.stageSprite.sprite2D = Sprite.Create(texture2D, new Rect(0f, 0f, (float)texture2D.width, (float)texture2D.height), default(Vector2)); this.stageSprite.SetDimensions(this.stageSprite.sprite2D.texture.width, this.stageSprite.sprite2D.texture.height); } } public void SetCharacterRandom() { this.charaNameLabel1.text = "??????"; this.charaNameLabel2.text = "??????"; this.charaThumbnailSprite.sprite2D = null; this.charaPanel.SetActive(true); } public void SetCharacter(ScoutMaidData scoutMaid, bool isScouting) { this.charaPanel.SetActive(scoutMaid != null); if (!this.charaPanel.activeSelf) { return; } if (isScouting) { Utility.SetLocalizeTerm(this.charaThumbnailLocalize, "SceneScout/スカウト中キャラクター", true); } else { Utility.SetLocalizeTerm(this.charaThumbnailLocalize, "SceneScout/スカウト予定キャラクター", true); } this.charaNameLabel1.text = scoutMaid.status.name1; this.charaNameLabel2.text = scoutMaid.status.name2; if (this.charaThumbnailSprite.sprite2D != null) { UnityEngine.Object.Destroy(this.charaThumbnailSprite.sprite2D.texture); } byte[] iconImageBinary = scoutMaid.GetIconImageBinary(); if (iconImageBinary != null) { Texture2D texture2D = new Texture2D(1, 1, TextureFormat.ARGB32, false); texture2D.LoadImage(iconImageBinary); this.charaThumbnailSprite.sprite2D = Sprite.Create(texture2D, new Rect(0f, 0f, (float)texture2D.width, (float)texture2D.height), default(Vector2)); this.charaThumbnailSprite.SetDimensions(this.charaThumbnailSprite.sprite2D.texture.width, this.charaThumbnailSprite.sprite2D.texture.height); } } public void ChangeBg(ScoutProgressInformation.Stage stage) { if (this.SelectStage == ScoutProgressInformation.Stage.ShoppingMall) { GameMain.Instance.BgMgr.ChangeBg("ShoppingMall"); } else if (this.SelectStage == ScoutProgressInformation.Stage.Club) { GameMain.Instance.BgMgr.ChangeBg("Theater"); } } [SerializeField] private UI2DSprite stageSprite; [SerializeField] private UILabel stageNameLabel; [SerializeField] private GameObject charaPanel; [SerializeField] private Localize charaThumbnailLocalize; [SerializeField] private UI2DSprite charaThumbnailSprite; [SerializeField] private UILabel charaNameLabel1; [SerializeField] private UILabel charaNameLabel2; public enum Stage { ShoppingMall, Club } } }