public class GameSetupBase : MonoBehaviour, ISchematicStarter
{
protected virtual void Awake() {
// ...
LoadProject(project);
CustomSetup();
}
public void CustomSetup()
{
// ...
var gameControlsSettings = Maki.Data.Get<GameControlsSettings>().controlSettings;
gameControlsSettings.collisionCamera.enable = true;
gameControlsSettings.collisionCamera.settings.type = CollisionCameraType.Cross;
gameControlsSettings.collisionCamera.settings.layerMask = LayerMask.GetMask("Default");
gameControlsSettings.collisionCamera.settings.moveTowards = 0.1f;
var childObjectSettings = new ChildObjectSettings
{
childName = "Head",
type = ChildObjectType.Path
};
gameControlsSettings.collisionCamera.settings.childObject = childObjectSettings;
var orkControlsSettings = Maki.Data.Get<ORKGameControlsSettings>();
orkControlsSettings.playerControl.type = PlayerControlType.Button;
orkControlsSettings.playerControl.buttonController.moveType = ButtonControlMoveType.AnimatorRootMotion;
// ...
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
Is it a good idea? Probably not :)
While you can generally handle of of this via code instead of setting it up in the editor - a big question here is why?
This is a lot of work to do that's already handled for you in the editor. Some settings might be simple (e.g. setting some settings in a control component), but a lot of the data you input in ORK/Makinom is very complex code-wise and involves a lot of setup and initialization that's handled by the editor and not done when you just set something via code.
E.g. even if the intial setup seems to work, this might cause errors later due to something not being initialized.
Also, a lot of data is not directly referenced by the project asset and instead saved as individual assets.
I'd recommend to handle the setup of things in the editor, or at least the basic setup for your system (status values, abilities, items, equipment, combatants, etc.). If your data is set up in the editor, you can handle the rest via code, e.g. adding combatants to the player group, managing inventory stuff, etc.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Ive been a C# programmer for ~20 years now so I'm being a bit stubborn because working with code is more comfortable for me. I am slowly picking up the editor alright though, so I think I'll be fine using it once i get more used to it.
However, another couple reasons I also wanted to work with code is for debugging and change tracking purposes. I use git for pretty much every project, and making changes via the editor is a bit more difficult to track what specifically changed between commits. Like if I managed to introduce a bug because I misconfigured something, but not sure what. I did get a PDB built and hooked up for the dll's, so i can go that route. And I know I can use the backups to go to a previous version, but I'm not sure what the easiest way to compare a project with a backup to determine what changed.
Ultimately I'm the only developer so I don't have to worry about reviewing PRs or anything, but I'm curious what suggestions you might have on comparing a current project to a backup? Would it mainly be by setting the data format to XML?
As for comparing with backups - yeah, having data format as XML is pretty much the only way to have a somewhat checkable thing there.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!