本文整理匯總了C#中System.Objects.Initialize方法的典型用法代碼示例。如果您正苦於以下問題:C# Objects.Initialize方法的具體用法?C# Objects.Initialize怎麽用?C# Objects.Initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Objects
的用法示例。
在下文中一共展示了Objects.Initialize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: addObject
/// <summary>
/// Adds the object Specified to the correct matricies
/// NOTE!:
/// These can only be of types:
/// Asteroid
/// Planet
/// Fighter
/// Projectile (of any type)
/// Destroyer.
/// </summary>
/// <param name="Object">The object to add</param>
public static void addObject(Objects.StaticObject Object)
{
// initialise the object first
Object.Initialize();
Object.LoadContent();
if (Object is Objects.Fighter)
{
Fighters.Add(Object);
}
else if (Object is Objects.Destroyer)
{
Destroyers.Add(Object);
}
else if (Object is Objects.Turret)
{
Towers.Add(Object);
}
else if (Object is Objects.Projectile)
{
Projectiles.Add(Object);
}
if (Object is Objects.DynamicObject)
DynamicObjs.Add(Object);
// _____-----TODO----____ Add asteroids when class is made
gameGrid.registerObject(Object);
AllObjects.Add(Object);
}