跳到主要內容

阿葉的Unity3D密技「血條」

嘿,其實血條大家多半早會了,但是應觀眾要求還是把這教學Run一遍才行。這次我們用的是新的UI系統「UGUI」他跟「NGUI」很像,是Unity公司挖角「NGUI」團隊到進去開發的系統,使用方便又省效能,個人覺得以後Unity遊戲大多都會使用這個系統。

這次介紹了三種方法實現血條,使用「Mask」「FillAmount」兩種常見的遮罩方式,基本涵蓋了上市面上大多血條作法,如果各位夥伴還有突發奇想新的血條歡迎到社團留言。

操作影片

留言

  1. 你好,能不能问下你的scrite是在哪里下的,我想要那个白色圆环的资料,谢谢了,vittoria1226@gmail.com

    回覆刪除
  2. The Perfect Wedding Band with T-Mobile Suit Up
    T-Mobile is an amazing combination of premium micro touch hair trimmer band, titanium max trimmer premium band titanium hair dye gear, premium earrings, and T-Mobile technology. Their T-Mobile is titanium a conductor phone band features titanium 3d printer

    回覆刪除

張貼留言

這個網誌中的熱門文章

你可能不知道的超冷門Unity功能#1 WaitForSeconds

遇此行時暫停,直到指定時間後才繼續執行下一行程式碼。 其實我根本沒用過幾次,不知道各位大大都怎麼使用它? 關鍵句 : yield WaitForSeconds( 5 ); 範例 : using UnityEngine; using System.Collections; public class WaitForSecondsExample : MonoBehaviour { void Start() { StartCoroutine(Example()); } IEnumerator Example() { print( Time.time ); yield return new WaitForSeconds (5); print( Time.time ); } } 影片操作 :

你可能不知道的超冷門Unity功能#2 NavMeshAgent.steeringTarget

在使用NavMeshAgent尋路系統的時候,內建豐富的位移效果常讓人感到頭痛。其實NavMeshAgent有一項鮮少有人知道的功能允許使用者自己取用下一個座標點,省去許多控制複雜參數的麻煩。 關鍵句 : .steeringTarget 範例 : using UnityEngine; using System.Collections; public class PlayCtrl : MonoBehaviour { private NavMeshAgent agent;//尋路系統 public Transform In;//最終目標 private Vector3 Look_pos;//中途目標 void Start () { agent = GetComponent<NavMeshAgent>(); } void Update () { agent.destination = In.position; Look_posa = agent.steeringTarget; } } 影片操作 :

你可能不知道的超冷門Unity功能#3 OnWillRenderObject

OnWillRenderObject這個東西能判定該物件有沒有被攝影機看到,可以拿來判定一個東西是否在視野內。 關鍵句 : void OnWillRenderObject() { } 範例 : using UnityEngine; using System.Collections; public class ExampleClass1 : MonoBehaviour { private ParticleSystem ps; void Start() { ps = GetComponent<ParticleSystem>(); } void OnWillRenderObject() { if (Camera.current.name == "MiniMapcam") ps.enableEmission = true; else ps.enableEmission = false; } } PS : 使用這個範例記得要把攝影機取名為 MiniMapcam 才有效果喔 影片操作 :