Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (healTime < 11f)
        {
            healTime += Time.deltaTime;
        }
        isMoving = playerMvntSCR.moving;

        if (currentHp <= 0)
        {
            Death();
        }
        if (engineMng.IsMedicEngineAlive())
        {
            if (currentHp < maxHp)
            {
                if (isInMedicRange())
                {
                    if (!isHealCrtRunning)
                    {
                        StartCoroutine(HealCrt());
                        print("Heal !");
                    }
                }
                else
                {
                    if (isHealCrtRunning)
                    {
                        stopCoroutine = true;
                    }
                }
            }
            else
            {
                if (isHealCrtRunning)
                {
                    stopCoroutine = true;
                }
            }
        }
        else
        {
            if (isHealCrtRunning)
            {
                stopCoroutine = true;
            }
        }
    }