private void Start() { _coll = GetComponent <CollisionHandler>(); _rb = GetComponent <Rigidbody2D>(); _anim = GetComponent <AnimationHandler>(); _anim = GetComponentInChildren <AnimationHandler>(); _vfx = GetComponent <VfxHandler>(); _ghost = GetComponent <GhostEffect>(); _healthManager = GetComponent <HealthManager>(); _attackManager = GetComponent <CharacterAttackManager>(); _capsuleCollider = GetComponent <CapsuleCollider2D>(); _input = GetComponent <IInputController>(); _gameManager = GameManager.Instance; _coll.OnGrounded += ResetIsJumping; _coll.OnWalled += ResetIsJumping; _groundTouch = true; _canStillJump = true; _wasOnWall = false; _side = 1; _capsuleOffset = _capsuleCollider.offset; _capsuleSize = _capsuleCollider.size; if (_showDebug) { CursedDebugger.Instance.Add("State", () => _state.ToString()); } }
private void Start() { _vfx = GetComponent <VfxHandler>(); _sfx = GetComponent <SFXHandler>(); _invAnim = GetComponent <InvincibilityAnimation>(); //Set to an eventual base number _stats = GetComponent <CharacterStats>(); if (_stats != null) { _maxHealth.Value = _stats.BaseStats.MaxHealth; } UpdateCurrentHealth(_maxHealth); _isInvincible = false; _timeInvincibleLeft = 0f; }