示例#1
0
 protected override void Awake()
 {
     base.Awake();
     m_board      = Object.FindObjectOfType <Board>().GetComponent <Board>();
     m_enemyMover = GetComponent <EnemyMover>();
     m_enemySenor = GetComponent <EnemySensor>();
 }
示例#2
0
 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>();
 }
示例#4
0
 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);
            }
        }
    }
示例#6
0
 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>();
 }
示例#7
0
 protected override void Awake()
 {
     base.Awake();
     _gameBoard   = Object.FindObjectOfType <Board>().GetComponent <Board>();
     _enemyMove   = GetComponent <EnemyMove>();
     _enemySensor = GetComponent <EnemySensor>();
     _enemyAttack = GetComponent <EnemyAttack>();
 }
示例#8
0
 public override void Awake()
 {
     base.Awake();
     _anim   = GetComponentInChildren <Animator>();
     _rigid  = GetComponent <Rigidbody2D>();
     _bh     = GetComponent <BehaviourController>();
     _sensor = GetComponentInChildren <EnemySensor>();
     _stat   = GetComponent <GeneralStatistics>();
 }
示例#9
0
    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>();
    }
示例#10
0
    public override void Initialize()
    {
        base.Initialize();
        board        = FindObjectOfType <Board>();
        enemyMover   = GetComponent <EnemyMover>();
        enemieSensor = GetComponent <EnemySensor>();
        enemyAttack  = GetComponent <EnemyAttack>();

        enemyMover.FinishMovementEvent.AddListener(() => FinishTurn());
    }
示例#11
0
 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;
 }
示例#12
0
    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>();
    }
示例#13
0
    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);
    }
示例#14
0
 void Start()
 {
     _enemy = FindObjectOfType<EnemyMove>();
     _sensor = FindObjectOfType<EnemySensor>();
 }
示例#15
0
 protected override void Awake()
 {
     base.Awake();
     m_enemySensor = GetComponent <EnemySensor>();
     m_gameManager = Object.FindObjectOfType <GameManager>();
 }
示例#16
0
 private void Awake()
 {
     _enemy = GetComponentInParent <EnemySensor>();
     _stats = GetComponentInParent <GeneralStatistics>();
 }
示例#17
0
 public override void Awake()
 {
     base.Awake();
     _bh     = GetComponent <BehaviourController>();
     _sensor = GetComponentInChildren <EnemySensor>();
 }