Beispiel #1
0
 void Update()
 {
     curChronoMummy -= Time.deltaTime;
     curChronoTrap  -= Time.deltaTime;
     if (curChronoMummy <= 0)
     {
         mummySpawner.SpawnMummy();
         curChronoMummy = Random.Range(mummyFrequency, mummyFrequency * 1.5f);
     }
     if (curChronoTrap <= 0)
     {
         trapSpawner.SpawnTrap();
         curChronoTrap = Random.Range(trapFrequency, trapFrequency * 1.5f);
     }
 }
 private void Update()
 {
     if (!cameraManager.AtInitPosition || !canShoot)
     {
         return;
     }
     if (Input.GetMouseButtonDown(0))
     {
         canShoot = false;
         float      ratio          = Input.mousePosition.x / Screen.width;
         float      realPosition   = distanceAB * ratio;
         float      spawnPositionX = baliseGauche.transform.position.x + realPosition;
         Vector3    spawnPosition  = new Vector3(spawnPositionX, yPosition, zPosition);
         GameObject newObstacle    = obstacleSpawner.SpawnTrap(spawnPosition);
         StartCoroutine(CameraFollowCoroutine(newObstacle));
     }
 }