Beispiel #1
0
        public override bool ShouldPerform()
        {
            Being enemy = this.m_AI.m_EnemyModule.m_Enemy;

            return(enemy && !enemy.IsDead() && (this.m_Active || (enemy.GetHeadTransform().position.To2D().Distance(this.m_AI.GetHeadTransform().position.To2D()) <= (this.m_AI.IsSwimming() ? 1.3f : this.m_AI.m_Params.m_AttackRange) && (!this.m_AI.IsSwimming() || Vector3.Dot((this.m_AI.m_EnemyModule.m_Enemy.transform.position - this.m_AI.transform.position).GetNormalized2D(), this.m_AI.transform.forward.GetNormalized2D()) >= 0.5f))));
        }
Beispiel #2
0
        private bool IsBeingVisible(Being being)
        {
            RaycastHit raycastHit;

            return(Vector3.Distance(being.transform.position, this.m_AI.transform.position) <= this.m_AI.m_Params.m_SightRange && this.IsInSightCone(being.gameObject) && ((Physics.Linecast(this.m_AI.GetHeadTransform().position, being.GetHeadTransform().position, out raycastHit) && raycastHit.transform == being.transform) || (Camera.main && raycastHit.transform == Camera.main.transform)));
        }