Code Monkey home page Code Monkey logo

Comments (4)

evilmu avatar evilmu commented on June 3, 2024 1

I tried but without success look what I did:

Class: public sealed class FarmerNameManager : MonoBehaviour, IUserBlobCallbacks2, IUserBlobCallbacksBase
Method: public void CreateFarmerName(string farmerName) { }

#if !BNM_DISABLE_NEW_CLASSES
using namespace BNM::Structures::Mono;
using namespace BNM::Operators;

BNM::LoadClass FarmerNameManagerClass{};
BNM::Method<monoString*> CreateFarmerNameMethod{};

void (*old_CreateFarmerNameA)(BNM::UnityEngine::Object*, monoString*);
void NewCreateFarmerName(BNM::UnityEngine::Object* instance, monoString* originalName) {
    monoString* newNameA = BNM::CreateMonoString("BILL GATES");
    old_CreateFarmerNameA(instance, newNameA);
}

void OnLoaded() {
    using namespace BNM;
    FarmerNameManagerClass = LoadClass(OBFUSCATE_BNM("Assembly-CSharp"), OBFUSCATE_BNM("FarmerNameManager"));
    CreateFarmerNameMethod = FarmerNameManagerClass.GetMethodByName(OBFUSCATE_BNM("CreateFarmerName"), 1);

    InvokeHook(CreateFarmerNameMethod, NewCreateFarmerName, old_CreateFarmerNameA);
}
#endif
 case 14: {
      BNM::AddOnLoadedEvent(OnLoaded);
            break;
        }

from bnm-android.

BNM-Dev avatar BNM-Dev commented on June 3, 2024

You can't just set OrderScore to 10000.0f;. You need instance of ProtoPartnerAnimalBreed

from bnm-android.

evilmu avatar evilmu commented on June 3, 2024

ProtoPartnerAnimalBreed MyAnimal= new ProtoPartnerAnimalBreed();

MyAnimal.OrderScore = 10000.0f;

I really didn't understand how to use it.

from bnm-android.

BNM-Dev avatar BNM-Dev commented on June 3, 2024

BNM has a lot of comments in src code. You can use:
LoadClass::CreateNewInstance, LoadClass::CreateNewObject, LoadClass::CreateNewObjectArgs.
I don't know which one is better for you. Read comments in BNM.h to find API that will be better for your problem.

from bnm-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.