Divine Gate
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Unity Note ## 基礎筆記 場景中所有的物件以組件(Component)為基礎 物件上搭配組件的堆疊創造出需要的遊戲效果 Scrpit同樣可以用組件的方式賦予給物件 ![](https://i.imgur.com/1lWPXkK.png) ![](https://i.imgur.com/TXHsLIz.png) ![](https://i.imgur.com/7XG14Ta.png) 腳本同樣也可以停用與刪除 ![](https://i.imgur.com/Z3BARZ9.png) --- # Unity與C#的基本概念 ![](https://i.imgur.com/LzZwWWF.png) ![](https://i.imgur.com/RhuClkE.png) ![](https://i.imgur.com/OXll9CA.png) ![](https://i.imgur.com/iliHsqS.png) ![](https://i.imgur.com/jHOI3IC.png) ### 繼承 ![](https://i.imgur.com/o9TXhfn.png) >繼承於Monobehaviour才可以使用start跟update(繼承/使用其中的指令) ### start&update ![](https://i.imgur.com/1hUK5Rl.png) ### Unity 腳本的生命週期 ![](https://i.imgur.com/SrCA0T9.png) 可以用Debug.Log("印出文字")測試腳本運行 Window>Console觀看Debug log ### 取得(捕捉?)特定遊戲物件上的組件 ![](https://i.imgur.com/P9rYTYi.png) ![](https://i.imgur.com/vBiRtON.png) --- ### 開啟與關閉特定遊戲物件 ![](https://i.imgur.com/zWXjqZv.png) ![](https://i.imgur.com/JIK9XXD.png) ![](https://i.imgur.com/Iu35Yl6.png) ![](https://i.imgur.com/3t2QUNT.png) > 注意編寫的順序,GameObject一旦被停用,組件皆會停止運作。 --- # 變數觀念與位移、物理控制 * 在Game視窗設定解析度 * 調整攝影機大小 * 避免圖片在過程中被縮放 ## 攝影機 ![](https://i.imgur.com/nBprsq4.png) ↓這個不知道怎麼換算到DG的畫面 Othographic:平行視角(2D攝影機) #### 弄懂了! 整個pixel高度(寬)除以2除以100 =1080/2/100 ![](https://i.imgur.com/UKaHcj4.png) ![](https://i.imgur.com/4EsSvma.png) ## 控制位移 座標中若有小數點需在後面加小寫f。 =:賦予數值 ![](https://i.imgur.com/y8aS2Kv.png) +=:將數值加入 ![](https://i.imgur.com/fHsfuEp.png) Time.deltatime:平衡執行次數 ![](https://i.imgur.com/XWyb7CL.png) Rigidbody2D velocity(向量速度) velocity=Vector2 (x,y) ![](https://i.imgur.com/Rs7MJOR.png) 判斷按鍵是否被按下,按下的是哪一個按鍵 ![](https://i.imgur.com/f3TX7jZ.png) ![](https://i.imgur.com/j1hGRn3.png) ![](https://i.imgur.com/3NOM03S.png) # 專案整理、變數修飾詞及邏輯運算子 資料夾記得整理,東西不要擺外面 變數 變數名稱 變數型態 資料 ![](https://i.imgur.com/UstEV9z.png) ![](https://i.imgur.com/CPwmbUR.jpg) 裡面裝著的東西叫什麼 ![](https://i.imgur.com/gu0nnTQ.png) ## 變數修飾詞 Class-變數-Method 公有與私有變數宣告(public),想要該變數(容器)可以被取用需設為公共 private可以被忽略,未輸入修飾詞將默認為private 設置公有變數時,該變數會出現在介面上,可以進行調整 ![](https://i.imgur.com/aantKDB.png) ![](https://i.imgur.com/aRn0Gnn.png) ## 邏輯運算子 運用在較複雜的邏輯判斷 > 我沒有邏輯了…… ||=或 &&=且 ![](https://i.imgur.com/N5huhwy.png) 這邊用||簡化了,如果左或右任一方向鍵被放開(任一條件成立)即將移動速度歸零 ![](https://i.imgur.com/SHECNkT.png) # 動畫片段建立與動畫控制 Animation Clip:切換組件與物件的屬性狀態 透過Animator組件管理 Animator管理Animation clip的狀態,可自行設計切換時的方向性(順序) 1:00 (秒:格數) Sample:每60格跑一秒 ![](https://i.imgur.com/OFDVJ0I.png) Animator>Parameter(變數) ![](https://i.imgur.com/pyi9dFp.png) Has Exit Time:前個動畫狀態到特定時間才切換動畫狀態 ![](https://i.imgur.com/8EoTGgZ.png) # 觸發區域與產生、刪除物件 Trigger:觸發區 Colider>In Trigger:設定為觸發區 音效置入時可以把最遠距離調小(範例為吃金幣的音效) ![](https://i.imgur.com/YXJiqbA.png) 距離與聽取的演示圖 ![](https://i.imgur.com/K4LxdLj.png) 建立好物件,動態產生預置物(隨機物品?) ![](https://i.imgur.com/3ZOkvEV.png) 在遊戲場景中,實例化(產生)物件的方法 Instantiate(Object original); ![](https://i.imgur.com/FZ2h7U3.png) ![](https://i.imgur.com/Bw2ftVO.png) # 透過陣列與迴圈處理重複事件 ## 陣列宣告-類別後面加上[] public GameObject[] active Objects; ## 陣列物件-變數後面加上索引(index) activeObjects[index] for迴圈 用Debug Logs抓資料 結束條件上的活用-依變數長度的改變為迴圈結束條件 Ex: activeObjects.Length=變數長度的改變 # UI介面與計分 ![](https://i.imgur.com/bhjTcZx.png) 錨點在

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully