Creating A Moddable Unity Game

前言:

对游戏进行修改与拓展(MOD)是我一直以来感兴趣的东西,我的程序生涯,也是因为在初中接触到GBA口袋妖怪改版开始的,改过也研究过一些游戏的MOD实现方式,早就想在自己的游戏中实现“MOD系统”以便支持玩家对我的游戏进行修改,无奈太懒一直没动手,最近在研究U3D游戏的HACK方式,顺便也看了几篇U3D游戏MOD的文章,整理一下算是给自己将来的“MOD化游戏框架”做点提取规划。

先上几篇博客以及做点笔记:

1.How easy is it to allow for modding in a Unity game?

So the first one is often overlooked by people and this is quite tricky to do, as when you load your current game, what do you do? I assume you load a scene which is your main menu. However this is a hardcoded thing, if your mod is an entire game you want to show the mods main menu not yours, so how do you go about doing this? You can basically do a DLL scan of a given folder or expect some command line arg or something to trigger it, however what if your mod is just adding a feature to your existing game (i.e world of warcraft mods), how do you achieve partial modding while keeping the underlying game the same? Generally you would have an event based system where all component interactions raise events, and these mods when loaded subscribe and either proxy or completely take over the handling of those events. Such as adding a god mode to you game via a mod would require you to either proxy the OnEntityDamage events or ignore them so the entity does not take damage etc.

2.Let's talk about modding Unity games.

3.Creating A Moddable Unity Game

4.Github Unity-CSharp-Mod

原文地址:https://www.cnblogs.com/jeason1997/p/6687127.html