Skip to content

Commit

Permalink
修改所有的foreach为for
Browse files Browse the repository at this point in the history
  • Loading branch information
sheenli committed Oct 22, 2019
1 parent 223c468 commit ddf79f9
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 13 deletions.
5 changes: 3 additions & 2 deletions Assets/Example/ExampleVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ private void Start()
{
var ver = new YKFramwork.ResMgr.VersionCtrl.Version(wepop.webRequest.downloadHandler.data);
Debug.Log(ver.version);
foreach (var abInfo in ver.AllAB)
for (var index = 0; index < ver.AllAB.Count; index++)
{
Debug.Log("name:"+abInfo.name+"/sha1:"+abInfo.sha1+"/size:"+abInfo.size);
var abInfo = ver.AllAB[index];
Debug.Log("name:" + abInfo.name + "/sha1:" + abInfo.sha1 + "/size:" + abInfo.size);
}
}
};
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scenes/SampleScene.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Assets/Scenes/SampleScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RenderSettings:
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
Expand Down Expand Up @@ -96,7 +96,8 @@ LightmapSettings:
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_ExportTrainingData: 0
m_LightingDataAsset: {fileID: 0}
m_LightingDataAsset: {fileID: 112000000, guid: 97ea5493731937a499e346f9874fb10f,
type: 2}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
Expand Down
Binary file added Assets/Scenes/SampleScene/LightingData.asset
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/Scenes/SampleScene/LightingData.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Scenes/SampleScene/ReflectionProbe-0.exr
Binary file not shown.
90 changes: 90 additions & 0 deletions Assets/Scenes/SampleScene/ReflectionProbe-0.exr.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions Assets/YKFramwork/ResMgr/Scripts/Data/RrsCfgData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ public class ResJsonData
public bool HasGroup(string groupName)
{
string[] strs = GetAllGroupNames();
foreach (string name in strs)
for (var index = 0; index < strs.Length; index++)
{
string name = strs[index];
if (name == groupName)
{
return true;
Expand All @@ -111,8 +112,9 @@ public bool HasGroup(string groupName)

public ResGroupCfg GetGroupInfo(string groupName)
{
foreach (ResGroupCfg scene in groups)
for (var index = 0; index < groups.Count; index++)
{
ResGroupCfg scene = groups[index];
if (groupName == scene.groupName)
{
return scene;
Expand All @@ -129,8 +131,9 @@ public ResGroupCfg GetGroupInfo(string groupName)
public string[] GetAllGroupNames()
{
List<string> list = new List<string>();
foreach (ResGroupCfg scene in groups)
for (var index = 0; index < groups.Count; index++)
{
ResGroupCfg scene = groups[index];
list.Add(scene.groupName);
}

Expand All @@ -147,8 +150,9 @@ public string[] GetAssetsNames(string groupName)
List<string> list = new List<string>();
if (!string.IsNullOrEmpty(groupName))
{
foreach (ResGroupCfg scene in groups)
for (var index = 0; index < groups.Count; index++)
{
ResGroupCfg scene = groups[index];
if (scene.groupName == groupName)
{
return scene.keys.ToArray();
Expand Down
4 changes: 3 additions & 1 deletion Assets/YKFramwork/ResMgr/Scripts/LoadRes/LoadGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,12 @@ private void LoadAsseted(UnityEngine.Object asset)

private void Finished()
{
foreach (var abname in allLoadABs)
for (var index = 0; index < allLoadABs.Count; index++)
{
var abname = allLoadABs[index];
ResMgr.Instance.ABMgr.Release(abname);
}

if(OnCompleted != null)
OnCompleted(this.mGroupName);
}
Expand Down
8 changes: 6 additions & 2 deletions Assets/YKFramwork/ResMgr/Scripts/LoadRes/ResMgr.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
Expand Down Expand Up @@ -275,17 +276,20 @@ public void Release(string addr, bool force = false)
public void UnloadUnused()
{
var list = new List<string>();
foreach (var addr in mAllRes.Keys)
var keys = mAllRes.Keys.ToList();
for (var index = 0; index < keys.Count; index++)
{
var addr = keys[index];
var info = cfg.ResData.GetResInfo(addr);
if (!info.isKeepInMemory)
{
list.Add(addr);
}
}

foreach (var addr in list)
for (var index = 0; index < list.Count; index++)
{
var addr = list[index];
mAllRes.Remove(addr);
}

Expand Down
16 changes: 14 additions & 2 deletions ProjectSettings/QualitySettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
QualitySettings:
m_ObjectHideFlags: 0
serializedVersion: 5
m_CurrentQuality: 5
m_CurrentQuality: 4
m_QualitySettings:
- serializedVersion: 2
name: Very Low
Expand Down Expand Up @@ -216,4 +216,16 @@ QualitySettings:
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
m_PerPlatformDefaultQuality: {}
m_PerPlatformDefaultQuality:
Android: 2
Lumin: 5
Nintendo 3DS: 5
Nintendo Switch: 5
PS4: 5
PSP2: 2
Standalone: 4
WebGL: 3
Windows Store Apps: 5
XboxOne: 5
iPhone: 2
tvOS: 2

0 comments on commit ddf79f9

Please sign in to comment.