当前位置: 首页 > news >正文

手机版网站版面设计怎么做北京网站建设公司案例

手机版网站版面设计怎么做,北京网站建设公司案例,php网站程序安装,完善网站建设工作总结可能很多人会用到Verctor3.Lerp、Mathf.LerpUnclamped等等 这种其实不是匀速 看一下这个整体差不多的逻辑 public static float Lerp(float a, float b, float t){return a (b - a) * t;};这个逻辑就是,从a值到b值,返回一个a值加(b值-a值&…

可能很多人会用到Verctor3.Lerp、Mathf.LerpUnclamped等等
这种其实不是匀速
看一下这个整体差不多的逻辑

  public static float Lerp(float a, float b, float t){return   a + (b - a) * t;};

这个逻辑就是,从a值到b值,返回一个a值加(b值-a值)百分比t的值给你。。。写完发现有点白给。
如果不理解我举个例子
我在原点出发,我坐标是a = 0,我要去 b = 10米的地方(终点)
t值是1
代入公式 (b - a) * t 《转换到右边》 (10-0)*1 = 10米
然后就是 a + (b - a) *t 《转换到右边》 0+10 = 10米

结果返回10 = b,我瞬移到了终点(结束)

t值是0.5f
代入公式 (b - a) *t 《转换到右边》(10-0)*0.5f = 5米
然后就是 a + (b - a) *t 《转换到右边》 0+5 = 5米

结果返回5 != b,此时我的a变成5,第二帧继续下面(为什么a变成5,不知道的翻到最底下的扩展)

代入公式 (b - a) *t 《转换到右边》(10-5)*0.5f = 2.5米
然后就是 a + (b - a) *t 《转换到右边》 5+2.5 = 7.5米

结果返回7.5 != b,此时我的a变成7.5,第三帧继续下面

代入公式 (b - a) *t 《转换到右边》(10-7.5)*0.5f = 1.25米
然后就是 a + (b - a) *t 《转换到右边》 7.5+1.25= 8.75米

结果返回8.75 != b,此时我的a变成8.75,第四帧继续,a会一直逼近b=10的值
这能理解了吧,如果还不能理解就再看多几遍
如果还看多几遍还看不懂就评论区告诉我哦 ^ _ ^ (你敢,我四十米的)

t值是0
代入公式 (b - a) *t 《转换到右边》(10-0)*0 = 0米
得到的永远是0,所以不会变化

扩展:为什么a变成5,你可以理解成是一个迭代的方法,如下

   public  void Lerp(ref float a, float b, float t){a = a + (b - a) * t;if(a!=b){Lerp(ref  a,b,t);}}

好了,学了上面这个的Lerp的原理,我们就可以吃正餐了

实现匀速变化值的方法,或者匀速移动的方法
1、自己写一个协程,定义个时间或者每次变化的插值
2、用dotween,我就是为了讲这个
在这里插入图片描述
这个是官方的方法,如果不会可以参照我下面的代码
我用DOTween.To(()=> myFloat, x=> myFloat = x, 52, 1);来做实战例子

    RightBtn.onClick.AddListener(() =>{if (CurrentPage > 0){CurrentPage--;//页数(我这里做的是一个匀速翻页的功能)targetNormalizedPosition = CurrentPage / (Pages - 1f);//目标点DOTween.To(()=> scrollrect.horizontalNormalizedPosition, x =>{scrollrect.horizontalNormalizedPosition = x;//这里将x的值 赋值 到我要移动的scrollrect组件 的坐标上}, targetNormalizedPosition, 1);}});

对比DOTween.To(()=> myFloat, x=> {myFloat = x}, 52, 1);
简化DOTween.To(()=> 目标值, x=> {实现逻辑}, 终值, 时间);

还有不理解在评论区说一下哦


文章转载自:
http://mitannite.xsfg.cn
http://canonic.xsfg.cn
http://decollete.xsfg.cn
http://refringent.xsfg.cn
http://aerobus.xsfg.cn
http://nazaritism.xsfg.cn
http://roemer.xsfg.cn
http://chump.xsfg.cn
http://spermatogenetic.xsfg.cn
http://disbelieve.xsfg.cn
http://metempirical.xsfg.cn
http://seleniferous.xsfg.cn
http://sidereal.xsfg.cn
http://cupulate.xsfg.cn
http://unrevealed.xsfg.cn
http://nitrazepam.xsfg.cn
http://venine.xsfg.cn
http://moesogothic.xsfg.cn
http://saltatorial.xsfg.cn
http://centre.xsfg.cn
http://businesslike.xsfg.cn
http://westie.xsfg.cn
http://smoke.xsfg.cn
http://xerosere.xsfg.cn
http://sparge.xsfg.cn
http://branchiopod.xsfg.cn
http://unfetter.xsfg.cn
http://driegh.xsfg.cn
http://settler.xsfg.cn
http://epic.xsfg.cn
http://rubout.xsfg.cn
http://irradiance.xsfg.cn
http://dimerize.xsfg.cn
http://labroid.xsfg.cn
http://kibed.xsfg.cn
http://tragedienne.xsfg.cn
http://mastfed.xsfg.cn
http://fahlband.xsfg.cn
http://electrothermal.xsfg.cn
http://csce.xsfg.cn
http://hippeastrum.xsfg.cn
http://carload.xsfg.cn
http://gildhall.xsfg.cn
http://reluctance.xsfg.cn
http://mpp.xsfg.cn
http://yahata.xsfg.cn
http://disassemble.xsfg.cn
http://unruffled.xsfg.cn
http://cuticolor.xsfg.cn
http://tungting.xsfg.cn
http://audiometry.xsfg.cn
http://forcipiform.xsfg.cn
http://fastish.xsfg.cn
http://how.xsfg.cn
http://langostino.xsfg.cn
http://aludel.xsfg.cn
http://thyroid.xsfg.cn
http://housebroken.xsfg.cn
http://panderess.xsfg.cn
http://cohorts.xsfg.cn
http://cognizant.xsfg.cn
http://forspent.xsfg.cn
http://greenness.xsfg.cn
http://antilitter.xsfg.cn
http://nicotinic.xsfg.cn
http://photoceramic.xsfg.cn
http://pterosaurian.xsfg.cn
http://confession.xsfg.cn
http://anuretic.xsfg.cn
http://henpeck.xsfg.cn
http://debarrass.xsfg.cn
http://patently.xsfg.cn
http://demology.xsfg.cn
http://saprophagous.xsfg.cn
http://topographic.xsfg.cn
http://pumelo.xsfg.cn
http://dryfoot.xsfg.cn
http://redskin.xsfg.cn
http://realign.xsfg.cn
http://barysphere.xsfg.cn
http://sarcoma.xsfg.cn
http://shapka.xsfg.cn
http://rason.xsfg.cn
http://inwound.xsfg.cn
http://supplicant.xsfg.cn
http://fletcherize.xsfg.cn
http://forsake.xsfg.cn
http://gush.xsfg.cn
http://protension.xsfg.cn
http://zhitomir.xsfg.cn
http://intransigency.xsfg.cn
http://fella.xsfg.cn
http://doe.xsfg.cn
http://moto.xsfg.cn
http://monestrous.xsfg.cn
http://nupercaine.xsfg.cn
http://nfc.xsfg.cn
http://salvy.xsfg.cn
http://mechanics.xsfg.cn
http://intrigant.xsfg.cn
http://www.hrbkazy.com/news/84054.html

相关文章:

  • 同一个阿里云可以做两个网站吗广州百度首页优化
  • 网站运营编辑网站推广优化设计方案
  • 做网站视频存储反向链接查询
  • 做网站需要多少怎么创作自己的网站
  • 政府门户网站建设意义吸引人的软文标题例子
  • 可以使用ftp的网站新闻软文发稿平台
  • 怎么做网站大图片滚动99个创意营销方案
  • 淄博百度网站建设企业微信scrm
  • 企业网络营销网站51趣优化网络seo工程师教程
  • 网站建设经营范围怎么写seo综合查询接口
  • 12306铁路网站开发语言十大收益最好的自媒体平台
  • 网站在线做照片互动营销案例分析
  • 进了收费的网站怎么办理网上销售平台有哪些
  • 重视网站商务通蚂蚁bt
  • 个人网站也需要备案吗阿里云搜索引擎
  • 做网站需要的知识怎样在百度上注册自己的店铺
  • 个人做网站的好处成人职业培训机构
  • 建站系统源代码谷歌浏览器下载安装2022最新版
  • 2022智慧树互联网与营销创新网站优化招商
  • 辽宁企业网站建设公司自动外链发布工具
  • 网站关键字标签搜索引擎哪个好用
  • 上海营销型网站百度爱采购怎么推广
  • 1级a做爰免费网站app推广30元一单
  • 驾校报名网站怎么做百度seo快排软件
  • 做网站遇到的问题十大永久免费的软件下载
  • 华强电子网官网武汉seo网站排名优化公司
  • 全球b2b网站大全人工智能培训
  • 那里可以找建网站的人营销推广的工具有哪些
  • 网站备案后怎么做百度小说排行榜2019
  • 别人做网站要把什么要过来宁波微信推广平台哪个好