예제 #1
0
        private void OnEnable()
        {
            m_EnemyBehaviour = GetComponent <SentryEnemyBehavior>();
            m_Animator       = GetComponent <Animator>();

            m_Ai.OpenBranch(
                BT.Trigger(m_Animator, "Shooting"),
                BT.Call(m_EnemyBehaviour.RememberTargetPos),
                BT.WaitForAnimatorState(m_Animator, "Attack")
                );
        }
예제 #2
0
        private void OnEnable()
        {
            m_EnemyBehaviour = GetComponent <EnemyBehaviour>();
            m_Animator       = GetComponent <Animator>();

            m_Ai.OpenBranch(
                BT.If(() => { return(m_EnemyBehaviour.Target != null); }).OpenBranch(
                    BT.Call(m_EnemyBehaviour.CheckTargetStillVisible),
                    BT.Call(m_EnemyBehaviour.OrientToTarget),
                    BT.Trigger(m_Animator, "Shooting"),
                    BT.Call(m_EnemyBehaviour.RememberTargetPos),
                    BT.WaitForAnimatorState(m_Animator, "Attack")
                    ),
                BT.If(() => { return(m_EnemyBehaviour.Target == null); }).OpenBranch(
                    BT.Call(m_EnemyBehaviour.ScanForPlayer)
                    )
                );
        }