![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Unity-UGUI
zy下令
有一天,我会做出这样一个游戏.
展开
-
UGUI点击事件的简单封装
UGUI点击事件的简单封装IPointerEnterHandler – OnPointerEnter – Called when a pointer enters the object IPointerExitHandler – OnPointerExit – Called when a pointer exits the object IPointerDownHandler – OnPoint原创 2016-12-03 17:24:51 · 599 阅读 · 1 评论 -
UGUI拖拽事件的实现
UGUI 自带有拖拽事件,我们具体来实现看看,为了便于理解,我尽量去除不必要的代码.第一步:继承3个接口:IBeginDragHandler,IDragHandler,IEndDragHandler,分别是拖拽开始,拖拽途中,拖拽结束.(实现相应方法)using UnityEngine;using System.Collections;using UnityEngine.EventSystems原创 2016-12-07 14:35:12 · 605 阅读 · 0 评论 -
UGUI 虚拟摇杆的实现
建2张 image,大小自己看着办: 第一步:将上一次拖拽实现的代码全部复制过来.将脚本放在较小的正方形 imageusing UnityEngine;using System.Collections;using UnityEngine.UI;using UnityEngine.EventSystems;public class Rocker : MonoBehaviour,IBeginD原创 2016-12-07 16:28:18 · 601 阅读 · 0 评论 -
UGUI实现图片特效轮播,使用插件DOTWEEN
今天我们来用unity3d的UGUI来实现图片的轮播,也就是经常在一些视频网站上的一些图片轮播。这次将使用到动画插件DOTWEEN,主要目的也是为了熟悉Dotween这个插件。图片轮播的原理是比较简单的,我将实现图片特效轮播,也是看了别人的网站后想在UGUI上面实现以下,正好刚刚学习了Dotween,拿来练练手。原理: 2张图片叠加在一起,且开始状态是2张图片都为一样的图片,切换之前,将后面的图片先原创 2016-12-26 17:26:14 · 11327 阅读 · 8 评论 -
Unity3D:面向敌人!
void Update(){ Vector3 dir = 己方位置-敌方位置 dir = new Vector3(dir.x, 0, dir.z);//如果不需要朝上和朝下,则将dir.y置为零! Quaternion quaternion = Quaternion.LookRotation(dir); weaponTransform.lo...原创 2018-12-07 14:45:17 · 1004 阅读 · 0 评论