Advertisemen
Binocular image used in this tutorial, just drag and drop to you desktop to download.
Copy and paste the code used above : C#
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class bionacularOne : MonoBehaviour {
public Slider slider;
// Use this for initialization
void Start () {
slider.value = 0.6f;
}
// Update is called once per frame
void Update () {
if(slider.value <= 0.05f){
slider.value = 0.05f;
}
Camera.main.fieldOfView = slider.value*100;
}
}
using System.Collections;
using UnityEngine.UI;
public class bionacularOne : MonoBehaviour {
public Slider slider;
// Use this for initialization
void Start () {
slider.value = 0.6f;
}
// Update is called once per frame
void Update () {
if(slider.value <= 0.05f){
slider.value = 0.05f;
}
Camera.main.fieldOfView = slider.value*100;
}
}
Thanks for watching,
Please don't forget to subscribe, like, share and comment for more tutorials.
See you in next tutorial.
Advertisemen
Tidak ada komentar:
Posting Komentar