资源简介
【UGUI】无线循环Scroview(附加 增 删 改 查 功能)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
代码片段和文件信息
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class ScrollIndexCallback1 : MonoBehaviour
{
public Image image;
public Text text;
void ScrollCellIndex (int idx)
{
string name = “Cell “ + idx.ToString ();
if (text != null)
{
text.text = name;
}
if (image != null)
{
image.color = Rainbow(idx / 50.0f);
}
gameobject.name = name;
}
// http://stackoverflow.com/questions/2288498/how-do-i-get-a-rainbow-color-gradient-in-c
public static Color Rainbow(float progress)
{
progress = Mathf.Clamp01(progress);
float r = 0.0f;
float g = 0.0f;
float b = 0.0f;
int i = (int)(progress * 6);
float f = progress * 6.0f - i;
float q = 1 - f;
switch (i % 6)
{
case 0:
r = 1;
g = f;
b = 0;
break;
case 1:
r = q;
g = 1;
b = 0;
break;
case 2:
r = 0;
g = 1;
b = f;
break;
case 3:
r = 0;
g = q;
b = 1;
break;
case 4:
r = f;
g = 0;
b = 1;
break;
case 5:
r = 1;
g = 0;
b = q;
break;
}
return new Color(r g b);
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-02-24 10:02 LoopScrollRect-master\
文件 399 2018-02-24 10:02 LoopScrollRect-master\.gitignore
目录 0 2018-02-24 10:02 LoopScrollRect-master\Assets\
文件 201 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo.me
目录 0 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\
文件 65436 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\DemoScene.unity
文件 183 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\DemoScene.unity.me
文件 201 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\Resources.me
目录 0 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\Resources\
文件 6613 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\Resources\ScrollCell1.prefab
文件 188 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\Resources\ScrollCell1.prefab.me
文件 6269 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\Resources\ScrollCell2.prefab
文件 188 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\Resources\ScrollCell2.prefab.me
文件 6352 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\Resources\ScrollCell3.prefab
文件 188 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\Resources\ScrollCell3.prefab.me
文件 201 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\sc
目录 0 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\sc
文件 1627 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\sc
文件 275 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\sc
文件 544 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\sc
文件 275 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\sc
文件 333 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\sc
文件 275 2018-02-24 10:02 LoopScrollRect-master\Assets\Demo\sc
文件 201 2018-02-24 10:02 LoopScrollRect-master\Assets\sc
目录 0 2018-02-24 10:02 LoopScrollRect-master\Assets\sc
文件 201 2018-02-24 10:02 LoopScrollRect-master\Assets\sc
目录 0 2018-02-24 10:02 LoopScrollRect-master\Assets\sc
文件 5240 2018-02-24 10:02 LoopScrollRect-master\Assets\sc
文件 275 2018-02-24 10:02 LoopScrollRect-master\Assets\sc
文件 4600 2018-02-24 10:02 LoopScrollRect-master\Assets\sc
文件 263 2018-02-24 10:02 LoopScrollRect-master\Assets\sc
............此处省略47个文件信息
- 上一篇:tsp 测试库 tsp
- 下一篇:混沌系统同步控制的代码
评论
共有 条评论