예제 #1
0
 public void RecieveDamage( Hazard source )
 {
     if ( source.element != GetElement )
         Kill();
     else
     {
         // Some kind of feedback that player got by without damage
         // particles or sound or whatever.
         source.AddToScore();
         Destroy( source.gameObject );
     }
 }
예제 #2
0
 public void RecieveDamage(Hazard source)
 {
     if (source.element != GetElement)
     {
         Kill();
     }
     else
     {
         // Some kind of feedback that player got by without damage
         // particles or sound or whatever.
         source.AddToScore();
         Destroy(source.gameObject);
     }
 }