kingBook

导航

上一页 1 ··· 7 8 9 10 11 12 13 下一页

2017年3月2日 #

unity 设置屏幕旋转

摘要: 只允许竖屏: Portrait √ Portrait Upside Down √ Landscape Right × Landscape Left × 只允许横屏: Portrait × Portrait Upside Down × Landscape Right √ Landscape Left 阅读全文

posted @ 2017-03-02 12:53 kingBook 阅读(2943) 评论(1) 推荐(1) 编辑

2017年3月1日 #

unity 加载读取外部XML

摘要: cfg.xml 阅读全文

posted @ 2017-03-01 10:21 kingBook 阅读(512) 评论(0) 推荐(0) 编辑

unity WWW加载进度条

摘要: using UnityEngine; using System.Collections;public class testProgress : MonoBehaviour { void Start () { StartCoroutine (getWWW()); } IEnumerator getWWW(){ WWW www = new WWW... 阅读全文

posted @ 2017-03-01 10:13 kingBook 阅读(861) 评论(0) 推荐(0) 编辑

2017年2月8日 #

直线方程

摘要: 1:一般式:Ax+By+C=0(A、B不同时为0)【适用于所有直线】 , A1/A2=B1/B2≠C1/C2←→两直线平行 A1/A2=B1/B2=C1/C2←→两直线重合 横截距a=-C/A 纵截距b=-C/B 2:点斜式:y-y0=k(x-x0) 【适用于不垂直于x轴的直线】 表示斜率为k,且过 阅读全文

posted @ 2017-02-08 16:04 kingBook 阅读(520) 评论(0) 推荐(0) 编辑

点斜式

摘要: 已知直线上一点(x1,y1,)并且存在直线的斜率k,则直线可表示y-y1=k(x-x1) x截距计算公式,当y等于0时: 0-y1=k(x-x1) -y1=k*x-k*x1 k*x=k*x1-y1 x=(k*x1-y1)/k x=x1-k*y1 y截距计算公式,当x等于0时: y-y1=k(0-x1 阅读全文

posted @ 2017-02-08 15:56 kingBook 阅读(751) 评论(0) 推荐(0) 编辑

斜截式

摘要: 直线的斜截式方程:y=kx+b k是直线的斜率,b是直线在y轴上的截距 该方程叫做直线的斜截式方程,简称斜截式 已知直线在y轴上的截距为b,斜率K,可以确定该直线的方程. 即为 y = k x + b 阅读全文

posted @ 2017-02-08 14:51 kingBook 阅读(1242) 评论(0) 推荐(0) 编辑

斜率

摘要: 由一条直线与X轴正方向所成角的正切。 阅读全文

posted @ 2017-02-08 14:45 kingBook 阅读(147) 评论(0) 推荐(0) 编辑

求线段的交点

摘要: var p1: Point = new Point(0, 0); var p2: Point = new Point(50, 50); var p3: Point = new Point(0, 50); var p4: Point = new Point(50, 0); var p: Point = new Point; if (p1.x == p2.x) { if (p3.x == ... 阅读全文

posted @ 2017-02-08 14:23 kingBook 阅读(268) 评论(0) 推荐(0) 编辑

2017年2月5日 #

不影响Inspector布局拓展类

摘要: DecoratorEditor.cs 阅读全文

posted @ 2017-02-05 14:39 kingBook 阅读(269) 评论(0) 推荐(0) 编辑

2017年1月20日 #

EditorGUILayout,GUILayout

摘要: RequireComponent的使用: 当你添加的一个用了RequireComponent组件的脚本,需要的组件将会自动被添加到game object(游戏物体)。这个可以有效的避免组装错误。举个例子一个脚本可能需要刚体总是被添加在相同的game object(游戏物体)上。用RequireCom 阅读全文

posted @ 2017-01-20 10:24 kingBook 阅读(438) 评论(0) 推荐(0) 编辑

2017年1月19日 #

Inspector视图中的get/set使用

摘要: using UnityEngine; using System.Collections; public class Test : MonoBehaviour { public int width { get { Debug.Log("get"); return _width; } ... 阅读全文

posted @ 2017-01-19 23:01 kingBook 阅读(229) 评论(0) 推荐(0) 编辑

使用flash导出图集动画到unity

摘要: 1.选中要导出的元件,元件所有动作要对齐,右键导出Sprite Sheet.. 2.设置如下 3.复制导出的png图片到unity,对图片进行网格裁剪,网格宽高在plist文件中: 阅读全文

posted @ 2017-01-19 16:38 kingBook 阅读(1015) 评论(0) 推荐(0) 编辑

2017年1月18日 #

& 运算

摘要: var f:uint; var e:uint; f=uint.MAX_VALUE; e=1 (f&e)!=e trace(f,e,uint(f&e));//output:4294967295 2147483648 2147483648 -----> (f&e)==e f=uint.MAX_VALUE; e=1 (f&e)==e 阅读全文

posted @ 2017-01-18 17:45 kingBook 阅读(173) 评论(0) 推荐(0) 编辑

2016年12月22日 #

box2d 易错

摘要: 1.动态刚体与一个与静态刚体重叠的小的感应刚体在contactBegin时,有些时候无法侦测到 2.bodyA.GetContactList()应用非动态刚体,会找不到另一非动态刚体的接触,非动态刚体重叠不会产生b2Contact 3.world.QueryShape(callback,shape) 阅读全文

posted @ 2016-12-22 11:59 kingBook 阅读(156) 评论(0) 推荐(0) 编辑

2016年12月20日 #

360度角转AS3角度

摘要: var ang:Number=400; ang=ang%360; //as3角指0~180,0~-180的角 //1. 360度角转as3角 if(ang>180)ang-=360; else if(ang<180)ang+=360; //2. as3角转360度角 if(ang<0)ang+=360; 阅读全文

posted @ 2016-12-20 14:21 kingBook 阅读(513) 评论(0) 推荐(0) 编辑

2016年12月14日 #

unity 组件开发

摘要: //在unit菜单加入Component->b2Components->b2BodyComponent [AddComponentMenu("b2Components/b2BodyComponent")] public class b2BodyComponent : MonoBehaviour { } 阅读全文

posted @ 2016-12-14 14:01 kingBook 阅读(288) 评论(0) 推荐(0) 编辑

2016年12月9日 #

box2d 计算下一帧的位置/角度

摘要: b2Island中的实现: 角度: LinearVelocity与像素的关系: 阅读全文

posted @ 2016-12-09 16:00 kingBook 阅读(832) 评论(0) 推荐(0) 编辑

2016年12月8日 #

绳子算法

摘要: package app{ import flash.display.Shape; import flash.geom.Point; import framework.Game; import framework.objs.GameObject; public class ThrowSceneRope extends GameObject... 阅读全文

posted @ 2016-12-08 09:21 kingBook 阅读(1163) 评论(0) 推荐(0) 编辑

2016年12月5日 #

c++ 定义宏常量

摘要: #ifndef __GAME_DATA_H__ #define __GAME_DATA_H__ #ifndef GAME_IS_CREATE_SHOP #define GAME_IS_CREATE_SHOP 1 #endif#endif //使用方法 #include "GameData.h" #if GAME_IS_CREATE_SHOP //你的代码 #endif 阅读全文

posted @ 2016-12-05 15:19 kingBook 阅读(715) 评论(0) 推荐(0) 编辑

2016年11月26日 #

cocos2d-3.x 创建动画

摘要: 1.多文件帧序列动画 TrademarkAnimation.h TrademarkAnimation.cpp 2.plist文件创建动画 阅读全文

posted @ 2016-11-26 16:38 kingBook 阅读(418) 评论(0) 推荐(0) 编辑

2016年10月28日 #

Unity3d中Dictionary和KeyValuePair的使用

摘要: using UnityEngine; using System.Collections; using System.Collections.Generic;public class test : MonoBehaviour { void Start () { Dictionary dict = new Dictionary (); dict.Add (0... 阅读全文

posted @ 2016-10-28 16:12 kingBook 阅读(1433) 评论(0) 推荐(0) 编辑

2016年10月21日 #

绳关节(b2RopeJoint)

摘要: 源码下载:http://pan.baidu.com/s/1jIjpjIu 阅读全文

posted @ 2016-10-21 15:40 kingBook 阅读(955) 评论(0) 推荐(0) 编辑

2016年10月19日 #

公式推导 圆面积公式 圆周长公式

摘要: 圆面积公式把圆平均分成若干份,可以拼成一个近似的长方形。长方形的宽就等于圆的半径(r),长方形的长就是圆周长(C)的一半。长方形的面积是ab,那圆的面积就是:圆的半径(r)乘以二分之一周长C,S=r*C/2=r*πr。圆周长公式圆周长(C):圆的直径(d),那圆的周长(C)除以圆的直径(d)等于π, 阅读全文

posted @ 2016-10-19 22:58 kingBook 阅读(11620) 评论(0) 推荐(0) 编辑

2016年10月17日 #

C# 读取二进制文件

摘要: using UnityEngine; using System.Collections; using System; using System.IO; public class Test : MonoBehaviour { void Start () { TextAsset binData=Resources.Load ("wp");//Resources文件夹... 阅读全文

posted @ 2016-10-17 16:43 kingBook 阅读(681) 评论(0) 推荐(0) 编辑

C#用Zlib压缩或解压缩字节数组

摘要: zlib.NET库下载:http://www.componentace.com/zlib_.NET.htm 阅读全文

posted @ 2016-10-17 16:32 kingBook 阅读(3449) 评论(0) 推荐(0) 编辑

2016年10月5日 #

Tiled2Unity

摘要: 官方:http://www.seanba.com/tiled2unity 文档:http://www.seanba.com/introtiled2unity.html 1.导入Tiled2Unity.unitypackage。 方法一:打开安装目录下Tiled2Unity.exe,需要安装4.5.2 阅读全文

posted @ 2016-10-05 12:54 kingBook 阅读(1960) 评论(0) 推荐(0) 编辑

Access to the path "Library\UnityAssemblies\UnityEngine.xml" is denied.

摘要: 这个问题基本上是重新打开UnityEditor,导入工程的时候VisualStudio还开着导致的。 解决方法是关掉Visual Studio,再重新打开。 阅读全文

posted @ 2016-10-05 01:19 kingBook 阅读(172) 评论(0) 推荐(0) 编辑

2016年10月4日 #

C# 获取字符的Unicode编码

摘要: using UnityEngine;using System.Collections;using System.Collections.Generic; 阅读全文

posted @ 2016-10-04 21:52 kingBook 阅读(3497) 评论(0) 推荐(0) 编辑

2016年8月5日 #

unity Mesh(网格)的使用

摘要: 创建两个三角形合成的矩形网格: 阅读全文

posted @ 2016-08-05 14:47 kingBook 阅读(1029) 评论(0) 推荐(0) 编辑

2016年6月24日 #

cocos2d-x 获得系统语言繁体

摘要: IosLocalUtil.h IosLocalUtil.mm 阅读全文

posted @ 2016-06-24 10:58 kingBook 阅读(1037) 评论(0) 推荐(0) 编辑

2016年6月16日 #

状态机

摘要: package framework.fsm{ public class Fsm{ protected var _curState:State; protected var _callbackChangeState:Function; /** * 状态机 * @param def... 阅读全文

posted @ 2016-06-16 09:43 kingBook 阅读(212) 评论(0) 推荐(0) 编辑

2016年6月8日 #

cocos2d-x 混合模式

摘要: 在OpenGL(ES),使用glBlendFunc函数实现实现混合模式,cocos2d-x中可以使用BlendFunc。 什么是颜色混合?简单来说就是将RGBA中的A,经行操作处理。具体一点,就是把某一像素位置原来的颜色和将要画上去的颜色,通过某种方式混在一起,从而实现特殊的效果。 OpenGL 会 阅读全文

posted @ 2016-06-08 17:19 kingBook 阅读(1343) 评论(0) 推荐(0) 编辑

cocos2d-x 3.x 橡皮擦功能

摘要: 1.HelloWorldScene.h 2.HelloWorldScene.cpp 的init方法中 3.触摸移动回调函数 阅读全文

posted @ 2016-06-08 16:56 kingBook 阅读(643) 评论(0) 推荐(0) 编辑

cocos2d-x 3.x 触摸事件

摘要: HelloWorldScene.h HelloWorldScene.cpp 阅读全文

posted @ 2016-06-08 11:53 kingBook 阅读(1553) 评论(0) 推荐(0) 编辑

2016年6月6日 #

cocos2d-x 3.x随机数

摘要: 1.使用标准库std::rand()函数 2.使用cocos2d::random()函数 阅读全文

posted @ 2016-06-06 17:26 kingBook 阅读(379) 评论(0) 推荐(0) 编辑

2016年5月26日 #

cocos2d-x 3.3 显示中文

摘要: Resources文件夹下的strings.xml: 保存为UTF-8编码格式。 c++代码: 关于ttf字体的精简看文章http://www.cnblogs.com/kingBook/p/5512784.html 阅读全文

posted @ 2016-05-26 15:33 kingBook 阅读(311) 评论(0) 推荐(0) 编辑

std::function 测试

摘要: //输出:105 阅读全文

posted @ 2016-05-26 10:45 kingBook 阅读(330) 评论(0) 推荐(0) 编辑

cocos2d-x 那些常犯的错误

摘要: Label::_label; if(_label==NULL){ //初始化_label的代码 } //指针默认值不等于NULL,需要赋初始值Label::_label=NULL; string str="name is lao wang"; cocos2d::log(str);//这是错误的 cocos2d::log("%s",str);//这是错误的 cocos2d::log(str.... 阅读全文

posted @ 2016-05-26 10:27 kingBook 阅读(149) 评论(0) 推荐(0) 编辑

2016年5月24日 #

编译Android各种错误

摘要: 第一次编译成功,第二次出现Value for 'keystore' is not valid. It must resolve to a single path 打开proj.android\ant.properties文件,把key.store=D:\Personal\Desktop\aa.key 阅读全文

posted @ 2016-05-24 14:31 kingBook 阅读(158) 评论(0) 推荐(0) 编辑

2016年5月22日 #

cocos2d-x3.x Vector

摘要: 输出: 阅读全文

posted @ 2016-05-22 16:41 kingBook 阅读(310) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 下一页