lundi 24 juillet 2017

Where to put all code/organize code in unity?

so I am a beginner at unity and cannot grasp how you are supposed to have a pattern or architecture with unity.

I am currently making a platform game which has a character that is supposed to stay on moving platforms and not fall off the screen (very basic). On the platform there are "monsters". If you touch these monsters you also lose. There is also some trees and such on the platform.

This is what I have so far: In the "manual gameobject list" or whatever you call it: Directional light

Main camera

Background (just a sprite that is always showing)

Player (contains a JS script that has character specific code for jumping and such)

Platformspawner (Contains only a c# script. This script spawns multiple platform gameobjects, these gameobjects then use a script called platform.cs. This class spawns monsters and the trees on each platform. The monsters and trees each use their own c# file that keeps track of collisions and such.)

For me this is pretty obvious code and I do not know how to organize it much better. Any tips? I tried following an MVC tutorial but it seems like there is not much gameobject spawning in those tutorials which is what I have to do, so they confuse me.

Aucun commentaire:

Enregistrer un commentaire