本帖最后由 taroxd 于 2015-10-25 21:00 编辑
console.log 原来是异步的,怪不得 console.log(this); 发现 _eventId 是 0
console.log(this.eventId());
console.log(this.eventId());
以下为谜之 Plugin Command 功能
- // Plugin Command: eventID x
- // assign eventID to variable x
- (function() {
- var _pluginCommand = Game_Interpreter.prototype.pluginCommand;
- Game_Interpreter.prototype.pluginCommand = function(command, args) {
- _pluginCommand.call(command, args);
- if (command === "eventID") {
- $gameVariables.setValue(parseInt(args[0]), this.eventId());
- }
- return true;
- };
- })();
复制代码 |