整合包
gameplay bundle has been imported together
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* FancyScrollView (https://github.com/setchi/FancyScrollView)
|
||||
* Copyright (c) 2020 setchi
|
||||
* Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
class UI_Panel_Character : MonoBehaviour
|
||||
{
|
||||
[SerializeField] float anim_Time = 0.5f;
|
||||
float Anim_Speed => 1f / anim_Time;
|
||||
[SerializeField] List<Animator> ui_Anim;
|
||||
[SerializeField] Transform content_Character_Slot;
|
||||
[SerializeField] Button button_Character_Slot_Prefab;
|
||||
[SerializeField] Text text_Character_Name;
|
||||
[SerializeField] Image Image_Character_Illustration;
|
||||
[SerializeField] Image Image_Character_Illustration_BG;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
if (Image_Character_Illustration.transform.parent.TryGetComponent(out CanvasGroup canvasGroup))
|
||||
{
|
||||
canvasGroup.alpha = 0;
|
||||
}
|
||||
else if(canvasGroup == null)
|
||||
{
|
||||
//Debug.LogError("Error for getting canvas group!");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var item in ui_Anim)
|
||||
{
|
||||
item.speed = Anim_Speed;
|
||||
}
|
||||
content_Character_Slot.Get_Childrens_Component<UI_Button_Character_Head_Slot>(true, true);
|
||||
for (int i = 0; i < UI_Panel_Main.Singleton.Data_List.Count; i++)
|
||||
{
|
||||
var obj = Instantiate(button_Character_Slot_Prefab, content_Character_Slot);
|
||||
var data = UI_Panel_Main.Singleton.Data_List[i];
|
||||
obj.image.sprite = data.Image_Head;
|
||||
if (obj.TryGetComponent(out UI_Button_Character_Head_Slot head_Slot))
|
||||
{
|
||||
head_Slot.index = data.index;
|
||||
obj.onClick.AddListener(() => Set_Character_Index(head_Slot.index));
|
||||
}
|
||||
}
|
||||
}
|
||||
public void Set_Character_Index(int index)
|
||||
{
|
||||
if (UI_Panel_Main.Singleton.Character_Index == index) return;
|
||||
UI_Panel_Main.Singleton.Character_Index = index;
|
||||
Set_Character();
|
||||
}
|
||||
private void OnEnable()
|
||||
{
|
||||
Set_Character();
|
||||
}
|
||||
Coroutine c_Character_Illustration_Anim;
|
||||
public void Set_Character()
|
||||
{
|
||||
if (c_Character_Illustration_Anim != null)
|
||||
{
|
||||
StopCoroutine(c_Character_Illustration_Anim);
|
||||
}
|
||||
if (Image_Character_Illustration.transform.parent.TryGetComponent(out CanvasGroup canvasGroup))
|
||||
{
|
||||
c_Character_Illustration_Anim = StartCoroutine(C_Character_Illustration_Anim(canvasGroup, Set_Character_Show));
|
||||
}
|
||||
}
|
||||
public void Set_Character_Show()
|
||||
{
|
||||
var data = UI_Panel_Main.Singleton.Get_Character_Image_Data();
|
||||
var pos1 = Image_Character_Illustration.rectTransform.anchoredPosition;
|
||||
Image_Character_Illustration.sprite = data.Image_Full;
|
||||
DOTween.To(value =>
|
||||
{ Image_Character_Illustration.rectTransform.anchoredPosition = new Vector2(value, pos1.y); },
|
||||
startValue: Image_Character_Illustration.rectTransform.anchoredPosition.x - 200,
|
||||
pos1.x, anim_Time);
|
||||
Image_Character_Illustration.SetNativeSize();
|
||||
var pos = Image_Character_Illustration_BG.rectTransform.anchoredPosition;
|
||||
Image_Character_Illustration_BG.sprite = data.Image_Full;
|
||||
DOTween.To(value =>
|
||||
{ Image_Character_Illustration_BG.rectTransform.anchoredPosition = new Vector2(value, pos.y); },
|
||||
startValue: Image_Character_Illustration_BG.rectTransform.anchoredPosition.x - 200,
|
||||
pos.x, anim_Time);
|
||||
Image_Character_Illustration_BG.SetNativeSize();
|
||||
Image_Character_Illustration_BG.transform.localScale = new(2.7f, 2.7f, 2.7f);
|
||||
|
||||
|
||||
string text = text_Character_Name.text;
|
||||
var t = DOTween.To(() => string.Empty, value => text_Character_Name.text = value, text, anim_Time).SetEase(Ease.Linear);
|
||||
t.SetOptions(true);
|
||||
}
|
||||
IEnumerator C_Character_Illustration_Anim(CanvasGroup canvasGroup, Action onHide)
|
||||
{
|
||||
while (canvasGroup.alpha > 0)
|
||||
{
|
||||
canvasGroup.alpha -= Anim_Speed * Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
onHide?.Invoke();
|
||||
while (canvasGroup.alpha < 1)
|
||||
{
|
||||
canvasGroup.alpha += Anim_Speed * Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 110f0ff82704aa0429d5eba59d3a6ee2
|
||||
timeCreated: 1487186233
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* FancyScrollView (https://github.com/setchi/FancyScrollView)
|
||||
* Copyright (c) 2020 setchi
|
||||
* Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using FancyScrollView.Example01;
|
||||
using TMPro;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
class UI_Panel_Level : MonoBehaviour
|
||||
{
|
||||
[SerializeField] float anim_Time = 0.5f;
|
||||
float Anim_Speed => 1f / anim_Time;
|
||||
[SerializeField] List<Animator> ui_Anim;
|
||||
[SerializeField] ScrollView scrollView = default;
|
||||
[SerializeField] TMP_Text Text_Level;
|
||||
private void OnEnable()
|
||||
{
|
||||
Text_Level.text = "1";
|
||||
string text = Text_Level.text;
|
||||
//var s = DOTween.Sequence();
|
||||
// s.Append(DOTween.To(value => { Text_Level.text = Mathf.Floor(value).ToString(); }, startValue: UnityEngine.Random.Range(0, 99), UnityEngine.Random.Range(0, 99), duration: anim_Time / 4)
|
||||
// );
|
||||
// s.Append(DOTween.To(value => { Text_Level.text = Mathf.Floor(value).ToString(); }, startValue: UnityEngine.Random.Range(0, 99), UnityEngine.Random.Range(0, 99), duration: anim_Time / 4)
|
||||
// );
|
||||
// s.Append(DOTween.To(value => { Text_Level.text = Mathf.Floor(value).ToString(); }, startValue: UnityEngine.Random.Range(0, 99), UnityEngine.Random.Range(0, 99), duration: anim_Time / 4)
|
||||
// );
|
||||
// s.Append(DOTween.To(() => string.Empty, value => Text_Level.text = value, text, anim_Time / 4)
|
||||
//);
|
||||
|
||||
//t.SetOptions(true);
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
foreach (var item in ui_Anim)
|
||||
{
|
||||
item.speed = Anim_Speed;
|
||||
}
|
||||
var items = Enumerable.Range(1, 100)
|
||||
.Select(i => new ItemData($"{i}"))
|
||||
.ToArray();
|
||||
|
||||
scrollView.UpdateData(items);
|
||||
scrollView.Scroller.OnSelectionChanged(Set_Level);
|
||||
}
|
||||
|
||||
private void Set_Level(int obj)
|
||||
{
|
||||
//obj++;
|
||||
//Text_Level.text = obj.ToString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 69123a589054bf041ba5ead99364646f
|
||||
timeCreated: 1487186233
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
class UI_Panel_Mail : MonoBehaviour
|
||||
{
|
||||
[SerializeField] float anim_Time = 0.5f;
|
||||
float Anim_Speed => 1f / anim_Time;
|
||||
[SerializeField] List<Animator> ui_Anim;
|
||||
[SerializeField] Transform content_Notice_Slot;
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
foreach (var item in ui_Anim)
|
||||
{
|
||||
item.speed = Anim_Speed;
|
||||
}
|
||||
StartCoroutine(C_Slot_Show());
|
||||
}
|
||||
IEnumerator C_Slot_Show()
|
||||
{
|
||||
var slots = content_Notice_Slot.GetComponentsInChildren<Button>();
|
||||
foreach (var item in slots)
|
||||
{
|
||||
item.gameObject.SetActive(false);
|
||||
}
|
||||
foreach (var item in slots)
|
||||
{
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
item.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef71b0bf89cb6354491f70a5cd33bdd1
|
||||
timeCreated: 1487186233
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,138 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UI_Panel_Main : Singleton_Mono<UI_Panel_Main>
|
||||
{
|
||||
public int Character_Index
|
||||
{
|
||||
set
|
||||
{
|
||||
character_Index = value;
|
||||
Set_Character_Illustration(Get_Character_Image_Data(character_Index).Image_Full);
|
||||
}
|
||||
get => character_Index;
|
||||
}
|
||||
public int character_Index = 1;
|
||||
[SerializeField] List<Character_Data_Image_SO> data_List;
|
||||
public List<Character_Data_Image_SO> Data_List => data_List;
|
||||
[SerializeField] Button button_Character_Set;
|
||||
[SerializeField] GameObject ui_Panel_Character;
|
||||
[SerializeField] Button button_Encyclopendia;
|
||||
[SerializeField] GameObject ui_Panel_Encyclopendia;
|
||||
[SerializeField] Image image_Character;
|
||||
[SerializeField] Button button_Mail;
|
||||
[SerializeField] GameObject ui_Panel_Mail;
|
||||
[SerializeField] Button button_Notice;
|
||||
[SerializeField] GameObject ui_Panel_Notice;
|
||||
[SerializeField] Button button_Level;
|
||||
[SerializeField] GameObject ui_Panel_Level;
|
||||
[SerializeField] MusicPlayer music_Player;
|
||||
[SerializeField] GameObject ui_Panel_Music;
|
||||
[SerializeField] Button button_Story;
|
||||
[SerializeField] GameObject ui_Panel_Story;
|
||||
[SerializeField] Button button_Setting;
|
||||
[SerializeField] GameObject ui_Panel_Setting;
|
||||
|
||||
[SerializeField] Button button_Idol;
|
||||
[SerializeField] Button button_Select_Music;
|
||||
[SerializeField] string ui_Select_Music_Scene_Name= "selectYourSongFirst";
|
||||
|
||||
protected override void In_Init()
|
||||
{
|
||||
|
||||
}
|
||||
protected override bool Is_Singleton_Auto()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
foreach (var item in data_List)
|
||||
{
|
||||
Destroy(item);
|
||||
}
|
||||
base.OnDestroy();
|
||||
}
|
||||
private void Start()
|
||||
{
|
||||
data_List = Resources.LoadAll<Character_Data_Image_SO>("Data").ToList();
|
||||
List<Character_Data_Image_SO> data_List_New = new();
|
||||
foreach (var item in data_List)
|
||||
{
|
||||
var so = Instantiate(item);
|
||||
data_List_New.Add(so);
|
||||
}
|
||||
data_List = data_List_New;
|
||||
Character_Index = character_Index;
|
||||
|
||||
button_Character_Set.onClick.AddListener(
|
||||
() => ui_Panel_Character.SetActive(true));
|
||||
button_Mail.onClick.AddListener(
|
||||
() => ui_Panel_Mail.SetActive(true));
|
||||
button_Notice.onClick.AddListener(
|
||||
() => ui_Panel_Notice.SetActive(true));
|
||||
button_Level.onClick.AddListener(
|
||||
() => ui_Panel_Level.SetActive(true));
|
||||
Character_Index = character_Index;
|
||||
button_Encyclopendia.onClick.AddListener(
|
||||
() => ui_Panel_Encyclopendia.SetActive(true));
|
||||
button_Story.onClick.AddListener(
|
||||
() => ui_Panel_Story.SetActive(true));
|
||||
music_Player.Button_List.onClick.AddListener(
|
||||
() => ui_Panel_Music.SetActive(true));
|
||||
button_Setting.onClick.AddListener(
|
||||
() => ui_Panel_Setting.SetActive(true));
|
||||
|
||||
|
||||
button_Select_Music.onClick.AddListener(
|
||||
() => SceneManager.LoadScene(ui_Select_Music_Scene_Name,LoadSceneMode.Single));
|
||||
}
|
||||
public Character_Data_Image_SO Get_Character_Image_Data(int index)
|
||||
{
|
||||
return data_List.Find(i => i.index == index);
|
||||
}
|
||||
public Character_Data_Image_SO Get_Character_Image_Data()
|
||||
{
|
||||
return data_List.Find(i => i.index == character_Index);
|
||||
}
|
||||
public void Set_Character_Illustration(Sprite sprite)
|
||||
{
|
||||
|
||||
if (c_Character_Illustration_Anim != null)
|
||||
{
|
||||
StopCoroutine(c_Character_Illustration_Anim);
|
||||
}
|
||||
if (image_Character.TryGetComponent(out CanvasGroup canvasGroup))
|
||||
{
|
||||
c_Character_Illustration_Anim = StartCoroutine(C_Character_Illustration_Anim(canvasGroup, () =>
|
||||
{
|
||||
image_Character.sprite = sprite;
|
||||
image_Character.SetNativeSize();
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
Coroutine c_Character_Illustration_Anim;
|
||||
[SerializeField] float character_Illustration_Time = 0.5f;
|
||||
IEnumerator C_Character_Illustration_Anim(CanvasGroup canvasGroup, Action onHide)
|
||||
{
|
||||
float a = 1f / character_Illustration_Time;
|
||||
while (canvasGroup.alpha > 0)
|
||||
{
|
||||
canvasGroup.alpha -= a * Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
onHide?.Invoke();
|
||||
while (canvasGroup.alpha < 1)
|
||||
{
|
||||
canvasGroup.alpha += a * Time.deltaTime;
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12413895c2383c14aa5ab0357715c678
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,239 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Mono.Cecil.Cil;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UI_Panel_Note : MonoBehaviour
|
||||
{
|
||||
[SerializeField] Button button_Close;
|
||||
[SerializeField] float anim_Time = 0.5f;
|
||||
[SerializeField] Button button_Character;
|
||||
[SerializeField] Button button_Enemy;
|
||||
[SerializeField] Button button_TERMINOLOGY;
|
||||
[SerializeField] Button button_AGENDA;
|
||||
[SerializeField] Button button_ORGANIZATIONS;
|
||||
[SerializeField] Button button_TERRITORIAL;
|
||||
[SerializeField] TMP_Text text_Select_Title;
|
||||
[SerializeField] Transform transform_Select;
|
||||
[SerializeField] ToggleGroup toggleGroup_Select;
|
||||
[SerializeField] Animator Animator_Select_Content;
|
||||
[SerializeField] UI_Button_Character button_Select_Prefab;
|
||||
[SerializeField] TMP_Text text_Character_Title;
|
||||
[SerializeField] Transform transform_Description_Content;
|
||||
[SerializeField] TMP_Text text_Only;
|
||||
[SerializeField] TMP_Text text_Character_Name;
|
||||
[SerializeField] Scrollbar scrollbar_Character_Description;
|
||||
[SerializeField] Image image_Character_Illustration;
|
||||
[SerializeField] TMP_Text text_Character_RealName;
|
||||
[SerializeField] TMP_Text text_Character_StageName;
|
||||
[SerializeField] TMP_Text text_Character_Gender;
|
||||
[SerializeField] TMP_Text text_Character_Age;
|
||||
[SerializeField] TMP_Text text_Character_Height;
|
||||
[SerializeField] TMP_Text text_Character_Weight;
|
||||
[SerializeField] TMP_Text text_Character_Birthday;
|
||||
[SerializeField] TMP_Text text_Character_Data;
|
||||
[SerializeField] TMP_Text text_Character_Description;
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
button_Close?.onClick.AddListener(Close);
|
||||
}
|
||||
void Close()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
private void Start()
|
||||
{
|
||||
Set_Button_Image(button_Character);
|
||||
button_Character.onClick.AddListener
|
||||
(() =>
|
||||
{
|
||||
Set_Select_Content(E_Character_Type.Character.ToString());
|
||||
Set_Button_Image_Select(button_Character);
|
||||
});
|
||||
Set_Button_Image(button_Enemy);
|
||||
button_Enemy.onClick.AddListener
|
||||
(() =>
|
||||
{
|
||||
Set_Select_Content(E_Character_Type.Enemy.ToString());
|
||||
Set_Button_Image_Select(button_Enemy);
|
||||
});
|
||||
Set_Button_Image(button_TERMINOLOGY);
|
||||
button_TERMINOLOGY.onClick.AddListener
|
||||
(() =>
|
||||
{
|
||||
Set_Select_Content(E_Character_Type.TERMINOLOGY.ToString());
|
||||
Set_Button_Image_Select(button_TERMINOLOGY);
|
||||
});
|
||||
Set_Button_Image(button_AGENDA);
|
||||
button_AGENDA.onClick.AddListener
|
||||
(() =>
|
||||
{
|
||||
Set_Select_Content(E_Character_Type.AGENDA.ToString());
|
||||
Set_Button_Image_Select(button_AGENDA);
|
||||
});
|
||||
Set_Button_Image(button_ORGANIZATIONS);
|
||||
button_ORGANIZATIONS.onClick.AddListener
|
||||
(() =>
|
||||
{
|
||||
Set_Select_Content(E_Character_Type.ORGANIZATIONS.ToString());
|
||||
Set_Button_Image_Select(button_ORGANIZATIONS);
|
||||
});
|
||||
Set_Button_Image(button_TERRITORIAL);
|
||||
button_TERRITORIAL.onClick.AddListener
|
||||
(() =>
|
||||
{
|
||||
Set_Select_Content(E_Character_Type.TERRITORIAL.ToString());
|
||||
Set_Button_Image_Select(button_TERRITORIAL);
|
||||
});
|
||||
button_Character.onClick.Invoke();
|
||||
}
|
||||
public void Set_Button_Image(Button btn)
|
||||
{
|
||||
btn.spriteState = new()
|
||||
{
|
||||
highlightedSprite = btn.spriteState.highlightedSprite,
|
||||
selectedSprite = btn.spriteState.selectedSprite,
|
||||
disabledSprite = btn.image.sprite,
|
||||
};
|
||||
}
|
||||
public void Set_Button_Image_Select(Button btn)
|
||||
{
|
||||
if (btn.TryGetComponent(out Image image))
|
||||
{
|
||||
image.sprite = btn.spriteState.selectedSprite;
|
||||
}
|
||||
;
|
||||
}
|
||||
public void Clear_Select_Content()
|
||||
{
|
||||
button_Character.image.sprite = button_Character.spriteState.disabledSprite;
|
||||
button_Enemy.image.sprite = button_Enemy.spriteState.disabledSprite;
|
||||
button_TERMINOLOGY.image.sprite = button_TERMINOLOGY.spriteState.disabledSprite;
|
||||
button_AGENDA.image.sprite = button_AGENDA.spriteState.disabledSprite;
|
||||
button_ORGANIZATIONS.image.sprite = button_ORGANIZATIONS.spriteState.disabledSprite;
|
||||
button_TERRITORIAL.image.sprite = button_TERRITORIAL.spriteState.disabledSprite;
|
||||
toggleGroup_Select.transform.Get_Childrens_Component<UI_Button_Character>(true, true);
|
||||
if (c_Clear_Select_Content != null)
|
||||
{
|
||||
StopCoroutine(c_Clear_Select_Content);
|
||||
}
|
||||
c_Clear_Select_Content = StartCoroutine(C_Clear_Select_Content());
|
||||
}
|
||||
Coroutine c_Clear_Select_Content;
|
||||
IEnumerator C_Clear_Select_Content()
|
||||
{
|
||||
Animator_Select_Content.Play("Hide");
|
||||
Animator_Select_Content.speed = 1 / anim_Time;
|
||||
if (Animator_Select_Content.gameObject.activeSelf == true)
|
||||
{
|
||||
yield return new WaitForSeconds(anim_Time);
|
||||
transform_Select.gameObject.SetActive(false);
|
||||
}
|
||||
transform_Select.gameObject.SetActive(true);
|
||||
}
|
||||
public void Set_Select_Content(string type)
|
||||
{
|
||||
Clear_Select_Content();
|
||||
if (c_Set_Select_Content != null)
|
||||
{
|
||||
StopCoroutine(c_Set_Select_Content);
|
||||
}
|
||||
c_Set_Select_Content = StartCoroutine(C_Set_Select_Content(type));
|
||||
}
|
||||
Coroutine c_Set_Select_Content;
|
||||
IEnumerator C_Set_Select_Content(string type)
|
||||
{
|
||||
Clear_Select_Content();
|
||||
if (Animator_Select_Content.gameObject.activeSelf == true)
|
||||
{
|
||||
yield return new WaitForSeconds(anim_Time);
|
||||
}
|
||||
var data = CharacterDataManager.Singleton.data_Dic;
|
||||
var data_List = CharacterDataManager.Singleton.data_Dic[type];
|
||||
var type_Index = (int)(E_Character_Type)Enum.Parse(typeof(E_Character_Type), type);
|
||||
if (data_List != null)
|
||||
{
|
||||
for (int i = 0; i < data_List.Count; i++)
|
||||
{
|
||||
Character_Data_SO item = data_List[i];
|
||||
UI_Button_Character btn = null;
|
||||
btn = Add_Select_Button(item, type_Index >= 2);
|
||||
if (i == 0)
|
||||
{
|
||||
btn.Init();
|
||||
}
|
||||
}
|
||||
text_Character_Title.text = type;
|
||||
}
|
||||
yield return null;
|
||||
|
||||
}
|
||||
public UI_Button_Character Add_Select_Button(Character_Data_SO item, bool text_Only)
|
||||
{
|
||||
UI_Button_Character btn = Instantiate(button_Select_Prefab, toggleGroup_Select.transform);
|
||||
btn.so = item;
|
||||
btn.Toggle.group = toggleGroup_Select;
|
||||
btn.Text.text = item.data.realName;
|
||||
btn.gameObject.name = nameof(UI_Button_Character) + "_" + item.data.realName;
|
||||
btn.gameObject.SetActive(true);
|
||||
btn.transform.localScale = Vector3.one;
|
||||
if (text_Only)
|
||||
{
|
||||
btn.Toggle.onValueChanged.AddListener((isOn) =>
|
||||
{
|
||||
if (isOn == true)
|
||||
{
|
||||
Set_Text_Only(btn.so);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
btn.Toggle.onValueChanged.AddListener((isOn) =>
|
||||
{
|
||||
if (isOn == true)
|
||||
{
|
||||
Set_Character_Description(btn.so);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return btn;
|
||||
}
|
||||
public void Set_Text_Only(Character_Data_SO item)
|
||||
{
|
||||
text_Only.gameObject.SetActive(true);
|
||||
transform_Description_Content.gameObject.SetActive(false);
|
||||
text_Only.text = item.data.personalityDescription;
|
||||
}
|
||||
public void Set_Character_Description(Character_Data_SO item)
|
||||
{
|
||||
text_Only.gameObject.SetActive(false);
|
||||
transform_Description_Content.gameObject.SetActive(true);
|
||||
var data = item;
|
||||
text_Character_Name.text = data.data.realName;
|
||||
image_Character_Illustration.sprite = Resources.Load<Sprite>(data.data.image_Name);
|
||||
text_Character_RealName.text = data.data.realName;
|
||||
text_Character_StageName.text = data.data.stageName;
|
||||
text_Character_Gender.text = data.data.stageName;
|
||||
text_Character_Age.text = data.data.age.ToString();
|
||||
text_Character_Height.text = data.data.height.ToString();
|
||||
text_Character_Weight.text = data.data.weight.ToString();
|
||||
text_Character_Birthday.text = data.data.birthday;
|
||||
text_Character_Data.text = data.data.registrationDate;
|
||||
text_Character_Description.text = data.data.personalityDescription;
|
||||
scrollbar_Character_Description.value = 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 841b34bb42a66e24c81ad648c3cc187c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* FancyScrollView (https://github.com/setchi/FancyScrollView)
|
||||
* Copyright (c) 2020 setchi
|
||||
* Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FancyScrollView.Example01;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
class UI_Panel_Notice : MonoBehaviour
|
||||
{
|
||||
|
||||
[SerializeField] float anim_Time = 0.5f;
|
||||
float Anim_Speed => 1f / anim_Time;
|
||||
[SerializeField] List<Animator> ui_Anim;
|
||||
[SerializeField] Transform content_Notice_Slot;
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
foreach (var item in ui_Anim)
|
||||
{
|
||||
item.speed = Anim_Speed;
|
||||
}
|
||||
StartCoroutine(C_Slot_Show());
|
||||
}
|
||||
IEnumerator C_Slot_Show()
|
||||
{
|
||||
var slots = content_Notice_Slot.GetComponentsInChildren<Button>();
|
||||
foreach (var item in slots)
|
||||
{
|
||||
item.gameObject.SetActive(false);
|
||||
}
|
||||
foreach (var item in slots)
|
||||
{
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
item.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67cd8ae402414ae46903dfc88076e320
|
||||
timeCreated: 1487186233
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,50 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ui_Panel_Setting : MonoBehaviour
|
||||
{
|
||||
[SerializeField] Button button_Close;
|
||||
[SerializeField] Toggle toggle_Game;
|
||||
[SerializeField] Toggle toggle_Game_Pie;
|
||||
[SerializeField] GameObject game_Content;
|
||||
[SerializeField] Toggle toggle_View;
|
||||
[SerializeField] Toggle toggle_View_Pie;
|
||||
[SerializeField] GameObject view_Content;
|
||||
private void Awake()
|
||||
{
|
||||
button_Close?.onClick.AddListener(Close);
|
||||
toggle_Game.onValueChanged.AddListener((isOn) =>
|
||||
{
|
||||
game_Content.SetActive(isOn);
|
||||
if (isOn == false) return;
|
||||
if (game_Content.TryGetComponent(out SimpleAxisTween simpleAxisTween))
|
||||
{
|
||||
simpleAxisTween.PlayTween();
|
||||
}
|
||||
});
|
||||
toggle_Game_Pie.onValueChanged.AddListener((isOn) => { toggle_Game.isOn = isOn; });
|
||||
toggle_View.onValueChanged.AddListener((isOn) =>
|
||||
{
|
||||
view_Content.SetActive(isOn);
|
||||
if (isOn == false) return;
|
||||
if (view_Content.TryGetComponent(out SimpleAxisTween simpleAxisTween))
|
||||
{
|
||||
simpleAxisTween.PlayTween();
|
||||
}
|
||||
});
|
||||
toggle_View_Pie.onValueChanged.AddListener((isOn) => { toggle_View.isOn = isOn; });
|
||||
|
||||
toggle_Game.isOn = true;
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
void Close()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ca6219beec64ec4ea91e7eeeab1163e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UI_Panel_Story : MonoBehaviour
|
||||
{
|
||||
[SerializeField] Button button_Close;
|
||||
private void Awake()
|
||||
{
|
||||
button_Close.onClick.AddListener(Close);
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
void Close()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b6dd6744b2827264ebf834f49d435d20
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user