Comments (12)
Ok thanks for the info, will spend some time having fun with my own execution plan and see what I can come up with.
from unrealclr.
Show me your code please.
from unrealclr.
using System;
using System.Drawing;
using UnrealEngine.Framework;
namespace Game
{
public static class Main
{ // Indicates the main entry point for automatic loading by the plugin
public static void OnWorldBegin() => Debug.AddOnScreenMessage(-1, 10.0f, Color.DeepPink, "Hello, Unreal Engine!");
public static void OnWorldEnd() => Debug.AddOnScreenMessage(-1, 10.0f, Color.DeepPink, "See you soon, Unreal Engine!");
public static void OnWorldPrePhysicsTick(float deltaTime) => Debug.AddOnScreenMessage(1, 10.0f, Color.DeepPink, "On pre physics tick invoked!");
public static void OnWorldDuringPhysicsTick(float deltaTime) => Debug.AddOnScreenMessage(2, 10.0f, Color.DeepPink, "On during physics tick invoked!");
public static void OnWorldPostPhysicsTick(float deltaTime) => Debug.AddOnScreenMessage(3, 10.0f, Color.DeepPink, "On post physics tick invoked!");
public static void OnWorldPostUpdateTick(float deltaTime) => Debug.AddOnScreenMessage(4, 10.0f, Color.DeepPink, "On post update tick invoked!");
}
}
from unrealclr.
It works fine for me. The test project works for you? Which version of the plugin are you using?
from unrealclr.
I'm using the latest version of the plugin with UE4.25.3 and dotnet-sdk-3.1.401-win-x64 although during the installer I said no to the tests, will retry with the tests now
from unrealclr.
If the test project doesn't work for you, then make sure that the plugin is properly initialized https://github.com/nxrighthere/UnrealCLR#running
from unrealclr.
It's working now, I think it's because I was building with dotnet build -o %Project%\Managed\
but when I switched to dotnet build -o %Project%\Managed\ClassLib
it's now working. I didn't realise output needed to be in a folder relative to the assembly name. Makes sense but could do with being a bit more clear in the docs
from unrealclr.
Nevermind, I found why this might happen, going to fix it quickly.
from unrealclr.
Awesome, also just been digging into the Tests and noticed that everything is static. What is the reason for this? Just wondering because in C++ you can for example do ACharacterBase : ACharacter
whereas here if everything is static how do you do CharacterBase : Character
? I ask because I was planning on using Dependency Injection which would require constructors.
from unrealclr.
I did that in tests to quickly switch between them. If you have experience working with regular .NET applications where you have Main()
entry point, then the principle here is the same. You have static entry points from where you kickstart your logic and then organize your code the way you like. There's no intermediate scripts manager or stuff like that. You can use inheritance here too, see this test.
from unrealclr.
Ok yeah that makes sense, I was assuming I could do something like the following based on my understanding of the C++ workflow:
public class PlayerCharacter : Character
{
protected override void Tick()
{
base.Tick();
Debug.Log(LogLevel.Display, "Tick");
}
}
from unrealclr.
Yea, the approach here is very different. The framework is not following idioms of the engine, so you can organize the execution flow and stuff the way you like with full control over it and keep it all managed. So to reproduce the same approach as in your example, you can create an intermediate scripts manager to execute logic using the object-oriented design or any other one.
from unrealclr.
Related Issues (20)
- Crash on Linux Pop!_OS 20.10 HOT 9
- `UDataAsset` support HOT 5
- Crash on macOS Big Sur 11.5.2 HOT 5
- nDisplay support HOT 2
- Install script fails on unknown target "net5.0" HOT 1
- Segfault on Linux when unloading module during cook phase HOT 12
- Change README to be multi-language compatible HOT 4
- Unreal Engine 5 Preview 1 support HOT 4
- Unreal Engine 5 module compilation error HOT 3
- Managed code is not running on Linux and Mac HOT 46
- Blueprint Event Dispatchers HOT 13
- Level blueprint events executing earlier than world events HOT 5
- Blueprint nodes generation at runtime HOT 16
- Initial stable version release HOT 6
- Installation fails due to whitespaces in a path to the installation tool HOT 3
- Exposure of managed classes to blueprints HOT 1
- Strings encoding for non-English characters HOT 14
- Managed code is not executing if the level actor doesn't persist in the world HOT 16
- Creation of properties from managed code HOT 25
- Crash on macOS Catalina 10.15.7 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unrealclr.