- 博客(18)
- 收藏
- 关注
原创 Lua--table的遍历
当我在工作中使用lua进行开发时,发现在lua中有4种方式遍历一个table,当然,从本质上来说其实都一样,只是形式不同,这四种方式分别是:for key, value in pairs(tbtest) do XXX end for key, value in ipairs(tbtest) do XXX end for i=1, #(tbtest) do
2015-08-25 18:22:29 318
原创 Lua--点和冒号的区别
function Script:OnBtnClicked() = function Script.OnBtnClicked(self)
2015-08-24 14:22:20 413
转载 LUA--string的使用
--string.len(s) --返回字符串s的长度 --string.rep(s, n)--返回重复n次字符串s的串,你使用string.rep("a", 2^20)可以创建一个1M bytes的字符串(比如,为了测试需要); --string.lower(s)--将s中的大写字母转换成小写(string.upper将小写转换成
2015-08-22 11:10:27 415
原创 lua 创建listview
只要是新的聊天对象就创建一个新的listviewlocal name = tolua.cast(UIHelper:seekWidgetByName(self.nameItem, "name"), "Label"); local playerName = name:getStringValue(); if nil == self.privateChatList[name:getTa
2015-08-20 13:43:42 1284
原创 unity里怎么判断现在是运行在32还是64位上?
if (IntPtr.Size == 4) { //32 Bit } else if (IntPtr.Size == 8) { //64 Bit }
2015-08-20 13:04:20 5358
原创 【Lua 第一篇】 Manager + Data 的定义与应用
新接触Lua,有些词语用的生硬,请多理解! 定义数据类: 便于存取-- 引用别的Lua文件 ,下面可以直接调用 比如 functions里的方法 : warn('字符串');require "Common/functions"require "System/class"-- 定义变量 local json = require "cjson"local util =
2015-08-18 15:24:22 1352 1
转载 DoTween官方手册中文版(一)命名规则
NGUI自带了一套tween,效果还不错。那么UGUI呢?其实我们有DoTween,并且已经全面支持unity5。由于网站访问需要番茄,并且官方还是英文的,故我将原文整理对照翻译成中文的,对于英文苦手,兴许有些帮助。有疑问的欢迎邮我:admin@u3dc.comNomenclature(命名规则)Tweener:A tween that takes contro
2015-08-13 10:24:24 2633
原创 UGUI Button
新项目需要UGUI实现,今天就开始学习UGUI吧!Interactable (交互) true 激活 false 禁用Transtion(Button显示状态) ColorTint (换颜色)
2015-08-11 20:00:20 628
原创 C# 关键字
abstract 可以和类、方法、属性、索引器及事件一起使用,标识一个可以扩展但不能被实体化的、必须被实现的类或方法。as 一个转换操作符,如果转换失败,就返回null。 base 用于访问被派生类或构造中的同名成员隐藏的基类成员。catch 定义一个代码块,在特定类型异常抛出时,执行块内代码。参见try和f
2015-08-10 16:17:13 307
原创 UILable
1. UIlable 设置颜色 UILabel m_Lable=null; private voi Test() { if(m_Lable==null) return; string Color = "[fa043e]";// 颜色 --------------这里的颜色值在16进制
2015-08-07 17:03:15 327
原创 【Buton的点击效果】方法(全)
需求: 默认状态鼠标Hover/OnClick状态第一种方法:直接图示吧,都能明白! 第二种方法(相交于比较复杂,小Btn适合上面的,大的就用这个方法): 记住下面这个shaderShader "Hidden/Unlit/Text (TextureClip)" { Properties { _MainTex ("Alpha (A)
2015-08-06 10:37:47 409
原创 UIScrolView里自己滚动滑动 ,无限制那种
之前在上海的公司,曾经要求过在佣兵界面做这种效果!要求: 1. 我有2个英雄,左右滑动的时候,永远不会见到尽头! 2. 相当于:向右的时候,到最后是一个的时候,再冲第一个开始滑动,不知道,我说的这个要求实现的效果,大家看明白没有! 先贴方法吧! 具体咱再留言私聊! 具体我都详细标示了! 一般咱们的习惯都是Grid排序对吧! 现在换成UI
2015-08-05 20:14:46 655
原创 UITools
using UnityEngine;using System.Collections;public class UITool { public static int RepositionByHeight(List items,float offset_y = 2.0f) { if (items == null) return 0; float height = 0
2015-08-04 15:12:10 532
原创 倒计时(1,时间 2,数字)
using UnityEngine;using System.Collections;using System;public enum EnCDNumberFormat{ /// /// 纯数字格式 /// Format_Number, /// /// 时间格式 /// Format_Time,}public class CenterCD : MonoBeha
2015-08-04 14:49:54 536
原创 左Btn-右Btn 切换list (1)
public UIButton m_LeftBtn=null;// 左箭头 public UIButton m_RightBtn=null;// 右箭头 public UIScrollView mScrollView=null;// List的UIScrollView public UIGrid mGrid=null;// List的Grid public int itemDataLis
2015-08-03 17:54:13 496
原创 数据List刷新UI的Items显示(比如服务器给客户端刷新好友列表) 方法(1)
GameObject mItem =null;// prefab UIGrid mGrid =null;// gird UIScrollView mScroll = null; public List mItems = new List ();//prefabList void UpdateValue(List list) { if(list != null && mIte
2015-08-03 16:51:26 646
原创 客户端和服务器通讯 方法(2)
using UnityEngine;using System;using System.Collections;using System.Collections.Generic;using Helper;using GameEvent;public enum GameEventID { PriendsUI = 0, ChatUI = 1, MainUI =
2015-08-03 12:03:55 467
原创 客户端和服务器通讯 方法(1)
using UnityEngine;using System.Collections;using System.Collections.Generic;using System;/// /// 事件类/// public class TestEventArgs : EventArgs { public enum TestEventType { PeiyangBtn,
2015-08-01 21:24:20 437
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人