示例#1
0
        public override void Initialize()
        {
            base.Initialize();

            // Attack affector
            m_AttackAffector.Initialize(configuration.alignmentProvider);

            // We don't want agents to attack towers until their path is blocked,
            // so disable m_AttackAffector until it is needed
            m_AttackAffector.enabled = false;
        }
示例#2
0
    public override void Initialize()
    {
        base.Initialize();
        // Attack affector
        if (gotLayerEnemyMask)
        {
            m_AttackAffector.Initialize(configuration.alignmentProvider, enemyLayerMask);
        }
        else
        {
            m_AttackAffector.Initialize(configuration.alignmentProvider);
        }

        if (stopForAttacking)
        {
            if (m_AttackAffector != null)
            {
                m_AttackAffector.m_Targetter.acquiredTarget += OnAcquiredTarget;
            }
            m_AttackAffector.m_Targetter.lostTarget += OnLostTarget;
        }
    }