zoukankan      html  css  js  c++  java
  • 一个类似与地平线中的车漆画板制作

    效果图

      public void SetCarPaintColor()
        {
            //初始化行数列数
            int Hcount = 0;
            int Vconut = 0;
            Hcount = 17; //17列(由共同的线性特点的列数)
            Vconut = 9;  //9行
            for (int z = 0; z < Vconut; z++)
            {
                //第一列比较特殊首先生成第一列
                var MaintColor = Color.HSVToRGB(0, 0, ((z + 1) / 9.0f));
                //Img是一张图片
                var obj = Instantiate(Img);
                obj.GetComponent<Image>().color = MaintColor;
                obj.transform.parent = parentTransform;
            }
            //生成后面的所有
            for (int i = 0; i < Hcount; i++)
            {
                for (int j = 0; j < Vconut; j++)
                {
                    float h = (i + 1) * (360 / Hcount);
                    float v = (j + 1) * (100f / (Vconut % 2 == 0 ? Vconut / 2 : Vconut / 2 + 1));
                    float s = 1;
                    var MaintColor = Color.HSVToRGB(h / 360, 1, v / 100);
                    if (j > (Vconut / 2))
                    {
                        s = (1 * (Vconut-1 - j)) / (Vconut / 2f);
                        if (s <= 0.1f)
                            s = 0.1f;
                        MaintColor = Color.HSVToRGB(h / 360, s, 1);
                    }
                    var obj = Instantiate(Img);
                    obj.GetComponent<Image>().color = MaintColor;
                    obj.transform.parent = parentTransform;
                }
            }
        }
    

      

  • 相关阅读:
    linux环境变量
    linux make configure make
    摘自(http://www.ruanyifeng.com/blog/2011/07/linux_load_average_explained.html)
    linux eaccelerator
    linux du df ls
    linux phpize
    mysql 分页
    mysql 执行计划和慢日志记录
    mysql 添加/删除列(column)
    mysql 索引
  • 原文地址:https://www.cnblogs.com/mafeihao/p/11381596.html
Copyright © 2011-2022 走看看