disallow_multiple¶
function in InfEngine.components
Description¶
Prevent multiple instances of this component on a GameObject.
Usable with or without parentheses::
@disallow_multiple
class MySingleton(InfComponent): ...
@disallow_multiple()
class MySingleton(InfComponent): ...
description
Prevents more than one instance of this component type from being attached to the same GameObject. The engine will refuse to add a duplicate and log a warning.
Equivalent to Unity's [DisallowMultipleComponent] attribute. Can be used with or without parentheses.
Example¶
example