adding another action to existing ones

  • hi.. i'm trying to extend onentervr and onexitvr from WEBVR plugin so it'd load a 3d scene (instead of the actual one) when entering and doing the opposite when leaving

    currently they are defined as
    onentervr="skin_showloading(false); webvr_onentervr(); webvr_setup();"
    onexitvr="webvr_onexitvr(); webvr_setup();"

    i'd like to add, dinamically, in the begining of entering something like test_for_3d_scene(); and when leaving return_to_2d_scene();

    tried to log trace(plugins[WebVR].onentervr()); and trace(get(plugins[WebVR].onentervr()));
    to see if it returnd some string and it didnt..

    so is this possible?

    ty all

    edit:
    the intention was to include another xml with the 3dscene
    that xml would add the action to entevr and exitvr
    onenter-> load_the_real_3c_scene
    onexit-> load_the_previous_scene

  • Hi,

    this should work:

    Code
    txtadd(plugin[WebVR].onentervr, '; test_for_3d_scene();');
    txtadd(plugin[WebVR].onexitvr, '; return_to_2d_scene();');

    and for removing you could use:

    Code
    txtreplace(plugin[WebVR].onentervr, '; test_for_3d_scene();', '');
    txtreplace(plugin[WebVR].onexitvr, '; return_to_2d_scene();', '');

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!