ITeye博客

2015 年文章归档

共 10 篇文章

Unity3D研究院之Time.timeScale、游戏暂停

项目里面一直在用Time.timeScale来做游戏的 1倍 2倍整体加速,今天我仔细看了一下Time.timeScale才发现之前我理解错了一些东西。 Time.timeScale可以控制Update 和LateUpdate 的执行速度,举个例子说明一下。 Time.timeScale=1时,Update、LateUpdate、FixedUpdate 都按正常的时间来执行。 Time.timeScale=2时,Update和 LateUpdate的执行速度是之前的2倍,而FixedUpdate还是按正常时间来执行。 Sorry上面红色这部分确实是写错了,感谢网友在留言处给我的指正,谢谢。 …

2015-11-03 20:54 · Unity

Unity3D研究院之一个有意思的搜索文档的小工具

无意间发现了一个很有意思的小工具,它专门用来搜索Unity的API文档,或者脚本内容。在AssetStore上搜索 Unity Search 第一个免费的那个就是了。或者直接打开如下网址址: https://www.assetstore.unity3d.com/en/#!/content/4113 接着,在Unity引擎中快捷键Command +E (Windows: Ctrl +E) 呼出搜索窗口。如下图所示,这里可以选择 搜脚本 搜手册 搜问答 搜维基 搜论坛。。 然后我随便搜了一个 比如就搜Animation把。 当我点击Search的时候坑爹的一幕出现了。如下图所示,他把我的搜索关键…

2015-11-03 20:28 · Unity

Unity3D异步加载游戏场景

[csharp] view plain copy using UnityEngine; using System.Collections; public class Test : MonoBehaviour { public UISlider slider; AsyncOperation async; bool flag = false; // Use this for initialization void Start() { } // Update is called once per frame void Update() { if (flag) { slider.value = as…

2015-05-14 09:47 · Unity

unity3d实现描边shader

[plain] view plain copy Shader "Custom/OutLine" {Properties { _Color ("Main Color", Color) = (.5,.5,.5,1) _OutlineColor ("Outline Color", Color) = (0,0,0,1) _Outline ("Outline width", Range (0.0, 0.03)) = .005 _MainTex ("Base (RGB)", 2D) = "white" { } } CGINCLUDE #include "UnityCG.cginc" struct app…

2015-05-14 09:47 · Unity

Unity3d 去掉exe版本的边框

[csharp] view plain copy using UnityEngine; using System.Collections; using System.Runtime.InteropServices; using System; public class Test : MonoBehaviour { /// <summary> /// 窗口宽度 /// </summary> public int winWidth; /// <summary> /// 窗口高度 /// </summary> public int winHeight; /// <summary> /// 窗口左上…

2015-05-13 14:38 · Unity

Unity3D一键导出Windows程序

using UnityEngine; using System.Collections; using UnityEditor; using System.Collections.Generic; using System.IO; public class Tools : EditorWindow { [MenuItem("Tools/Build for Windows")] public static void ShowWindow() { EditorWindow.GetWindow(typeof(Tools), true, "导出Windows应用程序"); } static strin…

2015-05-13 14:37 · Unity

NGUI动态创建UILabel

using UnityEngine; using System.Collections; public class Test : MonoBehaviour { public GameObject testBtn; public Font f; // Use this for initialization void Start() { UIEventListener.Get(testBtn).onClick += CreatLabel; } // Update is called once per frame void Update() { } void CreatLabel(GameObj…

2015-05-13 14:32 · Unity

Unity3D平台依赖编译

Platform Dependent Compilation Unity includes a feature named “Platform Dependent Compilation”. This consists of some preprocessor directives that let you partition your scripts to compile and execute a section of code exclusively for one of the supported platforms. Furthermore, you can run this co…

2015-05-13 14:21 · Unity

Android中处理崩溃闪退异常

大家都知道,现在安装Android系统的手机版本和设备千差万别,在模拟器上运行良好的程序安装到某款手机上说不定就出现崩溃的现象,开发者个人不可能购买所有设备逐个调试,所以在程序发布出去之后,如果出现了崩溃现象,开发者应该及时获取在该设备上导致崩溃的信息,这对于下一个版本的bug修复帮助极大,所以今天就来介绍一下如何在程序崩溃的情况下收集相关的设备参数信息和具体的异常信息,并发送这些信息到服务器供开发者分析和调试程序。 我们先建立一个crash项目,项目结构如图: 在MainActivity.java代码中,代码是这样写的: [java] view plain copy package com…

2015-05-13 10:51 · Unity

unity动画插件Hotween的使用

Hotween与itween类似,也是一个插值插件,都是对位移,缩放,旋转,颜色等数值进行插值,各有各的优势。如果做一般常见的动画建议使用Hotween,但是遗憾的是Hotween不支持路径动画,如果支持就完美了。 官方网站: http://www.holoville.com/hotween/index.html 根据Hotween官方网站介绍,hotween是运行快,类型安全和面向对象的unity插件,兼容unity所有的脚本语言,并且在官方网站上有和unity对比的demo( http://www.holoville.com/hotween/testRun.html ),一般情况下两者性…

2015-02-13 11:09 · 网络游戏