Exemplo n.º 1
0
    IEnumerator RepairHullCrt()
    {
        int repairProgress = 0;

        while (true)
        {
            if (engineMng != null)
            {
                if (engineMng.IsRepairEngineAlive())
                {
                    if (playerStats.health2 < playerStats.maxHealth2)
                    {
                        repairProgress += 1;
                        Engine repairEngine = engineMng.GetEngine(Engine.engineType.repair);
                        if (repairEngine != null)
                        {
                            modifiedMaxRepairProgress = maxRepairProgress * ((100 - (repairEngine.operateLevel * repairOperateRatio)) / 100f);
                            if (repairProgress >= modifiedMaxRepairProgress)
                            {
                                playerStats.health2 += 1;
                                repairProgress       = 0;
                            }
                        }
                    }
                }
            }
            yield return(new WaitForSeconds(0.1f));
        }
    }