Home > other >  Unity3d2018 implementation scenario fades but no response for your guidance
Unity3d2018 implementation scenario fades but no response for your guidance

Time:09-29

 using System. The Collections. 
using System.Collections.Generic;
using UnityEngine;
Using UnityEngine. SceneManagement;

Public class fadeInOut: MonoBehaviour
{
Public float fadeSpeed=1.5 f;
Private bool sceneStarting=true;
Private GUITexture Tex;
Void the Start ()
{
Tex=this. GetComponent (a);
Tex. PixelInset=new the Rect (0, 0, Screen width, Screen, height);
}
Void the Update ()
{
If (sceneStarting)
{
The StartScene ();
}
}
Private void FadeToClear ()
{
Tex. Color=color. Lerp (Tex. Color, the color clear, fadeSpeed * Time deltaTime);
}
Private void FadeToBlack ()
{
Tex. Color=color. Lerp (Tex. Color, color black, fadeSpeed * Time deltaTime);
}
Private void StartScene ()
{
FadeToClear ();
If (Tex. Color. A & lt;=0.05 f)
{
Tex. Color=color. The clear;
Tex. Enabled=false;
SceneStarting=false;
}
}
Public void EndScen ()
{
Tex. Enabled=true;
FadeToBlack ();
If (Tex. Color. A & gt;=0.95 f)
{
SceneManager. LoadScene (" Demo ");
}
}


}

CodePudding user response:

And why can't the public authority fadeSpeed variables on the unity interface change

CodePudding user response:

The big tuo code, looking at skull ache,,,,

CodePudding user response:

Switch the scene, and fadeout a ghost?? Means you turn off the tap, then said I say let him the water less,!!!!! You already turn off the faucet,,,,,,,!!!!! Program that is one thing,,,,,,,, you thought it was a little less, actually the whole closed, is a single line of code

CodePudding user response:

reference avi9111 reply: 3/f
scene switching, also fadeout a ghost?? Means you turn off the tap, then said I say let him the water less,!!!!! You already turn off the faucet,,,,,,,!!!!! Program that is one thing,,,,,,,, you thought it was a little less, actually the whole closed, is what one line of code

The scene there is no switch...

CodePudding user response:

Haven't solved? The basic is not saved you, suggest a career change,

You call fadeout is in the current scenario, then call loadScene (" "), how hasn't switch scene, when you call loadScene (" "), you thought it was to the next scene, no switch

Actually is, the former one scenario (current) kill, also the current scenario fadein fadeout were killed, to the next scene, so what to do, have no effect in this scene, this is the code, this is the program development,,,,,,,,,,

CodePudding user response:

Introduction, want to try more, wrong wrong, to do more, rather than ask more
Although I often poke fun, recently many team of programmers do, more do more wrong, very useless
But this group of programmers is indeed a primer, can find a well-paid job
Although this batch of programmers also hard to avoid self-righteousness, try more, as a result, the more they understand, though understanding is wrong, but it must be his understanding, write their own code has effect only
From ignorance to - "smug -" ask more, listen more - "comprehensive application, can success finally, basically can only walk along this path
No one can not learn to walk in school run
Also many programmers will not run
Has been to go along, so it do not need to be more about people,,,,,,,

CodePudding user response:

Thank you can spend your precious time to give me some advice, and then I come to school for a year, during the contact with something of interest, so a little vacation to learn c #, want to apply to the unity, but encountered many don't understand the place, do not understand the place of too much and has failed to settle, passionate nature has been watered down, glad to see you, let me feel, or did you learn of the heart is not firm!

CodePudding user response:

Above the brothers. He wrote this code does not call this last EndScene () method, (you should the scen is wrong), the problem is not out of here
  • Related