- 博客(14)
- 资源 (1)
- 收藏
- 关注
原创 学习lua结合unity遇到错误信息的解决方法
require "uiDefine"报错信息:module 'uiDefine' not found:no fieldpackage.preload['uiDefine']no such builtin lib'uiDefine'解决方法: 在require "ui.uiDefine" 在基于lua根目录的下require全路径,例如Assets/Scripts/lua为根目录static public class UnityCommonExtension{stati...
2017-04-28 18:40:44 24923
转载 Lua实现事件派发器
为了降低模块间的耦合, 很多系统使用事件派发机制, 接收方无需知道派发者是谁.在Qt中,这个系统被称作Slot&Signal, 需要配合moc代码生成机制, 但是系统本身是线程安全的.这里我们讨论的是lua的事件派发机制, 我将此写成lua模块, 方便配合cocos2dx进行逻辑处理 local Global = _Glocal package = _G.package
2017-04-27 15:30:59 1280
转载 RSA不对称加密,公钥加密私钥解密,私钥加密公钥解密
RSA算法是第一个能同时用于加密和数字签名的算法,也易于理解和操作。 RSA是被研究得最广泛的公钥算法,从提出到现在已近二十年,经历了各种攻击的考验,逐渐为人们接受,普遍认为是目前最优秀的公钥方案之一。RSA的安全性依赖于大数的因子分解,但并没有从理论上证明破译RSA的难度与大数分解难度等价。.NET提供常用的加密算法类,支持RSA的类是RSACryptoServiceProvider
2017-04-24 14:03:58 926
转载 C#实例复制和深度复制
深度复制与浅表复制的区别在于,浅表复制只复制值类型的值,而对于实例所包含的对象依然指向原有实例。[csharp] view plain copyclass Program { [Serializable] public class Car { pub
2017-04-24 14:00:05 1183
转载 Learn Linq
All LINQ query operations consist of three distinct actions:1. Obtain the data source.2. Create the query.3. Execute the query. // The Three Parts of a LINQ Query: // 1.
2017-04-21 21:20:58 364
转载 unity发射弓箭轨迹的实现
无论是愤怒的小鸟,还是弓箭发射功能,亦或者模拟炮弹受重力影响等抛物线轨迹,都可以使用本文的方法,模拟绝对真实。和往常一样,先说原理。就是抛物运动,在垂直方向上做加速度运动,在水平方向上,做匀速运动。在unity上的具体实现为,使用transform进行位移模拟。至于为何不使用刚体的物理模拟,大家自行脑补或者测试。那么如何使用transform模拟呢?让物体同时在两个方向产生
2017-04-21 11:23:03 1629
转载 Unity炸弹爆炸伤害(群攻伤害)
群攻伤害指在一定范围内同时对多游戏对象按距离衰减计算伤害。Unity对此有相关的接口,可以很方便的实现这个功能。 Collider[] Physics.OverlapSphere ( Vector3 position, float radius,int layerMask ) ; Vector3 position:爆炸目标点 float radius:爆炸半径
2017-04-21 11:11:02 1035
转载 Controlling Object Visibility and Editability in Unity Using HideFlags
Unity game objects and components have an interesting feature called HideFlags. This allows you to control whether a game object or component is visible, editable, persistent, or any combination the
2017-04-19 20:24:34 488
转载 2D Splatter Effects in Unity Using the Stencil Buffer
Shader "Splatter/Surface"{ Properties { [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} _Color ("Tint", Color) = (1,1,1,1) [MaterialToggle] PixelSnap ("
2017-04-19 20:17:08 565
转载 2D sprite outlines
Shader "Sprites/Outline"{ Properties { [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} _Color ("Tint", Color) = (1,1,1,1) [MaterialToggle] PixelSnap ("P
2017-04-19 19:23:03 1078
转载 Cg Programming/Unity
Cg programming in the game engine Unity is considerably easier than Cg programming for an OpenGL or Direct3D application. Import of meshes and images (i.e. textures) is supported by a graphical user i
2017-04-18 09:30:26 889
转载 c# 常用用法整理
public delegate void PrintStr(string s); class Delegate_GetInvocationList { static void Main(string[] args) { MethodInfo mInfo = typeof(Hello).GetMethod("P
2017-04-07 19:50:06 582
转载 lua脚本 打包与读取
一、打包 lua的后缀是不被支持打包进assertbundle的,所以我们一般把 .lua后缀 变为.lua.txt 或者 .lua.bytes 进行打包。 这里我就直接使用了框架的代码 1 [MenuItem("Lua/Build Lua without jit", false, 2)] 2 public static void Bui
2017-04-01 10:45:05 5161
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人