示例#1
0
    public void Update()
    {
        if (enemy.InRange == true)
        {
            CurrentState.HandleInput(E_Input.ReachPlayer, this);
        }

        else if (detect.Detected == true)
        {
            CurrentState.HandleInput(E_Input.DetectedPlayer, this);
            counter = 0.0f;
        }

        else if (detect.Detected == false && counter >= 3.0f)
        {
            CurrentState.HandleInput(E_Input.NoVisionForTime, this);
            counter = 0.0f;
        }

        else if (detect.Detected == false)
        {
            counter += Time.deltaTime;
            CurrentState.HandleInput(E_Input.NoVision, this);
        }

        else if (enemy.InRange == false)
        {
            CurrentState.HandleInput(E_Input.OutOfRange, this);
        }

        currentState.Update(enemy);
    }
示例#2
0
 private void Update()
 {
     currentState.Update();
 }