Skip to content

Commit

Permalink
Add file field to backgrond spec
Browse files Browse the repository at this point in the history
  • Loading branch information
yojohanshinwataikei committed Apr 30, 2020
1 parent 14f7eb2 commit 0ae3288
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Assets/Misc/BuildTimestamp.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
637213572750332766
637238730893599635
1 change: 1 addition & 0 deletions Assets/Misc/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
- 改善了 Arctap 粘贴失败时的报错信息
- 修复了某些情况下显示范围外的小节线没有隐藏的问题
- 修复了同时选中 Arc 和其上 ArcTap 时复制后报错的问题
- 略微增强了皮肤系统
- 由于底栏空间不够, 版本信息等移动到设置界面
14 changes: 9 additions & 5 deletions Assets/Scripts/Compose/AdeSkinHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ public class CollectionDataSpec<T>
public class BackgroundDataSpec
{
public string name;
public string file;
public string side;
public string theme;
}
Expand Down Expand Up @@ -600,7 +601,8 @@ private void LoadBackgroundData(SkinDatas skinData, BackgroundDataSpec spec)
Debug.LogWarning($"BackgroundDataSpec with a duplicated name will be ignored. spec:\n{JsonConvert.SerializeObject(spec)}");
return;
}
string path = Path.Combine(SkinFolderPath, "Playfield", "Background", spec.name + ".jpg");
string file = spec.file ?? spec.name;
string path = Path.Combine(SkinFolderPath, "Playfield", "Background", file + ".jpg");
Sprite background = LoadNormalSprite(path, externalSkinDataObjects);
if (background == null)
{
Expand Down Expand Up @@ -854,8 +856,9 @@ private Color LoadColor(string color, Color fallback)
}
private Texture2D LoadTexture2D(string path, List<UnityEngine.Object> resourceList)
{
Texture2D texture=Loader.LoadTexture2D(path);
if(texture!=null){
Texture2D texture = Loader.LoadTexture2D(path);
if (texture != null)
{
resourceList.Add(texture);
}
return texture;
Expand Down Expand Up @@ -904,8 +907,9 @@ private Sprite Load9SliceSprite(string path, Vector4 border, List<UnityEngine.Ob

private AudioClip LoadWavAudioClip(string path, List<UnityEngine.Object> resourceList)
{
AudioClip clip=Loader.LoadWavOrMp3AudioFile(path);
if(clip!=null){
AudioClip clip = Loader.LoadWavOrMp3AudioFile(path);
if (clip != null)
{
resourceList.Add(clip);
}
return clip;
Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ PlayerSettings:
16:10: 0
16:9: 1
Others: 0
bundleVersion: 0.1.0
bundleVersion: 0.2.0
preloadedAssets:
- {fileID: 4800000, guid: bb26ede1beb997943a7d6295fbf075d4, type: 3}
- {fileID: 4800000, guid: 1e340182228616b4ca7dad1e80f4d319, type: 3}
Expand Down

0 comments on commit 0ae3288

Please sign in to comment.