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

建网站后如何运营一加官网

建网站后如何运营,一加官网,网站在线制作,wordpress博客主机本章项目成果展示 我们打开上一篇74穿戴装备的项目#xff0c; 本章要做的事情是制作主角属性界面#xff0c;实现在面板上显示主角的攻击力等数值 制作一个简易的主角界面#xff08;创建Image与Text显示即可#xff09; 创建一个空物体 重命名为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).GetComponentText();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).GetComponentText();mpText transform.Find(PlayerInfo/MpText).GetComponentText();attText transform.Find(PlayerInfo/AttackInfoText).GetComponentText();defText transform.Find(PlayerInfo/DefenseText).GetComponentText();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).GetComponentImage();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.GetComponentImage().sprite childImage.sprite;weaponEquipPos.gameObject.GetComponentImage().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.GetComponentRectTransform().sizeDelta new Vector2(90, 90);gm.infoSys.attackValue 500;gm.infoSys.CombatValue (int)(500 * 1.3f);currentCanvas.transform.Find(EquipInfo).GetComponentText().color Color.green;currentCanvas.transform.Find(EquipInfo).GetComponentText().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.LoadSprite(Prefabs/UGUIIcons/IndigoWeaponIcon_01);currentCanvas GameObject.Find(CurrentCanvas).gameObject;}public void OnPointerClick(PointerEventData eventData){if (eventData.button PointerEventData.InputButton.Right){if (transform.GetComponentImage().sprite null)return;childImage GameObject.FindWithTag(WeaponEquipPos).GetComponentImage();if (childImage.sprite ! null){Transform uISlotPos GameObject.FindGameObjectWithTag(UISlot).transform;if (uISlotPos.gameObject.GetComponentImage().sprite null){uISlotPos.gameObject.GetComponentImage().sprite childImage.sprite;uISlotPos.gameObject.GetComponentImage().color Color.white;childImage.sprite WeaponIconNormal;childImage.GetComponentRectTransform().sizeDelta new Vector2(90, 90);gm.infoSys.attackValue - 500;gm.infoSys.CombatValue - (int)(500 * 1.3f);currentCanvas.transform.Find(EquipInfo).GetComponentText().color Color.red;currentCanvas.transform.Find(EquipInfo).GetComponentText().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)https://www.bilibili.com/video/BV1rZY4e9Ebs/?spm_id_from333.999.0.0vd_source547091a95b03acfa8e8a9e46ef499cd6
http://www.tj-hxxt.cn/news/222034.html

相关文章:

  • 娄底建设网站电商网站建设的内容
  • 百度的网站哪来的网站开发的销售
  • wordpress网站在哪里修改谷歌搜索关键词排名
  • 大学网站建设考核办法wordpress php5.6版本
  • 什么网站做蔬菜生鲜比较好成都信用网企业查询系统
  • 四川住房和城乡建设网站西安做网站app
  • 前端作业做一个网站国内域名网站有那些
  • 网站建设项目经理wordpress本地写文章
  • 易优建站南昌公路建设有限公司网站
  • 北京网页设计公司网站广州建设教育网站
  • 网站建设 官网芜湖的网站建设公司
  • 临沂品牌网站制作高端网站定制的方法
  • 做网站项目流程国内最近新闻
  • 公司网站制作教学今天发生的国外重大时事新闻
  • 高端网站建设公司费用在线代理上网
  • wordpress被改密码seo学院培训班
  • 塘厦镇做网站网页设计培训周志
  • 国外设计学院网站平台网站建设需要什么技术
  • 广东省城乡住房建设厅网站首页wordpress comment_form
  • 用php做的单车租赁网站网站开发员岗位职责
  • 怎么给自己做个网站吗网站接入服务提供商
  • python 建设网站售后服务网站建设
  • 吉林建设公司网站开一家网络公司需要什么
  • 企业网站备案材料中国容桂营销网站建设
  • 网页设计与网站建设批量建wordpress
  • 网站多久被百度收录dedecms做中英文网站
  • 设计一个电商网站的首页做拍卖的网站
  • powershell做网站郑州全平台广告推广
  • 门户网站集约化建设前端学校网站开发视频
  • 聊城专业网站建设公司哪家好大数据获客