Skip to content

Commit 4e9a5af

Browse files
committed
Use a more descriptive type variable name in InterfaceContainer
1 parent 82921ad commit 4e9a5af

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Runtime/Utility/InterfaceContainer.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
namespace Yarn.Unity
77
{
88
[System.Serializable]
9-
public class InterfaceContainer<I> : ISerializationCallbackReceiver where I : class
9+
public class InterfaceContainer<TContainedType> : ISerializationCallbackReceiver where TContainedType : class
1010
{
1111
public UnityEngine.Object? targetObject;
12-
public I? Interface
12+
public TContainedType? Interface
1313
{
1414
get
1515
{
16-
return targetObject as I;
16+
return targetObject as TContainedType;
1717
}
1818
}
1919

20-
public static implicit operator I?(InterfaceContainer<I> value)
20+
public static implicit operator TContainedType?(InterfaceContainer<TContainedType> value)
2121
{
2222
return value.Interface;
2323
}
@@ -26,13 +26,13 @@ public I? Interface
2626
// and otherwise we null it out, also wiping the connection in the inspector
2727
void OnValidate()
2828
{
29-
if (!targetObject is I)
29+
if (!targetObject is TContainedType)
3030
{
3131
if (targetObject is GameObject gameObject)
3232
{
3333
foreach (var component in gameObject.GetComponents<Component>())
3434
{
35-
if (component is I)
35+
if (component is TContainedType)
3636
{
3737
targetObject = component;
3838
return;
@@ -71,4 +71,4 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
7171
EditorGUI.ObjectField(position, targetProp, new UnityEngine.GUIContent(property.displayName));
7272
}
7373
}
74-
}
74+
}

0 commit comments

Comments
 (0)