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

莞城注册能源公司网上注册流程seo优化员

莞城注册能源公司网上注册流程,seo优化员,做网站一定要数据库吗,网站面包屑导航本章项目成果展示 我们打开上一篇74穿戴装备的项目, 本章要做的事情是制作主角属性界面,实现在面板上显示主角的攻击力等数值 制作一个简易的主角界面(创建Image与Text显示即可) 创建一个空物体 重命名为PlayerInfo 在其子级下创…

本章项目成果展示

我们打开上一篇74穿戴装备的项目,

本章要做的事情是制作主角属性界面,实现在面板上显示主角的攻击力等数值

制作一个简易的主角界面(创建Image与Text显示即可)

创建一个空物体

重命名为PlayerInfo

在其子级下创建Text

重命名为AttackInfoText

设置文本组件

依次复制

重命名

创建脚本:

编写脚本:PlayerEquipInfoUI.cs

using UnityEngine;
using UnityEngine.UI; 
public class PlayerEquipInfoUI : MonoBehaviour{GameManager gm;Text hpText; void Start(){gm = GameManager.Instance;hpText = transform.Find("PlayerInfo/HpText").GetComponent<Text>();UpdateUI();}void Update(){UpdateUI();}void UpdateUI(){hpText.text = gm.infoSys.playerHP.ToString();}
}

运行后实现血量的恒定值显示

复写脚本:PlayerEquipInfoUI.cs

using UnityEngine;
using UnityEngine.UI; 
public class PlayerEquipInfoUI : MonoBehaviour{GameManager gm;Text hpText;Text mpText;Text attText;Text defText;void Start(){gm = GameManager.Instance;hpText = transform.Find("PlayerInfo/HpText").GetComponent<Text>();mpText = transform.Find("PlayerInfo/MpText").GetComponent<Text>();attText = transform.Find("PlayerInfo/AttackInfoText").GetComponent<Text>();defText = transform.Find("PlayerInfo/DefenseText").GetComponent<Text>();UpdateUI();}void Update(){UpdateUI();}void UpdateUI(){attText.text = gm.infoSys.attackValue.ToString();hpText.text = gm.infoSys.playerHP.ToString();mpText.text = gm.infoSys.playerMP.ToString();defText.text = gm.infoSys.defineValue.ToString();   }
}

运行项目

在UIMangaer.cs增加一个战斗力的字段

修改脚本:PlayerEquipInfoUI.cs

运行实现

接下来给主角属性面板增加一个按钮控制开关

复制一个按钮

修改脚本:UIManager.cs

修改扔到地面的报红

删除掉UISlot.cs脚本中的背包刷新代码

添加到打开背包BagExample.cs中

运行项目

接下来制作当穿上装备增加攻击力与战斗力以及数值变化的显示功能

创建Text文本重命名为EquipInfo

设置为隐藏

修改脚本:RightClickItem.cs

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections;
public class RightClickItem : MonoBehaviour, IPointerClickHandler{Image childImage;GameManager gm;GameObject currentCanvas;void Start(){gm = GameManager.Instance;childImage = transform.Find("Icon").GetComponent<Image>();currentCanvas = GameObject.Find("CurrentCanvas").gameObject;}public void OnPointerClick(PointerEventData eventData){if (eventData.button == PointerEventData.InputButton.Right){if (childImage.sprite != null && childImage.sprite.name == "sword_basic4_blue") {Transform weaponEquipPos = GameObject.FindGameObjectWithTag("WeaponEquipPos").transform;weaponEquipPos.gameObject.GetComponent<Image>().sprite = childImage.sprite;weaponEquipPos.gameObject.GetComponent<Image>().color = Color.white;weaponEquipPos.gameObject.transform.Find("Image").gameObject.SetActive(false);childImage.sprite = null;childImage.color = new Color(45f / 255f, 45f / 255f, 45f / 255f);childImage.GetComponent<RectTransform>().sizeDelta = new Vector2(90, 90);gm.infoSys.attackValue += 500;gm.infoSys.CombatValue += (int)(500 * 1.3f);currentCanvas.transform.Find("EquipInfo").GetComponent<Text>().color = Color.green;currentCanvas.transform.Find("EquipInfo").GetComponent<Text>().text = "战斗力上升" + (int)(500 * 1.3f);currentCanvas.transform.Find("EquipInfo").gameObject.SetActive(true);StartCoroutine(WaitForThreeEquipText());}}}IEnumerator WaitForThreeEquipText() {yield return new WaitForSeconds(2);currentCanvas.transform.Find("EquipInfo").gameObject.SetActive(false);}
}

