コード例 #1
0
    void Start()
    {
        rb = this.GetComponent <Rigidbody2D>();

        spawnsc = GameObject.Find("Spawner").GetComponent <SpawningScript>();
        //This finds the text for the score.
        score = GameObject.Find("scoretext").GetComponent <ScoreScript>();
        if (GameObject.Find("player") != null)
        {
            weapon = GameObject.Find("player").GetComponent <Weapons_Systems>();
        }
    }
コード例 #2
0
    void Start()
    {
        rb = this.GetComponent <Rigidbody2D>();
        if (GameObject.FindWithTag("Player") != null)
        {
            player = GameObject.FindWithTag("Player").transform;
        }
        timeBtwShots = startTimeBtwShots;

        spawnsc = GameObject.Find("Spawner").GetComponent <SpawningScript>();
        score   = GameObject.Find("scoretext").GetComponent <ScoreScript>();
        weapon  = GameObject.Find("player").GetComponent <Weapons_Systems>();
    }