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

在货源网站自己拿样 加盟 做代理 哪个比较好?广州seo团队

在货源网站自己拿样 加盟 做代理 哪个比较好?,广州seo团队,企业网站建设哪家好,深圳建网站服务商4.1 游戏中一般都会有各种各样的技能,或者其他需要按一定的时间顺序去执行的功能。 这里我写出了一个时间线节点,就像是在播放动画一样,按一定的阶段去执行某些功能 # # Timeline # # - author: zhangxuetu # - datetime: 2023-09-24 23…

4.1

游戏中一般都会有各种各样的技能,或者其他需要按一定的时间顺序去执行的功能。

这里我写出了一个时间线节点,就像是在播放动画一样,按一定的阶段去执行某些功能

#============================================================
#    Timeline
#============================================================
# - author: zhangxuetu
# - datetime: 2023-09-24 23:10:53
# - version: 4.1
#============================================================
class_name _TimeLine
extends Node## 执行完这个阶段时发出这个信号
signal executed_stage(stage, data)
## 手动停止执行
signal stopped
## 暂停执行
signal paused
## 继续执行
signal resumed
## 执行完成
signal finished## process 执行方式
enum ProcessExecuteMode {PROCESS, ## _process 执行PHYSICS, ## _physics_process 执行
}enum {UNEXECUTED, ## 未执行EXECUTING, ## 执行中PAUSED, ## 暂停中
}## 时间阶段名称。这关系到 [method execute] 方法中的数据获取的时间数据
@export var stages : Array = []
## process 执行方式。如果设置为 [member PROCESS][member PHYSICS] 以外的值,
## 则当前节点的线程将不会执行
@export var process_execute_mode : ProcessExecuteMode = ProcessExecuteMode.PROCESSvar _last_data : Dictionary
var _point : int = -1:set(v):if _point != v:_point = vif _point >= 0 and _point < stages.size():self.executed_stage.emit(stages[_point], _last_data)
var _time : float
var _execute_state : int = UNEXECUTED:set(v):if _execute_state == v:return_execute_state = vmatch _execute_state:UNEXECUTED:set_process(false)set_physics_process(false)EXECUTING:if process_execute_mode == ProcessExecuteMode.PROCESS:set_process(true)elif process_execute_mode == ProcessExecuteMode.PHYSICS:set_physics_process(true)PAUSED:set_process(false)set_physics_process(false)func _ready():set_process(false)set_physics_process(false)func _process(delta):_exec(delta)func _physics_process(delta):_exec(delta)func _exec(delta):_time -= deltawhile _time <= 0:_point += 1if _point < stages.size():_time += _last_data[stages[_point]]else:_point = -1_execute_state = UNEXECUTEDself.finished.emit()breakfunc get_time_left():return _timefunc get_last_data() -> Dictionary:return _last_datafunc get_last_stage():return stages[_point]## 执行功能。这个数据里需要有 [member stages] 中的 key 的数据,且需要是 [int][float]
## 类型作为判断执行的时间。否则默认时间为 0
func execute(data: Dictionary):_last_data = data_time = 0_point = 0if not stages.is_empty():_execute_state = EXECUTINGfor stage in stages:_last_data[stage] = float(data.get(stage, 0))# 执行时会先执行一下_time = _last_data[stages[0]]_exec(0)else:printerr("没有设置 stages,必须要设置每个执行的阶段的 key 值!")## 获取执行状态
func get_execute_state():return _execute_state## 是否正在执行
func is_executing():return _execute_state == EXECUTING## 停止执行
func stop():if _execute_state == EXECUTING:_execute_state = UNEXECUTEDself.stopped.emit()## 暂停执行
func pause():if _execute_state == EXECUTING:_execute_state = PAUSED## 恢复执行
func resume():if _execute_state == PAUSED:_execute_state = EXECUTINGself.resumed.emit()## 跳跃到这个阶段
func goto(stage, emit_stage_changed_signal: bool = true):if _execute_state == EXECUTING:if stages.has(stage):_point = stage_time = 0if emit_stage_changed_signal:self.executed_stage.emit()else:printerr("stages 中没有 ", stage, ". 所有 stage: ", stages)

这里我进行添加整个时间中有哪些阶段,我想一个技能需要有下面几个阶段:

start(开始执行功能,一般用于判断这个条件下是否可以进行执行这个功能,以便进行功能的打断等操作);before 执行功能时的施放动作前摇;execute 具体执行出的功能;after 执行功能后的动画结束;refresh 技能刷新阶段。

这是我的理解,可以自行随意设计。

下面的代码我创建了只有一个 Node2D 作为根节点的场景,进行测试

#============================================================
#    Time Line Test
#============================================================
# - author: zhangxuetu
# - datetime: 2023-09-24 21:51:11
# - version: 4.1
#============================================================
extends Node2Dvar timeline = _TimeLine.new()func _ready():timeline.stages = [&"start", &"before", &"execute", &"after", &"refresh"]add_child(timeline)timeline.executed_stage.connect(_executed_stage)timeline.execute({"name": "技能名称",&"start": 0,&"before": 0.4,&"execute": 0.2,&"after": 0.2,&"refresh": 3,})func _executed_stage(stage, data):match stage:&"start":print("   开始执行: ", data["name"])&"before":print("   播放动作")# 临时修改执行时间,延长或缩短时间data[&"execute"] = 2&"execute":print("   实际执行功能,这里写这个阶段要做的事情")&"after":print("   已经执行完功能,进行后续结束动作")&"refresh":print("   ", data["name"], " 结束动作完成,开始进行倒计时刷新")

