AmateurHacker
Platinian
I'm using the code below to change the camera angle, and it works fine. The original Field of View Float value is 30.0. I change it to 12.0, and it works. But when I close the tool, I want the value to return to its original value. In short, when the tool is open, it returns a float of 12.0. When the tool is closed, it should return a float of 30.0. In other words, it should return its original value.
It should get the original value when Toogle is closed.
What should I add to my code for this?
bool FielofViews;
void (*SetCameraFov)(void* instance,float fieldOfView);
void (*old_Update)(void* instance);
void new_Update(void* instance) {
if (instance != nullptr) {
if (FielofViews) {
SetCameraFov (instance,16.0);
}
}
old_Update(instance);
}
It should get the original value when Toogle is closed.
What should I add to my code for this?
bool FielofViews;
void (*SetCameraFov)(void* instance,float fieldOfView);
void (*old_Update)(void* instance);
void new_Update(void* instance) {
if (instance != nullptr) {
if (FielofViews) {
SetCameraFov (instance,16.0);
}
}
old_Update(instance);
}