public void OnPlayerAttacked(UnitEnemy _Enemy) { if (_Enemy != null) { m_Player.TakeDamages(1); m_Player.AttackEnemy(); } /* * if (Application.isMobilePlatform) * { * if (_Enemy != null) * { * SetInputMode(new InputMode_MeleeBattle()); * } * else * { * SetInputMode(new InputMode_Movement()); * } * } * else * { * if (_Enemy != null) * { * SetInputMode(new InputMode_MeleeBattleDebug()); * } * else * { * SetInputMode(new InputMode_MovementDebug()); * } * }*/ }
public void SetAttackingEnemy(UnitEnemy _Enemy) { m_Enemy = _Enemy; for (int i = 0; i < m_OnPlayerAttackedEventRecievers.Count; i++) { m_OnPlayerAttackedEventRecievers[i].OnPlayerAttacked(m_Enemy); } }
public void RemoveEnemy(UnitEnemy pUnitEnemy) { mUnitEnemyList.Remove(pUnitEnemy); if (mUnitHero.vTargetObject == pUnitEnemy.aTransform) { mUnitHero.vTargetObject = null; } }
private void InternalLoadEnemies(I_Map _Map, List <EnemyData> _EnemyData) { for (int i = 0; i < _EnemyData.Count; i++) { UnitEnemy enemy = GameObject.Instantiate(Resources.Load <GameObject>("Entities/Enemy"), new Vector3(0, 0, 0), Quaternion.identity).GetComponent <UnitEnemy>(); enemy.LoadFromData(_Map, _EnemyData[i]); m_Enemies.Add(enemy); } }
private void InternalSpawnEnemyRandomly(I_Map _Map, int _Count) { for (int i = 0; i < _Count; i++) { UnitEnemy enemy = GameObject.Instantiate(Resources.Load <GameObject>("Entities/Enemy"), new Vector3(0, 0, 0), Quaternion.identity).GetComponent <UnitEnemy>(); enemy.TeleportTo(_Map.GetRandomWalkableTile()); m_Enemies.Add(enemy); } }
public void TriggerStop() { SetButtons(true); CheckAvailableAttack(); UnitEnemy unitEnemy = GetComponent <UnitEnemy>(); if (unitEnemy != null) { SetDown(true); unitEnemy.TryAttack(); } }
private void ServerHandleEnemyDespawned(UnitEnemy unitEnemy) { enemies.Remove(unitEnemy); if (enemies.Count != 1) { return; } int playerId = enemies[0].connectionToClient.connectionId; RpcGameOver($"Player {playerId}"); ServerOnGameOver?.Invoke(); }
public void Start() { vUnitEnemy = gameObject.GetComponent<UnitEnemy>(); if (vUnitEnemy == null) Debug.LogError("This object is not exist UnitEnemy component. please check your component"); }
public void SetTarget(UnitEnemy pEnemy) { vTargetObject = pEnemy.aTransform; }
void Start() { EnemyState = states.Idle; delay = Time.time; AIPathing = GetComponent<AIPathCustom>(); controller = GetComponent<CharacterController>(); GM= GameManager.Get(); if (gameObject.tag == "Bat" || gameObject.tag == "Larva"){ player = GM.objPlayer.transform; tmp = GetComponent<UnitEnemy>(); }else if (gameObject.tag == "MechBoss"){ StartCoroutine("bossAutoAttack"); } }
protected void Start() { TurnOrder.RegisterUnit(this); m_Enemy = GetComponent <UnitEnemy>(); }
public void AddEnemy(UnitEnemy pUnitEnemy) { pUnitEnemy.Init(); mUnitEnemyList.Add(pUnitEnemy); }
private void InternalRemoveEnemy(UnitEnemy _Enemy) { m_Enemies.Remove(_Enemy); }
public static void RemoveEnemy(UnitEnemy _Enemy) { GetInstance().InternalRemoveEnemy(_Enemy); }
private void ServerHandleEnemySpawned(UnitEnemy unitEnemy) { enemies.Add(unitEnemy); }