Getting supply drop in OnEntitySpawned?

Hello, I would like to ask you for a help.

I need to get CargoPlane itemcontainer(airdrop) entity in 

void OnEntitySpawned(BaseEntity entity)
{

}
method. Thanks in advance.

Hey!
Try using
var cargo = entity as CargoShip;
if (cargo == null)
    return;

// TODO​
Not that but airdrop as entity you know airdrop container
Oh, sorry. Try using
entity as SupplyDrop;​
instead of entity as CargoShip. I think you can access .inventory there
I mean how to get supplydrop that is dropped in 
void OnEntitySpawned(BaseEntity entity)
{

}

 

Merged post

i have got something like this but it isnt working 
void OnEntitySpawned(BaseEntity entity)
{
if (entity is CargoPlane)
{
var plane = entity.GetComponent<CargoPlane>();
var ent = plane.GetComponentInParent<SupplyDrop>();
var location = plane.dropPosition;
BaseEntity marker = addMarker("Air-drop", location);
planes.Add(marker, ent);
}
}