浏览代码

Fixes for ReorderableLists + Streaming null sceneToActivate

/main
Thomas ICHÉ 5 年前
当前提交
2b4016db
共有 2 个文件被更改,包括 11 次插入4 次删除
  1. 13
      NaughtyAttributes/Editor/PropertyDrawers/ReorderableListPropertyDrawer.cs
  2. 2
      Runtime/Managers/Implementations/LevelStreamingManager.cs

13
NaughtyAttributes/Editor/PropertyDrawers/ReorderableListPropertyDrawer.cs


{
private Dictionary<string, ReorderableList> reorderableListsByPropertyName = new Dictionary<string, ReorderableList>();
string GetPropertyKeyName(SerializedProperty property)
{
return property.serializedObject.targetObject.GetInstanceID() + "/" + property.name;
}
public override void DrawProperty(SerializedProperty property)
{
EditorDrawUtility.DrawHeader(property);

if (!this.reorderableListsByPropertyName.ContainsKey(property.name))
var key = GetPropertyKeyName(property);
if (!this.reorderableListsByPropertyName.ContainsKey(key))
{
ReorderableList reorderableList = new ReorderableList(property.serializedObject, property, true, true, true, true)
{

}
};
this.reorderableListsByPropertyName[property.name] = reorderableList;
this.reorderableListsByPropertyName[key] = reorderableList;
this.reorderableListsByPropertyName[property.name].DoLayoutList();
this.reorderableListsByPropertyName[key].DoLayoutList();
}
else
{

2
Runtime/Managers/Implementations/LevelStreamingManager.cs


yield return new WaitForEndOfFrame();
// Then change active scene
if (sceneToActivate != "")
if (!string.IsNullOrEmpty(sceneToActivate) )
{
var newActive = SceneManager.GetSceneByName(sceneToActivate);
SceneManager.SetActiveScene(newActive);

正在加载...
取消
保存