private IPositionServise PositionServise; [Construct] public CubeInitCommand(IPositionServise positionServise) { PositionServise = positionServise; }
使用[Construct]特性声明构造方法,如果多个构造方法,不用[Construct]声明哪个的话,就会默认使用参数最少的那个。