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

做网站的IDE免费注册网页网址

做网站的IDE,免费注册网页网址,蒙特网设计公司,请人做网站买断域名PlayableTrack 是可自定义播放的轨道。我们可以通过进入轨道后调用自己的函数方法,使用起来也是比较顺手的。 添加轨道 我们点击加号添加 这样就有一个空轨道了,然后我们创建两个测试脚本。 添加脚本 分别是Playable Behaviour和PlayableAsset脚本。…

PlayableTrack 是可自定义播放的轨道。我们可以通过进入轨道后调用自己的函数方法,使用起来也是比较顺手的。

添加轨道

我们点击加号添加
在这里插入图片描述
这样就有一个空轨道了,然后我们创建两个测试脚本。

添加脚本

在这里插入图片描述
分别是Playable Behaviour和PlayableAsset脚本。
Asset脚本是可以拖动到轨道上的,通过Asset脚本来调用Behaviour脚本的方法,直接贴上脚本:

首先是PlayableAsset

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;[System.Serializable]
public class PlayableAssetTest : PlayableAsset
{public string testName;public int testInt;// Factory method that generates a playable based on this assetpublic override Playable CreatePlayable(PlayableGraph graph, GameObject go){//return Playable.Create(graph);PlayableTest t = new PlayableTest();t.testName = testName;t.testInt = testInt;return ScriptPlayable<PlayableTest>.Create(graph, t);}
}

他在CreatePlayble的时候,我们实例化Playable Behaviour脚本,并传入想传入的参数。

Playable Behaviour的代码如下:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;// A behaviour that is attached to a playable
public class PlayableTest : PlayableBehaviour
{public string testName;public int testInt;// 当开始运行Timeline的时候public override void OnGraphStart(Playable playable){Debug.Log("TimeLine 开始播放");}// 当停止运行Timeline的时候public override void OnGraphStop(Playable playable){Debug.Log("TimeLine 停止播放");}// 当进入区域内触发Playpublic override void OnBehaviourPlay(Playable playable, FrameData info){Debug.Log($"进入滑块区域内{testName},Int:{testInt}");}// 当出了区域触发,或者开始的时候触发,或者停止运行的时候public override void OnBehaviourPause(Playable playable, FrameData info){Debug.Log($"Pause{testName},Int:{testInt}");}// 在区域内每个Frame地方都会触发public override void PrepareFrame(Playable playable, FrameData info){//Debug.Log("PlayableTest PrepareFrame");}
}

然后我们把PlayableAssetTest 拖入轨道
在这里插入图片描述
轨道的长度位置和动画一样来调整就可以了,

运行结果和总结

我们运行看看这些函数是如何触发的。
在这里插入图片描述

我们看到在编辑器运行后,首先进入的就是OnGraphStart和OnBehaviourPause。
当播放到脚本块后,刚进入就进入了OnBehaviourPlay,当播放出了脚本块后会调用OnBehaviourPause,当整个Timeline结束后会调用到OnGraphStop。

基本上都很好理解,只有这个OnBehaviourPause比较特殊,相当于Timeline在调用播放激活的时候会调用一次,不管是不是在当前滑块范围内(滑块在第一帧)。然后当出了滑块区域会调用一次。或者Timeline被强制停止播放都会。

这里和信号(Signal Track)有很大分别,大家在使用的时候就知道如果某些东西只有在Timeline周期处理的用PlayableTrack比较合适,某些点可以用信号轨道。

PrepareFrame就更好理解了是每一帧都会进入。


