Ejemplo n.º 1
0
        IEnumerator RecoverFromStruckState()
        {
            yield return(new WaitForSeconds(struckWaitTime));

            npcMaster.CallEventNpcRecoveredAnim();

            //Evil max.Repair gun hold
            //

            if (rangedWeapon != null)
            {
                // HARD CODED STATEMENT BELOW
                yield return(new WaitForSeconds(struckWaitTime / 2));

                rangedWeapon.SetActive(true);
            }

            if (myNavMeshAgent.enabled)
            {
                //myNavMeshAgent.Resume();
                myNavMeshAgent.isStopped = false;
            }

            currentState = capturedState;
        }
Ejemplo n.º 2
0
        void CheckHealthFraction()
        {
            if (npcHealth <= healthLow && npcHealth > 0)
            {
                npcMaster.CallEventNpcLowHealth();
                healthCritical = true;
            }

            else if (npcHealth > healthLow && healthCritical)
            {
                npcMaster.CallEventNpcRecoveredAnim();
                healthCritical = false;
            }
        }