小屋創作

日誌2018-01-19 15:02

Unity3d-筆記

作者:Red月

  • 6、攝影機跟隨目標
  • public Transform target;
  • void Update ()
  • {
  • transform.position=newVector3(target.position.x,target.position.y,target.position.z);
  • transform.rotation = Quaternion.Euler (30, 0, 0);
  • }

  • 7、多人連線
  • using UnityEngine.Networking;
  • public class NetWork : NetworkBehaviour
  • {
  • void Start ()
  • {
  • if(!isLocalPlayer)
  • GetComponent<PlayerMove> ().enabled = false;
  • }
  • }
  • 8、Resources Sprite圖片
  • public Sprite s;
  • public Sprite[] myall;
  • void Start ()
  • {
  • s = Resources.Load ("1", typeof(Sprite)) as  Sprite;
  • myall = Resources.LoadAll<Sprite> ("");
  • }

  • 9、Color 循環
  •     public Image lerpedColor;
  •     void Update()
  •     {
  •         lerpedColor.color = Color.Lerp(Color.white, Color.clear,
  •         Mathf.PingPong(Time.time, 0.5f));
  •     }
  • 10、物件開關
  •         gameObject.SetActive(true);
  •         gameObject.enabled = false;

  • 11、物件拖移
  •      IDragHandler ,IBeginDragHandler
  •     Vector3 pos;
  •     public void OnBeginDrag(PointerEventData eventData)
  •     {
  •         pos = new Vector3(transform.position.x - Input.mousePosition.x,
  •                           transform.position.y - Input.mousePosition.y);
  •     }
  •     public void OnDrag(PointerEventData eventData)
  •     {
  •         transform.position = (Input.mousePosition + pos);
  •     }


0

0

LINE 分享

相關創作

【yotoo】240504

【亞夜玩遊戲】《皇冠之心 Online》搶先體驗版

AI繪圖│父女洗澡的時光 #47

留言

開啟 APP

face基於日前微軟官方表示 Internet Explorer 不再支援新的網路標準,可能無法使用新的應用程式來呈現網站內容,在瀏覽器支援度及網站安全性的雙重考量下,為了讓巴友們有更好的使用體驗,巴哈姆特即將於 2019年9月2日 停止支援 Internet Explorer 瀏覽器的頁面呈現和功能。
屆時建議您使用下述瀏覽器來瀏覽巴哈姆特:
。Google Chrome(推薦)
。Mozilla Firefox
。Microsoft Edge(Windows10以上的作業系統版本才可使用)

face我們了解您不想看到廣告的心情⋯ 若您願意支持巴哈姆特永續經營,請將 gamer.com.tw 加入廣告阻擋工具的白名單中,謝謝 !【教學】