ã第2å æ¸è°·Unityåå¼·ä¼xã³ããã©Unityäºä¾çºè¡¨ãã«åå ãã¦ãã¾ãã
ãæºå¡å¾¡ç¤¼ï¼å¢å¡350åã第ï¼å æ¸è°·Unityæè¡åå¼·ä¼xã³ããã©äºä¾çºè¡¨ : ATND
http://atnd.org/events/24706
Togetterã¾ã¨ãã
2012/03/01_第ï¼å æ¸è°·Unityæè¡åå¼·ä¼xã³ããã©äºä¾çºè¡¨ï¼ #ShibuyaUnity ï¼ - Togetter
http://togetter.com/li/266118
Unityå ¥é 第1å - 赤åç²é³(@LeonAkasaka)ãã
ã¹ã©ã¤ãè³æã¯こちらã
â»èµ¤åç²é³ããã®è¬æ¼ã¯ã¹ã©ã¤ãè³æãå
¬éããã¦ããã®ã§èªåãç¹ã«æ°ã«ãªã£ãé¨åã¨ã¹ã©ã¤ãã«å«ã¾ãã¦ããªã解説ãQAã®é¨åã«ã¤ãã¦ã ãè¨è¿°ãã¦ç½®ãã¾ãã
- 以ä¸ã®æ§ãªæ¬ãåºããã¦ãã¾ãã
Windowsã²ã¼ã ããã°ã©ãã³ã° 第2ç Game Developer
- ä½è : 赤åç²é³
- åºç社/ã¡ã¼ã«ã¼: ã½ãããã³ã¯ã¯ãªã¨ã¤ãã£ã
- çºå£²æ¥: 2008/02/26
- ã¡ãã£ã¢: 大åæ¬
- è³¼å ¥: 3人 ã¯ãªãã¯: 19å
- ãã®ååãå«ãããã° (12件) ãè¦ã
ããããã¯ãããVisualC++2010forããã¼ã¸ã³ã¼ãC++/CLI
- ä½è : 赤åç²é³
- åºç社/ã¡ã¼ã«ã¼: ç§åã·ã¹ãã
- çºå£²æ¥: 2010/06/16
- ã¡ãã£ã¢: åè¡æ¬
- ã¯ãªãã¯: 18å
- ãã®ååãå«ãããã° (5件) ãè¦ã
- èªèº«ã§ã²ã¼ã ãä½ããããªäºã¯ã»ã¨ãã©ç¡ããã©ã²ã¼ã ä¼ç¤¾ã«æ°ããæè¡ã®æå°ã«è¡ãæ§ãªäºã¯æãã¨ã®äºã§ãã
- ããªã¼ã©ã³ã¹
こちらのサイトã§Unityã®å ¥éè¨äºãæ²è¼ä¸ã
æ¬åå¼·ä¼ã®ããããã®äºå®
3æ1æ¥ï¼æ¬æ¥ï¼
- Unityã®åºæ¬çãªæ§é ã俯ç°
- æ§é ä¸ã®æ³¨æç¹ãªã©
3æ29æ¥
- ã°ã©ãã£ãã¯ã¹
- ãªã½ã¼ã¹ã®å®è¡æçæãªã©ããã·ã¼ã¸ã£ã«ãªææ³
4æ26æ¥
- Unity Editorã®æ¡å¼µ
.NET Framework ã«ãããã誤解
- ä¸éè¨èªã¯ä»®æ³ãã·ã³ã§å®è¡ãããããé
ã
- JITãAOTã§å®è¡æã«ã¯ãã¤ãã£ãã³ã¼ãã«ã³ã³ãã¤ã«ããã
â»iOSã§ã¯è¦ç´ã®åé¡ã§AOTã«ããäºåã³ã³ãã¤ã«ã®ã¿
(çè
注)
AOT(Ahead-Of-Time)
äºåã³ã³ãã¤ã© - Wikipedia
http://ja.wikipedia.org/wiki/%E4%BA%8B%E5%89%8D%E3%82%B3%E3%83%B3%E3%83%91%E3%82%A4%E3%83%A9
éã¢ã»ã³ãã©ã®å®æ¼
Visual Stduioã«ä»å±ãã¦ããéã¢ã»ã³ãã©ã§ã¡ã½ããã確èªããå®æ¼ã
ä¼å ´ã¸ã®è³ªå
ããã¸ã§ã¯ãã«Booã使ã£ã¦ããäººå± ã¾ããï¼âä¼å ´ã®ææ 0
ä»ã®C#ã使ã£ãããã¸ã§ã¯ãã«ã使ããæ±ç¨çãªã©ã¤ãã©ãªãä½ãæã®æ³¨æç¹
- ä½æãããã®ã¯ä¸è¬çãª.NET Frameworkã®DLLã§OK
- MonoBehaviourãç¶æ¿ããæ§ãªãã®ã ã¨ä»ã®ç°å¢ã§ã¯ä½¿ããªã
- .NET Framework 2.0ç¸å½ã®æ©è½ã«éå®ãã
- ææ°ãã¼ã¸ã§ã³ã¯4.0ã ããUnityã§å©ç¨ãããã¨ãèããã¨ã¹ãã¼ããã©ã³åãã®ãããã¡ã¤ã«ã2.0ç¸å½
Unityä¾åã®ã©ã¤ãã©ãªãä½æããæã®æ³¨æç¹
- å¯è½ãªéãåå®å ¨ã«ãSendMessageãªã©ã¯æ¥µåé¿ãã
Unityã§ãªãã¸ã§ã¯ãã¨è¨ã£ã¦ããå ´åã«ã¯å ¨é¨ã§3ã¤ã®å¯è½ãæãã®ã§æ³¨æ
- System.Object
- å ¨ã¦ã®ãªãã¸ã§ã¯ãã®åºåºã¯ã©ã¹
- UnityEngine.Object
- UnityEngineã«ãã£ã¦ç®¡çããããªãã¸ã§ã¯ã
- ã²ã¼ã ãªãã¸ã§ã¯ããã³ã³ãã¼ãã³ããã¢ã»ããã®åºåºã¯ã©ã¹
- UnityEngine.GameObject
- UnityEngine.Objectããæ´¾ç
- ã·ã¼ã³ã«é ç½®ããã¦ãããªãã¸ã§ã¯ã
GCã®è©±
- GameObjectã¯å¸¸ã«Unityã¨ã³ã¸ã³ããåç
§ããã¦ãã
- ã¹ã¯ãªããã§åç §ã失ããã¦ãGCã®å¯¾è±¡ã«ãªããªã
- Destroy()ã¡ã½ããã«ããæ示çãªåé¤
- è¤æ°ã®ã¹ã¯ãªããã§å ±æãã¦ãããªãã¸ã§ã¯ãã®ç ´æ£ã«æ³¨æ
åéããããã¡ãª this
- ã¹ã¯ãªããèªèº«ã¯MonoBehaviourã®ã¤ã³ã¹ã¿ã³ã¹
- ããthisã®çµæãã²ã¼ã ãªãã¸ã§ã¯ãã¨æ··åãã¦ãã
- Destroy(this) ã¯ä½ãæ¶ãã®ã
- thisã¯ã¹ã¯ãªããèªèº«ã§ããã²ã¼ã ãªãã¸ã§ã¯ãã§ã¯ãªã
- ã²ã¼ã ãªãã¸ã§ã¯ã㯠this.gameObject
- ããthisã®çµæãã²ã¼ã ãªãã¸ã§ã¯ãã¨æ··åãã¦ãã
èªåã¡ã¢ãªç®¡çã§ãã¡ã¢ãªãªã¼ã¯ãã
- ä¸è¦ãªãªãã¸ã§ã¯ããåç
§ãç¶ããã¨ã¬ãã¼ã¸ã¨ãã¦ãã¼ã¯ã§ããªãããã¡ã¢ãªãªã¼ã¯ãã
- é åã®è¦ç´ ã¨ãã¦æ ¼ç´ããã¾ã¾å¿ãã
- ããªã²ã¼ããã¤ãã³ãã«è¿½å ããã¾ã¾å¿ãã
åèè³æ
Scripting Overview
http://unity3d.com/support/documentation/ScriptReference/
.NET Frameworkã®æ¦è¦
http://msdn.microsoft.com/ja-jp/library/a4t23ktk(v=VS.90).aspx
QA
Unityã®Unitãã¹ãã¯ã©ã®æ§ã«ãã¦ã¾ããï¼
- ãªã¼ãã³ã½ã¼ã¹ã®ç©ã使ã
- ã©ã¤ãã©ãªåããã©ã¤ãã©ãªããã£ãããã¹ããã
ã³ããã©ã®Unityäºæ 2 ããªãºã ã³ã¤ã³ï¼ã - æ ªå¼ä¼ç¤¾ã³ããã© é¦¬å ´ åæ·³ãã
- æã«3æ¬ã²ã¼ã ããªãªã¼ã¹ããã®ãç®æ¨
- Unityãã¼ã ã¯ç¾å¨13人
- Unity製ã®ã²ã¼ã ã¯å ¨ä¸çåè¨ã§250ä¸ã300ä¸DLããã
é£æ度調æ´Tips
- ãã¬ã¤ã®å®å ¨èªååã¨é«éåãããã
- 注æç¹
- ã²ã¼ã å ã®æéã«å·¦å³ãããå¦çã¯ãTime.deltaTimeãçã®å¤ãèæ ®ãã¦ã¹ã¯ãªãããçµã
- Animationãæ£ããæåããªããã¨ããã
- ã³ãªã¸ã§ã³ãç©çè¨ç®ãªã©ãä¸å®å®ã«ãªã
- ã¡ãªãã
- ãã©ã³ã¹èª¿æ´ã¨ãããä¸çªæéãæããå°ãã¤éè¦ãªä½æ¥ãç縮ã§ãã
- è¤æ°å°ã®ç«¯æ«ã§ã´ãªã´ãªåãã¨ãç ã£ã¦ããä¸å ·åãçªç¶åºã¦ããäºãªã©ããã
- ãã¹ãç¨ã«èªåã§ã³ã¤ã³ãè½ã¨ãã¢ã¼ã
- 10åé度ã§åä½ããã¢ã¼ã
- èªåçã«ä½æéãåä½ãããæ§ãªãã¹ããè¡ã£ã
- çµæãã¼ã¿ãä¿åãã¦ãã¦å¾ã§Excelã§è¦ããæ§ã«ãã¦ãã
- ç¹å®ã®æ©ç¨®ã®ã¿çºçãããã°âãã®ã¢ã¼ãã§åããäºã§ãããã°ãã
ãã¥ã¼ãã³ã°1
- Deep Profileã§(ONã«ããç¶æ ã§)ãããã¡ã¤ãªã³ã°ããªããæ¢ã
- Deep profileã¯ONã§ã¡ã½ããã®å¥¥ã¾ã§ç¢ºèªåºæ¥ãã
- æè¦ã§æ¢ããªãããããã¡ã¤ãªã³ã°ãã¦è² è·ã®ä¸ä½(ããã«ããã¯)ããé ã«æé©åãããï¼
ãã¥ã¼ãã³ã°2
ãã¨ã©ã«ãã¼ãªã©ããªã¼ãæ¤ç´¢ãã以ä¸ã®ã¡ã½ããã¯æ¥µå使ããªã
GameObject.Find("Name")
GameObject.FindObjectsWithTag("TagName")
GameObject.GetComponents
GameObject.SetActiveRecursively(bool)
â»ç¹ã«Update()ã§ã¯çµ¶å¯¾ã«ä½¿ç¨ç¦æ¢â
à GameObject obj = GameObject.Find("Wall");
⯠public GameObject wall;
ãã¥ã¼ãã³ã°3
DateTimeå/TimeSpanåã使ããªã
TimeSpan delta = DateTime.Now - startTime;
long elapsed = delta.TotalMilliseconds;
ã¨ãã£ãå¦çãUpdate()ã§æ¯ãã¬ã¼ã è¡ãã¨è¨ç®ã³ã¹ããé常ã«é«ãããããããã ã¨ã²ã¼ã å æéã§ã¯ãªãå®çµéæéã¨ãªã£ã¦ãã¾ãã®ã§ãã²ã¼ã ãªãã¸ã§ã¯ãã®ç®¡çã«ä½¿ãã«ã¯ã¨ã¦ãé½åãæªãã
private float delta = 0.0f;
delta += Time.deltaTime;
ãªã©
(â»é¢é£ããTwitterã§ã®ãã¤ã¼ã)
ãã¥ã¼ãã³ã°5
(çè 注ï¼ããï¼ãã¥ã¼ãã³ã°4ãã¡ã¢ããã®å¿ããããªï¼)
- RayCastãç¯ç´ãã
- ãã¾ã®å½±(ã®æ¿ããª)ã®åº§æ¨ãæ±ããããã«Updateæ¯ã«RayCastãã¦ãã(Deep Profileã§CPU Load 2.5%ããã)
- RayCastããåæ°ãæãããã¸ã£ã³ããã以å¤ã¯ä½¿ããªãã®ã§ãç¶æ å¤å®ãè¡ãªã£ã¦é£ãã§ãªãã¨ãã¯å¦çãã«ãã â 2%æ¹å
ãã¥ã¼ãã³ã°6
ãã¼ãã£ã¯ã«ã¯å¤§ããå°ãªã
å¦çè² è·ã¯ãã¼ãã£ã¯ã«ã®æ°ã«æ¯ä¾ãã
âç²ã®æ°ãæ¸ããã¦å¤§ç²ã«ããã表示ãããªãæ¹åã«é£ã°ãªãããã«é度ãä¸ããããã«è¨å®å¤ããã£ããè¦ç´ã
ä¾) ã³ã¤ã³ã®å¤åçã®ãã¼ãã£ã¯ã«ã200åºã¦ã(ã¨ãã§ããªãéã)â20ã¾ã§æ¸ããã¦å¤§ç²ã«
æ©ç¨®ä¾åæ å ±1
ãã£ã¼ãã¼ã¿ã¤ã ä¸ã®èæ¯ã®ã¯ãã¹ã¯ãªã¼ã³
- Screenã¢ãã«ãç¨æ
- Mesh Rendererã®ãããªã¢ã«ã«Render Texture
â²ç¾è±¡
該å½æ©ç¨®ï¼Docomo Galaxy S
ãã£ã¼ãã¼ã¿ã¤ã éå§æããããã¯çµäºæã«ã¢ããªã±ã¼ã·ã§ã³ãåæ¢ããã(GUITextureã«è»¢éãã¦2Dã¨ãã¦è¡¨ç¤ºããã¶ãã«ã¯åé¡ç¡ã)
â²åå
èµ·åæã«ã»ããããã¨ããªã¼ãº
â²å¯¾å¦
å¿
è¦ãªæã«è¨å®ãããä¸è¦ã«ãªã£ããåé¤
KumaCamera.camera.targetTexture = RenderTexture;
KumaCamera.active = true;
æ©ç¨®ä¾åæ å ±2
â²ç¾è±¡
該å½æ©ç¨®ï¼Docomo Galaxy S2
極ã¾ãã«ç«¯æ«ãªãã¼ã
â²åå
Audio Sourceãä»å ãããã²ã¼ã ãªãã¸ã§ã¯ãã§
audio.clip = Source
audio.Play()
ã¨ãããã¸ãã¯ã§ãµã¦ã³ããçãã¹ãã³(1ç§éã«è¤æ°å)ãä½åº¦ãç¹°ãè¿ããã¨ã«ãã£ã¦çºç
â²åé¿æ¹æ³
å
ããAudio Sourceã«å¯¾ãã¦Audio Clipãè¨å®ãã¦ãã
audio.PlayOnShot();
ã«å¤æ´ãããã¨ã«ãã£ã¦ã¯ã©ãã·ã¥ãåé¿
- ã³ã¼ãã1å1ååã£ã¦ã¯èªååä½ã2æéä½æµãã¦ã¯ã©ãã·ã¥ãããç¹°ãè¿ãã¦ç¢ºèªããã°ãè¦ã¤ããã®ã«2æ¥ããã£ãã
- æ¬ãªã©ã§ã¯ãåé¿æ¹æ³ãã®æ§ãªè¨è¿°ãæ¸ããã¦ãããããããä»åã¯é³ã®ã¯ãã¹ãã§ã¼ãããããã£ãçºã«ãã®æ§ãªå®è£ ã«ãã¦ããã
(çè 注ï¼LTãæ親ä¼ã®æã«è¡ããã¦ãã¦ãä»ã®æ¹ã ã¨è©±ã¦ãã¦LTãå§ã¾ã£ã¦ããã®æ°ãã¤ãã®ãé ãã¦ãã¾ãã¡ã¢ãåãã¦ãã¾ãããã¡ã¢ããé¨åã ãæ¸ãã¨ãã¾ã)
(LT)ä¸æ¬¡å 解åå¦æ¸ãã¿ããä»ä½ã£ã¦ãç«ã¢ããªã®ãã¿ by éç°ãã
- 3Dã®äººä½æ¨¡åã¢ããªãä½ã£ãæã®è©±
- ä½æããå¿ è¦ãæã3Dã¢ãã«ã®æ°ãè¨å¤§ã§æã£ãããä¾é ¼ãåãã大å¦ã§ã¢ã«ãã¤ããåã£ã
- 80人ãã®å¿åãæã£ã
- ãããªã«ã¯é¢æ¥ã¯åºæ¥ãªãçºãæå®ããé¨ä½ã®çèã®ã¢ãã«ãã¡ã¿ã»ã³ã¤ã¢ã§ä½ã£ã¦è²°ãäº
- 40人ãæåºãæã£ã
- ãã®ä¸ããæ°äºº(â»äººæ°ãè¨ããã¦ããã¯ãã§ããå¿ãã¡ããã¾ããã3人ãããã ã£ãã¨æãã¾ã)ãæ¡ç¨
(LT)2Dã¢ã»ããç³»ã¾ã¨ã - ææ è¯å¹³ãã
ã¹ã©ã¤ãè³æã¯こちらã
ãã¡ããã¹ã©ã¤ãè³æãæãã®ã§èªåãæ°ã«ãªã£ãæã ãã
- 2DToolKitã¯ã2Dã®è¦ãç®ã¨Physicsã®çµã¿åãããå¯è½ããAngly Birdsã¿ãããªç°¡åã«ä½æåºæ¥ãããã®æãç©çæ¼ç®ã¯Unityæ¨æºã®ãã®ã使ç¨å¯è½
- 2Dã®è¦ãç®ã¨Physicsãä¸è´ãã¦ãããããã®æ§ãªãã²ãã²ãªãã®å ´åã«ããã²ã®é¨åã«ã®ã¿å½ããå¤å®ãæã
- ex2Dã¯UIã«ã¤ãã¦ã¯Ã(çè 注ï¼ä¸å¿ããã¿ã³ãããã¯ä½ããä»çµã¿ãæãã¾ããã§ãã¾ããåºæ¬çã«ã¯é対å¿ãªæãã§ã)
ã¾ã¨ã
- 2DToolKit
- çµµã«åãããå½ãå¤å®ãå¿ è¦ãªã¢ããª
- AngryBirdsãªã©
- eX2D
- ã¡ããã¨ããã³ãéãã¢ãã¡ãå¿ è¦ãª2Dã²ã¼ã
- NGUI
- GUI主ä½ã®ã²ã¼ã ãªãããããã¿ã¼
- EZGUI
- ããå½¹å²ã¯çµããï¼