public override BossState Update(BossStateMachine boss) { //do stuff to the boss... Debug.Log("idle"); // transitions to other states if (boss.CanSeeAttackTarget()) { // transition to pursue state... AttackList(); } if (currentAttack == 1 && isAttacking == true) { Debug.Log("ATTACK01"); return(new BossStateShoot()); } if (currentAttack == 2 && isAttacking == true) { Debug.Log("ATTACK02"); } if (currentAttack == 3 && isAttacking == true) { Debug.Log("ATTACK03"); } if (currentAttack == 4 && isAttacking == true) { Debug.Log("ATTACK04"); } return(null); // stay in current state }
public override BossState Update(BossStateMachine boss) { Debug.Log("Pew Pew"); timeUntilNextShot -= Time.deltaTime; if (timeUntilNextShot <= 0) { boss.ShootProjectile(); timeUntilNextShot = timeBetweenShots; } //boss.ShootProjectile(); if (!boss.CanSeeAttackTarget()) { return(new BossStateIdle()); } else if (boss.DistanceToAttackTargt() < boss.attackDistanceThreshold) { return(new BossStateAttack()); } else { return(null); } }
public override BossState Update(BossStateMachine boss) { ///////////////////////////// STATE BEHAVIOR: Vector3 vectorToPlayer = boss.VectorToAttackTarget(); Vector3 dirToPlayer = vectorToPlayer.normalized; boss.transform.position += dirToPlayer * boss.speed * Time.deltaTime; //////////////////////////// TRANSITION: /// if (!boss.CanSeeAttackTarget()) // if we can't see the player.. { // transition to idle return(new BossStateIdle()); } else if (boss.DistanceToAttackTargt() < boss.attackDistanceThreshold) { return(new BossStateAttack()); } else if (boss.DistanceToAttackTargt() < boss.pursueDistanceThreshold) { return(new BossStateShoot()); } else { return(null); } }
public override BossState Update(BossStateMachine boss) { ///////////////////////////// STATE BEHAVIOR: Vector3 vectorToPlayer = boss.VectorToAttackTarget(); Vector3 dirToPlayer = vectorToPlayer.normalized; boss.transform.position += dirToPlayer * boss.speed * Time.deltaTime; //////////////////////////// TRANSITION: /// if (vectorToPlayer.sqrMagnitude < boss.pursueDistanceThreshold * boss.pursueDistanceThreshold) // if dis < threshold { return(new BossStatePursue()); } if (!boss.CanSeeAttackTarget()) // if we can't see the player.. { // transition to idle return(new BossStateIdle()); } return(null); }
public override BossState Update(BossStateMachine boss) { if (currentAttack == 1 && isAttacking == true) { Debug.Log("ATTACK01"); } if (currentAttack == 2 && isAttacking == true) { Debug.Log("ATTACK02"); } return(null); }
public override BossState Update(BossStateMachine boss) { //do stuff to the boss... Debug.Log("idle"); // transitions to other states if (boss.DistanceToAttackTargt() < boss.visionDistanceThreshold) { return(new BossStatePursue()); } return(null); // stay in current state }
public abstract BossState Update(BossStateMachine boss);
public virtual void OnEnd(BossStateMachine boss) { }
public virtual void OnStart(BossStateMachine boss) { }
public override void OnEnd(BossStateMachine boss) { isAttacking = false; }
public override void OnStart(BossStateMachine boss) { ///pickAnAttack = Random.Range(1, 5); pickAnAttack = 1; }
public override BossState Update(BossStateMachine boss) { return(null); }
public override void OnEnd(BossStateMachine boss) { pickAnAttack = 0; currentAttack = 0; isAttacking = false; }