示例#1
0
文件: FissileFuel.cs 项目: fourls/235
 void OnCollisionEnter2D(Collision2D other)
 {
     if (other.gameObject.CompareTag("Neutron"))
     {
         Neutron neutron = other.gameObject.GetComponent <Neutron>();
         float   chance  = 1f / (float)neutron.speedLevel;
         if (chance >= Random.value)
         {
             Destroy(other.gameObject);
             Fission();
         }
         else
         {
             neutron.Bounce(other.GetContact(0).normal);
         }
     }
 }