麦子学院讲师,游戏蛮牛专栏作家,CSDN博客专家,热爱游戏开发,热爱Coding!
上一讲中主要介绍了服务器的简单知识,配置服务器和客户端连接. 第二讲介绍客户端请求服务器,服务器响应操作,我们就以一个简单的用户登录为基础介绍吧 一、服务器端 按照上一篇教程我们配置好简单的photon服务器,但是只能用于连接服务器和断开服务器操作,其他的基本没有提到,今天是要在上一讲基础上添加内容.
Photon是个好东西,但是网上的入门教程太少了,特别是中文版的。小弟就自己琢磨吧,下面一系列是对Photon的研究过程,如有哪个地方写的有误,望请前辈指教。
Unity3D中所有控制脚本的基类MonoBehaviour有一些虚函数用于绘制中事件的回调,也可以直接理解为事件函数,例如大家都很清楚的Start,Update等函数,以下做个总结。
1. 传入某个属性的set方法的隐含参数的名称是什么? value,它的类型和属性所声名的类型相同。 2. 如何在C#中实现继承? 在类名后加上一个冒号,再加上基类的名称。
strong关键字与retain关似,用了它,引用计数自动+1,用实例更能说明一切 @property (nonatomic, strong) NSString *string1; @property (nonatomic, s...
我们主要使用3dsmax2010进行制作,输出FBX的类型导入Unity3D中。默认情况下,3dsmax8可以和U3D软件直接融合,自动转换为FBX物体。
在XCode4.5以上,写了@property之后,系统会自动生成私有_字段和实现@synthesize方法 但如果自己写了set或者get方法之后,就不会帮你产生默认的下划线字段 Student.
最近看了些关于objective-c的正式协议和非正式协议的内容,发现还是有些混乱,可能是因为还不熟悉OC,对正式协议和非正式协议的使用还不是很熟练,所以想整理一下 非正式协议,是使用类别category来实现,非正式协议是NSObject的一个类别,这样任何类的对象都可以作为委托对象来使用,它可以列出对象能够执行的所有方法,这样用来实现委托, 我们可以使用选择器来判断该非正式协议中是否有这个方法。
1:天空盒有接缝怎么解决?答:在贴图导入设置里设置Wrap Mode为"Clamp".2:DDS格式怎么不显示?答:Unity不支持DDS格式,Unity会将除DDS外的其他格式图片具有为DDS同样的优化.
Button.h: #import @class Button; typedef void (^ButtonBlock) (Button *); @interface Button : NSObject @property(nonatomic,as...
Student.h: #import @interface Student : NSObject @property(nonatomic) int no; -(void)TestStudent; @end Student.
#import void test(){ //定义一种结构体 struct Date{ int Year; int Month; int Day; }; struct Date d={2013,5,4}; d.
Student.h: #import @interface Student : NSObject +(id)student; -(void)test; @end Student.
Student.h: #import @interface Student : NSObject @property(nonatomic,assign) int age; +(id)studentWithAge:(int)age; @end Student.
#import #pragma mark - 创建可变字符串 void stringCreate(){ NSMutableString *str=[[NSMutableString alloc] initWithCapacity:10];//预分配...
#import int main(int argc, const char * argv[]) { @autoreleasepool { //NSNull是单例的,创建很多变量其实它只指向一个对象 NSNull *...
#import void number(){ NSNumber *numberint=[NSNumber numberWithInt:10]; NSNumber *numberchar=[NSNumber numberWithChar:'a...
Person.h: #import @interface Person : NSObject @property(nonatomic,retain) NSString * name; -(void) test; @end Person.
#import void stringCreate(){ //C语言中的字符串 //char * s="hello"; NSString *str=@"this is a NSString"; NSLog(@"%@\n",s...
Student.h: #import @interface Student : NSObject{ // @public // @private // @protected //y一般默认的情况是@pr...
Student.h: #import @interface Student : NSObject @property(nonatomic,unsigned)int age; +(id)student; +(id)initWithAge:(int)age; @end Student.
Car.h: #import @interface Card : NSObject @end Car.m: #import "Card.h" @implementation Card -(void)dealloc{ NSLog(@"Card被销毁"); [super dealloc]; } @end Book.
Book.h: #import @interface Book : NSObject @property float price; -(id)initeWithPrice:(float)price; @end Book.
Student.h: #import @interface Student : NSObject @property int age; //默认会生成一个_age属性 @end Student.
Student.h: #import @protocol Study,Learn; @interface Student : NSObject @end Student.
要求:用协议模拟实现按钮的点击事件 Button.h #import @class Button; //表示实现了某个协议 @protocol ButtonDelegate -(void)onClick:(Button *)btn; @end ...
SocketServer: #include #include #include #include #include #include #include #include #include #define SERVPORT 3333 ...
利用微软自带的TTS,能够做到一个简单的语音朗读功能 using System.Speech.Synthesis; //用于语音朗读 using System.
要求:展览中心有2条入场通道,在入场处需要登记入场人员的姓名,年龄以及电话。展览中心最多只能容纳100人。当展览中心满员时应当立即通知门卫不再允许人员入场。当有人员出场时才会允许人员入场,但同时在展览中心的人员不会超过100人。
Student.h: #import @interface Student : NSObject @property(nonatomic,retain) NSString * name; @property(nonatomic,assign) int age; @end Student.
//获取网页html NSURL* url = [NSURL URLWithString:@"http://www.baidu.com"]; NSMutableURLRequest* request = [NSMutableUR...
第一个简单的IOS程序是实现了一个QQ登陆界面 main: 1 #import 2 3 #import "DXWAppDelegate.
1 iphone开发笔记 2 3 退回输入键盘 4 - (BOOL) textFieldShouldReturn:(id)textField{ 5 [textField resignFirstRespo...
1 // 2 // main.m 3 // cope-MultableCopy 4 // 5 // Created by dingxiaowei on 13-5-19.
1 // 2 // main.m 3 // NSDate 4 // 5 // Created by dingxiaowei on 13-5-17.
如何将非OC对象封装成OC对象,塞给数组等 1 // 2 // main.m 3 // NSValue 4 // 5 // Created by dingxiaowei on 13-5-17.
1 // 2 // main.m 3 // NSMutableDictionary 4 // 5 // Created by dingxiaowei on 13-5-16.
1 // 2 // main.m 3 // NSDictionary 4 // 5 // Created by dingxiaowei on 13-5-15.
main函数: 1 // 2 // main.m 3 // NSArray排序 4 // 5 // Created by dingxiaowei on 13-5-13.
alloc new retain之后都必须要调用release方法 计数器要变只有这几种方法 retain release alloc new copy方法才会使计数器改变,谁想用人家对象,就对他进行retain操作,但在dealloc释放本对象的时候...
static string sqlcon = "server=.;database=;Integrated Security=true;"; /// /// 新增数据 /// public ...
#include using namespace std; class A { public: A()//构造函数不能申明为虚函数,不然会报错 { cout
成员函数的重载,覆盖(改写)和隐藏 成员函数被重载的特征是: 1、具有相同的作用域,即在同一个类申明中。 2、返回值相同,函数的参数不同。 3、同名const方法和非const方法之间的重载不受到2的约束,同类重载受到2的约束。
SocketServer: #include #include #include #include #include #include #include #include #include #define SERVPORT 3333 ...
Person.h: #import #import @interface Cup : NSObject{ int level; //成员变量-睡的深度值}-(int)level; //获取水的深度-(void)setLevel:(i...
Edit 编辑 frameselected 选取线框 select all选取所有 specialcharacters 角色专题 loadselection 加载选择 saveselection 保存选择 projectsettings 项目设置 ...
由于项目需要,要求用unity来展示三维场景,并在三维中能够方便的查询数据库等。一开始尝试在unity中直接连接数据库,当时连的xml,然而每次发布成网页后都会出现路径找不到等问题,所以迫不得已采用了unity向网页传送数据,网页中处理数据(查询数据库),然后将处理过的数据再反传送给unity,最终在unity中将其展示(在网页中展示更为灵活)。
unity3DGUI设计中文教程:http://url.cn/FxePDU unity3D机器人之战游戏中文教程:http://url.cn/FTMBJY unity3D切水果游戏中文教程:http://url.
如何实现游戏对象跟随鼠标方向移动。 效果:当点击鼠标左键时,游戏对象会朝鼠标点击的方向移动(类似魔兽争霸)。 思路:把鼠标的坐标转化成世界坐标(鼠标默认是屏幕坐标),然后当点击鼠标时,物体将朝着鼠标的世界坐标方向移动。
Unity3D入门:一 *添加天空盒子: 添加天空盒 有两种方式 1 : 在当前相机上添加skybox 2 : 在当前场景上添加skybox 上面的两种方式的结果是一样的 第一种方式的优势在于 如果 世界中有多个摄像机的话,...