- 博客(43)
- 资源 (5)
- 收藏
- 关注
原创 02 Scene
场景概述在Unity中,一个场景包含了一个Scene,许多的GameObject,GameObject中又包含了Transfrom、Render、Material、MonoBehavior等组件。因此我将用类Scene、GameObject、和Component来模拟Unity中的模式来存储游戏中所有的数据。实现场景文件场景数据将会使用JSON格式保存在.scene文件中.一个场景将会包含场景的通用数据(暂时有天空盒),子节点.子节点数据.有name, Components,Children等,
2021-03-16 17:33:42
197
原创 01 Start My Engine
开始我的游戏引擎概述 在我的计划中,我将实现一个3D渲染的游戏引擎,并用我的游戏引擎创建一个简单的游戏。 他将会实现一个简单的文件管理,场景管理,场景渲染等方面。 场景管理参照Unity的基于组件的设计理念。 场景渲染将会实现前向渲染和延迟渲染。工程目录||-framework|------Common //通用的接口|------File|------Logger //日志目录|------Math //数
2021-03-08 23:58:20
317
原创 [vscode] 给lua增加#region功能
[vscode] 给python和lua增加#region功能参考[[vscode] 给python和lua增加#region功能](https://blog.csdn.net/gneveek/article/details/80090055)在参考基础上修改 "folding": { "offSide": true, "markers": { "start": "^\\s*\\-\\-\\s*region\\b", "end": "^\\s*\\-\\-\\s*endregi
2020-11-09 17:51:54
1689
1
原创 cocos扫描lua文件中中文工具
扫描中文工具将lua代码中的中文字符导出到Excel中.Excel表中ID和String,Count使用修改root,指定自己需要的目录,如root = “c:/”python版本:2.7强烈推荐 regexr,能看到正则表达式的错误代码#将lua代码中的中文字符导出到Excel中.Excel表中ID和String,Count# -*- coding:utf-8-*-# 处理中文字符的情况将import codecsimport reimport osimport sysim
2020-11-07 17:35:00
148
原创 cocos实现长按,双击,点击
cocos实现长按,双击,点击local Test = class("Test")local kDoubleTime = 1function Test:ctor( ) self._longPressEnabled = true self._doubleEvent = trueendfunction Test:_addTouchEventListener(object...
2019-09-30 14:26:40
512
原创 cocos 实现富文本
cocos 实现富文本例子:local str = string.format( "每次兑换扣除%s点活力,获得%s经验。", string.format( "<font size='20' fontPath='fonts/font.ttf'>%s</font>", 1), string.format( "<font color='#%s' ty...
2019-09-18 13:54:47
1926
原创 C++ 服务端开发 libuv学习
C++ 服务端开发 libuv学习入门libuv 的使用参照征服优雅、高效的Libuv库最简单的服务端(官方demo)#include "Test/ProtocolTest.h"#include <uv.h>#define DEFAULT_PORT 19999void on_new_connection(uv_stream_t* server, int status)...
2019-05-09 23:21:21
1063
原创 Intel SPMD Program Compiler在VS2017中的使用
Intel SPMD Program Compiler在VS2017中的使用本文不讲Intel SPMD Program Compiler的语法,只讨论ispc如何在vs中编译。注意事项:vs工程不能有中文路径,否则.ispc无法编译准备工作:1.下载 ispc:在Intel SPMD Program Compiler下载最新版ispc。我们只需要关注ispc。exe和ispc.h...
2018-08-22 20:55:02
1193
原创 cocos 3D坐标变换
cocos 3D坐标变换-- 世界空间-&gt;摄像机空间-&gt;屏幕点-- @param pos 世界坐标-- @param camera 摄像机-- @return 屏幕坐标function ToolUtils.CameraPos2screenPos(pos,camera) local screenSize=cc.Director:getInstance():get...
2018-08-20 16:59:15
2030
原创 cocos3D的多光源照射问题
cocos3D的多光源照射问题在我的场景中有许多的光源,现在一个物体需要指定这些光源中特定的几个光源影响。在cocos中,目前我知道的有三种照射方式:1.单光源:这种方式是物体只受一个光源的影响。忽略其他光源的影响。 2.多光源:这种方式是物体受所有光源的影响。 3.特定光源:这种方式是物体只受特定光源的影响。1.单光源 单光源只需要在cocos studio设置光源...
2018-08-14 18:23:46
1047
原创 动画
动画顺序动画和融合动画融合动画:cc.Spawn:create()顺序动画:cc.Sequence:create()local bazier=cc.MoveTolocal sequence=cc.Sequence:create(cc.Spawn:create(bazier,rotate),cc.CallFunc:create(callFunc),nil)动画...
2018-08-14 14:07:34
392
原创 热更新流程
热更新流程热更新一般需要包含以下东西:1.URL1:游戏版本配置文件地址2.URL2:所有资源的MD5配置文件地址graph TB 启动游戏--&amp;gt;|准备|热更新; 热更新--&amp;gt;|拉取游戏版本文件|验证游戏版本; 验证游戏版本--&amp;gt;|本地服务器版本&amp;lt;服务器拉取的版本|进行热更新阶段; 验证游戏版本--&amp;gt;|本地游戏版本&
2018-06-29 16:45:13
3360
1
原创 3D麻将协议流程图
3D麻将流程图打牌流程graph TB 开始游戏--&amp;gt;|准备|准备中; 准备中--&amp;gt;|服务器下发出现牌墙协议/onMsgWallMah|牌墙动画; 牌墙动画--&amp;gt;|服务器下发掷骰子/onMsgThrowChip|掷骰子动画; 掷骰子动画--&amp;gt;|服务器下发发牌数据onMsgPlayerMah,该每一个数据包含13张初始牌_如果是庄则多一张牌|发...
2018-06-28 16:16:39
1072
原创 cocos 动画
动画顺序动画和融合动画local sequence=cc.Sequence:create(cc.Spawn:create(bazier,rotate),cc.CallFunc:create(callFunc),nil)动画1.贝塞尔曲线--获得一个贝塞尔曲线的Action--@param posFrom 运动起点--@param posTo 运动结束点...
2018-06-15 18:05:15
277
原创 Lua环境配置及Sublime配置
Lua 使用SubLime编译制作编译器1.下载lua源代码2.进入src文件,新建文件vslua.bat并用text打开3.复制并黏贴以下代码copy lua.c lua.1copy luac.c lua.2del lua.c luac.ccd ../md bincd ./srccl -c -nologo -W3 -O2 -Ob1 -Oi -Gs -MD *.clink -lib -o
2018-01-02 21:19:22
603
原创 cocos2D的屏幕适配方案1
cocos2D的屏幕适配版本cocos2dx3.3官方的屏幕适配方案有以下四种,但做的不符合人心意, _scaleX = (float)_screenSize.width / _designResolutionSize.width; _scaleY = (float)_screenSize.height / _designResolutionSize.height;
2017-12-15 17:52:59
384
原创 RangeAdditionII、ConstructtheRectangle、ExcelSheetColumnNumber
RangeAdditionII、ConstructtheRectangle、ExcelSheetColumnNumberExcelSheetColumnNumberRelated to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding
2017-12-10 14:46:28
217
原创 283MoveZeroes
283. Move ZeroesGiven an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after ca
2017-12-02 15:22:42
144
原创 448FindAllNumbersDisappearedInAnArray
448. Find All Numbers Disappeared in an ArrayGiven an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1, n] inclusi
2017-12-01 18:48:13
137
原创 520DetectCapital
Given a word, you need to judge whether the usage of capitals in it is right or not.We define the usage of capitals in a word to be right when one of the following cases holds:All letters in this word
2017-11-29 14:54:22
161
原创 226.InvertABinaryTree
226. Invert Binary TreeInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1/** * Definition for a binary tree node. * struct TreeN
2017-11-24 17:43:54
126
原创 485. Max Consecutive Ones
485. Max Consecutive OnesGiven a binary array, find the maximum number of consecutive 1s in this array.Example 1:Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digits
2017-11-23 15:41:13
162
原创 693. Binary Number with Alternating Bits
693. Binary Number with Alternating BitsGiven a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values.Example 1: Input: 5 Output: Tru
2017-11-23 15:14:20
137
原创 136. Single Number
136. Single Number题目Given an array of integers, every element appears twice except for one. Find that single one.Note: Your algorithm should have a linear runtime complexity. Could you implement it wi
2017-11-22 21:05:23
125
原创 637Submission Details
637Submission Details思路代码vector<double> push(list <TreeNode> &open, vector<double> &averages) { if (!open.size()) return averages; double sum = 0; int amout = 0;
2017-11-22 20:02:22
231
原创 496.Next Greater Element I
Next Greater Element IYou are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1’s elements in the correspondi
2017-11-21 19:16:47
179
原创 Reshape the Matrix
#代码想法一:在二维数组中,他的地址是有序、处于同一个内存空间的,{{1,2},{3,4}},在地址中表示相当与{1,2,3,4}。原想以这种方式来解决vector的重塑矩阵问题。但是在vector中,每一个新的vector都会动态的分配一个空间,所以前一个vector和后一个vector不可能会在一个内存空间中。想法1宣告失败。只能将vector中的值赋予数组中,再进行操作。 //基
2017-11-12 15:07:21
174
原创 Submission Details
Submission Details第5天 第11题题目You're now a baseball game point recorder.Given a list of strings, each string can be one of the 4 following types:1.Integer (one round's score): Directly represents the nu
2017-11-08 20:13:28
187
原创 DistributeCandies
Distribute Candies第5天 第10题Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You
2017-11-08 12:32:08
225
2
原创 KeyboardRow
Keyboard Row第四天第7题题目Given a List of words, return the words that can be typed using letters of alphabet on only one row’s of American keyboard like the image below. Example 1:Input: [“Hello”, “Alaska”
2017-11-07 20:14:34
142
原创 MergeTwoBinaryTrees
Merge Two Binary Trees第二天题目Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge the
2017-11-07 18:38:19
135
原创 LeetCode4
LeetCode: Reverse Words in a String III题目Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.#例子Example 1
2017-11-07 18:19:06
152
原创 hammingDistance
Hamming Distance根据位的运算计算得到: 与:0010&0011得到0010; 4&1=0000 0000 0000 0000 0000 0000 0000 0000 或:4|1=0000 0000 0000 0000 0000 0000 0000 1001 异或:5=0000 0000 0000 0101^7=0000 0000 0000 0111 = 0000 0000 0
2017-11-05 14:31:02
155
原创 矩阵第二节
二分查找思想在一个含有X个有序的元素序列中,查找一个元素n。第一步,判断中n跟X/2的元素比较。如果小了,则继续跟X/4比较。如果大了,则跟3/4X比较。直到找到元素n。时间复杂度为log2X。public class BinarySearch{ int low; int hight; int length; public int GetIndexWithBinarySe
2017-10-29 22:00:48
192
原创 矩阵第一讲
矩阵特殊矩阵1.零矩阵 所有矩阵的所有元素全都为02.对角矩阵 一个n阶方阵除对角线上的所有元素都为02.数量矩阵 对角矩阵中对角线上元素为常数,3.单位矩阵 数量矩阵中对角线上上常数为1.4.行阶梯矩阵 一个矩阵的每个非零行(元素不全为零)的非零首元(第一个非零元素)所在列的下标随着行标的增大,并且严格增大。并且元素全为0的行(如果有点话)均在非零行
2017-10-03 14:29:54
567
原创 Unity android调试
Android的两种调试方法1.使用MonoDelevelop断点调试1.将手机连接局域网1.使用数据线连接主机2.在cmd界面中输入 adb tcpip 55552.出现 restarting in TCP mode port:5555即为成功3.输入adb connect DEVICEIPADDRESS(为手机在局域网中的ip地址)(在此步骤前,最好是ping 一下地址,检查一下地址是否
2017-08-08 15:03:41
552
原创 unity C#将excel解析为json
unity C#将excel解析为json本文将会使用到4个插件:Excel.dll , ICSharpCode.SharpZipLib.dll , SimpleJson.cs , System.Data.dll .参考连接:http://www.xuanyusong.com/archives/2429 http://www.cnblogs.com/singledigit/p/62
2017-07-10 10:59:07
617
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人