Unity3D press any key to play Tutorial 17

Advertisemen

Unity3D press any key to play Tutorial 17
















DIRECT DOWNLOAD ALL PARTS HERE

--------------------------------------------------------------------------------------------------------------------------
THIS IS BACKUP  IN TEXT FORM
OFF ALL SCRIPTS OFF TUTORIAL 17
--------------------------------------------------------------------------------------------------------------------------
CREATE NEW C# AND NAME IT : ControlScene NEXT COPY PAST TEXT :
--------------------------------------------------------------------------------------------------------------------------

/// <summary>
/// This script use to control scene
/// </summary>

using UnityEngine;
using System.Collections;

public class ControlScene : MonoBehaviour {

public AudioClip sfxButton;
private bool oneshotSfx;
// Update is called once per frame
void Update () {
//if press any key jump to gameplay scene
if(Input.anyKeyDown)
{
if(!oneshotSfx)
{
AudioSource.PlayClipAtPoint(sfxButton,Vector3.zero);
Invoke("LoadScene",0.5f);
oneshotSfx = true;
}
}
}
void LoadScene()
{
//load gameplay scene
Application.LoadLevel("YOUR LEVEN NAME PUT HERE YES ");
}
}



















--------------------------------------------------------------------------------------------------------------------------
CREATE NEW C# AND NAME IT : AlphaText NEXT COPY PAST TEXT :
--------------------------------------------------------------------------------------------------------------------------



/// <summary>
/// This script use to fade GUI
/// </summary>


using UnityEngine;
using System.Collections;

public class AlphaText : MonoBehaviour {
public float speedFade;
private float count;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
//Fade in-out press start
count += speedFade * Time.deltaTime;
guiTexture.color = new Color(0.5f,0.5f,0.5f,Mathf.Sin(count)*0.5f);
}
}



--------------------------------------------------------------------------------------------------------------------------































Advertisemen

Disclaimer: Gambar, artikel ataupun video yang ada di web ini terkadang berasal dari berbagai sumber media lain. Hak Cipta sepenuhnya dipegang oleh sumber tersebut. Jika ada masalah terkait hal ini, Anda dapat menghubungi kami disini.

Tidak ada komentar:

Posting Komentar

© Copyright 2017 Tutorial Unity 3D