最近在做一个模型展示的项目,我的想法是根据滑动屏幕的x方向差值和Y方向的差值,来根据世界坐标下的X轴和Y轴进行旋转,但是实习时候总是有一些卡顿.在观察unity编辑器下的旋转之后,发现编辑器下的旋转非常流畅.仔细观察之后发现unity编辑器下的旋转运算模式如下图所示,红色箭头方向为触控滑动方向,黑色箭头为模型旋转的轴. 了解原理之后就是实现相关功能,具体实现还是粘代码吧.代码如下 using System.Collections; using System.Collections.Generic
本文参考自http://www.cnblogs.com/gbyukg/archive/2011/11/02/2232343.html centos下想访问NTFS分区,现在普遍的方法是利用ntfs-3g或者内核模块来实现. 一.使用ntfs-3g官方源码编译安装的方法: ntfs-3g下载页面:http://www.tuxera.com/community/ntfs-3g-download/ 安装步骤: .tgz cd ntfs-3g_ntfsprogs- ./configure make ma
工作的原因,今天就只写了unity下的鼠标左键控制摄像机的视角左右上下调节:明天,补齐.[有诸多参考,着实是需要多多加油的] using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public class CameraMove : MonoBehaviour { public Vector3 target; private Vec
在unity中写编辑器扩展工具,如在编辑器中加个菜单,点击这个菜单项时执行打包功能. 类如下,其中的静态变量,如果每次进来不清空,则LIST会越来越大,打包函数执行完后系统不会帮我们清空 #if UNITY_EDITOR using System; using System.Collections; using System.Collections.Generic; using System.IO; using UnityEditor; using UnityEngine; using LitJ
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class testTiming : MonoBehaviour { public Text t; public KeyCode currentKey; public Event e; // Use this for initialization void
using UnityEditor; using UnityEngine; [CustomEditor(typeof(GameObject))] public class MyEditor : Editor { void OnSceneGUI() { Handles.BeginGUI(); if (GUILayout.Button("输出位置及角度 QQ:745701540")) { GameObject[] objs = Selection.gameObjects; Vector3