【UnityRPG游戏制作】Unity_RPG项目_PureMVC框架应用

👨💻个人主页:@元宇宙-秩沅
👨💻 hallo 欢迎 点赞👍 收藏⭐ 留言📝 加关注✅!
👨💻 本文由 秩沅 原创
👨💻 收录于专栏:就业宝典
⭐🅰️推荐专栏⭐
⭐-软件设计师高频考点大全⭐
文章目录
- ⭐前言⭐
- (==3==)PureMVC框架面板系统
- **SetPanel**
- **GamePanel**
- statePanel
- backPackPanel
- RolePanel
- SotrePanel
- TipPanel
- StartTipPanel
- NPCTipPanel
- GameOVerPanel
- GamePassPanel(Clone)
- ⭐🅰️⭐
⭐前言⭐

(3)PureMVC框架面板系统

SetPanel

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//-------------------------------
//-------功能: 设置面板视图
//-------创建者: -------
//------------------------------public class SetView : BasePanel
{public Button stayBtu; //继续游戏按钮public Slider soundSlider; //音量滑动条 }
using PureMVC.Interfaces;
using PureMVC.Patterns.Mediator;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;//-------------------------------
//-------功能: 设置面板视图中介
//-------创建者: -------
//------------------------------public class SetViewMediator : Mediator
{//铭牌名public static string NAME = "SetViewMediator";/// <summary>/// 构造函数/// </summary>public SetViewMediator() : base(NAME){}/// <summary>/// 重写监听感兴趣的通知的方法/// </summary>/// <returns>返回你需要监听的通知的名字数组</returns>public override string[] ListNotificationInterests(){return new string[] {};}/// <summary>/// 面板中组件设置(监听相关)/// </summary>/// <param name="stateView"></param>public void setView(SetView seteView){ViewComponent = seteView;seteView.stayBtu.onClick.AddListener(() =>{SendNotification(PureNotification.HIDE_PANEL, "SetPanel");});//音乐滑动条seteView.soundSlider.onValueChanged.AddListener((vlaue) => {PlayerContorller.GetInstance().audioClip.volume = vlaue;});}/// <summary>/// 玩家受伤逻辑/// </summary>public void Hurt(){}/// <summary>/// 重写处理通知的方法,处理通知,前提是完成通知的监听/// </summary>/// <param name="notification">通知</param>public override void HandleNotification(INotification notification){}}
GamePanel

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//-------------------------------
//-------功能: 游戏面板视图
//-------创建者: -------
//------------------------------public class GameView : BasePanel
{public Slider audioSliderVuale; //音量滑动条public Button startBtu; //开始按钮public Button tipBtu; //游戏说明按钮}
using PureMVC.Interfaces;
using PureMVC.Patterns.Mediator;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;//-------------------------------
//-------功能: 游戏面板视图中介
//-------创建者: -------
//------------------------------public class GameViewMediator : Mediator
{//铭牌名public static string NAME = "GameViewMediator";/// <summary>/// 构造函数/// </summary>public GameViewMediator() : base(NAME){}/// <summary>/// 重写监听通知的方法,返回需要的监听(通知)/// </summary>/// <returns>返回你需要监听的通知的名字数组</returns>public override string[] ListNotificationInterests(){return new string[] {//PureNotification.UPDATA_ROLE_INFO,//PureNotification.UPDATA_STATE_INFO};}/// <summary>/// 面板中组件设置(监听相关)/// </summary>/// <param name="gameView"></param>public void SetView(GameView gameView){Debug.Log(gameView+"执行SetView");ViewComponent = gameView;//开始按钮逻辑监听gameView.startBtu.onClick.AddListener(()=>{Time.timeScale = 1;//取消游戏暂停SendNotification(PureNotification.HIDE_PANEL, "GamePanel");SendNotification(PureNotification.SHOW_PANEL, "StatePanel");});gameView.tipBtu .onClick.AddListener(() =>{SendNotification(PureNotification.SHOW_PANEL , "StartTipPanel");});//音乐滑动条gameView.audioSliderVuale .onValueChanged.AddListener((vlaue) =>{PlayerContorller.GetInstance().audioClip.volume = vlaue;});}/// <summary>/// 重写处理通知的方法,处理通知/// </summary>/// <param name="notification">通知</param>public override void HandleNotification(INotification notification){switch (notification.Name){//case PureNotification.UPDATA_STATE_INFO:// (ViewComponent as StateView).UpdateView(notification.Body as PlayerDataObj);// break;}}
}
statePanel

using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;//-------------------------------
//-------功能: 状态面板视图
//-------创建者: -------
//------------------------------public class StateView : BasePanel
{//1.找控件public TextMeshProUGUI levelText; //等级 public TextMeshProUGUI bloodValue; //当前血量 public TextMeshProUGUI attackVaule; //攻击力值 public float blood ,maxBlood, attack; public Slider hpSlider; //玩家血条 public Slider expSlider; //经验血条 public Slider bossSlider; //Boss血条 public Button roleBtu; //角色按钮 public Button backpackBtu; //背包按钮 public Image weaponSprite;//当前武器 public Text damon; //当前钻石的数量/// <summary>/// 2.更新面板视图View的显示数据/// </summary>public void UpdateView(PlayerDataObj data) //此处选择的是MVC的思想,在这里些许有些耦合{Debug.Log("来更新了");if(data != null){blood = data.blood;attack = data.attack;maxBlood = data.maxBlood; levelText.text = Convert.ToString(data.level);bloodValue.text = Convert.ToString(data.blood); attackVaule.text = Convert.ToString(data.attack); bossSlider.value = data.blood / data.maxBlood;weaponSprite.sprite = data.nowItem ;damon.text = Convert.ToString(PlayerContorller.GetInstance().damonNum ); }else{Debug.Log("date为空");}}/// <summary>/// 增加钻石/// </summary>public void UpdateDamon(){damon.text = PlayerContorller .GetInstance().damonNum .ToString ();}}
using PureMVC.Core;
using PureMVC.Interfaces;
using PureMVC.Patterns.Mediator;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//-------------------------------
//-------功能: 状态面板视图中介
//-------创建者:
//------------------------------/// <summary>
/// 状态面板视图中介
/// 固定:
/// 1.继承PureMVC的Mediator脚本
/// 2.写构造函数
/// 3.重写监听通知的方法
/// 4.重写处理通知的方法
/// 5.可选:重写注册时的方法
/// </summary>
public class StateViewMediator : Mediator
{ //铭牌名public static string NAME = "StateViewMediator";/// <summary>/// 构造函数/// </summary>public StateViewMediator() : base(NAME){}/// <summary>/// 重写监听感兴趣的通知的方法/// </summary>/// <returns>返回你需要监听的通知的名字数组</returns>public override string[] ListNotificationInterests(){return new string[] {PureNotification.UPDATA_STATE_INFO,PureNotification.PLAYER_INJURY ,PureNotification.LEVEL_UP ,PureNotification.UPDATA_WEAPON_INFO2,PureNotification .UPDATA_EXP,PureNotification.UPDATA_DAMON};}/// <summary>/// 面板中组件设置(监听相关)/// </summary>/// <param name="stateView"></param>public void setView(StateView stateView){ViewComponent = stateView;stateView.roleBtu.onClick.AddListener(()=>{//SendNotification(PureNotification.HIDE_PANEL, "StatePanel");SendNotification(PureNotification.SHOW_PANEL, "RolePanel");});stateView.backpackBtu.onClick.AddListener(() =>{//SendNotification(PureNotification.HIDE_PANEL, "StatePanel");SendNotification(PureNotification.SHOW_PANEL, "BackpackPanel");}); }/// <summary>/// 玩家受伤逻辑/// </summary>public void Hurt(){}/// <summary>/// 重写处理通知的方法,处理通知,前提是完成通知的监听/// </summary>/// <param name="notification">通知</param>public override void HandleNotification(INotification notification){switch (notification.Name){case PureNotification.UPDATA_STATE_INFO: //状态更新的处理逻辑(ViewComponent as StateView).UpdateView(notification.Body as PlayerDataObj);break;case PureNotification.PLAYER_INJURY : //玩家受伤命令的处理逻辑if (ViewComponent != null){StateView stateView = ViewComponent as StateView;int blood = Convert.ToInt32(notification.Body);stateView.blood -= blood ;stateView.blood = stateView.blood > stateView.maxBlood ? stateView.maxBlood : stateView.blood; //防止血条溢出float off = stateView.blood / stateView.maxBlood;stateView.hpSlider.value = off; //改变血条if(off <= 0)//如果血条变成0或者小于0,则玩家死亡{PlayerContorller.GetInstance().isDied = true;PlayerContorller.GetInstance().DiedEvent();//开启死亡}}break; case PureNotification.UPDATA_WEAPON_INFO2 : //玩家武器信息更新的处理逻辑if (ViewComponent != null){StateView stateView = ViewComponent as StateView;stateView.weaponSprite.sprite = notification .Body as Sprite ;stateView.weaponSprite.enabled = true;}break;case PureNotification.UPDATA_EXP ://玩家经验信息更新的处理逻辑if (ViewComponent != null){StateView stateView = ViewComponent as StateView;int exp = Convert.ToInt32(notification.Body);float off = exp / 100f;Debug.Log("来了"+off);stateView.expSlider .value = off; //改变经验条if(off >= 1 ) //经验条满{stateView.blood = stateView.maxBlood;if (!Facade.HasProxy (PlayerProxy.NAME)) //首先判断是否有该中介,没有就new一个{Facade.RegisterProxy(new PlayerProxy()); //注册该视图中介}//获取视图对应的代理PlayerProxy bm = Facade.RetrieveProxy(PlayerProxy.NAME) as PlayerProxy;bm.LevUp(); //数据升级的方法stateView.UpdateView(bm.Data as PlayerDataObj); //升级数据stateView.expSlider.value = 0;PlayerContorller.GetInstance().exp = 0; //经验条归位}}break;case PureNotification.UPDATA_DAMON:{if (ViewComponent != null){StateView stateView = ViewComponent as StateView;stateView.UpdateDamon(); //执行增加钻石的方法}break;}}}}
backPackPanel

using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;//-------------------------------
//-------功能: 背包系统视图
//-------创建者:
//------------------------------public class BackpackView : BasePanel
{public Button back; //退出按钮public GridLayoutGroup grid; /// <summary>/// 更新背包中的内容/// </summary>/// <param name="itemBtu"></param>public void AddItem(Button itemBtu){try{Destroy(itemBtu.transform.GetComponent<ShopItem>()); //移除该商品的脚本itemBtu.transform.AddComponent<PropItem>(); //重新添加脚本}catch { }//将传入的按钮设置为布局下面的子物体itemBtu.transform.SetParent (grid.gameObject.transform );itemBtu.transform.localScale = Vector3.one ;//初始化商品道具大小}}
RolePanel

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//-------------------------------
//-------功能: 角色面板视图
//-------创建者: -------
//------------------------------public class RoleView : BasePanel
{//1.找控件public Button back; //退出public Text levelText; //等级public Text maxBlood; //最大血量public Text attackVaule; //攻击力值public Text defenceVaule; //防御力值public Text CriticalVaule; //暴击率public Image[] item; //武器栏图public GameObject[] role; //显示角色选择/// <summary>/// 2.更新面板视图View的显示数据/// </summary>public void UpdateView(PlayerDataObj data) //此处选择的是MVC的思想,在这里些许有些耦合{if (data != null){levelText.text = data.level.ToString();maxBlood.text = data.maxBlood.ToString();attackVaule.text = data.attack.ToString();defenceVaule.text = data.denfence.ToString();CriticalVaule.text = data.strike.ToString();}else{Debug.Log("角色面板无法更新");}}/// <summary>/// 更新武器栏中的图片/// </summary>/// <param name="item"></param>public void UpdateWeaponItem(PlayerDataObj data){Debug.Log("更新武器");if (data.index < 3 && PlayerContorller.GetInstance().curWeaponNum >0){this.item[data.index].enabled = true;this.item[data.index++].sprite = data.nowItem;} }
}
using PureMVC.Interfaces;
using PureMVC.Patterns.Mediator;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;//-------------------------------
//-------功能: 角色面板视图中介
//-------创建者: -------
//------------------------------/// <summary>
/// 角色面板视图中介
/// 固定:
/// 1.继承PureMVC的Mediator脚本
/// 2.写构造函数
/// 3.重写监听通知的方法
/// 4.重写处理通知的方法
/// 5.可选:重写注册时的方法
/// </summary>
public class RoleViewMediator : Mediator
{//铭牌名public static string NAME = "RoleViewMediator";/// <summary>/// 构造函数/// </summary>public RoleViewMediator( ) : base(NAME){//可以去写创捷面板预设体的逻辑等}/// <summary>/// 重写监听通知的方法,返回需要的监听(通知)/// </summary>/// <returns>返回你需要监听的通知的名字数组</returns>public override string[] ListNotificationInterests(){return new string[] { PureNotification.UPDATA_ROLE_INFO,PureNotification.UPDATA_WEAPON_INFO1};}public void SetView(RoleView roleView){Debug.Log(roleView + "执行SetView");ViewComponent = roleView;//开始按钮逻辑监听roleView.back.onClick.AddListener(() =>{SendNotification(PureNotification.HIDE_PANEL, "RolePanel");});}/// <summary>/// 重写处理通知的方法,处理通知/// </summary>/// <param name="notification">通知</param>public override void HandleNotification(INotification notification){switch (notification.Name){case PureNotification.UPDATA_ROLE_INFO:if (ViewComponent != null){(ViewComponent as RoleView).UpdateView(notification.Body as PlayerDataObj);(ViewComponent as RoleView).UpdateWeaponItem(notification.Body as PlayerDataObj);}else { Debug.Log("为空"); }break;}}/// <summary>/// 可选:重写注册方法(他们需要到Facde中注册)/// </summary>public override void OnRegister(){base.OnRegister();}}
SotrePanel

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//-------------------------------
//-------功能: 商城系统
//-------创建者: -------
//------------------------------public class StoreView : BasePanel
{public GridLayoutGroup StoreGrid;public GridLayoutGroup BackGrid;public Button backBtu;public Button bugPack;//放入背包}
using PureMVC.Interfaces;
using PureMVC.Patterns.Mediator;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;//-------------------------------
//-------功能: -------
//-------创建者: -------
//------------------------------public class StoreViewMediator : Mediator
{//铭牌名public static string NAME = "StoreViewMediator";/// <summary>/// 构造函数/// </summary>public StoreViewMediator() : base(NAME){}/// <summary>/// 重写监听感兴趣的通知的方法/// </summary>/// <returns>返回你需要监听的通知的名字数组</returns>public override string[] ListNotificationInterests(){return new string[] {};}/// <summary>/// 面板中组件设置(监听相关)/// </summary>/// <param name="stateView"></param>public void setView(StoreView storeView){ViewComponent = storeView;if(ViewComponent == null) { Debug.Log("面板是空的"); }storeView.backBtu.onClick.AddListener(()=>{SendNotification(PureNotification.HIDE_PANEL, "StorePanel");});storeView.bugPack.onClick.AddListener(() =>{SendNotification(PureNotification.HIDE_PANEL, "StorePanel");});}/// <summary>/// 玩家受伤逻辑/// </summary>public void Hurt(){}/// <summary>/// 重写处理通知的方法,处理通知,前提是完成通知的监听/// </summary>/// <param name="notification">通知</param>public override void HandleNotification(INotification notification){switch (notification.Name){}}
}
TipPanel


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//-------------------------------
//-------功能: 余额不足提示面板视图
//-------创建者: -------
//------------------------------public class TipView : BasePanel
{public Button ok;
}
using PureMVC.Interfaces;
using PureMVC.Patterns.Mediator;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;//-------------------------------
//-------功能: 余额不足提示面板中介
//-------创建者: -------
//------------------------------public class TipViewMediator : Mediator
{//铭牌名public static string NAME = "TipViewMediator";/// <summary>/// 构造函数/// </summary>public TipViewMediator() : base(NAME){}/// <summary>/// 重写监听感兴趣的通知的方法/// </summary>/// <returns>返回你需要监听的通知的名字数组</returns>public override string[] ListNotificationInterests(){return new string[] {};}/// <summary>/// 面板中组件设置(监听相关)/// </summary>/// <param name="stateView"></param>public void setView(TipView tipView){ViewComponent = tipView;if (ViewComponent == null) { Debug.Log("面板是空的"); }tipView.ok.onClick.AddListener(() =>{SendNotification(PureNotification.HIDE_PANEL, "TipPanel");});}/// <summary>/// 玩家受伤逻辑/// </summary>public void Hurt(){}/// <summary>/// 重写处理通知的方法,处理通知,前提是完成通知的监听/// </summary>/// <param name="notification">通知</param>public override void HandleNotification(INotification notification){switch (notification.Name){}}
}
StartTipPanel

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//-------------------------------
//-------功能: 开始说明面板视图
//-------创建者: -------
//------------------------------public class StartTipView : BasePanel
{public Button startBtu; }
using PureMVC.Interfaces;
using PureMVC.Patterns.Mediator;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;//-------------------------------
//-------功能: 开始说明面板视图中介
//-------创建者: -------
//------------------------------public class StartTipViewMediator : Mediator
{//铭牌名public static string NAME = "StartTipViewMediator";/// <summary>/// 构造函数/// </summary>public StartTipViewMediator() : base(NAME){}/// <summary>/// 重写监听通知的方法,返回需要的监听(通知)/// </summary>/// <returns>返回你需要监听的通知的名字数组</returns>public override string[] ListNotificationInterests(){return new string[] {//PureNotification.UPDATA_ROLE_INFO,//PureNotification.UPDATA_STATE_INFO};}public void SetView(StartTipView startTipView){Debug.Log(startTipView + "执行SetView");ViewComponent = startTipView;//按钮逻辑监听startTipView.startBtu.onClick.AddListener(() =>{SendNotification(PureNotification.HIDE_PANEL, "GamePanel");SendNotification(PureNotification.HIDE_PANEL, "startTipPanel");SendNotification(PureNotification.SHOW_PANEL, "StatePanel");});}/// <summary>/// 重写处理通知的方法,处理通知/// </summary>/// <param name="notification">通知</param>public override void HandleNotification(INotification notification){switch (notification.Name){//case PureNotification.UPDATA_STATE_INFO:// (ViewComponent as StateView).UpdateView(notification.Body as PlayerDataObj);// break;}}
}
NPCTipPanel

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//-------------------------------
//-------功能: NPC交互面板视图
//-------创建者: -------
//------------------------------public class NPCTipView : BasePanel
{public Button backBtu;
}
using PureMVC.Interfaces;
using PureMVC.Patterns.Mediator;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;//-------------------------------
//-------功能: NPC交互面板视图中介
//-------创建者: -------
//------------------------------/// <summary>
/// 状态面板视图中介
/// 固定:
/// 1.继承PureMVC的Mediator脚本
/// 2.写构造函数
/// 3.重写监听通知的方法
/// 4.重写处理通知的方法
/// 5.可选:重写注册时的方法
/// </summary>
public class NPCTipViewMediator : Mediator
{//铭牌名public static string NAME = "NPCTipViewMediator";/// <summary>/// 构造函数/// </summary>public NPCTipViewMediator() : base(NAME){}/// <summary>/// 面板中组件设置(监听相关)/// </summary>public void SetView(NPCTipView npcTipView){Debug.Log(npcTipView + "执行SetView");ViewComponent = npcTipView;//出击按钮逻辑监听npcTipView.backBtu.onClick.AddListener(() =>{SendNotification(PureNotification.HIDE_PANEL, "NPCTipPanel"); });}/// <summary>/// 重写监听通知的方法,返回需要的监听(通知)/// </summary>/// <returns>返回你需要监听的通知的名字数组</returns>public override string[] ListNotificationInterests(){return new string[] {//PureNotification.UPDATA_ROLE_INFO,//PureNotification.UPDATA_STATE_INFO};}/// <summary>/// 重写处理通知的方法,处理通知/// </summary>/// <param name="notification">通知</param>public override void HandleNotification(INotification notification){switch (notification.Name){//case PureNotification.UPDATA_STATE_INFO:// (ViewComponent as StateView).UpdateView(notification.Body as PlayerDataObj);// break;}}
}
GameOVerPanel

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//-------------------------------
//-------功能: 失败面板视图
//-------创建者: -------
//------------------------------public class DefeatView : BasePanel
{public Button restartBtu; //重新开始按钮public Button endBtu; //结束按钮
}
using PureMVC.Interfaces;
using PureMVC.Patterns.Mediator;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;//-------------------------------
//-------功能: 失败面板视图中介
//-------创建者: -------
//------------------------------/// <summary>
/// 状态面板视图中介
/// 固定:
/// 1.继承PureMVC的Mediator脚本
/// 2.写构造函数
/// 3.重写监听通知的方法
/// 4.重写处理通知的方法
/// 5.可选:重写注册时的方法
/// </summary>
public class DefeatViewMediator : Mediator
{//铭牌名public static string NAME = "DefeatViewMediator";/// <summary>/// 构造函数/// </summary>public DefeatViewMediator() : base(NAME){}/// <summary>/// 重写监听通知的方法,返回需要的监听(通知)/// </summary>/// <returns>返回你需要监听的通知的名字数组</returns>public override string[] ListNotificationInterests(){return new string[] {//PureNotification.UPDATA_ROLE_INFO,//PureNotification.UPDATA_STATE_INFO};}public void SetView(DefeatView defeatView){ViewComponent = defeatView;defeatView.restartBtu.onClick.AddListener(()=>{SendNotification(PureNotification.HIDE_PANEL ,"DefeatPanel");SceneManager.LoadScene(2);});defeatView.endBtu .onClick.AddListener(() => {SendNotification(PureNotification.HIDE_PANEL, "DefeatPanel");SceneManager.LoadScene(2);});}/// <summary>/// 重写处理通知的方法,处理通知/// </summary>/// <param name="notification">通知</param>public override void HandleNotification(INotification notification){switch (notification.Name){//case PureNotification.UPDATA_STATE_INFO:// (ViewComponent as StateView).UpdateView(notification.Body as PlayerDataObj);// break;}}
}
GamePassPanel(Clone)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//-------------------------------
//-------功能: 通过游戏面板视图
//-------创建者: -------
//------------------------------public class GamePassView : BasePanel
{public Button okenter;
}
using PureMVC.Interfaces;
using PureMVC.Patterns.Mediator;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;//-------------------------------
//-------功能: 通过游戏面板视图中介
//-------创建者: -------
//------------------------------public class GamePassViewMediator : Mediator
{//铭牌名public static string NAME = "GamePassViewMediator";/// <summary>/// 构造函数/// </summary>public GamePassViewMediator() : base(NAME){}/// <summary>/// 重写监听感兴趣的通知的方法/// </summary>/// <returns>返回你需要监听的通知的名字数组</returns>public override string[] ListNotificationInterests(){return new string[] {};}/// <summary>/// 面板中组件设置(监听相关)/// </summary>/// <param name="stateView"></param>public void setView(GamePassView tipView2){ViewComponent = tipView2;if (ViewComponent == null) { Debug.Log("面板是空的"); }tipView2.okenter .onClick.AddListener(() =>{SendNotification(PureNotification.HIDE_PANEL, "GamePassPanel");SceneManager.LoadScene(2);});}/// <summary>/// 玩家受伤逻辑/// </summary>public void Hurt(){}/// <summary>/// 重写处理通知的方法,处理通知,前提是完成通知的监听/// </summary>/// <param name="notification">通知</param>public override void HandleNotification(INotification notification){switch (notification.Name){}}
}
⭐🅰️⭐
⭐【Unityc#专题篇】之c#进阶篇】
⭐【Unityc#专题篇】之c#核心篇】
⭐【Unityc#专题篇】之c#基础篇】
⭐【Unity-c#专题篇】之c#入门篇】
⭐【Unityc#专题篇】—进阶章题单实践练习
⭐【Unityc#专题篇】—基础章题单实践练习
⭐【Unityc#专题篇】—核心章题单实践练习
你们的点赞👍 收藏⭐ 留言📝 关注✅是我持续创作,输出优质内容的最大动力!、

相关文章:
【UnityRPG游戏制作】Unity_RPG项目_PureMVC框架应用
👨💻个人主页:元宇宙-秩沅 👨💻 hallo 欢迎 点赞👍 收藏⭐ 留言📝 加关注✅! 👨💻 本文由 秩沅 原创 👨💻 收录于专栏:就业…...
并行计算的一些知识点分享--并行系统,并行程序, 并发,并行,分布式
并行计算 核是个啥? 在并行计算中,“核”通常指的是处理器的核心(CPU核心)。每个核心都是一个独立的处理单元,能够执行计算任务。多核处理器指的是拥有多个这样核心的单一物理处理器,这样的设计可以允许多…...
设计模式:访问者模式
访问者模式(Visitor Pattern)是行为设计模式的一种,它使你能够在不修改对象结构的情况下,给对象结构中的每个元素添加新的功能。访问者模式将数据结构和作用于结构上的操作解耦,使得操作集合可相对自由地演化。 核心概…...
vivado Virtex-7 配置存储器器件
Virtex-7 配置存储器器件 下表所示闪存器件支持通过 Vivado 软件对 Virtex -7 器件执行擦除、空白检查、编程和验证等配置操作。 本附录中的表格所列赛灵思系列非易失性存储器将不断保持更新 , 并支持通过 Vivado 软件对其中所列非易失性存储器 进行擦除、…...
检测服务器环境,实现快速部署。适用于CRMEB_PRO/多店
运行效果如图: 最近被好多人问,本来运行的好好的,突然swoole就启动不了了。 本工具为爱发电,如果工具正好解决了您的需求。我会很开心 代码如下: """本脚本为爱发电by:网前雨刮器 """…...
Spring Security初探
url说明方法/login/oauth/authorize授权断点。无登录态时跳转到/authentication/require,有登录态时跳转到/loginorg.springframework.security.oauth2.provider.endpoint.AuthorizationEndpoint#authorize/authentication/require自己写的用于重定向到登录页面的ur…...
【Java代码审计】敏感信息泄漏篇
【Java代码审计】敏感信息泄漏篇 敏感信息泄露概述 敏感信息泄露概述 敏感信息是业务系统中对保密性要求较高的数据,通常包括系统敏感信息以及应用敏感信息 系统敏感信息指的是业务系统本身的基础环境信息,例如系统信息、中间件版本、代码信息ÿ…...
Windows Server 2012 R2 新增D盘分区
我们经常搭建windows版本的游戏时会要在D盘上操作,今天就介绍下新的服务器如何新增一个D盘。 在"开始"图标右边有个”服务器管理器“,单击点开 点开服务器管理器后,点击“工具”打开“计算机管理” 打开计算机管理后点击“存储”-…...
transformer与beter
transformer与beter 解码和编码器含义tokizer标记器和one-hot独热编码编码解码--语义较好的维度空间矩阵相乘--空间变换编码理解如何构造降维的嵌入矩阵--实现到达潜空间上面是基础,下面是transformer正文自注意力机制注意力分数--上下文修正系数为什么需要KQ两个矩…...
MySQL索引设计遵循一系列原则
高频查询与大数据量表:对查询频次较高且数据量较大的表建立索引。这是因为索引主要是为了加速查询过程,对于经常需要访问的表和数据,索引的效果最为显著。 选择合适索引字段:从WHERE子句中提取最佳候选列作为索引字段,…...
windows窗口消息队列与消息过程处理函数
在Windows窗口应用程序中,消息队列和窗口过程函数是实现消息驱动机制的核心组件。 消息队列(Message Queue): 消息队列是用于存储窗口消息的缓冲区。当用户与应用程序交互时,系统会将生成的消息插入到消息队列中&…...
【Chisel】chisel中怎么处理类似verilog的可变位宽和parameter
在 Chisel 中处理可变位宽和参数的方式与 Verilog 有一些不同,因为 Chisel 是建立在 Scala 语言之上的。以下是如何在 Chisel 中处理这些概念的方法: 参数化(Parameters) 在 Chisel 中,参数化是通过在模块构造函数中定…...
[Easy] leetcode-225/232 栈和队列的相互实现
一、用栈实现队列 1、题目 仅使用两个栈实现先入先出队列。队列应当支持一般队列支持的所有操作(push、pop、peek、empty): 实现 MyQueue 类:void push(int x) 将元素 x 推到队列的末尾 int pop() 从队列的开头移除并返回元素 …...
Springboot+Vue项目-基于Java+MySQL的个人云盘管理系统(附源码+演示视频+LW)
大家好!我是程序猿老A,感谢您阅读本文,欢迎一键三连哦。 💞当前专栏:Java毕业设计 精彩专栏推荐👇🏻👇🏻👇🏻 🎀 Python毕业设计 &…...
Leetcode 116:填充每一个节点的下一个右侧节点指针
给定一个 完美二叉树 ,其所有叶子节点都在同一层,每个父节点都有两个子节点。二叉树定义如下: struct Node {int val;Node *left;Node *right;Node *next; } 填充它的每个 next 指针,让这个指针指向其下一个右侧节点。如果找不到…...
AI智能分析赋能EasyCVR视频汇聚平台,为安全生产监管提供保障
一、背景需求 为提升公共及生产安全监管,深入贯彻落实中央关于智慧城市、数字乡村的部署要求,视频设备融合管理已成为视频治理的必然趋势。针对当前部分地区在视频监控系统建设中存在的问题,如重点地区视频监控系统建设零散、视频监控数据孤…...
Java设计模式 _结构型模式_外观模式
一、外观模式 1、外观模式 外观模式(Facade Pattern)是一种结构型模式。主要特点为隐藏系统的复杂性,并向客户端提供了一个客户端可以访问系统的接口。这有助于降低系统的复杂性,提高可维护性。当客户端与多个子系统之间存在大量…...
数据结构之----栈与队列
栈是限定仅在表尾进行插入和删除操作的线性表; 队列是只允许在一端进行插入操作,而另一端进行删除操作的线性表; 栈,允许插入和删除的一端称为栈顶,另一端称为栈底,特点后进先出。 插入操作称为进栈&#…...
如何在windows server下安装mysql5.7数据库,并使用Navicat Premium 15可视化工具新建数据库并读取数据库信息。
如何在windows server下安装mysql5.7数据库? MySQL :: Download MySQL Community Server (Archived Versions)https://downloads.mysql.com/archives/community/点击↑,然后选择对应版本和平台↓下载 将下载后的安装包放入固定目录(这里以D:…...
Calendar 366 II for Mac v2.15.5激活版:智能日历管理软件
在繁忙的工作和生活中,如何高效管理日程成为了许多人的难题。Calendar 366 II for Mac,作为一款全方位的日历管理软件,以其独特的功能和优秀的用户体验,成为您的日程好帮手。 Calendar 366 II for Mac支持多种视图模式,…...
【大模型RAG】拍照搜题技术架构速览:三层管道、两级检索、兜底大模型
摘要 拍照搜题系统采用“三层管道(多模态 OCR → 语义检索 → 答案渲染)、两级检索(倒排 BM25 向量 HNSW)并以大语言模型兜底”的整体框架: 多模态 OCR 层 将题目图片经过超分、去噪、倾斜校正后,分别用…...
DockerHub与私有镜像仓库在容器化中的应用与管理
哈喽,大家好,我是左手python! Docker Hub的应用与管理 Docker Hub的基本概念与使用方法 Docker Hub是Docker官方提供的一个公共镜像仓库,用户可以在其中找到各种操作系统、软件和应用的镜像。开发者可以通过Docker Hub轻松获取所…...
【Redis技术进阶之路】「原理分析系列开篇」分析客户端和服务端网络诵信交互实现(服务端执行命令请求的过程 - 初始化服务器)
服务端执行命令请求的过程 【专栏简介】【技术大纲】【专栏目标】【目标人群】1. Redis爱好者与社区成员2. 后端开发和系统架构师3. 计算机专业的本科生及研究生 初始化服务器1. 初始化服务器状态结构初始化RedisServer变量 2. 加载相关系统配置和用户配置参数定制化配置参数案…...
将对透视变换后的图像使用Otsu进行阈值化,来分离黑色和白色像素。这句话中的Otsu是什么意思?
Otsu 是一种自动阈值化方法,用于将图像分割为前景和背景。它通过最小化图像的类内方差或等价地最大化类间方差来选择最佳阈值。这种方法特别适用于图像的二值化处理,能够自动确定一个阈值,将图像中的像素分为黑色和白色两类。 Otsu 方法的原…...
P3 QT项目----记事本(3.8)
3.8 记事本项目总结 项目源码 1.main.cpp #include "widget.h" #include <QApplication> int main(int argc, char *argv[]) {QApplication a(argc, argv);Widget w;w.show();return a.exec(); } 2.widget.cpp #include "widget.h" #include &q…...
TRS收益互换:跨境资本流动的金融创新工具与系统化解决方案
一、TRS收益互换的本质与业务逻辑 (一)概念解析 TRS(Total Return Swap)收益互换是一种金融衍生工具,指交易双方约定在未来一定期限内,基于特定资产或指数的表现进行现金流交换的协议。其核心特征包括&am…...
HarmonyOS运动开发:如何用mpchart绘制运动配速图表
##鸿蒙核心技术##运动开发##Sensor Service Kit(传感器服务)# 前言 在运动类应用中,运动数据的可视化是提升用户体验的重要环节。通过直观的图表展示运动过程中的关键数据,如配速、距离、卡路里消耗等,用户可以更清晰…...
【Android】Android 开发 ADB 常用指令
查看当前连接的设备 adb devices 连接设备 adb connect 设备IP 断开已连接的设备 adb disconnect 设备IP 安装应用 adb install 安装包的路径 卸载应用 adb uninstall 应用包名 查看已安装的应用包名 adb shell pm list packages 查看已安装的第三方应用包名 adb shell pm list…...
【LeetCode】3309. 连接二进制表示可形成的最大数值(递归|回溯|位运算)
LeetCode 3309. 连接二进制表示可形成的最大数值(中等) 题目描述解题思路Java代码 题目描述 题目链接:LeetCode 3309. 连接二进制表示可形成的最大数值(中等) 给你一个长度为 3 的整数数组 nums。 现以某种顺序 连接…...
MySQL:分区的基本使用
目录 一、什么是分区二、有什么作用三、分类四、创建分区五、删除分区 一、什么是分区 MySQL 分区(Partitioning)是一种将单张表的数据逻辑上拆分成多个物理部分的技术。这些物理部分(分区)可以独立存储、管理和优化,…...
