剧情
This commit is contained in:
18
Assets/Scripts/Story/StoryUI/Blocks/BeatmapStatusMark.cs
Normal file
18
Assets/Scripts/Story/StoryUI/Blocks/BeatmapStatusMark.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class BeatmapStatusMark : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b547d2cc398393a46a2a4c503f128cac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
32
Assets/Scripts/Story/StoryUI/Blocks/BlockConnectorUI.cs
Normal file
32
Assets/Scripts/Story/StoryUI/Blocks/BlockConnectorUI.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Story.UI;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI.Extensions;
|
||||
|
||||
namespace Ichni.Story
|
||||
{
|
||||
public class BlockConnectorUI : MonoBehaviour
|
||||
{
|
||||
public UILineRenderer curve;
|
||||
public StoryBlockUIBase startBlock;
|
||||
public StoryBlockUIBase endBlock;
|
||||
|
||||
public void SetCurve(Vector2 startPosition, Vector2 endPosition)
|
||||
{
|
||||
Vector2 mid1 = (startPosition + endPosition) / 2;
|
||||
Vector2 mid2 = (startPosition + endPosition) / 2;
|
||||
|
||||
mid1.y = startPosition.y;
|
||||
mid2.y = endPosition.y;
|
||||
|
||||
curve.Points = new Vector2[]
|
||||
{
|
||||
startPosition,
|
||||
//mid1,
|
||||
mid2,
|
||||
endPosition
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Story/StoryUI/Blocks/BlockConnectorUI.cs.meta
Normal file
11
Assets/Scripts/Story/StoryUI/Blocks/BlockConnectorUI.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98bbf463dca50cc43961c0bb2b8d4f22
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
51
Assets/Scripts/Story/StoryUI/Blocks/DialogBlockUI.cs
Normal file
51
Assets/Scripts/Story/StoryUI/Blocks/DialogBlockUI.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Ichni.Story.UI
|
||||
{
|
||||
public class DialogBlockUI : StoryBlockUIBase
|
||||
{
|
||||
public string blockTitle;
|
||||
public TMP_Text titleText;
|
||||
|
||||
public Button button;
|
||||
public List<ChoiceGroupUI> choiceGroups;
|
||||
|
||||
public void Initialize(string blockName, Vector2 position, Vector2 positionOffset,
|
||||
Vector2 size, StoryBlockState state, string blockTitle)
|
||||
{
|
||||
base.Initialize(blockName, position, positionOffset, size, state);
|
||||
|
||||
this.blockTitle = blockTitle;
|
||||
titleText.text = blockTitle;
|
||||
|
||||
button.onClick.AddListener(() =>
|
||||
{
|
||||
if(state == StoryBlockState.Locked) return;
|
||||
|
||||
StoryManager.instance.storyline.currentBlock = this;
|
||||
|
||||
if (state == StoryBlockState.Current)
|
||||
{
|
||||
DialogManager.instance.SetDialog(blockName);
|
||||
DialogManager.instance.PlayNextDialogParagraph(DialogManager.instance.currentDialog);
|
||||
}
|
||||
else if (state == StoryBlockState.Completed)
|
||||
{
|
||||
DialogManager.instance.SetDialog(blockName);
|
||||
DialogManager.instance.PlayNextDialogParagraph(DialogManager.instance.currentDialog, false);
|
||||
DialogManager.instance.RevealDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public override StoryBlockSave GetBlockSave()
|
||||
{
|
||||
return new DialogBlockSave(blockName, blockPosition, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Story/StoryUI/Blocks/DialogBlockUI.cs.meta
Normal file
11
Assets/Scripts/Story/StoryUI/Blocks/DialogBlockUI.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b976128eb3ec59e4e866dbb610441706
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
78
Assets/Scripts/Story/StoryUI/Blocks/SongBlockUI.cs
Normal file
78
Assets/Scripts/Story/StoryUI/Blocks/SongBlockUI.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Ichni.Menu;
|
||||
using Ichni.RhythmGame;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Ichni.Story.UI
|
||||
{
|
||||
public class SongBlockUI : StoryBlockUIBase
|
||||
{
|
||||
public string songName;
|
||||
public Button button;
|
||||
public TMP_Text songNameText;
|
||||
public RectTransform beatmapStatusMarkContainer;
|
||||
|
||||
public GameObject beatmapStatusMarkPrefab;
|
||||
|
||||
public void Initialize(string blockName, Vector2 position, Vector2 positionOffset,
|
||||
Vector2 size, StoryBlockState state, string songName)
|
||||
{
|
||||
base.Initialize(blockName, position, positionOffset, size, state);
|
||||
|
||||
this.songName = songName;
|
||||
songNameText.text = songName;
|
||||
|
||||
button.onClick.AddListener(() =>
|
||||
{
|
||||
MenuManager.instance.prepareUIPage.FadeIn();
|
||||
});
|
||||
|
||||
SetUpBeatmapStatusMarks();
|
||||
}
|
||||
|
||||
public override StoryBlockSave GetBlockSave()
|
||||
{
|
||||
return new SongBlockSave(blockName, blockPosition, state);
|
||||
}
|
||||
|
||||
public void SetUpBeatmapStatusMarks()
|
||||
{
|
||||
SongStatusSave songStatusSave = GameSaveManager.instance.SongSaveModule.songStatusSaves[songName];
|
||||
|
||||
string chapter = StoryManager.instance.currentChapter;
|
||||
ChapterSelectionUnit cpt = ChapterSelectionManager.instance.chapters.First(c => c.chapterIndex == chapter);
|
||||
SongItemData song = cpt.songs.First(s => s.songName == this.songName);
|
||||
foreach (DifficultyData difficulty in song.difficultyDataList)
|
||||
{
|
||||
foreach (KeyValuePair<string, BeatmapSave> beatmapSave in songStatusSave.beatmapSaves)
|
||||
{
|
||||
if (beatmapSave.Key == difficulty.difficultyName)
|
||||
{
|
||||
if (beatmapSave.Value.isAllPerfect)
|
||||
{
|
||||
GameObject mark = Instantiate(beatmapStatusMarkPrefab, beatmapStatusMarkContainer);
|
||||
mark.GetComponent<Image>().color = difficulty.color;
|
||||
mark.transform.GetChild(0).GetComponent<TMP_Text>().color = difficulty.color;
|
||||
mark.transform.GetChild(0).GetComponent<TMP_Text>().text = "AP";
|
||||
break;
|
||||
}
|
||||
|
||||
if (beatmapSave.Value.isFullCombo)
|
||||
{
|
||||
GameObject mark = Instantiate(beatmapStatusMarkPrefab, beatmapStatusMarkContainer);
|
||||
mark.GetComponent<Image>().color = difficulty.color;
|
||||
mark.transform.GetChild(0).GetComponent<TMP_Text>().color = difficulty.color;
|
||||
mark.transform.GetChild(0).GetComponent<TMP_Text>().text = "FC";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Story/StoryUI/Blocks/SongBlockUI.cs.meta
Normal file
11
Assets/Scripts/Story/StoryUI/Blocks/SongBlockUI.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5efe0a39fe908354e9ab6d1edfdb8843
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
30
Assets/Scripts/Story/StoryUI/Blocks/StoryBlockUIBase.cs
Normal file
30
Assets/Scripts/Story/StoryUI/Blocks/StoryBlockUIBase.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace Ichni.Story.UI
|
||||
{
|
||||
public abstract class StoryBlockUIBase : MonoBehaviour
|
||||
{
|
||||
public string blockName;
|
||||
public Vector2 blockPosition;
|
||||
public StoryBlockState state;
|
||||
|
||||
public RectTransform blockRect;
|
||||
public RectTransform inPort;
|
||||
public RectTransform outPort;
|
||||
|
||||
protected void Initialize(string blockName, Vector2 position, Vector2 positionOffset, Vector2 size, StoryBlockState state)
|
||||
{
|
||||
this.blockName = blockName;
|
||||
this.blockPosition = position;
|
||||
this.state = state;
|
||||
|
||||
blockRect.anchoredPosition = position + positionOffset;
|
||||
blockRect.sizeDelta = size;
|
||||
}
|
||||
|
||||
public abstract StoryBlockSave GetBlockSave();
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Story/StoryUI/Blocks/StoryBlockUIBase.cs.meta
Normal file
11
Assets/Scripts/Story/StoryUI/Blocks/StoryBlockUIBase.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d489f986a1eea1e4c938658f0fd468ca
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
34
Assets/Scripts/Story/StoryUI/Blocks/TutorialBlockUI.cs
Normal file
34
Assets/Scripts/Story/StoryUI/Blocks/TutorialBlockUI.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Ichni.Story.UI
|
||||
{
|
||||
public class TutorialBlockUI : StoryBlockUIBase
|
||||
{
|
||||
public Button button;
|
||||
public string tutorialName;
|
||||
public TMP_Text tutorialNameText;
|
||||
|
||||
public void Initialize(string blockName, Vector2 position, Vector2 positionOffset, Vector2 size, StoryBlockState state, string tutorialName)
|
||||
{
|
||||
base.Initialize(blockName, position, positionOffset, size, state);
|
||||
|
||||
this.tutorialName = tutorialName;
|
||||
tutorialNameText.text = tutorialName;
|
||||
|
||||
button.onClick.AddListener(() =>
|
||||
{
|
||||
//DialogManager.instance.SetDialog(blockName);
|
||||
});
|
||||
}
|
||||
|
||||
public override StoryBlockSave GetBlockSave()
|
||||
{
|
||||
return new TutorialBlockSave(blockName, blockPosition, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Story/StoryUI/Blocks/TutorialBlockUI.cs.meta
Normal file
11
Assets/Scripts/Story/StoryUI/Blocks/TutorialBlockUI.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 821e50e1519236a46b03eb1f005acebe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user