feat(scripting): add script add-component api
This commit is contained in:
@@ -34,6 +34,11 @@ namespace XCEngine
|
||||
return GameObject.GetComponent<T>();
|
||||
}
|
||||
|
||||
public T AddComponent<T>() where T : Component
|
||||
{
|
||||
return GameObject.AddComponent<T>();
|
||||
}
|
||||
|
||||
public bool TryGetComponent<T>(out T component) where T : Component
|
||||
{
|
||||
component = GetComponent<T>();
|
||||
|
||||
Reference in New Issue
Block a user