// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { rb = animator.GetComponent <Rigidbody2D>(); pathfind = animator.GetComponent <EnemyPathfinding>(); AI = animator.GetComponent <EnemyAI>(); player = pathfind.GetTargetTransform(); }
private void Awake() { enemyPathfinding = GetComponent <EnemyPathfinding>(); enemyShoot = GetComponent <EnemyShoot>(); enemyWeapon = transform.GetComponentInChildren <EnemyWeapon>(); moveState = MoveState.Roaming; attackState = AttackState.Idle; }
protected void Start() { health = maxHealth; room = GameObject.FindGameObjectWithTag("RoomSpawner").GetComponent <RoomSpawner>().roomGrid.GetGridObject(transform.position); spriteRenderer = GetComponent <SpriteRenderer>(); animator = GetComponent <Animator>(); rb = GetComponent <Rigidbody2D>(); enemyPathfinding = GetComponent <EnemyPathfinding>(); }
// Start is called before the first frame update protected virtual void Start() { pfScript = GetComponent <EnemyPathfinding>(); currentState = EnemyState.IDLE; attackTimer = 0.0f; anim = GetComponentInChildren <EnemyAnimation>(); }
// Start is called before the first frame update void Awake() { pathfind = GetComponent <EnemyPathfinding>(); anime = GetComponent <Animator>(); eAttack = GetComponent <EnemyAttack>(); startingPosition = transform.position; //shoot = GetComponent<Shooting>(); state = EnemyAIState.Spawning; }
protected virtual void Awake() { pathfinding = GetComponent <EnemyPathfinding>(); pathfinding.enemy = enemy; rb = GetComponent <Rigidbody2D>(); hpDisplay = transform.Find("HpDisplay"); maxHp = Mathf.RoundToInt(enemy.maxHp * DifficultyManager.difficulty); hp = maxHp; rb.mass = (enemy.maxHp + enemy.defense * 2) / 10; pathfinding.speed = speedMultiplier * enemy.speed; }
void Awake() { mAnim = GetComponentInChildren <Animator> (); sr = GetComponentInChildren <SpriteRenderer> (); audioManager = GetComponentInChildren <AudioManager> (); mBody = GetComponent <Rigidbody2D> (); pathfinding = GetComponent <EnemyPathfinding> (); particleSystems = GetComponentsInChildren <ParticleSystem> (); pathfinding.seeker = gameObject.transform; StartCoroutine(PathRoutine()); }
//OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { rb2d = animator.GetComponent <Rigidbody2D>(); pathfind = animator.GetComponent <EnemyPathfinding>(); AI = animator.GetComponent <EnemyAI>(); AI.SetState(EnemyAIState.flyforward); emanager = animator.GetComponent <EnemyManager>(); //pos = rb2d.position; pos = rb2d.transform.right; axis = rb2d.transform.up; //player = pathfind.GetTargetTransform(); }
protected virtual void Start() { playerHealth = GameObject.FindWithTag("Player").GetComponent <Health>(); enemyPathfinding = this.GetComponent <EnemyPathfinding>(); }
//bool isProcessingPath; private void Awake() { instance = this; pathfinding = GetComponent <EnemyPathfinding>(); }
// Use this for initialization void Start() { nHitTime = hitTime; enemyPathFinding = FindObjectOfType <EnemyPathfinding> (); player = GameObject.FindGameObjectWithTag("Player"); }
void Start() { pathfinding = FindObjectOfType <EnemyPathfinding>(); newTargetNumber = 0; EnemySelector = 0; }
public void RemoveEnemyToList(EnemyPathfinding enemy) { enemies.Remove(enemy); }
public void AddEnemyToList(EnemyPathfinding enemy) { enemies.Add(enemy); }