Class TimbnFrameworkPlugin<T>
Base class for a Timbn plugin. Pass your plugin type as T to give it its own static Logger, Enabled entry, and Instance.
[SuppressMessage("BepInEx", "BepInEx001:BaseUnityPlugin should have a BepInPlugin attribute", Justification = "Abstract base; concrete plugins carry [BepInPlugin]")]
public abstract class TimbnFrameworkPlugin<T> : TimbnFrameworkPlugin where T : TimbnFrameworkPlugin<T>
Type Parameters
T
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourBaseUnityPluginTimbnFrameworkPlugin<T>
- Derived
- Inherited Members
-
BaseUnityPlugin.InfoBaseUnityPlugin.ConfigMonoBehaviour.m_CancellationTokenSourceMonoBehaviour.RaiseCancellation()MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.Internal_CancelInvokeAll(MonoBehaviour)MonoBehaviour.Internal_IsInvokingAll(MonoBehaviour)MonoBehaviour.IsObjectMonoBehaviour(Object)MonoBehaviour.StopCoroutineManaged(Coroutine)MonoBehaviour.GetScriptClassName()MonoBehaviour.OnCancellationTokenCreated()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.kInstanceID_NoneObject.m_CachedPtrObject.OffsetOfInstanceIDInCPlusPlusObjectObject.objectIsNullMessageObject.cloneDestroyedMessageObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.CompareBaseObjects(Object, Object)Object.EnsureRunningOnMainThread()Object.IsNativeObjectAlive(Object)Object.GetCachedPtr()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.ToString()Object.GetOffsetOfInstanceIDInCPlusPlusObject()Object.CurrentThreadIsMainThread()Object.Internal_CloneSingle(Object)Object.Internal_CloneSingleWithScene(Object, Scene)Object.Internal_CloneSingleWithParams(Object, InstantiateParameters)Object.Internal_InstantiateSingleWithParams(Object, Vector3, Quaternion, InstantiateParameters)Object.Internal_InstantiateSingle(Object, Vector3, Quaternion)Object.Internal_InstantiateSingleWithParent(Object, Transform, Vector3, Quaternion)Object.ToString(Object)Object.GetName()Object.IsPersistent(Object)Object.DoesObjectWithInstanceIDExist(EntityId)Object.FindObjectFromInstanceID(EntityId)Object.ForceLoadFromInstanceID(EntityId)Object.MarkDirty()Object.DoesObjectWithInstanceIDExist_Injected(ref EntityId)Object.FindObjectFromInstanceID_Injected(ref EntityId)Object.ForceLoadFromInstanceID_Injected(ref EntityId)Object.nameObject.hideFlags
Constructors
TimbnFrameworkPlugin()
protected TimbnFrameworkPlugin()
Properties
Enabled
The plugin's General/Enabled toggle. Null until the plugin has started.
public static ConfigEntry<bool> Enabled { get; }
Property Value
- ConfigEntry<bool>
Instance
The running plugin, or null while it is not running. This is how a Harmony patch, which has to be static, reaches the plugin's state without a static of its own, and it is cleared when the plugin unloads so a hot reload never leaves a patch talking to the old copy.
public static T? Instance { get; }
Property Value
- T
Examples
private static void GetDropPosPostFix(WgoData __instance, ref Vector3 __result)
{
if (Plugin.Instance?.Dismantle.TryGetDropPosition(__instance, out var position) == true)
__result = position;
}
IsEnabled
Whether the plugin's own Enabled toggle and Core's are both on. Check it in a patch or a static helper that has to stand down the moment a player turns the plugin off in a config manager. For one feature's toggle, see the plugin's Settings.IsEnabled.
public static bool IsEnabled { get; }
Property Value
Logger
The plugin's log source, writing under the plugin's name. It hides the BepInEx instance Logger so a static Harmony patch or helper can log the same way the plugin does.
public static ManualLogSource Logger { get; }
Property Value
- ManualLogSource