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

网站导航栏下拉框怎么做网站要做手机版怎么做

网站导航栏下拉框怎么做,网站要做手机版怎么做,wordpress插件用户权限,济南建站优化1、目标 保存下面库存栏中信息到文件中。 2、修改SceneSave.cs脚本 添加2行代码: 3、修改InventoryManager对象 添加Generate GUID组件。 4、修改InventoryManager.cs脚本 添加继承自ISaveable 添加属性信息: private string _iSaveableUniqueID;pub…

1、目标

保存下面库存栏中信息到文件中。

2、修改SceneSave.cs脚本

添加2行代码:

3、修改InventoryManager对象

添加Generate GUID组件。

4、修改InventoryManager.cs脚本

添加继承自ISaveable

添加属性信息:

    private string _iSaveableUniqueID;public string ISaveableUniqueID { get { return _iSaveableUniqueID; } set { _iSaveableUniqueID = value; } }private GameObjectSave _gameObjectSave;public GameObjectSave GameObjectSave { get { return _gameObjectSave; } set { _gameObjectSave = value; } }private UIInventoryBar inventoryBar;

在Awake()方法中添加2行代码:

添加如下几个方法:

 private void OnDisable(){ISaveableDeregister();}private void OnEnable(){ISaveableRegister();}private void Start()
{inventoryBar = FindObjectOfType<UIInventoryBar>();
}public void ISaveableRegister(){SaveLoadManager.Instance.iSaveableObjectList.Add(this);}public void ISaveableDeregister(){SaveLoadManager.Instance.iSaveableObjectList.Remove(this);}public GameObjectSave ISaveableSave(){// Create new scene saveSceneSave sceneSave = new SceneSave();// Remove any existing scene save for persistent scene for this gameobjectGameObjectSave.sceneData.Remove(Settings.PersistentScene);// Add inventory lists array to persistent scene savesceneSave.listInvItemArray = inventoryLists;// Add inventory list capacity array to persistent scene savesceneSave.intArrayDictionary = new Dictionary<string, int[]>();sceneSave.intArrayDictionary.Add("inventoryListCapacityArray", inventoryListCapacityIntArray);// Add scene save for gameobjectGameObjectSave.sceneData.Add(Settings.PersistentScene, sceneSave);return GameObjectSave;}public void ISaveableLoad(GameSave gameSave){if(gameSave.gameObjectData.TryGetValue(ISaveableUniqueID, out GameObjectSave gameObjectSave)){GameObjectSave = gameObjectSave;// Need to find inventory lists - start by trying to locate saveScene for game objectif(gameObjectSave.sceneData.TryGetValue(Settings.PersistentScene, out SceneSave sceneSave)){// list inv items array exists for persistent sceneif(sceneSave.listInvItemArray != null){inventoryLists = sceneSave.listInvItemArray;// Send events that inventory has been updatedfor(int i = 0; i < (int)InventoryLocation.count; i++){EventHandler.CallInventoryUpdatedEvent((InventoryLocation)i, inventoryLists[i]);}// Clear any items player was carryingPlayer.Instance.ClearCarriedItem();// Clear any highlights on inventory barinventoryBar.ClearHighlightOnInventorySlots();}// int array dictionary exists for sceneif(sceneSave.intArrayDictionary != null && sceneSave.intArrayDictionary.TryGetValue("inventoryListCapacityArray", out int[] inventoryCapacityArray)){inventoryListCapacityIntArray = inventoryCapacityArray;}}}}public void ISaveableStoreScene(string sceneName){// Nothing required here since the inventory manager is on a persistent scene;}public void ISaveableRestoreScene(string sceneName){// Nothing required here since the inventory manager is on a persistent scene;}

5、运行游戏

角色收集的item放到库存栏中,save game后退出游戏,重新进入游戏后load game,库存栏中的信息保持不变。

http://www.dtcms.com/wzjs/584703.html

相关文章:

  • 做搜狗pc网站点关于网站建设的书籍
  • 淘宝网站网页图片怎么做的官方网站建设条件
  • 专业网站建设找哪家李沧区网站服务公司
  • 公司招人去哪个网站温州网站优化案例
  • 网站的域名可以修改吗自己怎样做网站文章关键词内链
  • 打开山东城市建设职业学院网站wordpress主题修改导航链接
  • 免费关键词挖掘网站seo是什么意思 部门
  • 淘客网站推广免备案传智播客 网站开发
  • 网站模拟效果网站建设高
  • 山东建设企业网站成都注册公司代理公司
  • 网站空间知识洛阳万悦网站建设
  • 做点小本意 哪个网站拿货便宜点马蜂窝网站建设
  • 唐山中小企业网站制作重庆市城市建设档案馆网站
  • 3d建模在线制作网站wordpress 文章摘要
  • 四川建设行业网站有哪些魏县做网站的
  • 百度官网网站首页网站运营的提成方案怎么做
  • 河北建筑网站做古风文字头像的网站
  • 专门做网站公司妖姬直播
  • 帮助做问卷调查的网站沃尔玛网上商城中国
  • 电子工程网官方网站建设个网站多少钱
  • 学校建设网站费用申请怎么做新浪网站
  • 推荐网站建设建设工程管理条例
  • wordpress网站下载文件外国人做的古文字网站
  • 西安旅游网站开发群晖 套件 wordpress
  • 做网站推广和网络推广默认网站停止
  • 网站建设找哪个学院门户网站建设必要性
  • 想要导航网站推广怎么做深圳网站排名优化团队
  • 邳州微网站开发服装 网站规划方案
  • 深圳网站建设补助怎么做公司网站推广
  • 培训机构网站源码如何免费开个人网站