Exemple #1
0
 public Movement(Player player, MovementAttr stats) : base(player)
 {
     this.attr           = stats;
     rayCastController   = player.RayCastController;
     props               = new MovementProps( );
     basicMove           = new BasicMoveStrategy(ref props, ref stats, player);
     spaceMove           = new SpaceMoveStrategy(ref props, ref stats, player);
     slideMove           = new SlideMoveStrategy(ref props, ref stats, player);
     strategy            = basicMove;
     props.originGravity = player.Rb.gravityScale;
 }
Exemple #2
0
 void OnSlideAreaEnter(OnSlideAreaEnter e)
 {
     if (e.IsEnter)
     {
         strategy = slideMove;
         strategy.Init( );
     }
     else if (strategy == slideMove)
     {
         strategy = basicMove;
         strategy.Init( );
     }
 }
Exemple #3
0
 void OnSpaceAreaEnter(OnSpaceAreaEnter e)
 {
     if (e.IsEnter)
     {
         strategy = spaceMove;
         strategy.Init( );
         Player.Anim.SetBool("space", true);
     }
     else if (strategy == spaceMove)
     {
         strategy = basicMove;
         strategy.Init( );
         Player.Anim.SetBool("space", false);
     }
 }