コード例 #1
0
 protected void UseForEntity(MyEntity entity)
 {
     if (entity.IsDamaged() && entity.HealthRatio < MyGameplayConstants.NANO_REPAIR_TOOL_REPAIR_TO_HEALTH_MAX)
     {
         float repairHealth =
             Math.Min(
                 entity.MaxHealth * MyGameplayConstants.NANO_REPAIR_TOOL_REPAIR_HEALTH_RATIO_PER_SEC *
                 MyConstants.PHYSICS_STEP_SIZE_IN_SECONDS,
                 entity.MaxHealth * MyGameplayConstants.NANO_REPAIR_TOOL_REPAIR_TO_HEALTH_MAX - entity.Health);
         entity.AddHealth(repairHealth);
     }            
 }
コード例 #2
0
 protected void UseForEntity(MyEntity entity)
 {
     if (entity.IsDamaged() && entity.HealthRatio < MyGameplayConstants.NANO_REPAIR_TOOL_REPAIR_TO_HEALTH_MAX)
     {
         float repairHealth =
             Math.Min(
                 entity.MaxHealth * MyGameplayConstants.NANO_REPAIR_TOOL_REPAIR_HEALTH_RATIO_PER_SEC *
                 MyConstants.PHYSICS_STEP_SIZE_IN_SECONDS,
                 entity.MaxHealth * MyGameplayConstants.NANO_REPAIR_TOOL_REPAIR_TO_HEALTH_MAX - entity.Health);
         entity.AddHealth(repairHealth);
     }
 }