Project1

标题: 已解决:想在游戏读取存档函数里面添加自己的方法 [打印本页]

作者: rexuegg123    时间: 2019-7-21 20:52
标题: 已解决:想在游戏读取存档函数里面添加自己的方法
本帖最后由 rexuegg123 于 2019-7-21 22:02 编辑

如题:
试过在 DataManager.loadGame()或 DataManager.loadGameWithoutRescue ()里面添加了方法,但游戏读档时,根本就没反应。
比如:
[pre lang="javascript"]DataManager.loadGameWithoutRescue = function(savefileId) {
  WY_VarLoding ();  //自己的方法
  var globalInfo = this.loadGlobalInfo();
  if (this.isThisGameFile(savefileId)) {
      var json = StorageManager.load(savefileId);
      this.createGameObjects();
      this.extractSaveContents(JsonEx.parse(json));
      this._lastAccessedId = savefileId;
      return true;
  } else {
      return false;
  };
};[/pre]

想问问大神,是不是我找错了游戏读档的函数?



找到了:
[pre lang="javascript"]Scene_Load.prototype.onSavefileOk();//读档
Scene_Sava.prototype.onSavefileOk();//存档[/pre]







欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X5.0