Skip to content

Commit 320e6fc

Browse files
author
Ellan Jiang
authored
Merge pull request EllanJiang#17 from EllanJiang/v3.1.8
V3.1.8
2 parents c11e4f6 + 2a37d49 commit 320e6fc

16 files changed

+135
-32
lines changed

Libraries/GameFramework.dll

0 Bytes
Binary file not shown.

Libraries/GameFramework.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14669,6 +14669,11 @@
1466914669
获取当前是否正在播放。
1467014670
</summary>
1467114671
</member>
14672+
<member name="P:GameFramework.Sound.ISoundAgent.Length">
14673+
<summary>
14674+
获取声音长度。
14675+
</summary>
14676+
</member>
1467214677
<member name="P:GameFramework.Sound.ISoundAgent.Time">
1467314678
<summary>
1467414679
获取或设置播放位置。
@@ -14793,6 +14798,11 @@
1479314798
获取当前是否正在播放。
1479414799
</summary>
1479514800
</member>
14801+
<member name="P:GameFramework.Sound.ISoundAgentHelper.Length">
14802+
<summary>
14803+
获取声音长度。
14804+
</summary>
14805+
</member>
1479614806
<member name="P:GameFramework.Sound.ISoundAgentHelper.Time">
1479714807
<summary>
1479814808
获取或设置播放位置。
@@ -15784,6 +15794,11 @@
1578415794
获取当前是否正在播放。
1578515795
</summary>
1578615796
</member>
15797+
<member name="P:GameFramework.Sound.SoundManager.SoundAgent.Length">
15798+
<summary>
15799+
获取声音长度。
15800+
</summary>
15801+
</member>
1578715802
<member name="P:GameFramework.Sound.SoundManager.SoundAgent.Time">
1578815803
<summary>
1578915804
获取或设置播放位置。

Scripts/Editor/AssetBundleBuilder/AssetBundleBuilderController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ private byte[] GetXorBytes(byte[] bytes, byte[] code, int length)
14391439
}
14401440

14411441
byte[] result = new byte[bytesLength];
1442-
System.Buffer.BlockCopy(bytes, 0, result, 0, bytesLength);
1442+
Buffer.BlockCopy(bytes, 0, result, 0, bytesLength);
14431443

14441444
for (int i = 0; i < length; i++)
14451445
{

Scripts/Editor/AssetBundleEditor/AssetBundleEditor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -758,15 +758,15 @@ private void RefreshAssetBundleTree()
758758
AssetBundle[] assetBundles = m_Controller.GetAssetBundles();
759759
foreach (AssetBundle assetBundle in assetBundles)
760760
{
761-
string[] splitedPath = assetBundle.Name.Split('/');
761+
string[] splitPath = assetBundle.Name.Split('/');
762762
AssetBundleFolder folder = m_AssetBundleRoot;
763-
for (int i = 0; i < splitedPath.Length - 1; i++)
763+
for (int i = 0; i < splitPath.Length - 1; i++)
764764
{
765-
AssetBundleFolder subFolder = folder.GetFolder(splitedPath[i]);
766-
folder = subFolder == null ? folder.AddFolder(splitedPath[i]) : subFolder;
765+
AssetBundleFolder subFolder = folder.GetFolder(splitPath[i]);
766+
folder = subFolder == null ? folder.AddFolder(splitPath[i]) : subFolder;
767767
}
768768

769-
string assetBundleFullName = assetBundle.Variant != null ? Utility.Text.Format("{0}.{1}", splitedPath[splitedPath.Length - 1], assetBundle.Variant) : splitedPath[splitedPath.Length - 1];
769+
string assetBundleFullName = assetBundle.Variant != null ? Utility.Text.Format("{0}.{1}", splitPath[splitPath.Length - 1], assetBundle.Variant) : splitPath[splitPath.Length - 1];
770770
folder.AddItem(assetBundleFullName, assetBundle);
771771
}
772772
}

Scripts/Editor/AssetBundleEditor/AssetBundleEditorController.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -556,15 +556,15 @@ public void ScanSourceAssets()
556556
}
557557

558558
string assetPath = fullPath.Substring(SourceAssetRootPath.Length + 1);
559-
string[] splitedPath = assetPath.Split('/');
559+
string[] splitPath = assetPath.Split('/');
560560
SourceFolder folder = m_SourceAssetRoot;
561-
for (int i = 0; i < splitedPath.Length - 1; i++)
561+
for (int i = 0; i < splitPath.Length - 1; i++)
562562
{
563-
SourceFolder subFolder = folder.GetFolder(splitedPath[i]);
564-
folder = subFolder == null ? folder.AddFolder(splitedPath[i]) : subFolder;
563+
SourceFolder subFolder = folder.GetFolder(splitPath[i]);
564+
folder = subFolder == null ? folder.AddFolder(splitPath[i]) : subFolder;
565565
}
566566

