Your SlideShare is downloading. ×
0
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Emrah Özer : Introduction to Unity Scripting
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Emrah Özer : Introduction to Unity Scripting

972

Published on

Yazdigimiz demonun dosyalari …

Yazdigimiz demonun dosyalari

www.gamedevturkey.com/files/introductionToUnity.zip

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
972
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
16
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. INTRO TOUNITY SCRIPTING Emrah Özer Indie Game Developer
    • 2. Neden Unity?
    • 3. YENI BIR PLATFORMA BASLAMAK
    • 4. YENI BIR PLATFORMA BASLARKENİlk baktığım konseptler:• Variable Definition• Method Definition• Instantiation• Messaging• Event Handling• Platform Spesific Features• MVC implementation
    • 5. UNITY’YE BASLARKEN• Component Mimarisi Nedir• Component’lara Nasil Ulasilir• Objelere Nasil Ulasilir• Prefablar / Objeler Nasil Instantiate Edilir• Event Sistemi Nasil
    • 6. DİL SEÇİMİ C# JavascriptTercihim C#:• Daha kati (strict typing) bir dil olmasi• IDE acisindan avantajli olmasi (Visual Studio rules)• Unity API’sinin naming convention seciminin bu yonde olmasi. (Büyük harfle başlayan method isimleri)• Event sisteminde kolaylık sağlaması
    • 7. Accessing Components• Unity’de oyunumuzda kullandigimiz butun objeler GameObject’den extend ediyor.• Bir objenin kamera / kup / collider / light olduguna eklenen component’lar karar veriyor.• Objelerimize ekledigimiz component’larin hepsi aslinda birer script blogu (vice versa)
    • 8. Accessing Components (cont...)using UnityEngine;using System.Collections;public class example : MonoBehaviour { void Example() { GetComponent<SomeScript>().doSomething(); }}
    • 9. Accessing Objects• Inspector’a referans verilebilirusing UnityEngine;using System.Collections;public class example : MonoBehaviour { public Transform target; void Update() { target.Translate(0, 1, 0); }}
    • 10. Accessing Objects (cont...)• Ayni hiyerarsi icinde bulunan yani kendisine parent veya child olan objelere transform.Find() methodu ile ulasarakusing UnityEngine;using System.Collections;public class example : MonoBehaviour { void Example() { transform.Find("Hand").Translate(0, 1, 0); }}
    • 11. Accessing Objects (cont...)• ve FindObjectsOfType ile bir tipteki bütün FindObjectOfType scriptlere/componentlara ulaşılabilir.using UnityEngine;using System.Collections;public class example : MonoBehaviour { void Start() { OtherScript other = FindObjectOfType(typeof(OtherScript)); other.DoSomething(); }}
    • 12. Accessing Objects (cont...)• GameObject.Find()ve GameObject.FindWithTag() ile isim ve etikete gore arama yapilabilir.using UnityEngine;using System.Collections;public class example : MonoBehaviour { void Start() { GameObject go = GameObject.Find("Haydar"); go.transform.Translate(0, 1, 0); GameObject player = GameObject.FindWithTag("Player"); player.transform.Translate(0, 1, 0); }}
    • 13. Accessing Objects (cont...)• Buradan yola çıkarak objelere bağlı scriptlere ulaşılabilirusing UnityEngine;using System.Collections;public class example : MonoBehaviour { void Start() { GameObject go = GameObject.Find("Murtaza"); go.GetComponent<OtherScript>().DoSomething(); GameObject player = GameObject.FindWithTag("Player"); player.GetComponent<OtherScript>().DoSomething(); }}
    • 14. HERKES HERŞEYE ULAŞABİLİR!!!
    • 15. Instantiating • Instantiate methodu, instantiate edilecek obje, rotasyon ve pozisyon verisiyle birlikte cagirilir.Transform clonedObject = Instantiate(testObject,transform.position,transform.rotation) Destroy • GameObject, component veya bir asset’i kaldirmak icin kullanilir Destroy(gameObject); Destroy(); Destroy(rigidbody); Destroy(gameObject, 5);
    • 16. Platform Spesific Features• Bu tip ozellikleri gorebilecegimiz yer MonoBehaviour class’iAwakeUpdateLateUpdateFixedUpdateStartOnTriggerEnterOnCollisionEnter
    • 17. DEMO TIME

    ×