This commit is contained in:
SoulliesOfficial
2025-06-06 10:14:55 -04:00
parent d4e860fa16
commit db4d131192
1088 changed files with 45704 additions and 2260 deletions

View File

@@ -0,0 +1,48 @@
using System.Collections;
using System.Collections.Generic;
using Michsky.MUIP;
using Sirenix.Utilities;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace Ichni.Story
{
public class ChoiceFrame : MonoBehaviour
{
public GameObject choiceButtonPrefab;
public RectTransform choiceButtonContainer;
public List<Button> choiceButtonList;
public TooltipContent hint;
public void PlayChoice(List<Choice> choices)
{
gameObject.SetActive(true);
choiceButtonContainer.GetAllChildren().ForEach(x => Destroy(x.gameObject));
choiceButtonList.Clear();
/*if (choiceModule.hint != "")
{
hint.gameObject.SetActive(true);
hint.description = choiceModule.hint;
}
else
{
hint.gameObject.SetActive(false);
}*/
foreach (var choice in choices)
{
GameObject choiceButton = Instantiate(choiceButtonPrefab, choiceButtonContainer);
choiceButton.GetComponentInChildren<TMP_Text>().text = choice.choiceText;
choiceButton.GetComponent<Button>().onClick.AddListener(() =>
{
DialogManager.instance.PlayNextDialogParagraph(choice.nextDialogName);
DialogManager.instance.isPlayingChoice = false;
gameObject.SetActive(false);
});
choiceButtonList.Add(choiceButton.GetComponent<Button>());
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 62ce59e989ba99d4ca0407641e0ae2f2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Ichni.UI;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.Serialization;
namespace Ichni.Story.UI
{
public class DialogUIPage : UIPageBase
{
public TextFrame textFrame;
public ChoiceFrame choiceFrame;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 17254192719abee4f9222246fd403de5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Options;
using I2.Loc;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace Ichni.Story
{
public class TextFrame : MonoBehaviour
{
public GameObject textPrefab;
public RectTransform textContainer;
private TweenerCore<string, string, StringOptions> contentTween;
public bool isPlayingSentence;
public void PlaySentence(string speakerName, string content)
{
GameObject contentText = Instantiate(textPrefab, textContainer);
contentText.transform.GetChild(1).GetComponent<TMP_Text>().text = speakerName;
contentText.transform.GetChild(2).GetComponent<TMP_Text>().text = content;
//contentText.GetComponent<Localize>().OnLocalize();
}
public void FinishSentence()
{
if (isPlayingSentence)
{
contentTween.Complete();
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 14874d8a3e4a31941879415479892501
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: