Unity Component System in Java
Unity Component System in Java
I am looking to create a component-based game engine, and I was wondering how components would be stored on a GameObject
.
GameObject
Component will be a type that all scripts derive from.
Possibly an ArrayList
that holds references to each component?
ArrayList
I know it's going to be infinitely worse than UnityEngine.
Any ideas as to how? I just want the public's opinion on the best ways to store components on an object.
– EpicNicks
Aug 26 at 1:35
1 Answer
1
For an more inside view how Unity works it is usefull to set the project settings to force text files (Edit -> Project Settings -> Editor -> Asset Serialization). Also you should select "Visible Meta files" on "VersionControl Mode" in the same window. So you can open and read how Unity saves refrences and look into prefabs, meta files and scenes with an text editor (they are using YAML as descripion language).
And you could look into Unity source code: https://github.com/Unity-Technologies/UnityCsReference
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Without a design of your game engine components can be stored any way possible. If you want to learn I would say try and find out, look at different engines when you get stuck.
– Maarten Bodewes
Aug 23 at 20:00