Beispiel #1
0
 public void Inject(PlayerUnitDI di)
 {
     stateMachine = di.stateMachine;
     selectUnit   = di.abilities.selectUnit;
     wallSlide    = di.abilities.wallSlide;
     jump         = di.abilities.jump;
     physics      = di.physics;
 }
    public void Inject(PlayerUnitDI di)
    {
        stateMachine = di.stateMachine;

        PlayerAbilities abilities = di.abilities;

        selectUnit = abilities.selectUnit;
        movement   = abilities.movement;
        jump       = abilities.jump;
        wallSlide  = abilities.wallSlide;
        yeet       = abilities.yeet;
        action     = abilities.action;
        physics    = di.physics;

        this.abilities = new IPlayerAbility[] {
            action,
            selectUnit,
            yeet,
            wallSlide,
            movement,
            jump
        };
    }