Skip to content

Instantly share code, notes, and snippets.

View Leonardo-Rocha's full-sized avatar

Leo Stone Leonardo-Rocha

View GitHub Profile
@Leonardo-Rocha
Leonardo-Rocha / example.gd
Created June 25, 2025 09:32
Godot Universal Platform Interface
func _ready() -> void:
var onlineIdentity: OnlineIdentity = Online.get_identity()
if onlineIdentity == null:
Log.error("Online identity is invalid!")
return
var _login_result: LoginResult = await onlineIdentity._login()
if onlineIdentity._is_logged_in():
Log.info("User logged in!")
else:
@Leonardo-Rocha
Leonardo-Rocha / CustomFunctionLibrary.cpp
Created February 23, 2023 15:43
Unreal Engine - “Is in Editor and Not Playing” method.
bool UCustomBlueprintFunctionLibrary::IsWithEditor()
{
#if WITH_EDITOR
return true;
#else
return false;
#endif
}
bool UCustomFunctionLibrary::IsInEditorAndNotPlaying(const UObject* worldContextObject)
@Leonardo-Rocha
Leonardo-Rocha / UnrealEngineNavMeshTips.md
Last active February 15, 2023 18:43
UnrealEngineNavMeshTips

Unreal Engine Nav Mesh Tips

Tile Size UU

This parameter defines how fine the polygons that are generated are. Lower values mean a more precise navigation mesh, with more polygons, but also a slower generation time (and potentially more memory usage). You can see the effect of this parameter by turning on the Draw Triangle Edges in the display settings.

Cell Height

This determines how high the generated cells are from the floor (which might result in connecting areas at a different height, so be careful).

Agent settings (Radius, Height, Max Height, Max Slope, Max Step Height)

@Leonardo-Rocha
Leonardo-Rocha / Affiliation.cpp
Last active February 8, 2023 18:34
Unreal Engine AI Affilitiation
// MyCharacter.h
#include "GenericTeamAgentInterface.h"
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Team)
FGenericTeamId Team = FGenericTeamId::NoTeam;
/** Assigns Team Agent to given TeamID */
virtual void SetGenericTeamId(const FGenericTeamId& TeamID) override;
function []= outputCSV(name, t, y)
SAVEDIR = "D:\Downloads\trab_controle";
filename = fullfile(SAVEDIR, name);
header = "TIME, OUTPUT";
M = [t', y'];
// transform heterogeneous data into string data
tmpMatrix = strcat(string(M), ', ', 'c');
output = [header; tmpMatrix];
app.use(
(err: Error, request: Request, response: Response, next: NextFunction) => {
if (err instanceof AppError) {
return response.status(err.statusCode).json({
status: 'error',
message: err.message,
});
}
console.error(err);
@Leonardo-Rocha
Leonardo-Rocha / desafio04_error.txt
Created August 19, 2020 20:24
Desafio 04 - error
FAIL src/__tests__/App.spec.js
Likes
✕ should add a like to the like counter of the repository (89ms)
● Likes › should add a like to the like counter of the repository
Unable to find node on an unmounted component.
at findCurrentFiberUsingSlowPath (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:684:13)
at ReactTestInstance._currentFiber (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:17573:17)