本文整理汇总了C#中Enemy.SetTexture方法的典型用法代码示例。如果您正苦于以下问题:C# Enemy.SetTexture方法的具体用法?C# Enemy.SetTexture怎么用?C# Enemy.SetTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Enemy
的用法示例。
在下文中一共展示了Enemy.SetTexture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeParts
public void InitializeParts()
{
mainEmitter = new BulletEmitter(this, Origin, false);
mainEmitter.LockedToParentPosition = true;
mainEmitter.LockPositionOffset = Vector2.Zero;
ring1 = new Enemy(thisScene, Origin);
ring1.Initialize();
ring1.DeletionBoundary = DeletionBoundary;
ring1.DrawAtTrueRotation = true;
ring1.Color = Color.White;
ring1.Origin = Origin;
ring1.SetParent(this);
ring1.SetTexture(boss5Ring1Texture);
ring1.LockedToParentPosition = true;
ring1.Center = this.Center;
ring1.DrawLayer = .32f;
ring2 = new Enemy(thisScene, Origin);
ring2.Initialize();
ring2.DeletionBoundary = DeletionBoundary;
ring2.DrawAtTrueRotation = true;
ring2.Color = Color.White;
ring2.Origin = Origin;
ring2.SetParent(this);
ring2.SetTexture(boss5Ring2Texture);
ring2.LockedToParentPosition = true;
ring2.Center = this.Center;
ring2.DrawLayer = .31f;
ring1Emitters = new List<BulletEmitter>()
{
new BulletEmitter(ring1, new Vector2(130, 175)),
new BulletEmitter(ring1, new Vector2(130, 294)),
new BulletEmitter(ring1, new Vector2(381, 175)),
new BulletEmitter(ring1, new Vector2(381, 294))
};
ring2Emitters = new List<BulletEmitter>()
{
new BulletEmitter(ring2, new Vector2(195, 110)),
new BulletEmitter(ring2, new Vector2(117, 234.5f)),
new BulletEmitter(ring2, new Vector2(195, 359)),
new BulletEmitter(ring2, new Vector2(316, 110)),
new BulletEmitter(ring2, new Vector2(394, 234.5f)),
new BulletEmitter(ring2, new Vector2(316, 359))
};
// Setup the ring emitter properties.
foreach (BulletEmitter be in ring1Emitters)
{
be.Center = Center + (be.Center - Origin);
be.DeletionBoundary = new Vector2(99999, 99999);
be.CustomValue1 = Vector2.Distance(Center, be.Center);
be.Rotation = VectorMathHelper.GetAngleTo(Center, be.Center);
}
// Setup the ring emitter properties.
foreach (BulletEmitter be in ring2Emitters)
{
be.Center = Center + (be.Center - Origin);
be.DeletionBoundary = new Vector2(99999, 99999);
be.CustomValue1 = Vector2.Distance(Center, be.Center);
be.Rotation = VectorMathHelper.GetAngleTo(Center, be.Center);
}
topLayer = new Enemy(thisScene, Origin);
topLayer.Initialize();
topLayer.DeletionBoundary = DeletionBoundary;
topLayer.Color = Color.White;
topLayer.Origin = Origin;
topLayer.SetTexture(boss5TopTexture);
topLayer.SetParent(this);
topLayer.LockedToParentPosition = true;
topLayer.Center = this.Center;
topLayer.DrawLayer = .3f;
rotatingBullets = new List<Bullet>();
}