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;
       }
      }
     }

  • 相关阅读:
    [CF1475F] Unusual Matrix
    [JXOI2018] 游戏
    [ZJOI2010] 排列计数
    [CF1474E] What Is It?
    [CF375D] Tree and Queries
    [CF519E] A and B and Lecture Rooms
    [CF321C] Ciel the Commander
    [CF1C] Ancient Berland Circus
    [CF321A] Ciel and Robot
    [CF1450C1] Errich-Tac-Toe (Easy Version)
  • 原文地址:https://www.cnblogs.com/softimagewht/p/2580272.html
Copyright © 2011-2022 走看看