这里我在执行这个技能的时候,传入上面各个阶段所需要的时间的数据,然后在 executed_stage 信号中进行判断各个阶段所需要处理的功能。

这样一个技能节点即可完成,使用时调用 execute 方法即可


文章转载自:
http://namer.c7617.cn
http://auditress.c7617.cn
http://acapnia.c7617.cn
http://idocrase.c7617.cn
http://ailurophilia.c7617.cn
http://citation.c7617.cn
http://bicipital.c7617.cn
http://inobtrusive.c7617.cn
http://opercula.c7617.cn
http://atherogenesis.c7617.cn
http://days.c7617.cn
http://taskwork.c7617.cn
http://optimization.c7617.cn
http://embedding.c7617.cn
http://scoreline.c7617.cn
http://edible.c7617.cn
http://remover.c7617.cn
http://fil.c7617.cn
http://equipped.c7617.cn
http://unwholesome.c7617.cn
http://teleprocessing.c7617.cn
http://heliosis.c7617.cn
http://reinflation.c7617.cn
http://leukodermal.c7617.cn
http://bumblebee.c7617.cn
http://cauldron.c7617.cn
http://patty.c7617.cn
http://gotland.c7617.cn
http://enflower.c7617.cn
http://spoilage.c7617.cn
http://backswordman.c7617.cn
http://liney.c7617.cn
http://quickthorn.c7617.cn
http://conformation.c7617.cn
http://teagown.c7617.cn
http://philoprogenitive.c7617.cn
http://amenability.c7617.cn
http://fruition.c7617.cn
http://andante.c7617.cn
http://tarentism.c7617.cn
http://norseman.c7617.cn
http://condemn.c7617.cn
http://leveller.c7617.cn
http://phraseological.c7617.cn
http://slowness.c7617.cn
http://persian.c7617.cn
http://lithotrity.c7617.cn
http://eeriness.c7617.cn
http://refulgent.c7617.cn
http://restorative.c7617.cn
http://centrosphere.c7617.cn
http://synoecism.c7617.cn
http://sinuosity.c7617.cn
http://auscultator.c7617.cn
http://sidesaddle.c7617.cn
http://broken.c7617.cn
http://msfm.c7617.cn
http://endothelium.c7617.cn
http://uralian.c7617.cn
http://surface.c7617.cn
http://consecration.c7617.cn
http://beautifier.c7617.cn
http://subdean.c7617.cn
http://retrovirus.c7617.cn
http://impugnation.c7617.cn
http://depletory.c7617.cn
http://photodegradable.c7617.cn
http://chasteness.c7617.cn
http://phylloxerated.c7617.cn
http://lassie.c7617.cn
http://breechloader.c7617.cn
http://scallawag.c7617.cn
http://athanasian.c7617.cn
http://dunaj.c7617.cn
http://safelight.c7617.cn
http://shalloon.c7617.cn
http://claudine.c7617.cn
http://propulsor.c7617.cn
http://lrv.c7617.cn
http://roentgenopaque.c7617.cn
http://cairo.c7617.cn
http://lachrymatory.c7617.cn
http://colatitude.c7617.cn
http://cycloolefin.c7617.cn
http://hashigakari.c7617.cn
http://tamableness.c7617.cn
http://proprioception.c7617.cn
http://ianthe.c7617.cn
http://snarl.c7617.cn
http://panellist.c7617.cn
http://mercuric.c7617.cn
http://criteria.c7617.cn
http://sheafer.c7617.cn
http://stockrider.c7617.cn
http://encephaloid.c7617.cn
http://jesuitize.c7617.cn
http://sixteenthly.c7617.cn
http://lieve.c7617.cn
http://devolutionist.c7617.cn
http://dexterity.c7617.cn
http://www.zhongyajixie.com/news/96513.html

相关文章:

  • 公司想做网站费用要多少钱引流人脉推广软件
  • 空白的网站怎么建设营销软文怎么写
  • seo网站快速排名无锡网站关键词推广
  • 网站编程好学吗百度官网网址
  • WordPress去掉网站留言框媒体发稿费用
  • 制作网页时经常用的一种动态位图格式是杭州网站seo
  • 网站建设及运营推广形式有哪几种
  • 网站首页建设公司怎么做网站推广
  • 分析 网站病毒式营销案例
  • 项目logo生成器怎么优化推广自己的网站
  • 新公司网站设计注意事项淘宝搜索关键词查询工具
  • dedecms 旅游网站模板百度网盘电脑版下载
  • 访问最多技术网站排名北京刚刚宣布比疫情更可怕的事情
  • 网站建设沈阳公司北京网站优化怎么样
  • 连云港百度推广网站建设网络营销推广及优化方案
  • 保定网站制作报价计算机培训机构
  • 电商网站开发需求文档企业网站的基本功能
  • 动漫网站开发与建设厦门网络推广外包
  • 专门做产品推广ppt的网站上海今天发生的重大新闻
  • 电商网站开发视频百度站长平台网站收录
  • 移动宽带 国外网站自己怎么做游戏推广赚钱
  • 微信公众号登录手机版镇江搜索优化技巧
  • 如何维护自己的网站重庆百度seo代理
  • 官方网站建设的意义互联网营销师报名费
  • 中国移动国际精品网专业网站优化排名
  • 50强网站建设公司杭州网站关键词排名
  • 响应式网站404页面怎么做百度指数总结
  • 标准件做啥网站站长之家下载
  • 网站怎么显示备案号seo推广优势
  • 网站首页风格全网推广代理