Unity3d游戏修改

作者: LiuJP | 来源:发表于2019-03-15 14:05 被阅读2次

    Awesome Tanks
    超级坦克大战

    1、屏蔽CloudSaveButton,在相应的未知加入以下IL:

    805 ldarg.0 
    806 ldfld   UnityEngine.UI.Button MainMenuController::CloudSaveButton
    811 callvirt    UnityEngine.GameObject UnityEngine.Component::get_gameObject()
    816 ldc.i4.0    
    817 callvirt    System.Void UnityEngine.GameObject::SetActive(System.Boolean)
    

    2、屏蔽UnityAd,在ContinueClick()方法找到这个
    GetInterstitialAdsAllowedAfterLevelFinish() : Boolean
    然后修改这个方法的返回值;

     private void ContinueButtonClick()
    {
    GameplayCommons.Instance.effectsSpawner.DisableAllParticles();
    SoundManager.instance.PlayButtonClickSound();
    if (GlobalCommons.Instance.gameplayMode == GlobalCommons.GameplayModes.CustomLevel)
    {
        if (AdsProcessor.GetInterstitialAdsAllowedAfterLevelFinish())
        {
            GlobalCommons.Instance.SceneToTransferTo = "UserLevels";
            GlobalCommons.Instance.StateFaderController.ChangeSceneTo("PlayAdScene", false);
        }
        else
        {
            GlobalCommons.Instance.StateFaderController.ChangeSceneTo("UserLevels", false);
        }
    }
    else if (GameplayCommons.Instance.LastLevelCompleted)
    {
        GlobalCommons.Instance.StateFaderController.ChangeSceneTo("AllLevelsCompleteScene", false);
    }
    else if (((!AskForReviewSceneController.ShownThisSession && AskForReviewSceneController.ReviewAvailable()) && (!GlobalCommons.Instance.globalGameStats.RatedGame && (GlobalCommons.Instance.globalGameStats.AskForReviewFactor >= 2))) && (GlobalCommons.Instance.globalGameStats.WeaponsLevels[1] > 0))
    {
        GlobalCommons.Instance.StateFaderController.ChangeSceneTo("AskForReviewScene", false);
    }
    else if (AdsProcessor.GetInterstitialAdsAllowedAfterLevelFinish())
    {
        GlobalCommons.Instance.SceneToTransferTo = "Upgrades";
        GlobalCommons.Instance.StateFaderController.ChangeSceneTo("PlayAdScene", false);
    }
    else
    {
        GlobalCommons.Instance.StateFaderController.ChangeSceneTo("Upgrades", false);
    }
    }
    

    3:谷歌AdMob的AdUnitId

    public AdMobAdProvider()
    {
    this.AppId = "ca-app-pub-5822520606000185~7970637052";
    this.InterstitialAdUnitId = "ca-app-pub-5822520606000185/7784726802";
    this.RewardedAdUnitId = "ca-app-pub-5822520606000185/4578186951";
    this.DebugInterstitialAdUnitId = "ca-app-pub-3940256099942544/1033173712";
    this.DebugRewardedAdUnitId = "ca-app-pub-3940256099942544/5224354917";
    }
    

    4:IAdProcesser

    后来把dex 中的google 的类全部删除后,游戏在第四关卡卡死,
    去dll 中找到UpgradeMenuController类

    在CompletedLevel > 4的时候回去取广告,通过IAdProcesser接口,
    所以在这里屏蔽掉这个方法

    5: 金币初始化的地方,可以修改初始金币数量;

    相关文章

      网友评论

        本文标题:Unity3d游戏修改

        本文链接:https://www.haomeiwen.com/subject/vrblmqtx.html