Icon

Applies to: classes

Namespace:

namespace Lenga\Engine\Attributes;

Sets a custom icon for a Behaviour class in the editor. The icon is displayed next to the component's name in the Inspector and the scene hierarchy.

Parameters

Parameter Type Description
$iconPath string Path to the icon file, relative to the project's Assets/ folder.

Example

use Lenga\Engine\Attributes\Icon;
use Lenga\Engine\Core\Behaviour;

#[Icon('Icons/enemy-icon.png')]
class Enemy extends Behaviour
{
    public int $health = 50;

    public function update(): void
    {
        // enemy logic...
    }
}