コード例 #1
0
 private void spawnRightDrop()
 {
     //Right drop
     if (Random.value <= chanceToSpawnDrop)
     {
         if (Random.value >= .1)
         {
             SoupDrop rightDrop = Instantiate(soupDrop);
             rightDrop.parent             = this;
             rightDrop.transform.position = new Vector3(this.transform.position.x + spriteWidth / 2, this.transform.position.y, 0);
         }
         else
         {
             EvilSoupDrop rightDrop = Instantiate(evilDrop);
             rightDrop.parent             = this;
             rightDrop.transform.position = new Vector3(this.transform.position.x + spriteWidth / 2, this.transform.position.y, 0);
         }
     }
 }
コード例 #2
0
 private void spawnMiddleDrop()
 {
     //  Middle Drop
     if (Random.value <= chanceToSpawnDrop)
     {
         if (Random.value >= .1)
         {
             SoupDrop middleDrop = Instantiate(soupDrop);
             middleDrop.parent             = this;
             middleDrop.transform.position = this.transform.position;
         }
         else
         {
             EvilSoupDrop middleDrop = Instantiate(evilDrop);
             middleDrop.parent             = this;
             middleDrop.transform.position = this.transform.position;
         }
     }
 }