Libgdx Ashley GWT运行时异常:无法找到类的类型

时间:2017-12-21 05:38:04

标签: html5 gwt libgdx

我已经在桌面和Android平台上运行我的游戏,但GWT我遇到了一些麻烦。

在我的屏幕课程中:

pooledEngine.addSystem(new TouchSystem());

并在TouchSystem类中:

public TouchSystem() {
    super(Family.all(TransformComponent.class, TouchableComponent.class).get());
}

在我的enityClass中,我打电话给:

TransformComponent transformComponent = pooledEngine.createComponent(TransformComponent.class);

我有例外

  

“无法找到类TransformComponent的类型”

。 对不起,我的英语不好。 谢谢!

编辑: Common模块中的TransformComponent类:

public class TransformComponent extends BaseComponent {
public Vector2 position = new Vector2();
public Vector2 scale = new Vector2(1,1);
public Vector2 pivot = new Vector2(0.5f,0.5f);
public Rectangle bound = new Rectangle();
public float rotation = 0.0f;

public TransformComponent() {
}}

Common模块的BaseComponent:

 BaseComponent implements Component, IScript {
public GameObject gameObject;

public BaseComponent() {
}

@Override
public void addToEntity(GameObject gameObject) {
    this.gameObject = gameObject;
}}

我的Common.gwt.xml:

<extend-configuration-property name="gdx.reflect.include" value="mypacket.common" />
<extend-configuration-property name="gdx.reflect.include" value="com.hat.common.gameobject" />
<extend-configuration-property name="gdx.reflect.include" value="mypacket.common.gameobject.component" />
<extend-configuration-property name="gdx.reflect.include" value="mypacket.common.gameobject.component.TransformComponent" />
<extend-configuration-property name="gdx.reflect.include" value="mypacket.common.gameobject.component.TouchableComponent" />
<extend-configuration-property name="gdx.reflect.include" value="mypacket.common.gameobject.script" />

我的核心模块gwt:

<inherits name="Common" />
<extend-configuration-property name="gdx.reflect.include" value="mypacket" />

我的html gwt:

<extend-configuration-property name="gdx.reflect.include" value="mypacket" />
<extend-configuration-property name="gdx.reflect.include" value="mypacket.common.gameobject.component" />
<extend-configuration-property name="gdx.reflect.include" value="mypacket.common.gameobject.component.TransformComponent" />
<inherits name='BubbleGame' />

我已经坚持了几次:(有什么建议吗?

0 个答案:

没有答案