コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        if (Physics.gravity.y > -10)
        {
            Physics.gravity *= gravityModifier;
        }

        playerAudio = GetComponent <AudioSource>();
        playerRb    = GetComponent <Rigidbody>();
        scoreRef    = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScoreManagerX>();

        // Apply a small upward force at the start of the game
        playerRb.AddForce(Vector3.up * 5, ForceMode.Impulse);
    }
コード例 #2
0
 // Start is called before the first frame update
 void Start()
 {
     scoreRef = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScoreManagerX>();
     InvokeRepeating("SpawnObjects", spawnDelay, spawnInterval);
 }
コード例 #3
0
 // Start is called before the first frame update
 void Start()
 {
     scoreRef = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScoreManagerX>();
 }