Merhaba Arkadaşlar Bugün Sizlere Korku oyunu yapıyorsanız işinize yarayacak bir script'i paylaşacagım Not okuma sistemi
Önemli Not: Bu Kodu Kullanabilmek İçin CharacterMotor,FPSInputController,MouseLook Kodlarınız C# Olmak Zorunda Eger İsteyen Olursa PM Atsın JS Versiyonunu Yazıyım.. bu arada v o i d leri birleşik yazın
Character Motor,FPSInputController C# Versiyonu : TIKLA INDIR
Video: TIKLA IZLE
[C#] Kodlar
Önemli Not: Bu Kodu Kullanabilmek İçin CharacterMotor,FPSInputController,MouseLook Kodlarınız C# Olmak Zorunda Eger İsteyen Olursa PM Atsın JS Versiyonunu Yazıyım.. bu arada v o i d leri birleşik yazın
Character Motor,FPSInputController C# Versiyonu : TIKLA INDIR
Video: TIKLA IZLE
[C#] Kodlar
Kod:
using UnityEngine;
using System.Collections;
public class NotSistemi : MonoBehaviour {
public bool isReading;
public GUISkin mySkin;
public string baslik;
public string notYazisi;
// Use this for initialization
v o i d Start () {
}
// Update is called once per frame
v o i d Update () {
if (Input.GetKeyDown (KeyCode.N)) { // n tuşuna basınca
isReading = !isReading; // n tuşuna basınca isReading true oluyor tekrar basınca false oluyor
}
if(isReading == true) {
GameObject.Find("First Person Controller").GetComponent<MouseLook>().enabled = false; //burda isReading true ise fps controllerdeki mouselook yani mouse döndürme scriptini deaktif et
GameObject.Find("Main Camera").GetComponent<MouseLook>().enabled = false;
GameObject.Find("First Person Controller").GetComponent<FPSInputController>().enabled = false;
GameObject.Find("First Person Controller").GetComponent<CharacterMotor>().enabled = false;
}
if(isReading == false) {
GameObject.Find("First Person Controller").GetComponent<MouseLook>().enabled = true; //burda isReading true ise fps controllerdeki mouselook yani mouse döndürme scriptini deaktif et
GameObject.Find("Main Camera").GetComponent<MouseLook>().enabled = true;
GameObject.Find("First Person Controller").GetComponent<FPSInputController>().enabled = true;
GameObject.Find("First Person Controller").GetComponent<CharacterMotor>().enabled = true;
}
}
v o i d OnGUI() {
if (isReading == true) {
GUI.skin = mySkin;
GUI.Box(new Rect(Screen.width / 2 - 150 , Screen.height / 2 - 150,400,400),""+baslik);//burda baslik adli stringi yazdıracagız guı box'umuza
GUI.Label(new Rect(Screen.width / 2 - 150 , Screen.height / 2 - 125,300,300),""+notYazisi);
}
}
}
Son düzenleme: