一.图片的Inspector面板属性 Texture Type:一般是选择sprite(2D and UI) Sprite Mode:一般是选择Single Packing Tag:打包的标志值,最后打包的时候会把Tag相同的所有小图打包成一个大图.不像cocos打包图集需要用到第三方软件,这里Unity会帮我们把相同Tag的图片打包成大图,非常方便. Pixels Per Unit 100:表示100像素为1个Unity单位(1米),也可以在Scene视图中看出,640X960分辨率的图片在视
实现2dUI跟随游戏中角色的移动(应用于玩家名称,血条,称号) using UnityEngine; public class UI_Follow : MonoBehaviour { public Camera m_camera; public Transform m_target; public RectTransform m_ui; private Vector3 position_sp; private void Awake() { if (m_camera == null) { m_ca
1.Vector3坐标 2.地球,月球,太阳的旋转关系 using System.Collections; using System.Collections.Generic; using UnityEngine; public class spere01 : MonoBehaviour { public GameObject moon; public GameObject sun; // Use this for initialization void Start () { } // Updat
Chapter 1: Looking Back,LookingForward Chapter 2: Building Layouts Chapter 3: Control, Control, You Must Learn Control Chapter 4: Anchors Away Chapter 5: Screen Space, World Space, and the Camera Chapter 6: Working with the UI Source Chapter 1: Looki
参考链接: http://www.manew.com/thread-100366-1-1.html https://www.jianshu.com/p/3082ebf8a342 https://blog.csdn.net/serenahaven/article/details/80972601 1.RaycastTarget的检测 using UnityEngine; using UnityEngine.UI; public class DrawRaycastTarget : MonoBehav