private void Awake() { _health = GetComponent <IHealth>(); _move = GetComponent <IMove>(); _jump = GetComponent <IJump>(); _climb = GetComponent <IClimb>(); _inputControl = GetComponent <IBaseInput>(); _animator = GetComponent <Animator>(); _collider2D = GetComponent <BoxCollider2D>(); _rigidbody2D = GetComponent <Rigidbody2D>(); }
protected virtual void OnTriggerStay2D(Collider2D col) { if (Ladder.AngleType == 0) { IClimb mob = col.gameObject.GetComponent <IClimb>(); if (mob != null) { mob.LadderMove(Ladder, UpDown); } } else { IMove mob = col.gameObject.GetComponent <IMove>(); if (mob != null) { mob.SlapeMove(Ladder, UpDown); } } }