I'm quite new in unity and I'm trying to make a game. When I am at the end of the game, I want to subtract a subtitle when you press a button, it starts, but when I codify an image which I feed, then when you start playing So it plays straight. Do you guys know a solution?
#pragma Strict private var guiShow: boolean = false; Var Car: Game Object; Var renleg = 10; Var guiObject: GUITExture; Var Fitime = 1.0; Enum Fade {In, Out} var fadesubtitles: boolean = false; Function Update () {var hit: rescue; Var fwd = transform.TransformDirection (Vector3.forward); If (Physics. Recast (transet status, FWD, hit, ray langram)) {if (hit.collider.gameObject.tag == "car") {guiShow = true; If (input. Gatecadoon ("e")) {guiShow = false; } Else if (Input.GetKeyDown ("e")) {guiShow = false; }}} And {guisho = false; }} Function ongui () {if (guiShow == true) {GUI.Box (Rect (screen. / 2, screen.4high / 2, 150, 25), "Press F to Escape"); If (Input.GetKeyDown ("f")) {fadesubtitles = true; }}} If (fadesubtitles == true) {yield fadeGUITexture (guiObject, fadeTime, Fade.In); Yielding wait seconds (3.0); Yield FadeGUITexture (guiObject, fadeTime, Fade.Out); } Function Fadegtecture (Gio object: Gititimation, Timer: Float, Fideotype: Fed) {if (subtitles == true) {var start = fadeType == feed.in? 0.0: 1.0; Var end = fadeType == feed.In? 1.0: 0.0; Var i = 0.0; Var phase = 1.0 / timer; While (i <1.0) {i + = step * Time.deltaTime; GuiObject.color.a = Mathf.Lerp (start, end, i) * 5; Receipt; }}}}
I will start your game object in the 'disabled' state ( Uncheck it in the inspector). Then at the end of the game, there is some code that enables it
Comments
Post a Comment