- Home /
ScreenWipe CrossFade with C#
I'm trying to port this http://www.unifycommunity.com/wiki/index.php?title=CrossFade to C#. Right now I've this code http://pastebin.com/jZ06SvCs which doesn't work (nothing happens when I press space).
Is it possible to do this in C#? Am I doing something wrong?
thanks in advance, André.
This is possible in C#. I don't have the code right now because I'm in the middle of integrating it from the test case (into the actual game). But you just have to set one float value for the alpha value and use it to decide both (ie. one has the alpha
variable as its alpha and one has 1 - alpha
as its alpha value).
Note: If you are using that file as a .js file, then you may be having problems with the C# function not being able to successfully call functions from the .js file.
Edit: $$anonymous$$y solution above is for manually doing it. The other way is by changing your script loading order to ensure the .js file functions are properly loaded for usage by C#.
Thanks for the script LOOT, works well for me. Just had to add StartCouroutine() on a few of the methods that called other methods, for example when RectWipe() calls the public RectWipe() method.
Answer by ScottYann · Nov 22, 2014 at 06:31 AM
There were some minor problems with Loot's script. Try my version. It only does crossfade (non pro). The rest is up to you.
Answer by simonmc · Jun 18, 2012 at 10:51 AM
Change line 23 to:
yield return StartCoroutine(ScreenWipe.use.CrossFade(swap?cam1:cam2, swap?cam2:cam1, 2));
Note The call to StartCoroutine().
Answer by LOOT · Jul 20, 2012 at 09:00 PM
Here is a C# version of the script.link text
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Comparing position on Update or using camera visibility? 1 Answer
Raycast in camera 1 Answer
the code of camera rig in tanks Game can explain how this works? 0 Answers