コード例 #1
0
 // at each update: playing emission accordingly //
 private void Update()
 {
     // if the booster is boosting as necessary: //
     if (dependencies.areMet())
     {
         // if the player is grounded or the smoke ring is allowed to play when nongrounded and the player is terrained: track that the player was terrained at the last update //
         if (TerrainResponse.grounded() || (smokeRingWhenNongrounded && TerrainResponse.terrained()))
         {
             appropriatelyTerrainedAtLastUpdate = true;
         }
         // otherwise: if the player was terrained at the last update: track that the player was not terrained at the last update, play one round of emission of the booster smoke ring emitter //
         else if (appropriatelyTerrainedAtLastUpdate)
         {
             appropriatelyTerrainedAtLastUpdate = false;
             emitter.Play();
         }
     }
 }
コード例 #2
0
    // methods //


    // method: determine the (boolean) state of this Dependency Requisite //
    public override bool state()
    {
        return(TerrainResponse.grounded());
    }