Unity Capture Screenshot

Advertisemen

Unity Capture Screenshot






















DIRECT DOWNLOAD TUTORIAL 19/24  HERE
















THIS IS BACKUP  IN TEXT FORM  TUTORIAL 19/24






 Script  1 :

Play Audio By Key Down F1


1. Create New C# and name it : PlaySoundF1

2. Copy & Past this text and save C# :
----------------------------------------­­­­­------------------------------------­-­-­-­-­-


using UnityEngine;
using System.Collections;

[RequireComponent(typeof(AudioSource))]
public class PlaySoundF1 : MonoBehaviour {
void Update() {
if (Input.GetKeyDown(KeyCode.F1)) {
audio.Play();
}
}
}







 ----------------------------------------­­­­­------------------------------------­-­-­-­-­------------------------­­­­­------------------------------------­-­-­-­-­-











 Script  2 :

Screen Capture By Key Down F1


1. Create New C# and name it : ScreenCaptureF1

2. Copy & Past this text and save C# :
----------------------------------------­­­­­------------------------------------­-­-­-­-­-


using UnityEngine;
using System.Collections;

public class ScreenCaptureF1 : MonoBehaviour {
void Awake(){
DontDestroyOnLoad(this);
}
void Update(){
if(Input.GetKey (KeyCode.F1)){
string screenshotIMGName = System.DateTime.Now.ToString();
string subString = screenshotIMGName.Replace ('/','_');
string gypsy = subString.Replace(':','_');

Application.CaptureScreenshot(gypsy+ ".jpg");
}
}
}







 ----------------------------------------­­­­­------------------------------------­-­-­-­-­------------------------­­­­­------------------------------------­-­-­-­-­-
















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