本文整理汇总了C#中ResourceManager.GetRoomTexture方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceManager.GetRoomTexture方法的具体用法?C# ResourceManager.GetRoomTexture怎么用?C# ResourceManager.GetRoomTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResourceManager
的用法示例。
在下文中一共展示了ResourceManager.GetRoomTexture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResolveResources
public void ResolveResources(ResourceManager M59ResourceManager, bool RaiseChangedEvent)
{
ushort group = (animation != null) ? animation.CurrentGroup : (ushort)1;
int frameidx = 0;
/******************************************************************************/
if (UpperTexture > 0)
ResourceUpper = M59ResourceManager.GetRoomTexture(UpperTexture);
if (MiddleTexture > 0)
ResourceMiddle = M59ResourceManager.GetRoomTexture(MiddleTexture);
if (LowerTexture > 0)
ResourceLower = M59ResourceManager.GetRoomTexture(LowerTexture);
/******************************************************************************/
if (animation != null)
{
// note: possibly need animation instance for each parttype?
if (ResourceMiddle != null)
animation.GroupMax = ResourceMiddle.FrameSets.Count;
/*else if (ResourceLower != null)
animation.GroupMax = ResourceLower.FrameSets.Count;
else if (ResourceUpper != null)
animation.GroupMax = ResourceUpper.FrameSets.Count;*/
}
/******************************************************************************/
if (ResourceUpper != null && ResourceUpper.Frames.Count > 0)
{
frameidx = ResourceUpper.GetFrameIndex(group, 0);
frameidx = Math.Max(frameidx, 0);
if (ResourceUpper.Frames.Count > frameidx)
{
TextureUpper = ResourceUpper.Frames[frameidx];
SpeedUpper = GetWallScrollSpeed(TextureUpper.Width, TextureUpper.Height);
}
else
{
TextureUpper = null;
SpeedUpper = V2.ZERO;
}
TextureNameUpper = RooFile.GetNameForTexture(
ResourceUpper, frameidx);
MaterialNameUpper = RooFile.GetNameForMaterial(
ResourceUpper, frameidx, SpeedUpper);
}
else
{
TextureUpper = null;
SpeedUpper = V2.ZERO;
TextureNameUpper = null;
MaterialNameUpper = null;
}
/******************************************************************************/
if (ResourceMiddle != null && ResourceMiddle.Frames.Count > 0)
{
frameidx = ResourceMiddle.GetFrameIndex(group, 0);
frameidx = Math.Max(frameidx, 0);
if (ResourceMiddle.Frames.Count > frameidx)
{
TextureMiddle = ResourceMiddle.Frames[frameidx];
SpeedMiddle = GetWallScrollSpeed(TextureMiddle.Width, TextureMiddle.Height);
}
else
{
TextureMiddle = null;
SpeedMiddle = V2.ZERO;
}
TextureNameMiddle = RooFile.GetNameForTexture(
ResourceMiddle, frameidx);
MaterialNameMiddle = RooFile.GetNameForMaterial(
ResourceMiddle, frameidx, SpeedMiddle);
}
else
{
TextureMiddle = null;
SpeedMiddle = V2.ZERO;
TextureNameMiddle = null;
MaterialNameMiddle = null;
}
/******************************************************************************/
if (ResourceLower != null && ResourceLower.Frames.Count > 0)
{
//.........这里部分代码省略.........
示例2: ResolveResources
/// <summary>
/// Gets references to used textures from a resource manager.
/// </summary>
/// <param name="M59ResourceManager"></param>
/// <param name="RaiseChangedEvent"></param>
public void ResolveResources(ResourceManager M59ResourceManager, bool RaiseChangedEvent)
{
// floor
if (FloorTexture > 0)
{
ResourceFloor = M59ResourceManager.GetRoomTexture(FloorTexture);
if (ResourceFloor != null && ResourceFloor.Frames.Count > 0)
{
TextureFloor = ResourceFloor.Frames[0];
SpeedFloor = GetSectorScrollSpeed(true, TextureFloor.Width, TextureFloor.Height);
TextureNameFloor = RooFile.GetNameForTexture(
ResourceFloor, 0);
MaterialNameFloor = RooFile.GetNameForMaterial(
ResourceFloor, 0, SpeedFloor);
}
else
{
TextureFloor = null;
TextureNameFloor = null;
MaterialNameFloor = null;
SpeedFloor = V2.ZERO;
}
}
else
{
TextureFloor = null;
TextureNameFloor = null;
MaterialNameFloor = null;
SpeedFloor = V2.ZERO;
}
// ceiling
if (CeilingTexture > 0)
{
ResourceCeiling = M59ResourceManager.GetRoomTexture(CeilingTexture);
if (ResourceCeiling != null && ResourceCeiling.Frames.Count > 0)
{
TextureCeiling = ResourceCeiling.Frames[0];
SpeedCeiling = GetSectorScrollSpeed(false, TextureCeiling.Width, TextureCeiling.Height);
TextureNameCeiling = RooFile.GetNameForTexture(
ResourceCeiling, 0);
MaterialNameCeiling = RooFile.GetNameForMaterial(
ResourceCeiling, 0, SpeedCeiling);
}
else
{
TextureCeiling = null;
TextureNameCeiling = null;
MaterialNameCeiling = null;
SpeedCeiling = V2.ZERO;
}
}
else
{
TextureCeiling = null;
TextureNameCeiling = null;
MaterialNameCeiling = null;
SpeedCeiling = V2.ZERO;
}
}