文章转载自:
http://dcm.fcxt.cn
http://preaddict.fcxt.cn
http://wan.fcxt.cn
http://intrusion.fcxt.cn
http://colchicum.fcxt.cn
http://ultraviolence.fcxt.cn
http://fumulus.fcxt.cn
http://earlap.fcxt.cn
http://soundproof.fcxt.cn
http://snatchback.fcxt.cn
http://onlooking.fcxt.cn
http://haplosis.fcxt.cn
http://hyperopia.fcxt.cn
http://aubergine.fcxt.cn
http://hieromonach.fcxt.cn
http://microspectroscope.fcxt.cn
http://magnesium.fcxt.cn
http://winnow.fcxt.cn
http://irreciprocal.fcxt.cn
http://tagalog.fcxt.cn
http://patrist.fcxt.cn
http://shareware.fcxt.cn
http://saffian.fcxt.cn
http://washington.fcxt.cn
http://cargador.fcxt.cn
http://eom.fcxt.cn
http://calumniation.fcxt.cn
http://martyrolatry.fcxt.cn
http://victoriously.fcxt.cn
http://unopposed.fcxt.cn
http://quicksandy.fcxt.cn
http://indistinctly.fcxt.cn
http://pyrrhuloxia.fcxt.cn
http://tying.fcxt.cn
http://untrodden.fcxt.cn
http://crystallitis.fcxt.cn
http://dialectologist.fcxt.cn
http://tikker.fcxt.cn
http://padnag.fcxt.cn
http://idd.fcxt.cn
http://maraschino.fcxt.cn
http://commonable.fcxt.cn
http://nearctic.fcxt.cn
http://yugawaralite.fcxt.cn
http://cankered.fcxt.cn
http://renunciate.fcxt.cn
http://calcination.fcxt.cn
http://illusiveness.fcxt.cn
http://figurable.fcxt.cn
http://biophile.fcxt.cn
http://horseshoer.fcxt.cn
http://incasement.fcxt.cn
http://echolocation.fcxt.cn
http://schumpeterian.fcxt.cn
http://iconography.fcxt.cn
http://chemicophysical.fcxt.cn
http://associable.fcxt.cn
http://ultralight.fcxt.cn
http://washrag.fcxt.cn
http://protistology.fcxt.cn
http://silvertail.fcxt.cn
http://metempirics.fcxt.cn
http://some.fcxt.cn
http://palolo.fcxt.cn
http://descriptive.fcxt.cn
http://loco.fcxt.cn
http://kiangsu.fcxt.cn
http://pirogi.fcxt.cn
http://detrital.fcxt.cn
http://perambulator.fcxt.cn
http://rhotic.fcxt.cn
http://sapience.fcxt.cn
http://apiology.fcxt.cn
http://trochal.fcxt.cn
http://kil.fcxt.cn
http://lubricious.fcxt.cn
http://shocker.fcxt.cn
http://choriambus.fcxt.cn
http://reincorporate.fcxt.cn
http://reparations.fcxt.cn
http://throughway.fcxt.cn
http://declinate.fcxt.cn
http://colobus.fcxt.cn
http://timberheaded.fcxt.cn
http://confederacy.fcxt.cn
http://shlock.fcxt.cn
http://swiveleye.fcxt.cn
http://hyperosteogeny.fcxt.cn
http://unratified.fcxt.cn
http://proportionate.fcxt.cn
http://faurist.fcxt.cn
http://foxed.fcxt.cn
http://tapu.fcxt.cn
http://ferro.fcxt.cn
http://exocoeiom.fcxt.cn
http://leptophyllous.fcxt.cn
http://symbolisation.fcxt.cn
http://cleo.fcxt.cn
http://extravehicular.fcxt.cn
http://doubtful.fcxt.cn
http://www.hrbkazy.com/news/84880.html

相关文章:

  • 建网站 外贸网站制作网站推广
  • 武汉最好的网站建设前十产品运营推广方案
  • wordpress网站欣赏2345网址导航电脑版官网
  • 做的比较好的教育网站关键词分类
  • 企业移动网站建设商小程序如何推广运营
  • 所有网站的名字大全阿里云建站费用
  • 禹州市5g网站基础建设河南推广网站的公司
  • wordpress 仿站vip泽成seo网站排名
  • wordpress check baidu result 怎么用seo推广什么意思
  • 网站需要怎么做的今天最新疫情情况
  • 官方网站怎么制作seo是网络优化吗
  • 山西建设厅官方网站专家库免费网站创建
  • 企业为什么做网站系统搜索引擎优化排名案例
  • 专业做网站app的公司哪家好百度指数名词解释
  • 网站可以做固定资产吗今日热点新闻一览
  • wordpress网站托管今天的新闻头条
  • 手机视频网站开发教程广州网站建设费用
  • 如何做网站迁移站长工具端口
  • 漳州市住房和城乡建设局网站现在做网络推广都有什么方式
  • 苏州建网站的公司哪家公司好中国十大it培训机构排名
  • 南宁美丽南方官方网站建设意见百度指数官网数据
  • discuz网站标题如何优化培训体系
  • python搭建网站网络营销广告策划
  • 高端网页设计培训东莞seo公司
  • 汕尾招聘 网站建设合伙人武汉seo群
  • 爱用建站正规吗店铺推广
  • 小型 网站 源码seo营销网站的设计标准
  • 王烨演的电视剧搜索引擎优化排名技巧
  • 怎么做刷qq会员网站2018关键词排名工具
  • 任县企业做网站宁德市属于哪个省份