コード例 #1
0
    public static void Postfix(LoadoutConfigurator __instance)
    {
        Debug.Log("Doing postfix.");
        Traverse   traverse   = Traverse.Create(__instance);
        GameObject gameObject = PatcherHelper.nukeObject;

        if (gameObject)
        {
            GameObject toInject = GameObject.Instantiate <GameObject>(gameObject);
            toInject.name = "Nuke";
            // GameObject equipper = toInject.transform.GetChild(1).gameObject;
            GameObject edgeTransform = toInject.transform.GetChild(0).gameObject;
            Nuke       nuke          = gameObject.AddComponent <Nuke>();
            nuke.edgeTransform = edgeTransform;
            nuke.equipper      = GameObject.Instantiate(new GameObject());
            nuke.equipper.name = "Nuke";
            Debug.Log("Nuke added to EqInfo in postfix.");
            nuke.init();
            nuke.missileLauncher.LoadAllMissiles();
            toInject.SetActive(false);
            Debug.Log("Start eq info");
            Dictionary <string, EqInfo> unlockedWeaponPrefabs = (Dictionary <string, EqInfo>)traverse.Field("unlockedWeaponPrefabs").GetValue();
            Debug.Log("Got eq info.");
            EqInfo eq = new EqInfo(nuke.equipper, Environment.CurrentDirectory + "\\VTOLVR_ModLoader\\mods\\Nuke\\nukey");
            Debug.Log("New eq");

            /*eq.eq = nuke.HPEquipper;
             * Debug.Log("Eq.eq");
             * eq.eqObject = nuke.HPEquipper.gameObject;
             * Debug.Log("Eq.eqObject");*/
            unlockedWeaponPrefabs.Add("B61", eq); // Sadly can't prefix a method so shitty shit shit
            Debug.Log("Add to list.");
            traverse.Field("unlockedWeaponPrefabs").SetValue(unlockedWeaponPrefabs);
            Debug.Log("Postfix 200.");
        }
        else
        {
            Debug.LogError("Nuke not found in AssetBundle.");
        }
    }
コード例 #2
0
ファイル: Settings.cs プロジェクト: oruponu/Temonis
 public record Sounds(Kyoshin Kyoshin, Eew Eew, EqInfo EqInfo);