示例#1
0
    private void FieldOfView() //Detecta si el enemigo esta en su rango de vista
    {
        Collider[] targetsInRadius = Physics.OverlapSphere(transform.position, viewRadius);
        found = false;

        for (int i = 0; i < targetsInRadius.Length; i++)
        {
            if (targetsInRadius[i].tag == "Player")
            {
                dirToTarget = (targetsInRadius[i].transform.position - transform.position).normalized;
                if (Vector3.Angle(transform.forward, dirToTarget) < viewAngle / 2)
                {
                    if (!Physics.Raycast(transform.position, dirToTarget, distToTarget, stageMask))
                    {
                        UpdateEnemy = AttackMode;
                        found       = true;
                    }
                }
            }
            else if (i == targetsInRadius.Length - 1 && !found)
            {
                curDestination = points[pointNum].transform.position;
                DestinationSet();
                UpdateEnemy = Patrol;
            }
        }
    }
示例#2
0
文件: Imp.cs 项目: Penjat/SQuest
    public override void SetUp(EnemyDelegate enemyDelegate)
    {
        _maxArousal = 4.0f;
        _curArousal = 4.0f;

        _maxClimax = 8.0f;
        //set stats before base setup
        base.SetUp(enemyDelegate);
    }
示例#3
0
    public override void Start()
    {
        base.Start();

        UpdateEnemy    = Patrol;
        EnemyAI        = GetComponent <NavMeshAgent>();
        EnemyAI.speed  = speed;
        target         = GameObject.FindGameObjectWithTag("Player");
        curDestination = points[0].transform.position;
        DestinationSet();
    }
示例#4
0
文件: Enemy.cs 项目: Penjat/SQuest
    public virtual void SetUp(EnemyDelegate enemyDelegate)
    {
        _delegate = enemyDelegate;
        _card     = GetComponentInChildren <ICard>();
        _card.SetCardDelegate(this);
        _card.SetName(GetName());

        //set up the climax bar
        _card.SetUpClimax(this, _maxClimax);
        _card.SetClimax(_curClimax);

        //set up the arousal bar
        _card.SetUpArousal(this, _maxArousal);
        _card.SetArousal(_curArousal);
        _state = SelectState.Norm;
    }
示例#5
0
文件: Harpy.cs 项目: Penjat/SQuest
 public override void SetUp(EnemyDelegate enemyDelegate)
 {
     _maxClimax = 12.0f;
     //set stats before base setup
     base.SetUp(enemyDelegate);
 }
示例#6
0
 public void setPlayerAttackedFunction(EnemyDelegate onPlayerAttacked)
 {
     _onPlayerAttacked = onPlayerAttacked;
 }
示例#7
0
 public void addClickHandler(EnemyDelegate onClicked)
 {
     _onEnemyClicked = onClicked;
 }
示例#8
0
 public void setPlayerAttackedFunction(EnemyDelegate onPlayerAttacked)
 {
     _onPlayerAttacked = onPlayerAttacked;
 }
示例#9
0
 public void addClickHandler(EnemyDelegate onClicked)
 {
     _onEnemyClicked = onClicked;
 }