void Update() { GuardMushroom.NowisHit(); GuardMushroom.GoToPullPush(); GuardMushroom.QueenisADead(); Dltime += Time.deltaTime; if (Dltime > 0.15f) { if (GuardMushroom.QueenisAllDead) { GuardMushroom.SetState(GuardMushroomState.BChase); return; } else if (GuardMushroom.SBombing) { GuardMushroom.SetState(GuardMushroomState.Sbombing); return; } else { GuardMushroom.SetState(GuardMushroomState.Return); return; } } }
void Update() { if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.ChaseDistance) { GuardMushroom.SetState(GuardMushroomState.Chase); return; } if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance) { if (GuardMushroom.attackTimer > GuardMushroom.attackDelay) { GuardMushroom.SetState(GuardMushroomState.Attack); return; } } if (GuardMushroom.GetDistanceFromPlayer() > GuardMushroom.MStat.ChaseDistance) { GuardMushroom.SetState(GuardMushroomState.Gohome); return; } }
void Update() { GuardMushroom.ModeChange(); Dltime += Time.deltaTime; if (Dltime > 1.4f) { CPlayerManager._instance.isPush = false; CPlayerManager._instance.isPull = false; GuardMushroom.PPEnding = true; if (GuardMushroom.QueenisAllDead) { GuardMushroom.SetState(GuardMushroomState.BChase); return; } else if (GuardMushroom.SBombing) { GuardMushroom.SetState(GuardMushroomState.Sbombing); return; } GuardMushroom.SetState(GuardMushroomState.Return); return; } }
void Update() { GuardMushroom.GoToPullPush(); GuardMushroom.ModeChange(); GuardMushroom.NowisHit(); GuardMushroom.PlayerisDead(); GuardMushroom.QueenisADead(); GuardMushroom.GoToDestination(GuardMushroom.Player.position, GuardMushroom.MStat.MoveSpeed, GuardMushroom.rotAnglePerSecond); if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance) { if (GuardMushroom.AttackTimer > GuardMushroom.AttackDelay) { GuardMushroom.SetState(GuardMushroomState.Attack); return; } } if (GuardMushroom.AttackTimer < GuardMushroom.AttackDelay && GuardMushroom.GetDistanceFromPlayer() <= GuardMushroom.MStat.AttackDistance) { GuardMushroom.SetState(GuardMushroomState.Return); return; } }
void Update() { GuardMushroom.GoToPullPush(); GuardMushroom.NowisHit(); GuardMushroom.PlayerisDead(); GuardMushroom.QueenisADead(); Dltime += Time.deltaTime; if (Dltime > 1.5f) { if (GuardMushroom.GetDistanceFromPlayer() > GuardMushroom.MStat.AttackDistance) { GuardMushroom.SetState(GuardMushroomState.Chase); Dltime = 0; GuardMushroom.AttackTimer = 0f; return; } else { GuardMushroom.SetState(GuardMushroomState.Return); Dltime = 0; GuardMushroom.AttackTimer = 0f; return; } } }
void Update() { GuardMushroom.GoToPullPush(); GuardMushroom.NowisHit(); if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.ChaseDistance && (CPlayerManager._instance.isDead == false)) { GuardMushroom.GoToDestination(GuardMushroom.Player.position, GuardMushroom.MStat.MoveSpeed, GuardMushroom.rotAnglePerSecond); GuardMushroom.SetState(GuardMushroomState.Chase); return; } }
public void AttackCheck() { if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance + 2.0f) { Debug.Log("Hit!"); GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerParams>().SetHp(10.0f); if (GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerParams>().curHP == 0) { GuardMushroom.SetState(GuardMushroomState.Idle); } } }
void Update() { GuardMushroom.GoToPullPush(); GuardMushroom.NowisHit(); GuardMushroom.PlayerisDead(); GuardMushroom.GoToDestination(GuardMushroom.Player.position, GuardMushroom.BerserkerMoveSpeed, GuardMushroom.rotAnglePerSecond); if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance && GuardMushroom.AttackTimer > GuardMushroom.BerserkerAttackDelay) { GuardMushroom.SetState(GuardMushroomState.BAttack); return; } }
void Update() { GuardMushroom.GoToPullPush(); GuardMushroom.NowisHit(); GuardMushroom.PlayerisDead(); Dltime += Time.deltaTime; if (Dltime > 0.78f) { GuardMushroom.SetState(GuardMushroomState.BChase); Dltime = 0; return; } }
void Update() { GuardMushroom.GoToDestination(new Vector3(this.transform.position.x + default_direction.x, this.transform.position.y, this.transform.position.z + default_direction.z), 1.0f, GuardMushroom.rotAnglePerSecond); if (Vector3.Distance(this.transform.position, GuardMushroom.HomePosition) > 10.0f) { GuardMushroom.GoToDestination(GuardMushroom.HomePosition, 1.0f, GuardMushroom.rotAnglePerSecond); } if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.ChaseDistance) { GuardMushroom.GoToDestination(GuardMushroom.Player.position, GuardMushroom.MStat.MoveSpeed, GuardMushroom.rotAnglePerSecond); GuardMushroom.SetState(GuardMushroomState.Chase); return; } }
void Update() { Dltime += Time.deltaTime; if (Dltime > 1.5f) { if (GuardMushroom.GetDistanceFromPlayer() > GuardMushroom.MStat.AttackDistance) { GuardMushroom.SetState(GuardMushroomState.Chase); Dltime = 0; return; } else { GuardMushroom.SetState(GuardMushroomState.Return); Dltime = 0; return; } } }
void Update() { GuardMushroom.TurnToDestination(); GuardMushroom.GoToPullPush(); GuardMushroom.NowisHit(); GuardMushroom.PlayerisDead(); GuardMushroom.QueenisADead(); if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance && GuardMushroom.AttackTimer > GuardMushroom.AttackDelay) { GuardMushroom.SetState(GuardMushroomState.Attack); return; } if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.ChaseDistance && GuardMushroom.GetDistanceFromPlayer() > GuardMushroom.MStat.AttackDistance) { GuardMushroom.SetState(GuardMushroomState.Chase); return; } }
/*GuardMushroom.MoveToDestination(); * transform.position = new Vector3(GuardMushroom.GoHomePositionX,GuardMushroom.GoHomePositionY, GuardMushroom.GoHomePositionZ); * * GuardMushroom.MoveToTarget(new Vector3(GuardMushroom.GoHomePositionX, * GuardMushroom.GoHomePositionY, GuardMushroom.GoHomePositionZ));*/ void Update() { if (GuardMushroom.GetDistanceFromPlayer() > GuardMushroom.MStat.ChaseDistance) { GuardMushroom.GoToDestination(GuardMushroom.HomePosition, GuardMushroom.MStat.MoveSpeed, GuardMushroom.rotAnglePerSecond); if (Vector3.Distance(transform.position, new Vector3(GuardMushroom.GoHomePositionX, GuardMushroom.GoHomePositionY, GuardMushroom.GoHomePositionZ)) <= 2.0f) { GuardMushroom.SetState(GuardMushroomState.Idle); return; } } else { GuardMushroom.SetState(GuardMushroomState.Return); return; } }
void Update() { Dltime += Time.deltaTime; GuardMushroom.GoToDestination(SavePosition, 0, 0); if (Dltime > 1.85f) { GuardMushroom.ifEndBerserker = true; if (GuardMushroom.QueenisAllDead) { GuardMushroom.SetState(GuardMushroomState.BChase); return; } else { GuardMushroom.SetState(GuardMushroomState.Sbombing); return; } } }
void Update() { if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.ChaseDistance && GuardMushroom.GetDistanceFromPlayer() > GuardMushroom.MStat.AttackDistance) { GuardMushroom.GoToDestination(GuardMushroom.Player.position, GuardMushroom.MStat.MoveSpeed, GuardMushroom.rotAnglePerSecond); } if (GuardMushroom.GetDistanceFromPlayer() < GuardMushroom.MStat.AttackDistance) { if (GuardMushroom.attackTimer > GuardMushroom.attackDelay) { GuardMushroom.SetState(GuardMushroomState.Attack); return; } } else { GuardMushroom.SetState(GuardMushroomState.Return); return; } }