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

  • 相关阅读:
    springboot之redis的应用
    redis外部访问
    Calendar时间操作
    zookeeper安装
    springboot的interceptor(拦截器)的应用
    springboot中filter的用法
    IIS无法启动,应用程序池自动关闭
    HTTP 错误 403.14
    【转】JavaScript => TypeScript 入门
    angular2使用ng g component navbar创建组件报错
  • 原文地址:https://www.cnblogs.com/softimagewht/p/2580272.html
Copyright © 2011-2022 走看看