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
Tidak ada komentar:
Posting Komentar