NativeComponent

Namespace:

namespace Lenga\Engine\Core;

class NativeComponent

Example

use Lenga\Engine\Core\Behaviour;
use Lenga\Engine\Core\NativeComponent;

class CustomComponentUser extends Behaviour
{
    public function start(): void
    {
        // Get a native component attached to this GameObject
        // This is typically done through getComponent() with the appropriate class name
        $nativeComp = $this->getComponent(NativeComponent::class);

        if ($nativeComp !== null) {
            Debug::log('Found native component');
        }
    }
}