コード例 #1
0
    // Use this for initialization
    public void OnObjectSpawn()
    {
        GetComponent <Rigidbody2D>().AddForce(
            new Vector2(0, speed * 100)
            );

        objectPooler = GameObject.Find("Object Pooler").GetComponent <ObjectPooler>();

        carSpawnScript = GameObject.Find("Cars").GetComponent <CarSpawnScript>();
    }
コード例 #2
0
    void Start()
    {
        car = this.gameObject;

        spawnManager = GameObject.Find("SpawnManager");
        if (spawnManager != null)
        {
            spawnScript = spawnManager.GetComponent <CarSpawnScript>();
        }
        else
        {
            Debug.Log("Spawn manager not found");
        }

        shieldActive = false;
    }