protected override void Awake() { base.Awake(); m_board = Object.FindObjectOfType <Board>().GetComponent <Board>(); m_enemyMover = GetComponent <EnemyMover>(); m_enemySenor = GetComponent <EnemySensor>(); }
public void RemoveMonsterSenser(EnemySensor enemySensor) { if (_monsterSenses.Contains(enemySensor)) { _monsterSenses.Remove(enemySensor); } }
protected override void Awake() { base.Awake(); enemyMover = GetComponent <EnemyMover>(); enemySensor = GetComponent <EnemySensor>(); enemyAttack = GetComponent <EnemyAttack>(); }
public void AddMonsterSense(EnemySensor enemySensor) { if (!_monsterSenses.Contains(enemySensor)) { _monsterSenses.Add(enemySensor); } }
void Start() { waypointController = GetComponent <WaypointController>(); zombieAnimator = GetComponent <Animator>(); sensor = GetComponent <EnemySensor>(); characterControl = GetComponent <AICharacterControl>(); attackRangeChecker = GetComponent <AttackRangeChecker>(); thirdPersonCharacter = GetComponent <ThirdPersonCharacter>(); attackRangeChecker.enabled = false; //Add in animation events AnimationClip[] animationClips = zombieAnimator.runtimeAnimatorController.animationClips; foreach (AnimationClip clip in animationClips) { //We want to add a function to be called when the zombie attack is a place if (clip.name == "Zombie Attack") { AnimationEvent animationEvent = new AnimationEvent(); animationEvent.functionName = "AttackAnimationComplete"; //Animation time for a place where this could hit animationEvent.time = 1.13f; clip.AddEvent(animationEvent); } if (clip.name == "Zombie Death") { AnimationEvent animationEvent = new AnimationEvent(); animationEvent.functionName = "DeathAnimationComplete"; animationEvent.time = clip.length; clip.AddEvent(animationEvent); } } }
private void InitializeComponents() { Mover = GetComponent <RootMover>(); Enemy = GetComponent <Enemy>(); CameraController = GameObject.FindWithTag(Tags.MainCamera).GetComponent <CameraController>(); PickableSensor = transform.root.GetComponentInChildren <PickableSensor>(); EnemySensor = transform.root.GetComponentInChildren <EnemySensor>(); }
protected override void Awake() { base.Awake(); _gameBoard = Object.FindObjectOfType <Board>().GetComponent <Board>(); _enemyMove = GetComponent <EnemyMove>(); _enemySensor = GetComponent <EnemySensor>(); _enemyAttack = GetComponent <EnemyAttack>(); }
public override void Awake() { base.Awake(); _anim = GetComponentInChildren <Animator>(); _rigid = GetComponent <Rigidbody2D>(); _bh = GetComponent <BehaviourController>(); _sensor = GetComponentInChildren <EnemySensor>(); _stat = GetComponent <GeneralStatistics>(); }
protected override void Awake() { base.Awake(); m_board = Object.FindObjectOfType <Board>().GetComponent <Board>(); m_enemyMover = GetComponent <EnemyMover>(); m_enemySensor = GetComponent <EnemySensor>(); m_enemyDeath = GetComponent <EnemyDeath>(); m_player = Object.FindObjectOfType <PlayerManager>().GetComponent <PlayerManager>(); }
public override void Initialize() { base.Initialize(); board = FindObjectOfType <Board>(); enemyMover = GetComponent <EnemyMover>(); enemieSensor = GetComponent <EnemySensor>(); enemyAttack = GetComponent <EnemyAttack>(); enemyMover.FinishMovementEvent.AddListener(() => FinishTurn()); }
void Awake() { m_groundSensor = transform.Find("Ground Sensor").GetComponent <EnemySensor>(); m_body2d = GetComponent <Rigidbody2D>(); spriteRenderer = GetComponent <SpriteRenderer>(); attackPoint = transform.Find("AttackPoint"); attackPointPosition = attackPoint.localPosition; m_player = GameObject.FindGameObjectWithTag("Player"); m_animator = GetComponent <Animator>(); enemyHealth = enemyMaxHealth; }
protected override void Awake() { base.Awake(); m_board = Object.FindObjectOfType <Board>().GetComponent <Board>(); m_enemyMover = GetComponent <EnemyMover>(); m_enemySensor = GetComponent <EnemySensor>(); m_enemyAttack = GetComponent <EnemyAttack>(); m_skeletonArrow = GetComponent <ShootArrow>(); godMode = Object.FindObjectOfType <GodModeManager>(); }
public override void Initialize() { base.Initialize(); startNode = board.FindNodeAt(transform.position); if (startNode == null) { Debug.LogWarning($"{gameObject.name} start node is lost"); } startRotation = transform.rotation; wpmanager = FindObjectOfType <WPManager>(); sensor = GetComponent <EnemySensor>(); GetComponent <EnemyManager>().DeathEvent.AddListener(() => currentNode = null); }
void Start() { _enemy = FindObjectOfType<EnemyMove>(); _sensor = FindObjectOfType<EnemySensor>(); }
protected override void Awake() { base.Awake(); m_enemySensor = GetComponent <EnemySensor>(); m_gameManager = Object.FindObjectOfType <GameManager>(); }
private void Awake() { _enemy = GetComponentInParent <EnemySensor>(); _stats = GetComponentInParent <GeneralStatistics>(); }
public override void Awake() { base.Awake(); _bh = GetComponent <BehaviourController>(); _sensor = GetComponentInChildren <EnemySensor>(); }