Pardon our dust! Docs for Yarn Spinner for Unity 3.2 and Yarn Spinner for Godot C# are on docs.yarnspinner.dev (the old docs site). Docs for Yarn Spinner for Unity 3.3 (pre-release, out ASAP), Yarn Spinner for Godot GDScript and Yarn Spinner for Unreal Engine (work in progress) are on /docs/ (the new docs site).

InterfaceContainer<TContainedType>

This type exists to allow connecting up interfaces into objects via the inspector.
public class InterfaceContainer<TContainedType> : ISerializationCallbackReceiver where TContainedType : class

Inherits from ISerializationCallbackReceiver

Type Parameters

  • TContainedType
    The interface type to be contained, it must be a unity object.
This is a convenience mechanism because there is no practical way to serialise an interface in Unity. Your interfaces do still need to be something that is a subclass of UnityEngine.Object for it to be serialisable using this wrapper. Essentially this is just a wrapper around a monobehaviour but allows you to think only in the terms of the interface. Which is generally more useful and helpful.

#Fields

#targetObject

public UnityEngine.Object? targetObject;

Type Nullable

#Properties

#Interface

public TContainedType? Interface { get; }

Type TContainedType

#Methods

#OnAfterDeserialize()

public void OnAfterDeserialize()

#OnBeforeSerialize()

public void OnBeforeSerialize()

Generated from Yarn Spinner for Unity 3.3.