当前位置: 首页>>代码示例>>C#>>正文


C# Ship.GetHealth方法代码示例

本文整理汇总了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();
    }
开发者ID:emmaconner,项目名称:CS361-CMYKrash,代码行数:35,代码来源:MagentaShipGUI.cs

示例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;
 }
开发者ID:SomethingStupid,项目名称:Scripts,代码行数:12,代码来源:HUD.cs

示例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;
    }
开发者ID:Astaffor,项目名称:CS361-CMYKrash,代码行数:18,代码来源:hud.cs


注:本文中的Ship.GetHealth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。