public static bool IsEnableTouchLayer(Camera cameraSeeTheLayer, string layer)
{
bool r = false;
string strLayer = "";
Vector3 posMouse = Input.mousePosition;
posMouse.z = 10;
Ray ray = cameraSee……继续阅读 »
sharezer
8年前 (2016-05-06) 2117浏览 0评论
0个赞
public static string timeStampToString(int time)
{
long ltime = (long )time;
DateTime t = new DateTime(time * TimeSpan.TicksPerSecond);
t = t. ToLocalTime();
int year = t.Year + 1969 ;
string syear = "" + year;
int month = t.Month ;
string smonth = month < 10……继续阅读 »
sharezer
8年前 (2016-04-27) 2031浏览 0评论
0个赞
假设有一个怪物类Monster,Monster中包含跑、跳、走、爬等属性。
定义:
static const int a = 1; //跑 1
static const int b = 1 << 1; //跳 10
static const int c = 1 << 2; //走 100
static const int ……继续阅读 »
sharezer
8年前 (2016-04-27) 1930浏览 0评论
0个赞
配置文件:battleRes.json
{
"png": [
"sprite/heroSpecialEffect1.png",
"sprite/heroSpecialEffect2.png",
"sprite/planeLine.png",
"sprite/sky_bg.png",
"sprite/superReward1.png",
"sprite/superReward2.png",
……继续阅读 »
sharezer
8年前 (2016-04-27) 2442浏览 0评论
0个赞
不少公司的网管试图解决双网卡问题,下面我就给大家详细的讲解一下双网卡同时使用的方法,这样即可保障内网的安全,又能解决电脑访问外网的问题,一举两得。希望大家喜欢。
首先你的机器需要有两块网卡,分别接到两台交换机上,
internet地址:192.168.1.8,子网掩码:255.255.255.0,网关:192.168.1.1
内部网地址:172.23.1.8,子网掩码:255.255.255.0,网关:172.23.1.1
如果按正常的设置方法设置每块网卡的ip地址和网关,再cmd下使用route print查……继续阅读 »
sharezer
8年前 (2016-04-27) 2240浏览 0评论
0个赞
public void Update()
{
if (Input.GetMouseButton(0))
{
Vector3 pos = UICamera.currentCamera.ScreenToWorldPoint(Input.mousePosition);
test.transform.position = pos;
}
}
……继续阅读 »
sharezer
8年前 (2016-04-08) 3501浏览 2评论
0个赞
1、在你自己的头文件中加入#include ”extensions/cocos-ext.h”
2、使用命名空间USING_NS_CC_EXT;
3、选中工程右键“属性”->”配置属性“->”c/c++”->”常规”->”附加包含目录”中添加
$(EngineRoot)
$(EngineRoot)cocos
$(EngineRoot)cocos\editor-support
……继续阅读 »
sharezer
8年前 (2016-04-08) 2485浏览 0评论
0个赞
NGUI官网示例–讲解:http://game.ceeger.com/forum/read.php?tid=4172;fpage=2
NGUI官网示例2-interaction-讲解(一)http://game.ceeger.com/forum/read.php?tid=4179
NGUI官网示例2-interaction-讲解(二)http://game.ceeger.com/forum/read.php?tid=4180
NGUI官网示例3–Menu讲解http://game.ceeger.com/forum/read.php?tid=4187
NGUI官方实例—ControlIe……继续阅读 »
sharezer
8年前 (2016-04-08) 11923浏览 2评论
1个赞
AddObjectToAsset 将objectToAdd这个对象添加到指定路径上的现有资源
AssetPathToGUID 返回指定路径path下资源的GUID(全局唯一标识符)
ClearLabels 清除标签
Contains 资源中是否存在该对象
CopyAsset 复制指定路径的资源文件到一个新的路径
CreateAsset 在指定的路径新建资源
Crea……继续阅读 »
sharezer
8年前 (2016-01-06) 3918浏览 0评论
0个赞
转载请注明出处:http://blog.csdn.net/u010019717
属性 (Attribute)
使用 Unity 的C#语言 ,利用属性(Attribute)来类定义和变量定义或区分其他的变量,您可以设置一种特殊行为。
例如,您添加[SerializeField]属性变量,私有变量标识序列化。
这个序列化字段我要多说几句:
很多时候我们写脚本代码时,需要在编辑器的Inspector面板中进行赋值,最不讲究的做法就是把变量的访问权限设置为public,这种做法是严重违反面向对象的封装特性的,如果把字段都设置为public,那么你就去看看为什么有属性,为什么类成员的默认访问权限是pr……继续阅读 »
sharezer
8年前 (2015-12-24) 2240浏览 0评论
0个赞