UNITY3

以下是为您整理出来关于【UNITY3】合集内容,如果觉得还不错,请帮忙转发推荐。

【UNITY3】技术教程文章

Unity3d《Shader篇》绘制圆角图片【代码】【图】

Pass{CGPROGRAM // Upgrade NOTE: excluded shader from OpenGL ES 2.0 because it does not contain a surface program or both vertex and fragment programs.#pragma exclude_renderers gles#pragma fragment frag#include "UnityCG.cginc"sampler2D _MainTex;float4 _MainColor;float _RoundRadius;struct texCoord{float2 inputTexCoord : TEXCOORD0;};float4 frag(texCoord input) : COLOR{float x = input.inputTexCoord.x;...

LZMA C# SDK 子线程压缩与解压缩 Unity3d实例

参考雨松的LZMA SDK使用方法:http://www.xuanyusong.com/archives/3095转自http://blog.csdn.net/huutu http://www.thisisgame.com.cn计划在项目中使用 不压缩的Assetbundle ,所以需要对Assetbundle 进行手动压缩打包,因为之前有对 十万个冷笑话的打包分析,所以这次坚定选择 LZMA压缩算法来压缩Assetbundle。转自http://blog.csdn.net/huutu http://www.thisisgame.com.cnNote:因为暂时不知道LZMA如何压缩与解压文件夹,所以目...

Unity3D热更新全书-脚本(三) C#LightEvil语法与调试【图】

调试,这是一个无法规避的问题C#Light 由于有 词法解释、语法解释、运行时三种情况所以和C#也是有类似的问题 出错大致可以分为编译错误和运行时错误拼写出莫名的东西或者语法不正确,会在编译阶段报错,这种错误很好检查,因为C#Light语法是C#的严格子集,所有的C#Light脚本都可以用C#的标准做语法检查这也是C#Light基本上是用VisualStudio做编辑器的原因所在,直接作为C#代码编译,可以排除大部分的语法问题。然后剩下的一些作为C...

unity3d mvvm c#【代码】

using UnityEngine; using System.Collections;publicinterface IState {void BeforEnter();void BeforLeave(); }publicinterface ISceneState: IState {}publicclass GenFSM {IState _state;public GenFSM(IState state){this._state = state;this._state.BeforEnter();}publicvoid ChangeState(IState state){this._state.BeforLeave();this._state = state;this._state.BeforEnter();} }namespace Scene {publicclass Login: I...

unity3d实现广告滑动效果【代码】【图】

新建了一个带mask的prefab,加上代码只需要将图片prefab、按钮prefab和所想添加的图片拖进去会自动生成按钮,滑动速度可以随意调time,滑动效果用itween实现的,所以需要加上itween插件效果如下:(图片是我最爱的马路小天使(ˉ﹃ˉ))附上代码 1using UnityEngine;2using System.Collections.Generic;3using UnityEngine.UI;4 5publicclass Mask : MonoBehaviour {6 7public List<Sprite> sprite = new List<Sprite>();8 Li...

Unity3D - 动作动画忽略timeScale【代码】

近期在调战斗时的动画与特效。Unity3D对加/减速提供了Time.timeScale支持。可是,timeScale提供的是全局的时间缩放,而我们有些动作或动画是不希望被timeScale加减速的。比方,《刀塔传奇》中播放大招时。除了大招特效,全部别的动作/动画都暂停。以下各自是Animation、Animator和粒子特效的ignoreTimeScale方法。AnimationTime.realtimeSinceStartup记录是不受timeScale影响的真实时间,利用它来在每一帧採样播放Animation。代码片...

【Unity3D】【NGUI】Atlas的动态创建

NGUI讨论群:333417608 NGUI版本:3.6.5 1、参见SZUIAtlasMakerRuntimeTest设置相应的值以上值需要提前设置好 2、没有检查是否atlas能够正确创建,自己可以改,加入返回值 3、代码都是在NGUI里面拷贝出来的,只是进行改动,没有新代码 4、适用与那种从网上下图片,之后还不想用UITexture的人,但是还是建议用UITexture如果drawcall不是问题的话 5、自己以后更新按我的方式改改就可以 6、动态创建速度较慢,建议在游戏启动的时候运行...

Unity3d 编辑器中 Shader 属性导出【代码】

本例用于导出TerrainForMobile/3TexturesDiffuseSimple 的shader的贴图和缩放导出protected const string SHADER_FILTER = "TerrainForMobile/3TextureDiffuseSimple";public void parse(GameObject go) {//判空就不写了Renderer renderer = go.renderer;Material mat = renderer.sharedMaterial;Shader shader = mat.shader;int count = ShaderUtil.GetPropertyCount(shader);for ( int index = 0; index < count; ++index ){Shad...

Unity3d Shader

Unity3d Shader 预览Surface Shader主要用来实现光照相关处理,可能更简洁。 Vertex and Fragment Shader 如果不与光照交互, 则可以用这个shader,更录活 fixed function shaders 固定shader主要用于老旧卡 ShaderLab 不管写哪种shader,最终通过shaderLab实现,其组织结构如下: Shader "MyShader" { Properties{ _MyTexture ("My Texture",2D) = "white" {} // other properties like colors or vectors go he...

Unity3d Gis 坐标转换

近期在做unity3d与Gis结合的项目,最主要的就是坐标的转换问题。比方把经纬度为(166.23.9.27 。 39.55.15.74) 转换到unity里面成相应的位置点。废话不多说 上代码:using UnityEngine; using System.Collections;public class SaiGetLatLog : MonoBehaviour {public Transform firstPoint; //Unity中左上点public Transform secondPoint;//Unity中右下点public SaiEarth firstSai;//地图中相应的左上经纬度点public SaiEarth sec...

UNITY3 - 相关标签