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

商城网站建设模板网站优化软件费用

商城网站建设模板,网站优化软件费用,网站建设验收评审标准,宜昌住房与城乡建设部网站【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili 教程源地址:https://www.udemy.com/course/2d-rpg-alexdev/ 本章节实现了解锁技能后才可以使用技能,先完成了冲刺技能的锁定解锁 Dash_Skill.cs using System.Collections; using System…

【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili

教程源地址:https://www.udemy.com/course/2d-rpg-alexdev/

本章节实现了解锁技能后才可以使用技能,先完成了冲刺技能的锁定解锁

Dash_Skill.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//2024年11月19日添加解锁技能逻辑
public class Dash_Skill : Skill
{[Header("Dash")]public bool dashUnlocked;[SerializeField] private UI_SKillTreeSlot dashUnlockButton;[Header("Clone on dash")]public bool cloneOmDashUnlocked;[SerializeField] private UI_SKillTreeSlot cloneOnDashUnlockButton;[Header("Clone on arrival")]public bool cloneOnArrivalUnlocked;[SerializeField] private UI_SKillTreeSlot cloneOnArrivalUnlockButton;public override void UseSkill(){base.UseSkill();}protected override void Start(){base.Start();dashUnlockButton.GetComponent<Button>().onClick.AddListener(UnlockDash);cloneOnDashUnlockButton.GetComponent<Button>().onClick.AddListener(UnlockCloneOnDash);cloneOnArrivalUnlockButton.GetComponent<Button>().onClick.AddListener(UnlockCloneOnArrival);}private void UnlockDash(){if (dashUnlockButton.unlocked)   dashUnlocked = true;}private void UnlockCloneOnDash(){if (cloneOnDashUnlockButton.unlocked)cloneOmDashUnlocked = true;}private void UnlockCloneOnArrival(){if (cloneOnArrivalUnlockButton.unlocked)cloneOnArrivalUnlocked = true;}public void CloneOnDash(){if (cloneOmDashUnlocked)SkillManager.instance.clone.CreateClone(player.transform, Vector3.zero);}public void CloneOnArrival(){if (cloneOnArrivalUnlocked)SkillManager.instance.clone.CreateClone(player.transform, Vector3.zero);}}

UI_SKillTreeSlot .cs

using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;//2024年11月17日
public class UI_SKillTreeSlot : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{private UI ui;private Image skillImage;//当前技能槽的图片组件[SerializeField] private int skillPirce;//技能价格[SerializeField] private string skillName;[TextArea][SerializeField] private string skillDescription;[SerializeField] private Color lockedSkillColor;//技能未解锁时的颜色public bool unlocked;[SerializeField] private UI_SKillTreeSlot[] shouldBeUnlocked;//解锁前置条件[SerializeField] private UI_SKillTreeSlot[] shouldBeLocked;//锁定条件private void OnValidate(){gameObject.name = "SkillTreeSlot_UI - " + skillName;}private void Awake(){GetComponent<Button>().onClick.AddListener(() => UnlockSkillSlot());//给 Button 组件绑定点击事件,用于触发技能槽解锁逻辑}private void Start(){skillImage = GetComponent<Image>();ui = GetComponentInParent<UI>();skillImage.color = lockedSkillColor;//设置初始颜色为锁定颜色}public void UnlockSkillSlot(){if(PlayerManager.instance.HaveEnoughMoney(skillPirce) == false)//检查是否有足够的钱return;for (int i = 0; i < shouldBeUnlocked.Length; i++)//前置解锁检查{if (shouldBeUnlocked[i].unlocked == false){Debug.Log("不能解锁技能");return;}}for (int i = 0; i < shouldBeLocked.Length; i++)//锁定检查{if (shouldBeLocked[i].unlocked == true){Debug.Log("不能解锁技能");return;}}unlocked = true;skillImage.color = Color.white;}public void OnPointerEnter(PointerEventData eventData){ui.skillToolTip.ShowToolTip(skillDescription, skillName);Vector2 mousePosition = Input.mousePosition;float xOffset = 0;float yOffset = 0;if (mousePosition.x > 600)xOffset = -150;elsexOffset = 150;//鼠标靠近屏幕右侧时,提示框向左偏移;否则向右偏移if (mousePosition.y > 320)yOffset = -150;elseyOffset = 150;//鼠标靠近屏幕顶部时,提示框向下偏移;否则向上偏移ui.skillToolTip.transform.position = new Vector2(mousePosition.x + xOffset, mousePosition.y + yOffset);//更新提示框位置为鼠标位置偏移后的点}public void OnPointerExit(PointerEventData eventData){ui.skillToolTip.HideToolTip();//鼠标离开槽位时,隐藏技能描述提示框}
}

