Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
GD0102: Il tipo di membro esportato non è supportato
ID regola |
GD0102 |
Categoria |
Utilizzo |
Soluzione è distruttiva o non-distruttiva |
Distruttiva - Se il tipo del membro viene cambiato Non-distruttiva - Se l'attributo |
Abilitato per predefinito |
Si |
Causa
È specificato un tipo non supportato per un membro annotato con l'attributo [Export] quando è previsto un tipo compatibile con Variant.
Descrizione della regola
Every exported member must be Variant-compatible so it can be marshalled by the engine.
class SomeType { }
// SomeType is not a valid member type because it doesn't derive from GodotObject,
// so it's not compatible with Variant.
[Export]
public SomeType InvalidProperty { get; set; }
// System.Int32 is a valid type because it's compatible with Variant.
[Export]
public int ValidProperty { get; set; }
Come risolvere le violazioni
Per correggere una violazione di questa regola, cambiare il tipo del membro in modo che sia compatibile con Variant oppure rimuovere l'attributo [Export].
Quando sopprimere gli avvertimenti
Non sopprimere un avviso da questa regola. I membri con tipi che non è possibile convertire e serializzare causeranno errori in fase di esecuzione.