KMDelegateInfo - Qkrisi/ktanemodkit GitHub Wiki

KMDelegateInfo

[AddComponentMenu("")]
public sealed class KMDelegateInfo : MonoBehaviour, ISerializationCallbackReceiver

Added to game objects with components that have KM delegates in order to preserve which functions should be registered ingame (delegates are set in Awake).

This component is handled by the modkit, it's not meant to be added to game objects by the modder.


public const BindingFlags FLAGS;

Binding flags used to list/set delegates and methods.


public const string SpecialPostfix;

Postfix used after method names to indicate it having a caller parameter (*).


public List<DelegateInfo> DelegateInfos;

The list of methods to be assigned to certain delegates.


[HideInInspector] public bool AllowUnityComponents;

Unity/KMFramework components filter


[HideInInspector] public bool AllowInheriteds;

Inherited methods filter


[HideInInspector] public bool AllowCompilerGenerateds;

Compiler generated/special methods filter


public void OnBeforeSerialize()

Serialize DelegateInfos in order to pass its values to the game.


public void OnAfterDeserialize()

Deserialize the got information into DelegateInfos (only in the game)


KMDelegateInfo.DelegateInfo

[Serializable]
public class DelegateInfo

The class holding information about delegates and methods to be set ingame.


public GameObject SourceGameObject;

The game object containing the component that contains the method to be assigned to the delegate.


public Component SourceComponent;

The component that contains the method to be assigned to the delegate.


public string MethodName;

The name of the method to be assigned to the delegate. (+SpecialPostfix if has a caller parameter)


public Component DestinationComponent;

The component containing the delegate field the method should be registered to.


public string DelegateName;

The name of the delegate field the method should be registered to.


public bool UseReturnValue;

Indicates whether the returned value of the method should be the returned value of the delegate or not.


public int Index;

Index used by the editor for ordering.