Skip to content

Commit

Permalink
Add UPlayer.AddComponent & UPlayer.GetComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardosnt committed Feb 4, 2016
1 parent db3f040 commit e521bde
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Api/Unturned/UPlayer.cs
Expand Up @@ -312,6 +312,26 @@ public override int GetHashCode()
return RocketPlayer.GetHashCode();
}

public T AddComponent<T>() where T : Component
{
return UnturnedPlayer.gameObject.AddComponent<T>();
}

public Component AddComponent( Type componentType )
{
return UnturnedPlayer.gameObject.AddComponent( componentType );
}

public T GetComponent<T>() where T : Component
{
return UnturnedPlayer.gameObject.GetComponent<T>();
}

public Component GetComponent( Type componentType )
{
return UnturnedPlayer.gameObject.GetComponent( componentType );
}

public static UPlayer From( UnturnedPlayer player )
{
return player == null
Expand Down

0 comments on commit e521bde

Please sign in to comment.