Пример #1
0
 protected virtual void Init()
 {
     physic                = GetComponent <CharacterPhysic>();
     stats                 = GetComponent <CharacterStats>();
     gravity               = GetComponent <Gravity>();
     stats.DeathAction    += JumpStop;
     stats.DeathAction    += jumpDownReset;
     stats.onGroundAction += ChargeJump;
 }
Пример #2
0
 private void Start()
 {
     stats             = GetComponent <CharacterStats>();
     physic            = GetComponent <CharacterPhysic>();
     move              = GetComponent <CharacterMovement>();
     gravity           = GetComponent <Gravity>();
     physic.Layer     += LayerMask.GetMask("Player");
     physic.HitAction += HitCheck;
     MovementCommand();
 }
Пример #3
0
 protected virtual void Init()
 {
     currentJumpDistance = jumpDistance;
     moveDirection       = Toolkit.SideToVector(direction);
     if (moveDirection != Vector2.right)
     {
         moveDirection = Vector2.left;
     }
     stats           = GetComponent <CharacterStats>();
     physic          = GetComponent <CharacterPhysic>();
     move            = GetComponent <CharacterMovement>();
     jump            = GetComponent <CharacterJump>();
     gravity         = GetComponent <Gravity>();
     physic.Layer   += LayerMask.GetMask("Player");
     stats.MoveSide  = moveDirection;
     layerMask       = LayerMask.GetMask("Player", "Block");
     stats.BodyState = BodyStateE.Laying;
 }
 // Start is called before the first frame update
 void Start()
 {
     characterphysic = this;
     rb = GetComponent <Rigidbody2D>();
 }