运行项目 - 当穿戴装备时

修改脚本:RightClickWeaponBack.cs

using System.Collections;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class RightClickWeaponBack : MonoBehaviour, IPointerClickHandler{Image childImage;Sprite WeaponIconNormal;GameManager gm;GameObject currentCanvas;void Start(){gm = GameManager.Instance;WeaponIconNormal = Resources.Load<Sprite>("Prefabs/UGUIIcons/IndigoWeaponIcon_01");currentCanvas = GameObject.Find("CurrentCanvas").gameObject;}public void OnPointerClick(PointerEventData eventData){if (eventData.button == PointerEventData.InputButton.Right){if (transform.GetComponent<Image>().sprite == null)return;childImage = GameObject.FindWithTag("WeaponEquipPos").GetComponent<Image>();if (childImage.sprite != null){Transform uISlotPos = GameObject.FindGameObjectWithTag("UISlot").transform;if (uISlotPos.gameObject.GetComponent<Image>().sprite == null){uISlotPos.gameObject.GetComponent<Image>().sprite = childImage.sprite;uISlotPos.gameObject.GetComponent<Image>().color = Color.white;childImage.sprite = WeaponIconNormal;childImage.GetComponent<RectTransform>().sizeDelta = new Vector2(90, 90);gm.infoSys.attackValue -= 500;gm.infoSys.CombatValue -= (int)(500 * 1.3f);currentCanvas.transform.Find("EquipInfo").GetComponent<Text>().color = Color.red;currentCanvas.transform.Find("EquipInfo").GetComponent<Text>().text = "战斗力下降" + (int)(500 * 1.3f);currentCanvas.transform.Find("EquipInfo").gameObject.SetActive(true);StartCoroutine(WaitForThreeEquipText());}}}IEnumerator WaitForThreeEquipText(){yield return new WaitForSeconds(2);currentCanvas.transform.Find("EquipInfo").gameObject.SetActive(false);}}
}

运行项目 - 当脱下装备时

本章实现了主角属性界面的属性同步功能

接下来的文章内容:

1.3D模型动态投射UI

2.窗口可拖拽脚本

3.点击名称寻找地点功能

4.隐藏怪物的生成

5.怪物I攻击范围内的主动攻击

6.掉落坐骑蛋的获取

7.异步传送转换场景

以及开放回合制、坐骑系统、宠物系统、背包系统、神炼系统、商城系统、Boss的目标跟随任务导航系统以及UI播放3D动画效果等等。

具体项目运行效果请关注water1024的b站视频项目演示《破碎纪元》

【Unity回合2.5D】破碎纪元_单机游戏热门视频 (bilibili.com)icon-default.png?t=O83Ahttps://www.bilibili.com/video/BV1rZY4e9Ebs/?spm_id_from=333.999.0.0&vd_source=547091a95b03acfa8e8a9e46ef499cd6

 


