Пример #1
0
  @Override
  public void onGoToNextLevel() {
    ManageableScene currentScene = (ManageableScene) this.mEngine.getScene();
    String newScene = null;

    if (currentScene instanceof IConfigurableScene)
      newScene =
          NEXT_SCENE_LAUNCHER.get(((IConfigurableScene) currentScene).getNameOfInstantiatedScene());
    else newScene = NEXT_SCENE_LAUNCHER.get(currentScene.getpSCDescriptor().sceneName);

    // check if the use has purchased the license for the scene
    if (newScene != null) {
      // get scene descriptor
      SceneDescriptor pSDesc;
      ConfiguredSceneDescriptor pCfgSDesc;
      String theLicence = null;

      if ((pSDesc = SceneDescriptorsManager.getInstance().getScene(newScene)) != null)
        theLicence = pSDesc.getSceneLicenceID();
      else if ((pCfgSDesc = SceneDescriptorsManager.getInstance().getCFGScene(newScene)) != null)
        theLicence = pCfgSDesc.getSceneLicenceID();
      else theLicence = "default";
      if (!theLicence.equalsIgnoreCase("default")) {
        if (!mPurchMgr.hasPurchase(
            theLicence)) { // check if has the licence to show the requested scene
          newScene = "IAP_monsters_4to24"; // if not launch scene to by the lincence
          onChangeChildScene(newScene);
          return;
        }
      }
    }
    onChangeScene(newScene);
    return;
  }
Пример #2
0
  @Override
  public void onGoToMenu() {
    ManageableScene currentScene = (ManageableScene) this.mEngine.getScene();
    String newScene = null;
    if (currentScene instanceof IConfigurableScene)
      newScene =
          MENU_SCENE_LAUNCHER.get(((IConfigurableScene) currentScene).getNameOfInstantiatedScene());
    else newScene = MENU_SCENE_LAUNCHER.get(currentScene.getpSCDescriptor().sceneName);

    if (newScene != null) onChangeScene(newScene);
  }