粉丝50
关注 2
获赞 163
游戏涨经验数值,涨金币动画AE脚本突破3000限制, 带千分位分隔符,aescript要30美刀

[软件插件] 游戏涨经验数值,涨金币动画AE脚本突破3000限制, 带千分位分隔符,aescript要30美刀

[复制链接]
1867 1 0 2 3年前 举报
//这一个脚本在aescript上卖30美刀!这里仅仅只要0元,而且源码开放,随意添加!全部复制贴进text层的source即可{:6_222:}
//----------解决千分位问题的代码-------------
//----------经验升级数字动画的AE代码-----------------
//tempA为最小值,tempB为最大值;StartFrame为多少秒开始涨;EndFrame为多少秒停止;tempA和B的数值0.00小数点后面写几位数,对应DotNum表示保留几位;
tempA=0.123;
tempB=345687454454.2352;
StartFrame=110;
EndFrame=164;
DotNum=3;

//-----数据转换------

tempC=StartFrame/30;
tempD=EndFrame/30;
tempE=0;
ThousandSeparator=true;
tempA.toFixed(DotNum);
tempB.toFixed(DotNum);
tempC.toFixed(2);
tempD.toFixed(2);

//-----------初始值---------------------------
value=tempA.toFixed(DotNum);
//-----动态增长值------(金钱/时长*时间=每帧涨的金钱)*(总时间-起始涨时间=涨了多长时间)+初始值-------------------
if(time>=tempC)
{
tempE=(((tempB-tempA)/(tempD-tempC))*(time-tempC)+tempA).toFixed(DotNum);
v=tempE;
//-------解决千分位问题--------
if(ThousandSeparator==true){
s=""+Math.floor(v);
a=v;
b=(a-s).toFixed(DotNum);
if(s.length>3&&s.length<7)
s.substr(0,s.length-3)+","+s.substr(-3)+b.substr(-1*(DotNum+1));
else if (s.length>=7&&s.length<10)
s.substr(0,s.length-6)+","+s.substr(-3,3)+","+s.substr(-3);
else if (s.length>=10&&s.length<13)
s.substr(0,s.length-9)+","+s.substr(-6,3)+","+s.substr(-3,3)+","+s.substr(-3)+b.substr(-1*(DotNum+1));
else  
v=tempB.toFixed(DotNum);
};
//-------解决千分位问题end--------
};
//-------------目标值-------------------------
if(time>=tempD)
{
v=tempB.toFixed(DotNum);
//-------解决千分位问题--------
if(ThousandSeparator==true){
s=""+Math.floor(v);
a=v;
b=(a-s).toFixed(DotNum);
if(s.length>3&&s.length<7)
s.substr(0,s.length-3)+","+s.substr(-3)+b.substr(-1*(DotNum+1));
else if (s.length>=7&&s.length<10)
s.substr(0,s.length-6)+","+s.substr(-3,3)+","+s.substr(-3);
else if (s.length>=10&&s.length<13)
s.substr(0,s.length-9)+","+s.substr(-6,3)+","+s.substr(-3,3)+","+s.substr(-3)+b.substr(-1*(DotNum+1));
else  
v=tempB.toFixed(DotNum);
};
//-------解决千分位问题end--------
};




0
点赞
0
打赏
2
添加到收藏夹
打赏一次,1个CG券
全部评论1
您需要登录后才可以回帖 登录 | 立即注册

//----------经验升级数字动画的AE代码-----------------
//tempA为最小值,tempB为最大值;StartFrame为多少帧开始涨;EndFrame为多少帧停止;tempA和B的数值0.00小数点后面写几位数,对应DotNum表示保留几位;
tempA=30000;
tempB=29800;
StartFrame=110;
EndFrame=164;
DotNum=0;
//-----数据转换------
tempC=StartFrame/30;
tempD=EndFrame/30;
tempA.toFixed(DotNum);
tempB.toFixed(DotNum);
tempC.toFixed(2);
tempD.toFixed(2);
//-----------初始值---------------------------
value=tempA.toFixed(DotNum);
//-----动态增长值------(金钱/时长*时间=每帧涨的金钱)*(总时间-起始涨时间=涨了多长时间)+初始值-------------------
if(time>=tempC)
{
value=Math.floor(((tempB-tempA)/(tempD-tempC))*(time-tempC)+tempA).toFixed(DotNum);
};
//-------------目标值-------------------------
if(time>=tempD)
{
value=tempB.toFixed(DotNum);
};
3年前
回复

使用道具 举报