浏览代码

Fixed Performance issue in GameplayIngredientsSettings when having a big list of Excluded managers

/main
Thomas ICHÉ 5 年前
当前提交
10492027
共有 3 个文件被更改,包括 23 次插入11 次删除
  1. 1
      CHANGELOG.md
  2. 31
      Editor/PropertyDrawers/TypeDropDownPropertyDrawer.cs
  3. 2
      Runtime/Settings/GameplayIngredientsSettings.cs

1
CHANGELOG.md


#### Fixed
* Fixed LinkGameView not working in play mode when excluding VirtualCameraManager.
* Fixed Performance issue in GameplayIngredientsSettings when having a big list of Excluded managers.
## 2019.1.2

31
Editor/PropertyDrawers/TypeDropDownPropertyDrawer.cs


{
Dictionary<string, List<string>> m_AssignableTypeNames;
Type type;
Type type = ((TypeDropDownAttribute)attribute).m_BaseType;
if(type == null)
type = ((TypeDropDownAttribute)attribute).m_BaseType;
EditorGUI.BeginChangeCheck();
if(GUI.changed && index != newVal)
if(EditorGUI.EndChangeCheck() && index != newVal)
{
property.stringValue = m_AssignableTypeNames[TypeName][newVal];
}

{
if (m_AssignableTypeNames == null)
{
string key = baseType.FullName;
string key = baseType.FullName;
if (!m_AssignableTypeNames.ContainsKey(key))
m_AssignableTypeNames.Add(key, new List<string>());
if (!m_AssignableTypeNames.ContainsKey(key))
m_AssignableTypeNames.Add(key, new List<string>());
foreach(var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
foreach(var type in assembly.GetTypes())
foreach(var assembly in AppDomain.CurrentDomain.GetAssemblies())
if(baseType.IsAssignableFrom(type) && !type.IsAbstract)
foreach(var type in assembly.GetTypes())
m_AssignableTypeNames[key].Add(type.Name);
if(baseType.IsAssignableFrom(type) && !type.IsAbstract)
{
m_AssignableTypeNames[key].Add(type.Name);
}
}
}
}

2
Runtime/Settings/GameplayIngredientsSettings.cs


[BoxGroup("Callables")]
[SerializeField, InfoBox("Verbose Calls enable logging at runtime, this can lead to performance drop, use only when debugging.", InfoBoxType.Warning, "m_VerboseCalls")]
private bool m_VerboseCalls = false;
[BoxGroup("Callables")]
[SerializeField, InfoBox("Per-update calls should be avoided due to high performance impact. Enable and use with care, only if strictly necessary.", InfoBoxType.Warning, "m_AllowUpdateCalls")]
private bool m_AllowUpdateCalls = false;

正在加载...
取消
保存