コード例 #1
0
    // Use this for initialization
    void Start()
    {
        rigidBody = gameObject.GetComponent <Rigidbody2D>();

        coreProperties = gameObject.AddComponent(typeof(otherCoreProperties)) as otherCoreProperties;
        initializeCoreProperties();
    }
コード例 #2
0
    void initializeCoreProperties()
    {
        otherCoreProperties reference = gameObject.GetComponent <Ship_Constructor>().shipCore.GetComponent <otherCoreProperties>();

        coreProperties.speed = reference.speed;
        coreProperties.changesSpeedWhenFiring = reference.changesSpeedWhenFiring;
        coreProperties.firingSpeed            = reference.firingSpeed;
    }