zoukankan      html  css  js  c++  java
  • 血槽制作

         var showGUI = false;
      var foregroundTexture:Texture;//血值
      var foreground01Texture:Texture;//法力值
      var EnmetryforegroundTexture:Texture;//敌人血值
      var backgroundTexture:Texture ;
      var rightSide = false;
     
     function OnGUI ()
     {
          if(showGUI == true)
       {
            var health =GetComponent("BloomAndPower").bloom/100.0;
         var power =GetComponent("BloomAndPower").power/100.0;
        
        var rect :Rect = new Rect(10, Screen.height/10+15, Screen.width/4, backgroundTexture.height);
        var rect01 :Rect = new Rect(10, Screen.height/10+35, Screen.width/4, backgroundTexture.height);
       if (rightSide)
       {
        rect.x = Screen.width*0.6 - rect.x;
        rect.width = -rect.width;
        GUI.DrawTexture(rect, backgroundTexture);
           rect.width *= health;
           GUI.DrawTexture(rect, EnmetryforegroundTexture );
       }
       else
       {
        GUI.DrawTexture(rect, backgroundTexture);
        rect.width *= health;
        GUI.DrawTexture(rect, foregroundTexture);
        
        GUI.DrawTexture(rect01, backgroundTexture);
        rect01.width *= power;
        GUI.DrawTexture(rect01, foreground01Texture);
        //GUI.color = Color.yellow;
       }
      }
     }

  • 相关阅读:
    A Famous City
    A Famous ICPC Team
    配置单元测试环境,找不到SenTestingKit
    linux解压.tar命令
    语音输入——科大讯飞
    查看dsym错误信息
    工程里关闭arc
    导入签名错误
    mac显示隐藏文件
    类uialertview弹出动画
  • 原文地址:https://www.cnblogs.com/softimagewht/p/2580272.html
Copyright © 2011-2022 走看看