public override void AnimationState() { switch (animationState) { case State.Idle: { EnemyObject.GetComponent <Animation>().Play("Idle"); //accessing the EnemyObject property break; } case State.Running: { EnemyObject.GetComponent <Animation>().Play("Firing"); break; } case State.Death: { EnemyObject.GetComponent <Animation>().Play("Death"); isDead = true; break; } default: { break; } } }
// Use this for initialization void Start() { //bossHP = 1; hpBarImage = this.GetComponent <Image>(); mAnimator = this.GetComponent <Animator>(); hitPointsAtFull = boss.GetComponent <EnemyObject>().hitpoints; }
IEnumerator UnpauseInGame() { yield return(null); Unpause(); instance.pausePanel.SetActive(false); instance.buttonPause.SetActive(true); instance.blindPanel.SetActive(false); string gameMode = instance.GetCurrentGame()[0]; if (gameMode.Equals("Vagabond") || gameMode.Equals("Guardian") || gameMode.Equals("Stalker") || gameMode.Equals("Sniping") || gameMode.Equals("Boss")) { EnemyObject.GetComponent <Enemy>().SpeakReady(); yield return(new WaitForSeconds(2.2f)); if (PlayerObject != null) { PlayerObject.GetComponent <Player>().SpeakReady(); } } else if (gameMode.Equals("Deceiver")) { PlayerObject.GetComponent <Player>().SpeakReady(); yield return(new WaitForSeconds(3.5f)); if (EnemyObject != null) { EnemyObject.GetComponent <Enemy>().SpeakReady(); } } else if (gameMode.Equals("Dummy")) { PlayerObject.GetComponent <Player>().SpeakReady(); yield return(new WaitForSeconds(1.8f)); if (EnemyObject != null) { EnemyObject.GetComponent <Enemy>().SpeakReady(); } } }
public override bool CanReachEnemy() { float distance = 0.0f; EnemyObject nearestObject = GameManager.Instance.GetClosestEnemyObjectTo(Owner.gameObject, ref distance); if (nearestObject == null) { return(false); } //敵の半径もリーチ計算に入れる float extX = nearestObject.GetComponent <BoxCollider>().bounds.extents.x; if (distance <= (_reachLength + extX)) { return(true); } return(false); }
public void UpdateStatusBars() { PlayerObject[] players = GameManager.Instance.battleComponents.field.GetPlayerObjects(); for (int i = 0; i < players.Length; i++) { if (this.statusBars[i] == null) { continue; } PlayerObject player = players[i]; if (player == null) { this.statusBars[i].gameObject.SetActive(false); continue; } if (i == 0) { // Heros have mana ManaStatusBarUI heroStatusBar = (ManaStatusBarUI)statusBars[i]; heroStatusBar.SetFighter(player); heroStatusBar.SetName(player.Name); heroStatusBar.SetHP(player.stats.hp.GetValue(), player.stats.maxHp.GetValue()); heroStatusBar.SetMana(player.stats.mana.GetValue(), player.stats.maxMana.GetValue()); heroStatusBar.SetNameColor(player.GetOrderColor()); heroStatusBar.SetStatusAilmentIcons(player.ailmentController.GetAllAilments().Map(entry => entry.Value)); } else { // Mooks have energy MookStatusBarUI mookStatusBar = (MookStatusBarUI)statusBars[i]; mookStatusBar.SetFighter(player); mookStatusBar.SetName(player.Name); mookStatusBar.SetHP(player.stats.hp.GetValue(), player.stats.maxHp.GetValue()); mookStatusBar.SetStatusAilmentIcons(player.ailmentController.GetAllAilments().Map(entry => entry.Value)); // Note: Energy might be its own thing later, but for now, lets just use mana mookStatusBar.SetEnergy(player.ailmentController.GetAilment("Out of Juice").duration, maxMookEnergy); mookStatusBar.SetNameColor(player.GetOrderColor()); if (!player.HasSetCommand()) { mookStatusBar.actionMenuUI.UnsetActions(); } } this.statusBars[i].gameObject.SetActive(true); } EnemyObject[] enemies = GameManager.Instance.battleComponents.field.GetEnemyObjects(); for (int i = 0; i < enemies.Length; i++) { if (this.enemyStatusBars[i] == null) { continue; } EnemyObject enemy = enemies[i]; if (enemy == null) { this.enemyStatusBars[i].gameObject.SetActive(false); continue; } enemyStatusBars[i].SetFighter(enemy); enemyStatusBars[i].SetName(enemies[i].targetName); enemyStatusBars[i].SetHP(enemies[i].stats.hp.GetValue(), enemies[i].stats.maxHp.GetValue()); enemyStatusBars[i].SetStatusAilmentIcons(enemy.ailmentController.GetAllAilments().Map(entry => entry.Value).Filter(ailment => ailment.icon != null)); Transform barMarker = enemy.GetComponent <FighterPositions>().statusBar; WorldspaceToScreenUI barPositioner = enemyStatusBars[i].GetComponent <WorldspaceToScreenUI>(); barPositioner.SetWorldPoint(barMarker); this.enemyStatusBars[i].gameObject.SetActive(true); } }