Ejemplo n.º 1
0
 void Start()
 {
     Player       = GameObject.FindGameObjectWithTag("Player");
     currentState = FearState.NotScared;
     fearAmount   = 0f;
     fillAmount   = 0f;
 }
Ejemplo n.º 2
0
    protected void Awake()
    {
        idleState = new IdleState(this);
        huntState = new HuntState(this);
        fearState = new FearState(this);
        engageState = new EngageState(this);
        counterState = new CounterState(this);

        nav = GetComponent<NavMeshAgent> ();
    }
Ejemplo n.º 3
0
    private void fearManager()
    {
        currentFear += Time.deltaTime * scareInc;
        if (currentFear > 0.0f && currentFear - Time.deltaTime * scareDec > 0.0f)
        {
            currentFear -= Time.deltaTime * scareDec;
        }
        else
        {
            currentFear = 0.0f;
        }

        FearMeter.updateMeter(currentFear / MAXFEAR);
        FearState.updateFearState(scaredState.ToString());
    }
Ejemplo n.º 4
0
 void UpdateFearState()
 {
     if (fillAmount == 0)
     {
         currentState = FearState.NotScared;
     }
     else if (fillAmount <= 0.25f && fillAmount > 0f)
     {
         currentState = FearState.NotTooScared;
     }
     else if (fillAmount > 0.25f && fillAmount <= 0.5f)
     {
         currentState = FearState.LittleScared;
     }
     else if (fillAmount > 0.5f && fillAmount <= 0.75f)
     {
         currentState = FearState.ModeratelyScared;
     }
     else if (fillAmount > 0.75f && fillAmount <= 1.0f)
     {
         currentState = FearState.VeryScared;
     }
 }