説明
The IsClassDerivedFrom Lua function returns a boolean indicating if a class is derived from a different class.
引数
- string:
This string needs to be the name of the class that might be derived from a different class.
- String:
This string needs to be the name of the class that might be the base class.
戻り値
- boolean:
The returned boolean indicates if the class is derived from the base class.
例
This example checks if a class is derived from a different class and returns useful feedback.
|
return function() local derivedName = "World" local baseName = "Group" local isDerived = IsClassDerivedFrom(derivedName, baseName) if isDerived then Printf(derivedName .. " is derived from " .. baseName) else Printf(derivedName .. " is not derived from " .. baseName) end end |