Change how scripts are handled
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Is your feature request related to a problem? Please describe.
Currently there are 3 different types of scripts (startup, sync and async), i think it'll be better if startup and sync scripts get unified (and maybe async too) and have more functions like FixedUpdate, Awake, LateUpdate, OnEnable, OnDisable (virtual so you can override only the ones you need), the current system isn't scalabe as new methods require new classes (which is not ideal), so having a single class (maybe next to async) that has all the functions and then the user can override the ones he needs would be super helpful, also using virtual methods, or interfaces is standard with a lot of component based frameworks. As such, this is how most users would expect it to function. finally i think it'll be way better to have scripts activable so you can easily enable and disable scripts (which is very useful)
Describe the solution you'd like
Have a single class (let's say ScriptBehavior or something) that contains all the virtual functions, and make the scriptComponent inherit from ActivableEntityComponent instead of EntityComponent
Describe alternatives you've considered
The user can add these functions by himself (in async script for example) but that's not a great way of doing things and it's unnecessary extra work imo
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the current startup, sync, and async script implementations, then review ScriptComponent, EntityComponent, and ActivableEntityComponent. Compare how lifecycle callbacks and activation are handled today. Done should mean the proposed unified script behavior and activatable scripts have an agreed, tested design covering the listed callbacks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100