- 博客(10)
- 收藏
- 关注
原创 Unity 拖动UI物体
using UnityEngine; using System.Collections; using UnityEngine.EventSystems; public class Tool : MonoBehaviour, IDragHandler,IPointerDownHandler,IPointerUpHandler{ // Use this for initialization v
2016-06-03 15:58:27 3460 1
原创 Unity 2D射线与 3D射线 UI射线
//3D射线 if (Input.GetMouseButton(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);//从摄像机发出到点击坐标的射线 RaycastHit hitInfo; if (Physics.Raycast(r
2016-05-26 14:40:17 10946
原创 Unity 截屏,WWW加载图片,保存到本地
using UnityEngine; using System.Collections; using System.IO; public class NewBehaviourScript : MonoBehaviour { private Texture2D tex; void Start () { CaptureScreenshot2(new Rect(Scre
2016-03-22 17:01:28 873
转载 HTTP 请求工具类
using UnityEngine; using System.Collections; using System.Collections.Generic; public class HttpClient : MonoBehaviour { // Use this for initialization void Start() { } // Upd
2015-12-15 16:16:21 433
原创 Unity 鼠标拖动场景内的物体
using UnityEngine; using System.Collections; public class mouse_Drag : MonoBehaviour { public Camera mCamera; public float deth = 10f; //鼠标放到物体上 void OnMouseEnter() { thi
2015-07-24 10:04:36 997
原创 Unity WWW的用法
AssetBundle 动态加载场景 WWW download = WWW.LoadFromCacheOrDownload("file://E:/MirPenUU/sence_gamefarm.ab", 1); //两种方法都可以 WWW download = new WWW("file://E:/MirPenUU/sence_gamefarm.ab"); if
2015-07-17 15:32:31 6812
原创 Resources中读取prefab,动态生成控件
GameObject obj = Resources.Load("RankContent") as GameObject; for (int i = 0; i < 5;i++ ) { GameObject Rank = Instantiate(obj) as GameObject; Rank.transform.par
2015-07-14 13:53:56 601
转载 unity中Image显示android手机SD卡中的图片
using UnityEngine; using System.Collections; using UnityEngine.UI; using System.IO; public class ImageManager : MonoBehaviour { private string imagePath; private Image image; private Te
2015-06-29 12:26:54 2868
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人