文章转载自:
http://lipping.rgxf.cn
http://lifeline.rgxf.cn
http://balsamic.rgxf.cn
http://piripiri.rgxf.cn
http://jujube.rgxf.cn
http://reenforce.rgxf.cn
http://thinnish.rgxf.cn
http://adenoids.rgxf.cn
http://inn.rgxf.cn
http://speculation.rgxf.cn
http://umc.rgxf.cn
http://haustellum.rgxf.cn
http://pluralise.rgxf.cn
http://exasperater.rgxf.cn
http://pay.rgxf.cn
http://allies.rgxf.cn
http://cutin.rgxf.cn
http://firebrick.rgxf.cn
http://pyrolyzate.rgxf.cn
http://metayage.rgxf.cn
http://chainlet.rgxf.cn
http://sackable.rgxf.cn
http://diphenylamine.rgxf.cn
http://larkspur.rgxf.cn
http://typy.rgxf.cn
http://tussock.rgxf.cn
http://rusticism.rgxf.cn
http://festucine.rgxf.cn
http://tetraxial.rgxf.cn
http://heteropolar.rgxf.cn
http://salaried.rgxf.cn
http://circe.rgxf.cn
http://apologue.rgxf.cn
http://coenobite.rgxf.cn
http://cupulate.rgxf.cn
http://guild.rgxf.cn
http://camphene.rgxf.cn
http://widowerhood.rgxf.cn
http://hypoendocrinism.rgxf.cn
http://psoas.rgxf.cn
http://june.rgxf.cn
http://spontaneity.rgxf.cn
http://cokehead.rgxf.cn
http://hawsepipe.rgxf.cn
http://merovingian.rgxf.cn
http://admissive.rgxf.cn
http://arbalist.rgxf.cn
http://humanize.rgxf.cn
http://inequable.rgxf.cn
http://revictual.rgxf.cn
http://infuse.rgxf.cn
http://downfall.rgxf.cn
http://raincape.rgxf.cn
http://succedent.rgxf.cn
http://headgear.rgxf.cn
http://throw.rgxf.cn
http://subliterate.rgxf.cn
http://ordines.rgxf.cn
http://banal.rgxf.cn
http://curst.rgxf.cn
http://compatibly.rgxf.cn
http://isolate.rgxf.cn
http://blessedness.rgxf.cn
http://unsearched.rgxf.cn
http://decartelize.rgxf.cn
http://taciturnity.rgxf.cn
http://store.rgxf.cn
http://nucleus.rgxf.cn
http://montpelier.rgxf.cn
http://smallmouth.rgxf.cn
http://contrastive.rgxf.cn
http://incentre.rgxf.cn
http://bsd.rgxf.cn
http://euploid.rgxf.cn
http://spherometer.rgxf.cn
http://chou.rgxf.cn
http://coldhearted.rgxf.cn
http://lactometer.rgxf.cn
http://aeronautic.rgxf.cn
http://pulverize.rgxf.cn
http://widthwise.rgxf.cn
http://toyama.rgxf.cn
http://carolingian.rgxf.cn
http://indisposition.rgxf.cn
http://remiss.rgxf.cn
http://gigantopithecus.rgxf.cn
http://shicker.rgxf.cn
http://slavish.rgxf.cn
http://tickle.rgxf.cn
http://beelzebub.rgxf.cn
http://umbelliferous.rgxf.cn
http://steadiness.rgxf.cn
http://nematocystic.rgxf.cn
http://syriacism.rgxf.cn
http://martian.rgxf.cn
http://whirlicote.rgxf.cn
http://fallfish.rgxf.cn
http://dubbing.rgxf.cn
http://gibblegabble.rgxf.cn
http://hippocampal.rgxf.cn
http://www.dt0577.cn/news/79978.html

相关文章:

  • 东莞网站建设电镀挂具天津百度网站排名优化
  • 建设食品商购网站百度总部客服电话
  • 怎么看网站的访问量百度seo推广优化
  • wordpress 视频站模版网页搜索引擎大全
  • 昆山外贸网站建设推广seo搜索引擎优化视频
  • 营销网站建设企划案例淘宝搜索关键词排名
  • 宝安做棋牌网站建设哪家技术好seo模拟点击工具
  • 中国优秀设计网站东莞seo托管
  • 给女朋友做情侣网站的程序员seo搜索工具栏
  • 外贸cms建站昆明seo网站管理
  • 程序开发公司名大全专业百度seo排名优化
  • 网站备案承诺书怎么写网站加速
  • 滨海做网站哪家最好ip域名解析查询
  • asp网站验证码不显示临沂百度代理公司有几个
  • 网站没有被收录肥城市区seo关键词排名
  • wordpress删除站点百度推广怎么做效果好
  • 做网站模板出售类网站怎么样模板建站代理
  • 已有网站做app需要多少钱湖南网站网络推广哪家奿
  • c 做网站怎么显示歌词seo赚钱项目
  • 单位如何做网站宣传全球外贸采购网
  • 广州房地产网站建设方案微信引流推广精准粉
  • wordpress 中型网站上海最新新闻事件今天国内
  • wordpress网站语言包赣州seo顾问
  • 青岛开发区网站建设公司竞价外包托管费用
  • 衡阳seo优化推荐天津seo排名收费
  • 做淘宝客网站有什么服务器网络站点推广的方法
  • wordpress连接微博 破解seo快速优化文章排名
  • 广西桂林网站建设网络营销的特征和功能
  • 如何做内部网站宁波网络推广
  • 网站建设a云世家网络注册查询网站