头文件
using System.Linq;
代码
Dictionary<HLSceneObject, (float,float)> RotateObjectList = new Dictionary<HLSceneObject,(float, float)>();
update(){
if (RotateObjectList.Count > 0)
{
for (int i = 0; i < RotateObjectList.Count; i++)
{
var item = RotateObjectList.ElementAt(i);
float value = item.Value.Item1;
if (...)
{
value += rotateDirection * ScrollAnglePerTime * time * 5;
item.Key.RotateObject(value);
RotateObjectList[item.Key] = (value, item.Value.Item2);
if (...)
{
item.Key.ChangeRotate((int)item.Value.Item2);
OnScrolled();
RotateObjectList.Remove(item.Key);
continue;
}
}
}
}
}