/    Sign up×
Community /Pin to ProfileBookmark

NEED HELP DECYPHERING INSTRUCTIONS and general coding help!

i bought an asset because it was not free and i am not very familiar with creating JavaScript codes. the asset is supposed to help me create transitions between scenes in unity using javascript codes, but i am somehow supposed to tweak the codes to get the effects to work properly. i tried to contact support but to no avail: 😡

read me file:

Easy Masking Transition – Version 0.9
Copyright 2013- Ages three and app
email: [email][email protected][/email]


———————————————-

How to use it:
———————————————-

  • 1. drag and drop the “Presets/EMTransition – Color” or “Presets/EMTransition – Image” to your scene.

  • 2. edit in inspector window.

  • 3. add JS/C# script and write “OnTransitionComplete()” to launch at the end of the transition.

  • ———————————————-

    API
    ———————————————-

    function OnTransitionStart() : void
    launch at the beginning of the transition
    (When Preview Mode is true, it doesn’t call)

    function OnTransitionComplete() : void
    launch at the end of the transition
    (When Preview Mode is true, it doesn’t call)

    function EMTransition.play() : void
    if playOnAwake is false, you need to call play() to start transition.


    ———————————————-

    Tips
    ———————————————-

    If you would like to use multiple transitions, you should duplicate materials.

    apparently there are loads of ways to code transitions, i found an easy and legit one that worked for me for free, but it only works on the first scene and only for the beginning, so i don’t know how to tweak it for an effect at the beginning and the end of a scene. and, if i add the code to 2 scenes it only shows up on the first one.

    var theTexture : Texture2D;

    private var StartTime : float;

    function OnGUI(){

    // set the color of the GUI

    GUI.color = Color.white;

    // interpolate the alpha of the GUI from 1(fully visible)

    // to 0(invisible) over time

    GUI.color.a = Mathf.Lerp(2.0, 0.0, (Time.time));

    // draw the texture to fill the screen

    GUI.DrawTexture(Rect(0,0,Screen.width, Screen.height), theTexture);

    is there an easier way to code at least just a fade in/out in javascript? lil help??

    to post a comment
    JavaScript

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @jburridgeMar 01.2014 — function OnGUI is what is making it only work on the first scene. I assume as soon as Unity starts the OnGUI function is being called, It's not being called for every scene. So to make it work with every scene you would have to find out what function is being called at the beginning of every scene and change the name to that.

    Same goes for the end of a scene, You would have to find out what function is being called at the end of a scene and duplicate that code and change the function name. "function onSceneStart() {" , "function onSceneEnd() {" Odds are these do not work, Just an example of what you need to change / look for.
    Copy linkTweet thisAlerts:
    @00murdaauthorMar 01.2014 — i think i kinda understand what you mean. but would the fact that i added the same script to the camera in both scenes mean anything? shouldn't it call for the function onGUI at the beginning of each scene? so if it doesn't, i would have to remove the script, and add script from the asset...... i have been playing with the asset and found that it is working, however i don't know how to find and adjust the times of the transitions from the code. what is "time" and "delta" and all that? .. also the function onGUI script worked in the scene, however when linked to another scene it doesn't work. say i have a scene. i play the scene and it fades in. i have another scene. i play the scene, it fades in, and it goes to the first screen without fading in/out. but i want it to.

    is there an easier way to code at least just a fade in/out in javascript? lil help?

    i about to break down and buy another asset ? .. scene manager, or something...
    ×

    Success!

    Help @00murda spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.2,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,
    )...