void Start()
    {
        _rb             = GetComponent <Rigidbody2D>();
        _collider       = GetComponent <BoxCollider2D>();
        _movementSystem = GetComponent <MovementSystem>();

        var ctx = new MovementStrategy.Context(_rb, _collider, moveSpeed, platformMask, minDistToWall);

        _movementSystem.SetContext(ctx);
        _movementSystem.SetStrategy(context => new StandingStrategy(context));
        // _movementSystem.SetStrategy(new StandingStrategy(ctx));

        // Time.timeScale = 0.1f;
    }
Example #2
0
 public void SetContext(MovementStrategy.Context ctx)
 {
     _ctx = ctx;
 }