コード例 #1
0
 void Update()
 {
     if (lifeCounter.GetLifeCount() > 0)
     {
         rb.AddForce(new Vector3(
                         Input.GetAxis("Horizontal") * speed,
                         0.0f,
                         Input.GetAxis("Vertical") * speed
                         ));
     }
     timePassed += Time.deltaTime;
     if (timePassed >= 1)
     {
         scoreCounter.GainPoints(pointsPerSecond);
         timePassed = 0;
     }
 }