Exemplo n.º 1
0
    // Use this for initialization

    void Start()
    {
        allowerMovement  = PositionsFather.GetComponent <AllowerMovement>();
        playerPersecutor = GetComponent <PlayerPersecutor>();
        patrolingEnemy   = GetComponent <PatrolingEnemy>();
        patrolliArea     = PositionsFather.GetComponent <PatrollingArea>();
    }
Exemplo n.º 2
0
 public override void EnterState(PatrolingEnemy enemyAI)
 {
     Debug.Log("STATE CHANGE:" + enemyAI.gameObject.name + " ATTACK STATE");
     Debug.Log("AttackState.ENTER");
     enemyAI.movementSpeed = 0;
     player = GameObject.FindGameObjectWithTag("Player");
 }
Exemplo n.º 3
0
 public override void UpdateState(PatrolingEnemy enemyAI)
 {
     timeleft -= Time.deltaTime;
     if (timeleft < 0)
     {
         enemyAI.TransitionToState(enemyAI.patrolstate);
     }
 }
 public override void EnterState(PatrolingEnemy enemyAI)
 {
     Debug.Log("STATE CHANGE:" + enemyAI.gameObject.name + " PATROL STATE");
     Debug.Log("patrolstate.ENTER");
     enemyAI.movementSpeed    = 2f;
     patrolingenemy           = enemyAI;
     enemyAI.agent.autoRepath = true;
 }
Exemplo n.º 5
0
    void OnTriggerStay(Collider hit)
    {
        PatrolingEnemy act = hit.GetComponent <PatrolingEnemy>();

        switch (gasType)
        {
        case Type.Nerve:
            act.Damage(damageOverTime);
            break;

        case Type.Smoke:
            act.currentSeekTime = 0;
            break;
        }
    }
Exemplo n.º 6
0
 public override void EnterState(PatrolingEnemy enemyAI)
 {
     Debug.Log("STATE CHANGE:" + enemyAI.gameObject.name + " IDLE STATE");
     Debug.Log("IdleState.ENTER");
     enemyAI.movementSpeed = 0;
 }
Exemplo n.º 7
0
 public override void ExitState(PatrolingEnemy enemyAI)
 {
 }
 public override void UpdateState(PatrolingEnemy enemyAI)
 {
     AnimationState();
     NextDestination();
     Debug.Log(patrolingenemy.gameObject.name);
 }
 public override void ExitState(PatrolingEnemy enemyAI)
 {
     patrolingenemy.agent.destination = GameObject.FindGameObjectWithTag("Player").transform.position;
 }
Exemplo n.º 10
0
 // Use this for initialization
 void Start()
 {
     canPatrol      = false;
     patrolingEnemy = gameObject.GetComponent <PatrolingEnemy>();
     animator       = gameObject.GetComponent <Animator>();
 }
 public abstract void ExitState(PatrolingEnemy enemyAI);
 public abstract void UpdateState(PatrolingEnemy enemyAI);
 public abstract void EnterState(PatrolingEnemy enemyAI);
Exemplo n.º 14
0
 public override void UpdateState(PatrolingEnemy enemyAI)
 {
     enemyAI.agent.SetDestination(player.transform.position);
 }