20241123
This commit is contained in:
@@ -400,6 +400,40 @@ RectTransform:
|
||||
m_AnchoredPosition: {x: 0, y: -74.65784}
|
||||
m_SizeDelta: {x: -0.0002, y: 141.3334}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &782858428
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 782858429}
|
||||
m_Layer: 0
|
||||
m_Name: AudioSystem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &782858429
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 782858428}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1944636609}
|
||||
- {fileID: 1832857650}
|
||||
- {fileID: 1734966956}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &801894613
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1712,6 +1746,134 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1699916270}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1734966955
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1734966956}
|
||||
- component: {fileID: 1734966957}
|
||||
m_Layer: 0
|
||||
m_Name: BackMix
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1734966956
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1734966955}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 782858429}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!82 &1734966957
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1734966955}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 0}
|
||||
m_PlayOnAwake: 1
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
Loop: 1
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 128
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 500
|
||||
Pan2D: 0
|
||||
rolloffMode: 0
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
panLevelCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
spreadCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
reverbZoneMixCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!1 &1815868748
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1776,6 +1938,262 @@ MonoBehaviour:
|
||||
m_ChildScaleWidth: 0
|
||||
m_ChildScaleHeight: 0
|
||||
m_ReverseArrangement: 0
|
||||
--- !u!1 &1832857649
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1832857650}
|
||||
- component: {fileID: 1832857651}
|
||||
m_Layer: 0
|
||||
m_Name: TextMix
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1832857650
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1832857649}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 782858429}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!82 &1832857651
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1832857649}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 0}
|
||||
m_PlayOnAwake: 1
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
Loop: 0
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 128
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 500
|
||||
Pan2D: 0
|
||||
rolloffMode: 0
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
panLevelCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
spreadCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
reverbZoneMixCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!1 &1944636608
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1944636609}
|
||||
- component: {fileID: 1944636610}
|
||||
m_Layer: 0
|
||||
m_Name: Character_Voice
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1944636609
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1944636608}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 782858429}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!82 &1944636610
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1944636608}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 0}
|
||||
m_PlayOnAwake: 1
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
Loop: 0
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 128
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 500
|
||||
Pan2D: 0
|
||||
rolloffMode: 0
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
panLevelCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
spreadCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
reverbZoneMixCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!1 &2064238917
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -14,6 +14,8 @@ namespace ScenesScripts.GalPlot
|
||||
{
|
||||
public class GalManager : MonoBehaviour
|
||||
{
|
||||
public static string PlotID;
|
||||
|
||||
[Title("当前对话")]
|
||||
///
|
||||
public GalManager_Text Gal_Text;
|
||||
@@ -27,10 +29,6 @@ namespace ScenesScripts.GalPlot
|
||||
[Title("控制背景图片的组件")]
|
||||
public GalManager_BackImg Gal_BackImg;
|
||||
|
||||
/// <summary>
|
||||
/// 角色发言的AudioSource
|
||||
/// </summary>
|
||||
private AudioSource Gal_Voice;
|
||||
|
||||
/// <summary>
|
||||
/// 当前场景角色数量
|
||||
@@ -43,7 +41,23 @@ namespace ScenesScripts.GalPlot
|
||||
public static GameConfig Department = new($"{GameAPI.GetWritePath()}/HGF/Department.ini");
|
||||
|
||||
}
|
||||
public class AudioSystemModel
|
||||
{
|
||||
public AudioSource Character_Voice;
|
||||
public AudioSource BackMix;
|
||||
public AudioSource TextMix;
|
||||
public class AudioInfo
|
||||
{
|
||||
public string name;
|
||||
public string path;
|
||||
}
|
||||
public List<AudioInfo> AudioList = new();
|
||||
/// <summary>
|
||||
/// 背景音乐Clip
|
||||
/// </summary>
|
||||
|
||||
}
|
||||
public static AudioSystemModel AudioSystem = new();
|
||||
/// <summary>
|
||||
/// 存储整个剧本的XML文档
|
||||
/// </summary>
|
||||
@@ -67,6 +81,7 @@ namespace ScenesScripts.GalPlot
|
||||
public GameObject CharacterGameObject;
|
||||
public string Name;
|
||||
public string Affiliation;
|
||||
public string FromID;
|
||||
}
|
||||
public List<Struct_CharacterInfo> CharacterInfo = new();
|
||||
public List<Struct_Choice> ChoiceText = new();
|
||||
@@ -82,12 +97,14 @@ namespace ScenesScripts.GalPlot
|
||||
public string NowJumpID;
|
||||
|
||||
}
|
||||
|
||||
public static Struct_PlotData PlotData = new();
|
||||
private void Start ()
|
||||
{
|
||||
Gal_Voice = this.gameObject.GetComponent<AudioSource>();
|
||||
ResetPlotData();
|
||||
StartBackAudio();
|
||||
StartCoroutine(LoadPlot());
|
||||
|
||||
return;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -135,6 +152,11 @@ namespace ScenesScripts.GalPlot
|
||||
{
|
||||
switch (item.Name.ToString())
|
||||
{
|
||||
case "ID":
|
||||
{
|
||||
PlotID = item.Value;
|
||||
break;
|
||||
}
|
||||
case "title":
|
||||
{
|
||||
PlotData.Title = item.Value;
|
||||
@@ -153,6 +175,19 @@ namespace ScenesScripts.GalPlot
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "AudioList":
|
||||
{
|
||||
foreach (var item_name in item.Elements())
|
||||
{
|
||||
|
||||
AudioSystem.AudioList.Add(new AudioSystemModel.AudioInfo
|
||||
{
|
||||
name = item_name.Value,
|
||||
path = item_name.Attribute("Path").Value,
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "MainPlot":
|
||||
{
|
||||
foreach (var MainPlotItem in item.Elements())
|
||||
@@ -221,7 +256,7 @@ namespace ScenesScripts.GalPlot
|
||||
_.Name = CharacterConfig.CharacterInfo.GetValue(_From, "Name");
|
||||
_.CharacterID = _CharacterId;
|
||||
_.Affiliation = CharacterConfig.Department.GetValue(CharacterConfig.CharacterInfo.GetValue(_From, "Department"), "Name");
|
||||
|
||||
_.FromID = _From;
|
||||
var _CameObj = Resources.Load<GameObject>("HGF/Img-Character");
|
||||
_CameObj.GetComponent<Image>().sprite = GameAPI.LoadTextureByIO($"{GameAPI.GetWritePath()}/HGF/Texture2D/Portrait/{CharacterConfig.CharacterInfo.GetValue(_From, "ResourcesPath")}/{CharacterConfig.CharacterInfo.GetValue(_From, "Portrait-Normall")}");
|
||||
_.CharacterGameObject = Instantiate(_CameObj, Gal_CharacterImg.gameObject.transform);
|
||||
@@ -263,7 +298,7 @@ namespace ScenesScripts.GalPlot
|
||||
if (PlotData.NowPlotDataNode.Attributes("SendMessage").Count() != 0)
|
||||
SendCharMessage(_nodeinfo.CharacterID, PlotData.NowPlotDataNode.Attribute("SendMessage").Value);
|
||||
if (PlotData.NowPlotDataNode.Attributes("AudioPath").Count() != 0)
|
||||
StartCoroutine(PlayAudio(Gal_Voice, PlotData.NowPlotDataNode.Attribute("AudioPath").Value));
|
||||
StartCoroutine(PlayAudio(AudioSystem.Character_Voice, PlotData.NowPlotDataNode.Attribute("AudioPath").Value));
|
||||
break;
|
||||
}
|
||||
case "ChangeBackImg"://更换背景图片
|
||||
@@ -278,6 +313,26 @@ namespace ScenesScripts.GalPlot
|
||||
DestroyCharacterByID(PlotData.NowPlotDataNode.Attribute("CharacterID").Value);
|
||||
break;
|
||||
}
|
||||
case "ChangeCharacterImg":
|
||||
{
|
||||
var _CharacterID = PlotData.NowPlotDataNode.Attribute("CharacterID").Value;
|
||||
var _obj = GetCharacterObjectByName(_CharacterID);
|
||||
|
||||
//Debug.Log(_obj.CharacterGameObject.GetComponent<Image>() is null);
|
||||
|
||||
//ResourcesPath
|
||||
_obj.CharacterGameObject.GetComponent<GalManager_CharacterImg>().SetImage(GameAPI.LoadTextureByIO($"{GameAPI.GetWritePath()}/HGF/Texture2D/Portrait/{CharacterConfig.CharacterInfo.GetValue(_obj.FromID, "ResourcesPath")}/{CharacterConfig.CharacterInfo.GetValue(_obj.FromID, PlotData.NowPlotDataNode.Attribute("KeyName").Value)}"));
|
||||
// _obj.CharacterGameObject.GetComponent<Image>().sprite = Resources.Load<Sprite>($"Texture2D/Menhera/Plot/character/{GameManager.ServerManager.Config.CharacterInfo.GetValue(_obj.FromID, "ResourcePath")}/{GameManager.ServerManager.Config.CharacterInfo.GetValue(_obj.FromID, PlotData.NowPlotDataNode.Attribute("Img").Value)}");
|
||||
// Debug.Log($"Texture2D/Menhera/Plot/character/{GameManager.ServerManager.Config.CharacterInfo.GetValue(_obj.FromID, "ResourcePath")}/{GameManager.ServerManager.Config.CharacterInfo.GetValue(_obj.FromID, PlotData.NowPlotDataNode.Attribute("Img").Value)}");
|
||||
Button_Click_NextPlot();
|
||||
break;
|
||||
}
|
||||
case "ChangeBackAudio":
|
||||
{
|
||||
PlayAudio(AudioSystem.BackMix, AudioSystem.AudioList.Find(e => e.name == PlotData.NowPlotDataNode.Value).path);
|
||||
Button_Click_NextPlot();
|
||||
break;
|
||||
}
|
||||
case "ExitGame":
|
||||
{
|
||||
foreach (var item in PlotData.CharacterInfo)
|
||||
@@ -335,7 +390,7 @@ namespace ScenesScripts.GalPlot
|
||||
{
|
||||
//获取.wav文件,并转成AudioClip
|
||||
GameAPI.Print($"{GameAPI.GetWritePath()}/{fileName}");
|
||||
UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip($"{GameAPI.GetWritePath()}/HGF/Audio/Plot/{fileName}", AudioType.MPEG);
|
||||
UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip($"{GameAPI.GetWritePath()}/HGF/Audio/Plot/{PlotID}/{fileName}", AudioType.MPEG);
|
||||
//等待转换完成
|
||||
yield return www.SendWebRequest();
|
||||
//获取AudioClip
|
||||
@@ -345,6 +400,17 @@ namespace ScenesScripts.GalPlot
|
||||
//播放声音
|
||||
audioSource.Play();
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化音乐系统
|
||||
/// </summary>
|
||||
private void StartBackAudio ()
|
||||
{
|
||||
AudioSystem.Character_Voice = GameObject.Find("AudioSystem/Character_Voice").GetComponent<AudioSource>();
|
||||
AudioSystem.BackMix = GameObject.Find("AudioSystem/BackMix").GetComponent<AudioSource>();
|
||||
AudioSystem.TextMix = GameObject.Find("AudioSystem/TextMix").GetComponent<AudioSource>();
|
||||
|
||||
}
|
||||
|
||||
private void FixedUpdate ()
|
||||
{
|
||||
CharacterNum = PlotData.CharacterInfo.Count;
|
||||
|
||||
Binary file not shown.
8
Assets/StreamingAssets/HGF/Audio/Plot/TestPlot.meta
Normal file
8
Assets/StreamingAssets/HGF/Audio/Plot/TestPlot.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54aa75e7a287a8246b66b664bc43eea4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/StreamingAssets/HGF/Audio/Plot/TestPlot/1.mp3
Normal file
BIN
Assets/StreamingAssets/HGF/Audio/Plot/TestPlot/1.mp3
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3010215d4e45f0649ae1ba932d4d83c6
|
||||
guid: 295a212e1a38194488ce7ab227aa7fae
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -1,11 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--剧情数据,需要包含一个根节点-->
|
||||
<data>
|
||||
<ID>TestPlot</ID>
|
||||
|
||||
<!--本章剧情标题-->
|
||||
<title>测试章节</title>
|
||||
<!--本章剧情简介-->
|
||||
<Synopsis>本章节为你演示HOILAI Galgame Framework(HGF) 的功能</Synopsis>
|
||||
<!-- 这个节点表示分支剧情在以下内容中查找,如果需要跳转到别的节点的分支,暂不支持-->
|
||||
|
||||
<BranchPlot>
|
||||
<BranchPlotNode ID="S1">
|
||||
<Speak CharacterID="1" Content="你跳转到了分支一"></Speak>
|
||||
@@ -19,9 +22,9 @@
|
||||
<!--以下才属于正式剧情-->
|
||||
<MainPlot>
|
||||
<!-- 添加一个角色,这个角色的ID为1 有关所有角色ID需要到相关的配置文件修改 -->
|
||||
<AddCharacter CharacterID="1" From="C1" SendMessage="Outside-ToLeft"></AddCharacter>
|
||||
<AddCharacter CharacterID="1" From="C1" SendMessage="Outside-ToLeft" ></AddCharacter>
|
||||
<!--开始发言,角色ID为1的角色发言:你好啊!!! 同时发送消息,我需要执行入场动画:从屏幕左侧滑进-->
|
||||
<Speak CharacterID="1" Content="你好啊!!! 我是不是从左侧进入的?"></Speak>
|
||||
<Speak CharacterID="1" Content="你好啊!!! 我是不是从左侧进入的?" AudioPath="1.mp3"></Speak>
|
||||
<!--分支剧情,这句话结束后会自动弹出选项-->
|
||||
<Speak CharacterID="1" Content="这句话结束会弹出选项">
|
||||
<!--每个Choice需要有一个JumpID ,就是点击这个之后跳转到的节点,如果不希望跳转,也就是假选项,填写-1-->
|
||||
@@ -31,9 +34,10 @@
|
||||
<!--分支剧情结束后自动继续游戏-->
|
||||
<ChangeBackImg Path="home.png"></ChangeBackImg>
|
||||
<Speak CharacterID="1" Content="接下来我们继续" SendMessage="Shake-Y-Once"></Speak>
|
||||
<ChangeCharacterImg CharacterID="1" KeyName="Portrait-Photo"></ChangeCharacterImg>
|
||||
<!--AudioPath表示语音路径,可以使资源文件夹的,也可以是外部路径,但不支持URL路径(以后或许会支持)-->
|
||||
<Speak CharacterID="1" SendMessage="Shake" AudioPath="HYKB/1.mp3" Content="是不是为我的突然说话感到意外?"></Speak>
|
||||
<Speak CharacterID="1" SendMessage="Shake" Content="AudioPath属性是我的语音路径哦~"></Speak>
|
||||
<Speak CharacterID="1" SendMessage="Shake" Content="是不是为我的突然说话感到意外?"></Speak>
|
||||
<Speak CharacterID="1" SendMessage="Shake" Content="KeyName属性是我的语音路径哦~"></Speak>
|
||||
<Speak CharacterID="1" Content="那么测试章节结束啦~我们下次再见吧!"></Speak>
|
||||
<!--id为1的角色退场,发送消息ToRight ,表示从屏幕右侧滑出-->
|
||||
<DeleteCharacter CharacterID="1" SendMessage="ToRight"></DeleteCharacter>
|
||||
|
||||
@@ -7,21 +7,21 @@
|
||||
"dependencies": {
|
||||
"com.unity.mathematics": "1.2.1"
|
||||
},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.collab-proxy": {
|
||||
"version": "2.2.0",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ext.nunit": {
|
||||
"version": "1.0.6",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ide.rider": {
|
||||
"version": "3.0.26",
|
||||
@@ -30,7 +30,7 @@
|
||||
"dependencies": {
|
||||
"com.unity.ext.nunit": "1.0.6"
|
||||
},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ide.visualstudio": {
|
||||
"version": "2.0.22",
|
||||
@@ -39,28 +39,28 @@
|
||||
"dependencies": {
|
||||
"com.unity.test-framework": "1.1.9"
|
||||
},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ide.vscode": {
|
||||
"version": "1.2.5",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.mathematics": {
|
||||
"version": "1.2.6",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.nuget.newtonsoft-json": {
|
||||
"version": "3.2.1",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.render-pipelines.core": {
|
||||
"version": "12.1.13",
|
||||
@@ -88,7 +88,7 @@
|
||||
"depth": 2,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.shadergraph": {
|
||||
"version": "12.1.13",
|
||||
@@ -108,7 +108,7 @@
|
||||
"com.unity.modules.imgui": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.textmeshpro": {
|
||||
"version": "3.0.6",
|
||||
@@ -117,19 +117,19 @@
|
||||
"dependencies": {
|
||||
"com.unity.ugui": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.timeline": {
|
||||
"version": "1.6.5",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.modules.audio": "1.0.0",
|
||||
"com.unity.modules.director": "1.0.0",
|
||||
"com.unity.modules.animation": "1.0.0",
|
||||
"com.unity.modules.audio": "1.0.0",
|
||||
"com.unity.modules.particlesystem": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ugui": {
|
||||
"version": "1.0.0",
|
||||
@@ -148,7 +148,7 @@
|
||||
"com.unity.ugui": "1.0.0",
|
||||
"com.unity.modules.jsonserialize": "1.0.0"
|
||||
},
|
||||
"url": "https://packages.unity.cn"
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.modules.ai": {
|
||||
"version": "1.0.0",
|
||||
|
||||
@@ -21,7 +21,7 @@ MonoBehaviour:
|
||||
m_Registries:
|
||||
- m_Id: main
|
||||
m_Name:
|
||||
m_Url: https://packages.unity.cn
|
||||
m_Url: https://packages.unity.com
|
||||
m_Scopes: []
|
||||
m_IsDefault: 1
|
||||
m_Capabilities: 7
|
||||
@@ -31,6 +31,6 @@ MonoBehaviour:
|
||||
m_RegistryInfoDraft:
|
||||
m_Modified: 0
|
||||
m_ErrorMessage:
|
||||
m_UserModificationsInstanceId: -848
|
||||
m_OriginalInstanceId: -850
|
||||
m_UserModificationsInstanceId: -826
|
||||
m_OriginalInstanceId: -828
|
||||
m_LoadAssets: 0
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
m_EditorVersion: 2021.3.33f1c1
|
||||
m_EditorVersionWithRevision: 2021.3.33f1c1 (682b9db7927c)
|
||||
m_EditorVersion: 2021.3.33f1
|
||||
m_EditorVersionWithRevision: 2021.3.33f1 (ee5a2aa03ab2)
|
||||
|
||||
Reference in New Issue
Block a user