mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-13 02:28:44 +08:00
[csharp] Add audioPath to EventData and SkeletonData
This commit is contained in:
parent
18eec077e4
commit
83778a76c1
@ -39,7 +39,8 @@ namespace Spine {
|
||||
public string Name { get { return name; } }
|
||||
public int Int { get; set; }
|
||||
public float Float { get; set; }
|
||||
public string String { get; set; }
|
||||
public string @String { get; set; }
|
||||
public string AudioPath { get; set; }
|
||||
|
||||
public EventData (string name) {
|
||||
if (name == null) throw new ArgumentNullException("name", "name cannot be null.");
|
||||
|
||||
@ -151,8 +151,12 @@ namespace Spine {
|
||||
|
||||
if (nonessential) {
|
||||
skeletonData.fps = ReadFloat(input);
|
||||
|
||||
skeletonData.imagesPath = ReadString(input);
|
||||
if (skeletonData.imagesPath.Length == 0) skeletonData.imagesPath = null;
|
||||
if (string.IsNullOrEmpty(skeletonData.imagesPath)) skeletonData.imagesPath = null;
|
||||
|
||||
skeletonData.audioPath = ReadString(input);
|
||||
if (string.IsNullOrEmpty(skeletonData.audioPath)) skeletonData.audioPath = null;
|
||||
}
|
||||
|
||||
// Bones.
|
||||
@ -280,6 +284,7 @@ namespace Spine {
|
||||
data.Int = ReadVarint(input, false);
|
||||
data.Float = ReadFloat(input);
|
||||
data.String = ReadString(input);
|
||||
data.AudioPath = ReadString(input);
|
||||
skeletonData.events.Add(data);
|
||||
}
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ namespace Spine {
|
||||
|
||||
// Nonessential.
|
||||
internal float fps;
|
||||
internal string imagesPath;
|
||||
internal string imagesPath, audioPath;
|
||||
|
||||
public string Name { get { return name; } set { name = value; } }
|
||||
|
||||
@ -79,7 +79,12 @@ namespace Spine {
|
||||
/// <summary>The Spine version used to export this data, or null.</summary>
|
||||
public string Version { get { return version; } set { version = value; } }
|
||||
public string Hash { get { return hash; } set { hash = value; } }
|
||||
|
||||
/// <summary>The path to the images directory as defined in Spine. Available only when nonessential data was exported. May be null</summary>
|
||||
public string ImagesPath { get { return imagesPath; } set { imagesPath = value; } }
|
||||
|
||||
/// <summary>The path to the audio directory defined in Spine. Available only when nonessential data was exported. May be null.</summary>
|
||||
public string AudioPath { get { return audioPath; } set { audioPath = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// The dopesheet FPS in Spine. Available only when nonessential data was exported.</summary>
|
||||
|
||||
@ -104,6 +104,7 @@ namespace Spine {
|
||||
skeletonData.height = GetFloat(skeletonMap, "height", 0);
|
||||
skeletonData.fps = GetFloat(skeletonMap, "fps", 0);
|
||||
skeletonData.imagesPath = GetString(skeletonMap, "images", null);
|
||||
skeletonData.audioPath = GetString(skeletonMap, "audio", null);
|
||||
}
|
||||
|
||||
// Bones.
|
||||
@ -293,6 +294,7 @@ namespace Spine {
|
||||
data.Int = GetInt(entryMap, "int", 0);
|
||||
data.Float = GetFloat(entryMap, "float", 0);
|
||||
data.String = GetString(entryMap, "string", string.Empty);
|
||||
data.AudioPath = GetString(entryMap, "audio", string.Empty);
|
||||
skeletonData.events.Add(data);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user