本文整理汇总了C#中Static.Bounce方法的典型用法代码示例。如果您正苦于以下问题:C# Static.Bounce方法的具体用法?C# Static.Bounce怎么用?C# Static.Bounce使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Static
的用法示例。
在下文中一共展示了Static.Bounce方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override void Execute( CommandEventArgs args, object o )
{
if( o is AddonComponent )
{
BaseAddon addon = ((AddonComponent)o).Addon;
if( addon.Components.Count > 0 )
{
for( int i = 0; i < addon.Components.Count; i++ )
{
AddonComponent component = addon.Components[i];
Static newStatic = new Static( component.ItemID );
newStatic.Hue = component.Hue;
newStatic.Name = component.Name;
newStatic.MoveToWorld( new Point3D( component.Location ), component.Map );
}
}
addon.Delete();
AddResponse( "The add-on has been converted to static objects." );
}
else if( o is Item && !(o is Static) )
{
Item i = (Item)o;
Static newItem = new Static( i.ItemID );
newItem.Hue = i.Hue;
newItem.Layer = i.Layer;
newItem.Light = i.Light;
newItem.Name = i.Name;
newItem.MoveToWorld( new Point3D( i.Location ), i.Map );
if( i.Parent == args.Mobile )
newItem.Bounce( args.Mobile );
if( i is Container )
((Container)i).Destroy();
else
i.Delete();
AddResponse( "The item has been converted to a static." );
}
else
{
LogFailure( "This command only works with non-static items or add-ons." );
}
}