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

网站推广的方法有哪些用别的域名给网站做竞价

网站推广的方法有哪些,用别的域名给网站做竞价,怎么查公司网站有没有被收录,免费wordpress托管系列文章目录 自定义TimeLine 自定义TimeLine 系列文章目录前言正文UI部分代码部分Data#xff08;数据#xff09;Clip#xff08;片段#xff09;Track#xff08;轨道#xff09;Mixer#xff08;混合#xff09;被控制物体 总结 前言 自定义TimeLine实际上就是自定…系列文章目录 自定义TimeLine 自定义TimeLine 系列文章目录前言正文UI部分代码部分Data数据Clip片段Track轨道Mixer混合被控制物体 总结 前言 自定义TimeLine实际上就是自定义轨道 在这里我们实现一个简单的例子我使用的Unity版本是2021.3.20f1c1 创建的一个URP项目。其实Build-in也是一样的 但是有的代码可能需要改一下。 正文 在这里先介绍一下实现思路因为要实现的是我们每次收看音乐频道的时候下方歌词的效果首先我们需要创建两个Text一个在下面作为底色然后在控制上层的字进行移动以达到效果 UI部分 我使用TMP创建的Text其中的结构如下图 其中有一个地方需要着重说一下就是 Mask 这是一个 空物体挂在了Rect Mask 2D 组件 用于遮挡文字实现效果如果不使用遮罩而是直接控制Text会出现文字卡顿的现象为了避免这种现象所以使用的是遮罩。 还有就是需要把中心点设为00 还有就是创建一个空物体加上Playable Director 组件控制timeline。 代码部分 Data数据 using UnityEngine.UI; using UnityEngine.Playables;public class TextBehaviour : PlayableBehaviour {public string line; //我们要显示的文字public float speed; // 文字移动的速度 }Clip片段 using UnityEngine; using UnityEngine.Playables; using UnityEngine.Timeline;public class TextClip : PlayableAsset,ITimelineClipAsset {private TextBehaviour template;//这俩个参数是参数不需要进行拖拽操作所以没有使用再上一篇讲的暴露变量public float speed;public string Line;public override Playable CreatePlayable(PlayableGraph graph, GameObject owner){var playable ScriptPlayableTextBehaviour.Create(graph, template);TextBehaviour clone playable.GetBehaviour();clone.speed speed;clone.line Line;return playable;}public ClipCaps clipCaps ClipCaps.All; } Track轨道 using UnityEngine; using UnityEngine.Playables; using UnityEngine.Timeline;[TrackBindingType(typeof(TextController))] [TrackColor(255/255f,255/255f,200/255f)] [TrackClipType(typeof(TextClip))] public class TextTrack : TrackAsset {public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount){return ScriptPlayableTextMixer.Create(graph, inputCount);} } Mixer混合 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Playables;public class TextMixer : PlayableBehaviour {private string defaultLine default;private float defaultProgress default;public override void ProcessFrame(Playable playable, FrameData info, object playerData){var textController playerData as TextController;int inputCount playable.GetInputCount();string currentLine defaultLine;float currentProgress defaultProgress;bool isEmpty true;for (int i 0; i inputCount; i){var clipPlayable (ScriptPlayableTextBehaviour)playable.GetInput(i);// 获取当前的 TextBehaviour behaviour clipPlayable.GetBehaviour();float inputWight playable.GetInputWeight(i);Debug.Log(inputWight);if (inputWight 0){isEmpty false;float progress (float)(clipPlayable.GetTime() / clipPlayable.GetDuration());if(textController) textController.OnUpdate(behaviour.line,behaviour.speed,progress);}//textController.OnUpdate(defaultLine,0,defaultProgress);}if (isEmpty){textController.OnUpdate(defaultLine,0,defaultProgress);}} } 被控制物体 using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine;public class TextController : MonoBehaviour {public TextMeshProUGUI baseText;public TextMeshProUGUI colorText;[SerializeField]private RectTransform maskTransform;public void OnUpdate(string line,float speed,float progress){baseText.text line;colorText.text line;float x colorText.preferredWidth * progress * speed;maskTransform.sizeDelta new Vector2(x, maskTransform.sizeDelta.y);} } 总结 基本上说完了因为这个只是做一个简单示例所以也没有过多的细讲。因为只要理解了原理这其实很简单的。
http://www.zqtcl.cn/news/9397/

相关文章:

  • 怎么做网盘搜索网站建筑模版东莞网站建设技术支持
  • WordPress自定义计算广州做网站优化哪家好
  • 哪里有网站建设公司wordpress文章编辑器的插件
  • 株洲做网站公司网站建设手稿
  • 视频一页网站怎么做四川公共资源交易中心
  • 商务网站建设作业wordpress更改固定链接404
  • 手机怎么搭建网站摄影网站免费
  • 网站5建设需要学什么关于自己公司的网站怎么做
  • 谁知道免费网站asp300源码
  • dede 中英文网站免费卖货平台
  • 西宁网站公司怎么提高网站浏览量
  • 免费网站建设优化wordpress链接重建
  • 自建网站教程视频企业网站类型主要包括
  • 常见的导航网站有哪些做一个app大概需要多少费用
  • 海南省建设培训与执业资格注册中心网站太原网络营销策划
  • 升降平台找企汇优做网站推广如何免费找精准客户
  • 网站建设简讯网站移动端怎么做的
  • wordpress视频网站模板下载淘宝客做网站还是做app
  • 外贸网站 流量湖州网站建设培训教程
  • 安徽外贸网站google建站企业网站开发外包公司
  • 上海建设工程安全监理网站设计网站 杭州
  • 福州哪里制作网站怎样写代码
  • 微信网站开发需要什么技术北京网络公司网站
  • 上海网站科技北京房产网站大全
  • a做爰网站网站程序是什么?
  • 重庆忠县网站建设公司哪里有ppt资源网免费
  • 电商网站制作公司旅游类网站如何做推广
  • 什么是网站平台开发怎样建公司网站
  • 青岛广新信建设咨询公司网站广东建设工程招标网站
  • 上海制作网站的网站阿里云账号密码发给网站开发