// Start is called before the first frame update void Start() { rb2d = GetComponent <Rigidbody2D>(); enemyAggro = aggroCollider.GetComponent <EnemyAggro>(); rightChecker = sideCheckerRight.GetComponent <SideCheckerRight>(); leftChecker = sideCheckerLeft.GetComponent <SideCheckerLeft>(); groundChecker = groundCheckBox.GetComponent <GroundChecker>(); avoidPlayerChecker = avoidPlayerCapsule.GetComponent <EnemyAvoidPlayerBlock>(); thisEnemy = enemy.GetComponent <Enemy>(); enemyRange = attackPoint.GetComponent <EnemyRangeCheck>(); }
// Start is called before the first frame update void Start() { animator = GetComponent <Animator>(); rb2d = GetComponent <Rigidbody2D>(); spriteRenderer = GetComponent <SpriteRenderer>(); groundChecker = groundCheckBox.GetComponent <GroundChecker>(); rightChecker = rightCheckerBox.GetComponent <SideCheckerRight>(); leftChecker = leftCheckerBox.GetComponent <SideCheckerLeft>(); currentHealth = maxHealth; SetHealth(currentHealth, maxHealth); lastPos = rb2d.velocity; }