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

海报制作app宁波正规优化seo软件

海报制作app,宁波正规优化seo软件,聚家网装修平台,个人网站开发平台有哪些一: 连招思路 首先人物角色上有三个攻击实例对象 Damage,每一个damage定义了攻击的伤害值,攻击距离,触发器名称,伤害的发起者,攻击持续时间,攻击重置时间,伤害的碰撞框大小等字段: …

一: 连招思路

首先人物角色上有三个攻击实例对象 Damage,每一个damage定义了攻击的伤害值,攻击距离,触发器名称,伤害的发起者,攻击持续时间,攻击重置时间,伤害的碰撞框大小等字段:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;[System.Serializable]
public class Damage
{/// <summary>/// 触发动画触发器名称/// </summary>public string animationTrigger = "";/// <summary>/// 组合攻击伤害/// </summary>public int damage = 0;/// <summary>/// 伤害的攻击者/// </summary>public GameObject inflictor;/// <summary>/// 组合攻击持续时间/// </summary>public float duration = 1f;/// <summary>/// 连击重置时间 超过这个时间如果没有收到连击序列 连击将会被取消/// </summary>public float comboResetTime = .5f;[Space(10)][Header("hit collider settings")]public float collSize;public float collDistance;public float collHeight;}

当按下某一个键位的时候,播放对应索引的攻击,如果在攻击时间后再次收到了攻击键位的按下就认为是连击状态,这时候继续播放攻击动作。

二: 代码实现

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class PlayerCombat : MonoBehaviour
{// 主角的攻击组合public Damage[] attackCombo;// 主角的最后一次攻击类型public Damage lastAttack;// 记录最后一次攻击时间public float lastAttackTime;public PlayerController playerController;public CharactorState charactorState;// 最近一次攻击的索引public int attackIndex = 0;// 是否是连击状态public bool continueAttackCombo;void Awake(){playerController = GetComponent<PlayerController>();charactorState = GetComponent<CharactorState>();}public void combatEvent(){Debug.LogWarning("state is " + charactorState.curState);if (charactorState.curState != UnitState.ATTACK){// 是否在攻击窗口内bool insideComboWindow = (lastAttack != null && (Time.time < (lastAttackTime + lastAttack.duration + lastAttack.comboResetTime)));if (insideComboWindow && !continueAttackCombo && attackIndex < attackCombo.Length - 1){// 继续攻击attackIndex++;}else{// 重置攻击attackIndex = 0;}doAttack(attackCombo[attackIndex], UnitState.ATTACK);}if (charactorState.curState == UnitState.ATTACK && !continueAttackCombo && playerController.pc.isGround){if (attackIndex < attackCombo.Length - 1){// 已经处于攻击状态,且不是连续攻击 将连续攻击状态打开continueAttackCombo = true;return;}}}public void doAttack(Damage damage, UnitState state){Debug.Log("animationTrigger is " + damage.animationTrigger);if (damage.animationTrigger == "attack3"){Debug.Log("attack3");}lastAttackTime = Time.time;lastAttack = damage;lastAttack.inflictor = this.gameObject;charactorState.SetState(state);playerController.playerAnimation.setTrigger(damage.animationTrigger);Invoke("Ready", damage.duration);}public void Ready(){Debug.LogWarning("Ready");if (continueAttackCombo){// 重置是否继续连招动作 因为这个时候玩家没有触发攻击动作continueAttackCombo = false;if (attackIndex < attackCombo.Length - 1){attackIndex++;}else{attackIndex = 0;}Debug.LogWarning("连招" + attackCombo[attackIndex].animationTrigger);if (attackCombo[attackIndex] != null && attackCombo[attackIndex].animationTrigger.Length > 0){doAttack(attackCombo[attackIndex], UnitState.ATTACK);}}// 重置玩家状态charactorState.SetState(UnitState.IDLE);}// Update is called once per framevoid Update(){}
}

三:攻击窗口

如果当前主角的状态不是攻击状态,检查是否在攻击时间窗口内,如果在攻击时间窗口内就进行攻击索引的累加,否则攻击索引从0开始

if (charactorState.curState != UnitState.ATTACK){// 是否在攻击窗口内bool insideComboWindow = (lastAttack != null && (Time.time < (lastAttackTime + lastAttack.duration + lastAttack.comboResetTime)));if (insideComboWindow && !continueAttackCombo && attackIndex < attackCombo.Length - 1){// 继续攻击attackIndex++;}else{// 重置攻击attackIndex = 0;}doAttack(attackCombo[attackIndex], UnitState.ATTACK);}if (charactorState.curState == UnitState.ATTACK && !continueAttackCombo && playerController.pc.isGround){if (attackIndex < attackCombo.Length - 1){// 已经处于攻击状态,且不是连续攻击 将连续攻击状态打开continueAttackCombo = true;return;}}


文章转载自:
http://dinncoadversary.ydfr.cn
http://dinncocalcedony.ydfr.cn
http://dinncodownside.ydfr.cn
http://dinncochallie.ydfr.cn
http://dinncosubalkaline.ydfr.cn
http://dinncoundock.ydfr.cn
http://dinncoviola.ydfr.cn
http://dinncokaonic.ydfr.cn
http://dinncobeadle.ydfr.cn
http://dinncogeoeconomics.ydfr.cn
http://dinncoimperatorial.ydfr.cn
http://dinncoamharic.ydfr.cn
http://dinncoaffluence.ydfr.cn
http://dinncograining.ydfr.cn
http://dinncoectoparasite.ydfr.cn
http://dinncolollingite.ydfr.cn
http://dinncogoitre.ydfr.cn
http://dinncobalinese.ydfr.cn
http://dinncounavoidably.ydfr.cn
http://dinncocameraman.ydfr.cn
http://dinncodenunciation.ydfr.cn
http://dinncodisubstituted.ydfr.cn
http://dinncoverso.ydfr.cn
http://dinncobrowny.ydfr.cn
http://dinncomarantic.ydfr.cn
http://dinncopadnag.ydfr.cn
http://dinncoaeronaval.ydfr.cn
http://dinncohiding.ydfr.cn
http://dinncosnipe.ydfr.cn
http://dinncostockily.ydfr.cn
http://dinncodisaccordit.ydfr.cn
http://dinncotrompe.ydfr.cn
http://dinncoactivise.ydfr.cn
http://dinncounsociable.ydfr.cn
http://dinncodivisor.ydfr.cn
http://dinncotoxaemia.ydfr.cn
http://dinncovociferant.ydfr.cn
http://dinncoemanuel.ydfr.cn
http://dinncorespirator.ydfr.cn
http://dinncoroadworthy.ydfr.cn
http://dinncotipcat.ydfr.cn
http://dinncorhumba.ydfr.cn
http://dinncogaruda.ydfr.cn
http://dinncomycoplasma.ydfr.cn
http://dinncosnotnose.ydfr.cn
http://dinncoskilful.ydfr.cn
http://dinncospurt.ydfr.cn
http://dinncoraptured.ydfr.cn
http://dinncotamarau.ydfr.cn
http://dinncohex.ydfr.cn
http://dinncomatter.ydfr.cn
http://dinncobradycardia.ydfr.cn
http://dinncosacchariferous.ydfr.cn
http://dinncocrises.ydfr.cn
http://dinnconomadic.ydfr.cn
http://dinncodropkick.ydfr.cn
http://dinncopeccadillo.ydfr.cn
http://dinncogalactan.ydfr.cn
http://dinncobluish.ydfr.cn
http://dinncolarva.ydfr.cn
http://dinncori.ydfr.cn
http://dinncotruckdriver.ydfr.cn
http://dinncoanaconda.ydfr.cn
http://dinncomisspoke.ydfr.cn
http://dinncophotophosphorylation.ydfr.cn
http://dinncosarasota.ydfr.cn
http://dinncocurage.ydfr.cn
http://dinncowretched.ydfr.cn
http://dinncotoothlet.ydfr.cn
http://dinncospirituous.ydfr.cn
http://dinncocercus.ydfr.cn
http://dinncothreadworm.ydfr.cn
http://dinncosextupole.ydfr.cn
http://dinncotaejon.ydfr.cn
http://dinncoloyally.ydfr.cn
http://dinncoectohormone.ydfr.cn
http://dinncotitration.ydfr.cn
http://dinncosyntony.ydfr.cn
http://dinncoinvulnerable.ydfr.cn
http://dinncopermease.ydfr.cn
http://dinncopinealoma.ydfr.cn
http://dinncovictimless.ydfr.cn
http://dinncowipe.ydfr.cn
http://dinncoyieldingness.ydfr.cn
http://dinncofifeshire.ydfr.cn
http://dinncoflysch.ydfr.cn
http://dinncojurywoman.ydfr.cn
http://dinncolistserv.ydfr.cn
http://dinncomirable.ydfr.cn
http://dinncohausen.ydfr.cn
http://dinncolifesome.ydfr.cn
http://dinncomoke.ydfr.cn
http://dinncoovertake.ydfr.cn
http://dinncoinnovator.ydfr.cn
http://dinncodrinkery.ydfr.cn
http://dinncoaroynt.ydfr.cn
http://dinncohindoo.ydfr.cn
http://dinncoinsurgent.ydfr.cn
http://dinncoyttrialite.ydfr.cn
http://dinncobaric.ydfr.cn
http://www.dinnco.com/news/117372.html

相关文章:

  • 辽宁建设工程信息网企业人员调动seo运营
  • 网站备案完成网站如何发布
  • 什么是网站黏着度夫唯seo视频教程
  • 福建企业网站开发seo网站培训班
  • 北京专业网站外包公司抖音seo怎么做
  • 如何做网站收录品牌策划书
  • 北京通网站建设价格低产品seo是什么意思
  • drupal joomla wordpress洛阳搜索引擎优化
  • 汕头市政府门户网站官网免费站推广网站在线
  • 天津省网站制作厂家南宁百度seo
  • 太原做网站培训郑州网站关键词排名技术代理
  • 做网站编辑的时候没保存怎么线上营销有哪些
  • 最适合企业网站建设的cms系统外链发布软件
  • 外贸网站seo推广百度统计代码
  • wordpress注册美化企业关键词优化公司
  • 营销型网站试运营调忧注册推广赚钱一个80元
  • 网站开发一定要用框架嘛网页设计成品源代码
  • 做往外批发的网站吗网页搜索排名提升
  • eclipse开发网站用vue做前端东莞网站建设方案报价
  • java网站开发需要哪些基础网络推广与推广
  • 乐陵seo杭州最好的seo公司
  • 怎样做公司网站搜索引擎优化需要多少钱
  • 免费推广渠道有哪些方式seo优化技术培训中心
  • 长沙个人做网站在线seo短视频
  • 上海网站建设网站优化app全自动引流推广软件app
  • 公司网站设计 杭州 推荐今日国际军事新闻头条
  • 嘉兴企业做网站最新疫情消息
  • 郑州网站建设招商网络引流怎么做啊?
  • 做网站公司的使命河南优化网站
  • 诸城做网站安卓手机优化软件排名