本文整理汇总了C#中Ship.GetHealth方法的典型用法代码示例。如果您正苦于以下问题:C# Ship.GetHealth方法的具体用法?C# Ship.GetHealth怎么用?C# Ship.GetHealth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ship
的用法示例。
在下文中一共展示了Ship.GetHealth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start()
{
texture = new Texture2D(128, 128,TextureFormat.RGB24,false);
style = new GUIStyle();
texture2 = new Texture2D(128, 128,TextureFormat.RGB24,false);
style = new GUIStyle();
weapon = GetComponent<Weapon>();
ship = GetComponent<Ship>();
maxHealth = ship.GetHealth();
curHealth = maxHealth;
maxCool = weapon.GetcdTime();
curCool = maxCool;
for (int y = 0; y < texture.height; ++y)
{
for (int x = 0; x < texture.width; ++x)
{
Color color = new Color(238, 0, 238);
texture.SetPixel(x, y, color);
}
}
texture.Apply();
for (int y = 0; y < texture2.height; ++y)
{
for (int x = 0; x < texture2.width; ++x)
{
Color color = new Color(255, 0, 0);
texture2.SetPixel(x, y, color);
}
}
texture2.Apply();
}
示例2: Start
// Use this for initialization
void Start()
{
mgmt = Camera.main.GetComponent<GameManagement>();
cShip = mgmt.ships[0].GetComponent<Ship>();
mShip = mgmt.ships[1].GetComponent<Ship>();
yShip = mgmt.ships[2].GetComponent<Ship>();
cHealth = cShip.GetHealth();
mHealth = mShip.GetHealth();
yHealth = yShip.GetHealth();
maxHealth = 7;
}
示例3: Start
//int l =100;
//int h = 20;
// Use this for initialization
void Start()
{
mgmt = GetComponent<GameManagement>();
ship1 = mgmt.GetShip(1);
ship2 = mgmt.GetShip(2);
ship3 = mgmt.GetShip(3);
ship1Script = ship1.GetComponent<Ship>();
ship2Script = ship2.GetComponent<Ship>();
ship3Script = ship3.GetComponent<Ship>();
cur1Health = ship1Script.GetHealth();
cur2Health = ship2Script.GetHealth();
cur3Health = ship3Script.GetHealth();
maxHealth = 6;
}