567-
SourceAsset asset = folder.AddAsset(assetGuid, fullPath, splitedPath[splitedPath.Length - 1]);
567+
SourceAsset asset = folder.AddAsset(assetGuid, fullPath, splitPath[splitPath.Length - 1]);
568568
m_SourceAssets.Add(asset.Guid, asset);
569569
}
570570
}

Scripts/Runtime/Config/DefaultConfigHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ namespace UnityGameFramework.Runtime
1818
/// </summary>
1919
public class DefaultConfigHelper : ConfigHelperBase
2020
{
21-
private static readonly string[] RowSplit = new string[] { "\r\n", "\r", "\n" };
22-
private static readonly string[] ColumnSplit = new string[] { "\t" };
21+
private static readonly string[] RowSplitSeparator = new string[] { "\r\n", "\r", "\n" };
22+
private static readonly string[] ColumnSplitSeparator = new string[] { "\t" };
2323
private const int ColumnCount = 4;
2424

2525
private ResourceComponent m_ResourceComponent = null;
@@ -35,15 +35,15 @@ public override bool ParseConfig(string text, object userData)
3535
{
3636
try
3737
{
38-
string[] rowTexts = text.Split(RowSplit, StringSplitOptions.None);
38+
string[] rowTexts = text.Split(RowSplitSeparator, StringSplitOptions.None);
3939
for (int i = 0; i < rowTexts.Length; i++)
4040
{
4141
if (rowTexts[i].Length <= 0 || rowTexts[i][0] == '#')
4242
{
4343
continue;
4444
}
4545

46-
string[] splitLine = rowTexts[i].Split(ColumnSplit, StringSplitOptions.None);
46+
string[] splitLine = rowTexts[i].Split(ColumnSplitSeparator, StringSplitOptions.None);
4747
if (splitLine.Length != ColumnCount)
4848
{
4949
Log.Warning("Can not parse config '{0}'.", text);

Scripts/Runtime/Download/UnityWebRequestDownloadAgentHelper.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#else
1414
using UnityEngine.Experimental.Networking;
1515
#endif
16+
using Utility = GameFramework.Utility;
1617

1718
namespace UnityGameFramework.Runtime
1819
{
@@ -111,7 +112,7 @@ public override void Download(string downloadUri, int fromPosition, object userD
111112

112113
Dictionary<string, string> header = new Dictionary<string, string>
113114
{
114-
{ "Range", GameFramework.Utility.Text.Format("bytes={0}-", fromPosition.ToString()) }
115+
{ "Range", Utility.Text.Format("bytes={0}-", fromPosition.ToString()) }
115116
};
116117

117118
m_UnityWebRequest = UnityWebRequest.Post(downloadUri, header);
@@ -139,7 +140,7 @@ public override void Download(string downloadUri, int fromPosition, int toPositi
139140

140141
Dictionary<string, string> header = new Dictionary<string, string>
141142
{
142-
{ "Range", GameFramework.Utility.Text.Format("bytes={0}-{1}", fromPosition.ToString(), toPosition.ToString()) }
143+
{ "Range", Utility.Text.Format("bytes={0}-{1}", fromPosition.ToString(), toPosition.ToString()) }
143144
};
144145

145146
m_UnityWebRequest = UnityWebRequest.Post(downloadUri, header);

Scripts/Runtime/Entity/EntityLogic.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ public bool Visible
7070
{
7171
if (!m_Available)
7272
{
73-
throw new GameFrameworkException(Utility.Text.Format("Entity '{0}' is not available.", Name));
73+
Log.Warning("Entity '{0}' is not available.", Name);
74+
return;
7475
}
7576

7677
if (m_Visible == value)

Scripts/Runtime/Localization/DefaultLocalizationHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ namespace UnityGameFramework.Runtime
1818
/// </summary>
1919
public class DefaultLocalizationHelper : LocalizationHelperBase
2020
{
21-
private static readonly string[] RowSplit = new string[] { "\r\n", "\r", "\n" };
22-
private static readonly string[] ColumnSplit = new string[] { "\t" };
21+
private static readonly string[] RowSplitSeparator = new string[] { "\r\n", "\r", "\n" };
22+
private static readonly string[] ColumnSplitSeparator = new string[] { "\t" };
2323
private const int ColumnCount = 4;
2424

2525
private ResourceComponent m_ResourceComponent = null;
@@ -92,15 +92,15 @@ public override bool ParseDictionary(string text, object userData)
9292
{
9393
try
9494
{
95-
string[] rowTexts = text.Split(RowSplit, StringSplitOptions.None);
95+
string[] rowTexts = text.Split(RowSplitSeparator, StringSplitOptions.None);
9696
for (int i = 0; i < rowTexts.Length; i++)
9797
{
9898
if (rowTexts[i].Length <= 0 || rowTexts[i][0] == '#')
9999
{
100100
continue;
101101
}
102102

103-
string[] splitLine = rowTexts[i].Split(ColumnSplit, StringSplitOptions.None);
103+
string[] splitLine = rowTexts[i].Split(ColumnSplitSeparator, StringSplitOptions.None);
104104
if (splitLine.Length != ColumnCount)
105105
{
106106
Log.Warning("Can not parse dictionary '{0}'.", text);

Scripts/Runtime/Resource/DefaultLoadResourceAgentHelper.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using UnityEngine.Networking;
1313
#endif
1414
using UnityEngine.SceneManagement;
15+
using Utility = GameFramework.Utility;
1516

1617
namespace UnityGameFramework.Runtime
1718
{
@@ -164,7 +165,7 @@ public override void ReadBytes(string fullPath, int loadType)
164165
m_BytesFullPath = fullPath;
165166
m_LoadType = loadType;
166167
#if UNITY_5_4_OR_NEWER
167-
m_UnityWebRequest = UnityWebRequest.Get(GameFramework.Utility.Path.GetRemotePath(fullPath));
168+
m_UnityWebRequest = UnityWebRequest.Get(Utility.Path.GetRemotePath(fullPath));
168169
#if UNITY_2017_2_OR_NEWER
169170
m_UnityWebRequest.SendWebRequest();
170171
#else
@@ -344,7 +345,7 @@ private void UpdateUnityWebRequest()
344345
#else
345346
isError = m_UnityWebRequest.isError;
346347
#endif
347-
m_LoadResourceAgentHelperErrorEventHandler(this, new LoadResourceAgentHelperErrorEventArgs(LoadResourceStatus.NotExist, GameFramework.Utility.Text.Format("Can not load asset bundle '{0}' with error message '{1}'.", m_BytesFullPath, isError ? m_UnityWebRequest.error : null)));
348+
m_LoadResourceAgentHelperErrorEventHandler(this, new LoadResourceAgentHelperErrorEventArgs(LoadResourceStatus.NotExist, Utility.Text.Format("Can not load asset bundle '{0}' with error message '{1}'.", m_BytesFullPath, isError ? m_UnityWebRequest.error : null)));
348349
}
349350
}
350351
else
@@ -399,7 +400,7 @@ private void UpdateFileAssetBundleCreateRequest()
399400
}
400401
else
401402
{
402-
m_LoadResourceAgentHelperErrorEventHandler(this, new LoadResourceAgentHelperErrorEventArgs(LoadResourceStatus.NotExist, GameFramework.Utility.Text.Format("Can not load asset bundle from file '{0}' which is not a valid asset bundle.", m_FileFullPath)));
403+
m_LoadResourceAgentHelperErrorEventHandler(this, new LoadResourceAgentHelperErrorEventArgs(LoadResourceStatus.NotExist, Utility.Text.Format("Can not load asset bundle from file '{0}' which is not a valid asset bundle.", m_FileFullPath)));
403404
}
404405
}
405406
else
@@ -451,7 +452,7 @@ private void UpdateAssetBundleRequest()
451452
}
452453
else
453454
{
454-
m_LoadResourceAgentHelperErrorEventHandler(this, new LoadResourceAgentHelperErrorEventArgs(LoadResourceStatus.ChildAssetError, GameFramework.Utility.Text.Format("Can not load asset '{0}' from asset bundle which is not exist.", m_ResourceChildName)));
455+
m_LoadResourceAgentHelperErrorEventHandler(this, new LoadResourceAgentHelperErrorEventArgs(LoadResourceStatus.ChildAssetError, Utility.Text.Format("Can not load asset '{0}' from asset bundle which is not exist.", m_ResourceChildName)));
455456
}
456457
}
457458
else
@@ -475,7 +476,7 @@ private void UpdateAsyncOperation()
475476
}
476477
else
477478
{
478-
m_LoadResourceAgentHelperErrorEventHandler(this, new LoadResourceAgentHelperErrorEventArgs(LoadResourceStatus.SceneAssetError, GameFramework.Utility.Text.Format("Can not load scene asset '{0}' from asset bundle.", m_ResourceChildName)));
479+
m_LoadResourceAgentHelperErrorEventHandler(this, new LoadResourceAgentHelperErrorEventArgs(LoadResourceStatus.SceneAssetError, Utility.Text.Format("Can not load scene asset '{0}' from asset bundle.", m_ResourceChildName)));
479480
}
480481
}
481482
else

0 commit comments

Comments
 (0)