Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        myBody      = this.GetComponent <Rigidbody2D>();
        targetCheck = gameObject.GetComponentInChildren <TargetCheck>();
        target      = GameObject.FindGameObjectWithTag("Player");

        //Animation
        if (animated)
        {
            anim = GetComponent <Animator>();
        }

        //enemy movement pattern while patrolling; will move in a clockwise square
        xPatrolMovement = new int[] { 1, 0, -1, 0 };
        yPatrolMovement = new int[] { 0, -1, 0, 1 };
        //choose a random starting movement
        patrolMovementIndex = Random.Range(0, 3);

        nextPatrolMovement = Time.time;

        //nextWiggle = Time.time;


        playerController = GameObject.Find("Player").GetComponent <PlayerController>();
    }
Ejemplo n.º 2
0
 void Start()
 {
     rb          = this.gameObject.GetComponent <Rigidbody2D>();
     animator    = this.gameObject.GetComponent <Animator>();
     targetCheck = this.gameObject.GetComponentInChildren <TargetCheck>();
     dashingTime = baseDashingTime;
     setHealthUI(health, baseHealth);
     setManaUI(mana, baseMana);
 }
Ejemplo n.º 3
0
 public bool AllowTarget(Actor actor) => TargetCheck.Evaluate(actor);