// Use this for initialization void Start() { rigidBody = gameObject.GetComponent <Rigidbody2D>(); coreProperties = gameObject.AddComponent(typeof(otherCoreProperties)) as otherCoreProperties; initializeCoreProperties(); }
void initializeCoreProperties() { otherCoreProperties reference = gameObject.GetComponent <Ship_Constructor>().shipCore.GetComponent <otherCoreProperties>(); coreProperties.speed = reference.speed; coreProperties.changesSpeedWhenFiring = reference.changesSpeedWhenFiring; coreProperties.firingSpeed = reference.firingSpeed; }