Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Unity tips

11,412 views

Published on

Unity道場04 新卒ブートキャンプの内容

Published in: Technology
  • Sex in your area is here: ❶❶❶ http://bit.ly/2F4cEJi ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ❤❤❤ http://bit.ly/2F4cEJi ❤❤❤
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • accessibility Books Library allowing access to top content, including thousands of title from favorite author, plus the ability to read or download a huge selection of books for your pc or smartphone within minutes.........ACCESS WEBSITE Over for All Ebooks ..... (Unlimited) ......................................................................................................................... Download FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Unity tips

  1. 1. COPYRIGHT 2015 @ UNITY TECHNOLOGIES ボール転がしゲームの制 作を通して学ぶUnity Tips ユニティ・テクノロジーズ・ジャパン 伊藤 周
  2. 2. COPYRIGHT 2014 @ UNITY TECHNOLOGIESCOPYRIGHT 2015 @ UNITY TECHNOLOGIES 環境配置
  3. 3. COPYRIGHT 2015 @ UNITY TECHNOLOGIES Unity Tips プロジェクトのファイル置き方 • ルートは乱さない • AssetStore のモノが勝手に置かれる場所 • ならば自分関連のモノは「_MyGame」とかに置いておい てまとめておく • _MyGame以下は Scenes、Materials、Scripts、Animations、 Modelsとフォルダ分けする(「s」をつけよう)
  4. 4. COPYRIGHT 2015 @ UNITY TECHNOLOGIES Unity Tips エディタの使い方 • Unity Editorの使い方 • Unity Editor = 台所 • Alt+ドラッグ:回転、ホイール:拡大縮小、ホイールドラッグ:平行移動、Fキー:注目 • 名前変更のやり方は2種類 • クリックして、ちょっと経ってもう一度クリック • Inspectorから変更 • ファイルの追加?更新? • Explorer/Finder から上書きコピー → ファイル更新 • Explorer/Finder からUnityにD&D → ファイル追加
  5. 5. COPYRIGHT 2014 @ UNITY TECHNOLOGIESCOPYRIGHT 2015 @ UNITY TECHNOLOGIES Player設定
  6. 6. COPYRIGHT 2015 @ UNITY TECHNOLOGIES Unity Tips Update と FixedUpdateの違い • Update : 不定期 • FixedUpdate :定期 Update Render Update Render Updat e Render Fixed Fixed Fixed Fixed Fixed
  7. 7. COPYRIGHT 2015 @ UNITY TECHNOLOGIES Unity Tips Update と FixedUpdateの違い • Update • 描画フレームごとに呼ばれる関数 • 基本的な更新はこっちで • あまり使わない方がいい:Rigidbody系 • FixedUpdate • 物理処理の更新の際に呼ばれる関数 • 物理系をいじりたい時だけこっちで • あまり使わない方がいい:Input系
  8. 8. COPYRIGHT 2015 @ UNITY TECHNOLOGIES Unity Tips Component参照について • 同じGameObjectに参照したいComponentがある場合 • GetComponent<MyClass>() 利点:いちいちInspectorで操作しなくても良い 欠点:冗長。少し処理が走る • public MyClass myClass 変数として、InspectorでD&D 利点:簡潔。負荷なし 欠点:Missing になるかも • [RequireComponent (typeof (Rigidbody))] ←オススメ
  9. 9. COPYRIGHT 2015 @ UNITY TECHNOLOGIES Unity Tips Component参照について • 同じGameObjectに参照したいComponentがある場合のFA [RequireComponent(typeof(Rigidbody))] public class myBallCon : MonoBehaviour { private Rigidbody rb; void Start() { rb = GetComponent<Rigidbody>(); }
  10. 10. COPYRIGHT 2015 @ UNITY TECHNOLOGIES Unity Tips Component参照について • 他のGameObjectに参照したいComponentがある場合 • GameObject.Find(“MyObject”) → GetComponent 利点:自由。簡単。 欠点:とにかく重い。名前が変わったら検索できなくなるし、それがわからない • GameObject.FindWithTag(“MyTag”) → GetComponent 利点:ある程度軽い。 欠点:タグを増やす手間がかかる。多少負荷がかかる • public MyClass myClass 変数として、InspectorでD&D 利点:簡潔。負荷なし 欠点:PrefabにするとMissingになる(超NG!)
  11. 11. COPYRIGHT 2015 @ UNITY TECHNOLOGIES Unity Tips Component参照について • 他のGameObjectに参照したいComponentがある場合のFA using UnityEngine.Assertions; public class myBallCon : MonoBehaviour { private Rigidbody otherRb; void Start() { GameObject go = GameObject.FindWithTag("MyPlayer"); Assert.IsNotNull<GameObject>(go); otherRb = go.GetComponent<Rigidbody>(); Assert.IsNotNull<Rigidbody>(otherRb); }
  12. 12. COPYRIGHT 2014 @ UNITY TECHNOLOGIESCOPYRIGHT 2015 @ UNITY TECHNOLOGIES Camera
  13. 13. COPYRIGHT 2015 @ UNITY TECHNOLOGIES Unity Tips Update と LateUpdate の違い • LateUpdate は 全てのUpdateの後に処理される Update Late Updat e Updat e Late Late Component A Component B Component C Update Updat e Updat e
  14. 14. COPYRIGHT 2014 @ UNITY TECHNOLOGIESCOPYRIGHT 2015 @ UNITY TECHNOLOGIES Prefab
  15. 15. COPYRIGHT 2015 @ UNITY TECHNOLOGIES Unity Tips Prefab関連 • Prefabはコピーした先を全て一気に変更できる • Duplicate は一気に変更するのに手間がかかる • Instantiate して安全に生成できる • シーン上のオブジェクトの Instantiateは危険 • Prefabの関連を切る方法 • シーン上のPrefab関連のオブジェクトを選択 • メニューの「GameObject→Break Prefab Instance」で切れる
  16. 16. COPYRIGHT 2014 @ UNITY TECHNOLOGIESCOPYRIGHT 2015 @ UNITY TECHNOLOGIES 物理運動
  17. 17. COPYRIGHT 2015 @ UNITY TECHNOLOGIES Unity Tips 物理運動 • Dynamic ←→Dynamic • 例: Player と Enemy • 通常の物理運動(Rigidbody同士) • Dynamic ←→ Static • 例: Playerと地形 • Staticは作用しないでDynamicが一方的に移動(Rigidbody と 非Rigidbody) • Static ←→ Static • 処理しない(動かないので)
  18. 18. COPYRIGHT 2015 @ UNITY TECHNOLOGIES Unity Tips 物理運動 • 移動する反作用させたいものは、全てRigidbodyをつける • 例: 動く地形とか • Rigidbodyを付けてIs Kinematic をオン • つけないと、毎回再計算をしてしまう

×