当前位置: 首页>>代码示例>>Java>>正文


Java AppStateManager.attach方法代码示例

本文整理汇总了Java中com.jme3.app.state.AppStateManager.attach方法的典型用法代码示例。如果您正苦于以下问题:Java AppStateManager.attach方法的具体用法?Java AppStateManager.attach怎么用?Java AppStateManager.attach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.app.state.AppStateManager的用法示例。


在下文中一共展示了AppStateManager.attach方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
@Override
public void initialize(@NotNull final AppStateManager stateManager, @NotNull final Application app) {
    super.initialize(stateManager, app);
    this.stateManager = stateManager;
    this.application = app;

    startPhysics();

    if (isDebugEnabled()) {
        debugAppState = new BulletDebugAppState(physicsSpace);
        stateManager.attach(debugAppState);
    }

    final SceneNode sceneNode = getSceneNode();
    if (sceneNode != null) {
        updateNode(sceneNode, physicsSpace);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder-extension,代码行数:19,代码来源:EditableBulletSceneAppState.java

示例2: initialize

import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
@Override
public void initialize(AppStateManager stateManager, Application app) {
	super.initialize(stateManager, app);
	
	this.stateManager = stateManager;
	this.app = app;
	
	for (AppState state : states) {
		stateManager.attach(state);
	}
}
 
开发者ID:quadracoatl,项目名称:quadracoatl,代码行数:12,代码来源:AbstractManagingAppState.java

示例3: run

import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
public boolean run(String cmdName, CommandLine commandLine) {
    AppStateManager stateManager = console.getApp().getStateManager();
    ForumAppState game = stateManager.getState(ForumAppState.class);
    if(game == null) {
        stateManager.attach(new ForumAppState());
    }
    else {
        stateManager.detach(game);
    }
    return true;
}
 
开发者ID:rockfireredmoon,项目名称:iceclient,代码行数:12,代码来源:IGF.java

示例4: run

import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
public boolean run(String cmdName, CommandLine commandLine) {
    final AppStateManager stateManager = console.getApp().getStateManager();
    ActionBarsAppState current = stateManager.getState(ActionBarsAppState.class);
    if (current != null) {
        ((Iceclient)console.getApp()).getToolManager().reset(current.getHudType());
        ActionBarsAppState newState = new ActionBarsAppState(console.getPreferences(), current.getHudType());
        stateManager.detach(current);
        stateManager.attach(newState);
        return true;
    } else {
        console.outputError("Toolbox not loaded");
        return false;
    }
}
 
开发者ID:rockfireredmoon,项目名称:iceclient,代码行数:15,代码来源:ResetTools.java

示例5: toggle

import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
public static void toggle(AppStateManager stateManager) {
	ToolBoxAppState toolBox = stateManager.getState(ToolBoxAppState.class);
	if (toolBox == null) {
		stateManager.attach(new ToolBoxAppState());
	} else {
		stateManager.detach(toolBox);
	}
}
 
开发者ID:rockfireredmoon,项目名称:iceclient,代码行数:9,代码来源:ToolBoxAppState.java

示例6: setTweaking

import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
public static void setTweaking(AppStateManager stateManager, boolean tweak) {
	boolean tweaking = isTweaking(stateManager);
	if (tweak && !tweaking) {
		LOG.info("Enering build mode");
		stateManager.attach(new CreatureTweakAppState());
	} else if (!tweak && tweaking) {
		LOG.info("Leaving build mode");
		stateManager.detach(stateManager.getState(CreatureTweakAppState.class));
	}
}
 
开发者ID:rockfireredmoon,项目名称:iceclient,代码行数:11,代码来源:CreatureTweakAppState.java

示例7: createScene

import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
static private boolean createScene(SimpleApplication app, EntityData ed) {
	// RendererPlatform.setApp(app);
	app.getViewPort().addProcessor(new FilterPostProcessor(app.getAssetManager()));

	AppStateManager stateManager = app.getStateManager();

	stateManager.attach(new DataState(EditorPlatform.getEntityData()));
	stateManager.attach(new SceneSelectorState());

	return true;
}
 
开发者ID:meltzow,项目名称:supernovae,代码行数:12,代码来源:LoadingGameController.java

示例8: onInitialized

import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
@Override
protected void onInitialized(AppStateManager stateManager) {
	super.onInitialized(stateManager);
	if (stateManager.getState(BulletAppState.class) == null) {
		stateManager.attach(new BulletAppState());
	}
	stateManager.getState(BulletAppState.class).getPhysicsSpace().setGravity(new Vector3f(0, 0, -6));
	stateManager.getState(BulletAppState.class).startPhysics();

	physicsSpace = stateManager.getState(BulletAppState.class).getPhysicsSpace();
}
 
开发者ID:meltzow,项目名称:supernovae,代码行数:12,代码来源:PhysicProc.java

示例9: initialize

import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
/**
 * Initialise play state.
 * @param stateManager The application state manager.
 * @param app The game application object.
 */
@Override
public void initialize(AppStateManager stateManager, Application app) {
  super.initialize(stateManager, app);
  this.app = (SimpleApplication) app;
  this.rootNode = this.app.getRootNode();

  // Initialise physics.
  bullet = new BulletAppState();
  stateManager.attach(bullet);

  // Create ambient light for world.
  AmbientLight ambientLight = new AmbientLight();
  ambientLight.setColor(ColorRGBA.White.mult(1.3f));
  this.rootNode.addLight(ambientLight);

  // Load current course.
  Spatial course
      = app.getAssetManager().loadModel("Scenes/DeveloperCourse/Course.j3o");
  this.rootNode.attachChild(course);

  // Fetch and initialise the course path.
  coursePath = new CoursePath((Node) course, bullet);

  // Create player manager either for server or client.
  if (isServer) {
    playerManager = new PlayerManager(this.app, coursePath, bullet,
                                      totalPlayers);
  } else {
    playerManager = new PlayerManager(this.app, coursePath, bullet,
                                      totalPlayers, localPlayerIdx);

    // Create the camera attached to the player.
    followCamera = new FollowCamera(this.app.getCamera(),
        playerManager.getLocalPlayer(), CAMERA_DISTANCE);

    // Capture input to player.
    InputManager input = app.getInputManager();
    String[] mappingNames = new String[] { PlayerInput.MOVE_LEFT,
        PlayerInput.MOVE_RIGHT, PlayerInput.MOVE_UP, PlayerInput.MOVE_DOWN };
    playerInput = new PlayerInput(playerManager.getLocalPlayer());
    input.addListener(playerInput, mappingNames);
    input.addMapping(PlayerInput.MOVE_LEFT, new KeyTrigger(KeyInput.KEY_A));
    input.addMapping(PlayerInput.MOVE_RIGHT, new KeyTrigger(KeyInput.KEY_D));
    input.addMapping(PlayerInput.MOVE_UP, new KeyTrigger(KeyInput.KEY_S));
    input.addMapping(PlayerInput.MOVE_DOWN, new KeyTrigger(KeyInput.KEY_W));
  }
}
 
开发者ID:meoblast001,项目名称:seally-racing,代码行数:53,代码来源:PlayState.java

示例10: addAppStateImpl

import com.jme3.app.state.AppStateManager; //导入方法依赖的package包/类
@JMEThread
private void addAppStateImpl(@NotNull final SceneAppState appState) {
    final AppStateManager stateManager = EDITOR.getStateManager();
    stateManager.attach(appState);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:6,代码来源:SceneEditor3DState.java


注:本文中的com.jme3.app.state.AppStateManager.attach方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。