mirror of
https://github.com/celisej567/gm_construct_port.git
synced 2026-09-19 20:11:46 +03:00
Add files via upload
This commit is contained in:
31
code/Carriable.cs
Normal file
31
code/Carriable.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Sandbox;
|
||||
|
||||
public partial class Carriable : BaseCarriable, IUse
|
||||
{
|
||||
public override void CreateViewModel()
|
||||
{
|
||||
Host.AssertClient();
|
||||
|
||||
if ( string.IsNullOrEmpty( ViewModelPath ) )
|
||||
return;
|
||||
|
||||
ViewModelEntity = new ViewModel
|
||||
{
|
||||
Position = Position,
|
||||
Owner = Owner,
|
||||
EnableViewmodelRendering = true
|
||||
};
|
||||
|
||||
ViewModelEntity.SetModel( ViewModelPath );
|
||||
}
|
||||
|
||||
public bool OnUse( Entity user )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool IsUsable( Entity user )
|
||||
{
|
||||
return Owner == null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user