![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
unity3d游戏开发
Je't
花花世界!
展开
-
Untiy3D基础-----鼠标控制相机围绕物体旋转,缩放
using UnityEngine;using System.Collections;using System;//挂载脚本到主相机public class SmoothMouseLook : MonoBehaviour{ public Transform target;//主相机要围绕其旋转的物体 public float distance = 7.0f;//主相机与目标物体之间的距离 private float eulerAngles_x; private .原创 2020-11-18 22:25:49 · 351 阅读 · 0 评论 -
Unity UGUI实现鼠标拖动图片
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;using UnityEngine.EventSystems;// UGUI拖动图片,脚本挂在Image上即可public class TuoDongWuPin : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDragHandler{原创 2020-11-12 10:17:00 · 1585 阅读 · 2 评论 -
相机围绕目标旋转
Transform m_Rounder = Camera.main.transform; Transform m_Center = m_TargetXingqiu.transform; //当前触摸的坐标与上一个触摸坐标的偏移量 Vector2 offsetPos = m_TouchCurPos - m_TouchPrePos; //围绕半径 float radius = (m_Round原创 2017-08-04 17:50:56 · 1165 阅读 · 0 评论 -
Unity如何调用安卓手机摄像头实现拍照和录像
1,要想调用摄像头首先要打开摄像头驱动,如果用户允许则可以使用。2,定义WebCamTexture的变量用于捕获单张照片。3,连续捕获须启用线程。脚本绑定到MainCamer实现代码如下:using UnityEngine; using System.Collections; using System.IO; using System.Runtime.Serialization; usin...原创 2018-01-17 16:27:13 · 7393 阅读 · 3 评论