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]
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.
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.
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??