- Home /
need help decyphering instructions and general js 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: :mad:
read me file:
Easy Masking Transition - Version 0.9 Copyright 2013- Ages three and app email: info@agesthreeandapp.com
How to use it:
drag and drop the "Presets/EMTransition - Color" or "Presets/EMTransition - Image" to your scene.
edit in inspector window.
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?:confused:
Your question is not a good fit for Unity Answers. Unity Answers addresses single, specific technical questions. It is hard to find the specific issue in your question text. The Unity Forums may be a better place for this question. I'm not going to close it right now because someone on this list may have used your specific package and have a magic-bullet solution for you, but I recommend you close the question here and opening a new question on Unity Forums.