Standard way to pass Object Instantiation arguments

I know that you can’t use constructors with Unity, as well as that I can create a public method initialize and do this:

GameObject a = new GameObject.LoadFromSomething;
a.initialize(parameter1, parameter2, ...);

Is there some better way to pass arguments to a new Unity object, since I can’t use a constructor?

I don’t really see how it could get any better than what you’ve already posted; one creates an object and then passes values to it.

If by better, you mean in one line ( not always better) , then you might consider creating a static method for creating instances of that class.

public class Weapon : MonoBehaviour{
    
    public static Weapon CreateWeapon(string name, int dmg){
        GameObject g = new GameObject(name);
        Weapon result = g.AddComponent<Weapon>();
        result.damage = dmg;
        return result;
    }

    private int damage;
}

So your creation code would look like:

Weapon a = Weapon.CreateWeapon("Knife",5);

I assume here that you’re not actually interested in calling the initialize-method on the GameObject, but the created MonoBehaviour… If that is not the case, then you’ll need an extension method for GameObject for which you can define as many parameters as required.