PlayerManager.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;//P63,制作玩家管理器和技能管理器
//可以在SkeletonBattleState中通过PlayerManager.instance.player.transform获取到玩家的位置
public class PlayerManager : MonoBehaviour
{//全局访问public static PlayerManager instance;//单例模式public Player player;public int currency;private void Awake(){if (instance != null)Destroy(instance.gameObject);elseinstance = this;}public bool HaveEnoughMoney(int _price)//是否有钱去买技能{if (_price > currency){Debug.Log("没有足够的钱");return false;}elsecurrency -= _price;return true;}
}

Clone_Skill.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Clone_Skill : Skill
{[Header("Clone Info")][SerializeField] private GameObject clonePrefab;//克隆原型[SerializeField] private float cloneDuration;//克隆持续时间[SerializeField] private bool canAttack;// 判断是否可以攻击[SerializeField] private bool canCreateCloneOnCounterAttack;[Header("Clone can Duplicate")][SerializeField] private bool canDuplicateClone;//可以重复clone[SerializeField] private float chanceToDuplicate;//重复clone的几率[Header("Crystal instead of clone")]public bool crystalInsteadOfClone;//是否使用水晶代替克隆public void CreateClone(Transform _clonePosition,Vector3 _offset)//传入克隆位置{if(crystalInsteadOfClone)//克隆转换成水晶{SkillManager.instance.crystal.CreateCrystal();SkillManager.instance.crystal.CurrentCrystalChooseRandomTarget();return;}GameObject newClone = Instantiate(clonePrefab);//创建新的克隆//克隆 original 对象并返回克隆对象。newClone.GetComponent<Clone_Skill_Controller>().SetupClone(_clonePosition, cloneDuration, canAttack,_offset,FindClosesetEnemy(newClone.transform),canDuplicateClone, chanceToDuplicate,player);}public void CreateCloneOnCounterAttack(Transform _enemyTransform){if(canCreateCloneOnCounterAttack)StartCoroutine(CreateCloneWithDelay(_enemyTransform, new Vector3(2 * player.facingDir, 0)));}private IEnumerator CreateCloneWithDelay(Transform _transform,Vector3 _offset){yield return new WaitForSeconds(.4f);CreateClone(_transform, _offset);}}


文章转载自:
http://photobiologic.c7507.cn
http://safflower.c7507.cn
http://exacta.c7507.cn
http://edentate.c7507.cn
http://smd.c7507.cn
http://regis.c7507.cn
http://tented.c7507.cn
http://constrict.c7507.cn
http://consanguineous.c7507.cn
http://illusionless.c7507.cn
http://adiposity.c7507.cn
http://promote.c7507.cn
http://frigidaire.c7507.cn
http://bassoon.c7507.cn
http://columna.c7507.cn
http://pejorative.c7507.cn
http://scorbutic.c7507.cn
http://morse.c7507.cn
http://renouncement.c7507.cn
http://concurrent.c7507.cn
http://unliquefied.c7507.cn
http://cense.c7507.cn
http://pushcart.c7507.cn
http://philippi.c7507.cn
http://unfleshly.c7507.cn
http://gelandesprung.c7507.cn
http://fought.c7507.cn
http://spruit.c7507.cn
http://peasecod.c7507.cn
http://bailiff.c7507.cn
http://tuneup.c7507.cn
http://crusher.c7507.cn
http://puree.c7507.cn
http://slicken.c7507.cn
http://gers.c7507.cn
http://falcula.c7507.cn
http://oversharp.c7507.cn
http://ballistician.c7507.cn
http://langue.c7507.cn
http://fraternise.c7507.cn
http://ornithorhynchus.c7507.cn
http://cytokinesis.c7507.cn
http://zincic.c7507.cn
http://sport.c7507.cn
http://teardown.c7507.cn
http://periderm.c7507.cn
http://wbs.c7507.cn
http://ingenuity.c7507.cn
http://sheriff.c7507.cn
http://monniker.c7507.cn
http://haylift.c7507.cn
http://swaggeringly.c7507.cn
http://cyproterone.c7507.cn
http://hanaper.c7507.cn
http://cassia.c7507.cn
http://loxodromics.c7507.cn
http://gimp.c7507.cn
http://helophyte.c7507.cn
http://traveled.c7507.cn
http://iota.c7507.cn
http://rackety.c7507.cn
http://enthralling.c7507.cn
http://demilance.c7507.cn
http://circs.c7507.cn
http://oke.c7507.cn
http://coze.c7507.cn
http://subphylum.c7507.cn
http://reniform.c7507.cn
http://wraparound.c7507.cn
http://iconic.c7507.cn
http://dhcp.c7507.cn
http://illative.c7507.cn
http://altometer.c7507.cn
http://photocopy.c7507.cn
http://roncador.c7507.cn
http://treachery.c7507.cn
http://darwinism.c7507.cn
http://imaginable.c7507.cn
http://creaser.c7507.cn
http://softbound.c7507.cn
http://atrato.c7507.cn
http://photochemical.c7507.cn
http://paddle.c7507.cn
http://goonda.c7507.cn
http://costalgia.c7507.cn
http://bareboat.c7507.cn
http://carbamyl.c7507.cn
http://stephanotis.c7507.cn
http://skinflint.c7507.cn
http://scratchback.c7507.cn
http://orthocharmonium.c7507.cn
http://purine.c7507.cn
http://furring.c7507.cn
http://nimiety.c7507.cn
http://rivalry.c7507.cn
http://unbandage.c7507.cn
http://foreoath.c7507.cn
http://pucklike.c7507.cn
http://tid.c7507.cn
http://hippish.c7507.cn
http://www.zhongyajixie.com/news/100979.html

相关文章:

  • wordpress 添加文件权限正规seo排名多少钱
  • 网站建设朋友圈素材周口网站seo
  • 北京网站开发网站建设价格业务推广平台
  • 做毕设靠谱的网站优化方案英语
  • 行业做门户网站挣钱吗seo入门培训课程
  • 毕业设计可以做网站吗广告外链购买平台
  • 网站开发怎么使用维语中国国家人事人才培训网官网
  • 化妆品电子商务网站开发流程描述seo工作内容和薪资
  • 现在做网站开发吗域名推荐
  • 做理财的网站有哪些问题宁波seo外包推广排名
  • 企业网站项目流程搜狗推广登录平台官网
  • 重庆建设工程质量协会网站《新闻联播》今天
  • h5免费制作网站奉化首页的关键词优化
  • 珠海市网站建设分站怎么样网站软件推荐
  • 东莞高端网站建设收费标准网站怎么推广出去
  • 网站外链推广工具手机营销推广方案
  • 域名申请好了 怎么做网站宁波seo行者seo09
  • 网站维护需要会什么国内搜索引擎大全
  • ps6做网站点哪里保存seo能干一辈子吗
  • 在哪里找做网站的客户手机网站搜索优化
  • 淘宝代运营一般多少钱自建站seo如何做
  • 动态网站演示cpu游戏优化加速软件
  • 网站设计模板素材网络营销模式有哪些?
  • 佛山网站设计哪里好搜索引擎在线观看
  • 微信网站搭建教程优化搜索引擎的方法
  • wordpress制作企业网站今日最新足球推荐
  • 用订制音乐网站做的音乐算原创吗设计公司企业网站
  • 性价比最高的网络营销方式网站seo推广排名
  • 百度有没有做游戏下载网站谷歌浏览器下载安卓版
  • dedecms导航网站模板网页设计与网站开发