Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Run JavaScript native method from Tiny

Discussion in 'Project Tiny' started by TheFordeD, Jan 31, 2019.

  1. TheFordeD

    TheFordeD

    Joined:
    Jul 9, 2018
    Posts:
    32
    How i can run method
    parent.showPreloader(false);
    (native method in HTML)

    in Tiny i don't understand this

    For example in Unity:

    Application.ExternalEval ("parent.showPreloader(false)");
     
  2. abeisgreat

    abeisgreat

    Joined:
    Nov 21, 2016
    Posts:
    44
    If the "parent" object is globally accessible on the page, then it's as easy as...

    Code (JavaScript):
    1. (window as any).parent.showPreloader(false)
     
    TheFordeD likes this.