Hi everyone,
As I’m working on mobile, optimization is an important part.
I’m trying to find the best way to automatically assigned most of the components properties as followed:
public abtract class MonoBehaviourBase : MonoBehaviour
{
private Animation _animation = null;
public new Animation animation
{
get { return _animation; }
}
private AudioSource _audio = null;
public new AudioSource audio
{
get { return _audio; }
}
private Camera _camera = null;
public new Camera camera
{
get
{ return _camera; }
}
private Collider _collider = null;
public new Collider collider
{
get
{ return _collider; }
}
private Collider2D _collider2D = null;
public new Collider2D collider2D
{
get { return _collider2D; }
}
private Transform _transform = null;
public new Transform transform
{
get { return _transform; }
}
private ConstantForce _constantForce = null;
public new ConstantForce constantForce
{
get { return _constantForce; }
}
private HingeJoint _hingeJoint = null;
public new HingeJoint hingeJoint
{
get { return _hingeJoint; }
}
private Light _light = null;
public new Light light
{
get { return _light; }
}
private ParticleEmitter _particleEmitter = null;
public new ParticleEmitter particleEmitter
{
get { return _particleEmitter; }
}
private ParticleSystem _particleSystem = null;
public new ParticleSystem particleSystem
{
get { return _particleSystem; }
}
private Renderer _renderer = null;
public new Renderer renderer
{
get { return _renderer; }
}
private Rigidbody _rigidbody = null;
public new Rigidbody rigidbody
{
get { return _rigidbody; }
}
private Rigidbody2D _rigidbody2D = null;
public new Rigidbody2D rigidbody2D
{
get { return rigidbody2D; }
}
}
But I was wondering if declaring all this Components would affect the size of the objects and so have a direct impacts on the performance?
Thanks