You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1017 B
35 lines
1017 B
9 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using UnityEditor;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace UnityTest
|
||
|
{
|
||
|
public class GroupByGoRenderer : AssertionListRenderer<GameObject>
|
||
|
{
|
||
|
protected override IEnumerable<IGrouping<GameObject, AssertionComponent>> GroupResult(IEnumerable<AssertionComponent> assertionComponents)
|
||
|
{
|
||
|
return assertionComponents.GroupBy(c => c.gameObject);
|
||
|
}
|
||
|
|
||
|
protected override bool PrintFoldout(bool isFolded, GameObject key)
|
||
|
{
|
||
|
isFolded = base.PrintFoldout(isFolded,
|
||
|
key);
|
||
|
|
||
|
EditorGUILayout.ObjectField(key,
|
||
|
typeof(GameObject),
|
||
|
true,
|
||
|
GUILayout.ExpandWidth(false));
|
||
|
|
||
|
return isFolded;
|
||
|
}
|
||
|
|
||
|
protected override string GetFoldoutDisplayName(GameObject key)
|
||
|
{
|
||
|
return key.name;
|
||
|
}
|
||
|
}
|
||
|
}
|