How consist of script object at scene?

I do like this, but have no idea this is properly or not.

Any comments?

Divided 4 script objects because there are so many scripts attached to one script object.

I don’t understand the question.

2 Likes

With that many scripts, I think separating them into multiple objects is helpful. If nothing else, it’s less to scroll through and you can organize by category.
The other option is to have larger scripts with more functions. There are pros and cons to each. I tend to have one large main script with a ton of functions, and a moderate number of small scripts to handle the rest.

Do you actually need to put ANY of those in the scene? They don’t seem to have any data or predefined state associated with them.

I prefer the singleton approach.

Some super-simple Singleton examples to take and modify:

Simple Unity3D Singleton (no predefined data):

Unity3D Singleton with Prefab used for predefined data:

These are pure-code solutions, do not put anything into any scene, just access it via .Instance!

I don’t put out script that only have class and functions.

But most of scripts has variable that reference from scene…

Because it should control the game UI component, data.

and I am already using

public class scriptname : singleton

from copied singleton class code got somewhere in this forum.