自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(24)
  • 收藏
  • 关注

原创 UITabEx

using UnityEngine;using System.Collections;using CommonDelegate;[RequireComponent(typeof(BoxCollider))][RequireComponent(typeof(UIWidget))]public class UITabEx : MonoBehaviour{ [SerializeFiel

2016-03-30 21:01:00 337

原创 UIRichLabel

using UnityEngine;using System.Collections;using System.Collections.Generic;using System.Text.RegularExpressions;using System;/* * sprite标签格式: * framesprite标签格式: * button标签格式: */public cl

2016-03-30 20:20:12 848 1

原创 Edtior

using UnityEngine;using UnityEditor;using System.Collections;public class NTEditorMenu : MonoBehaviour { [MenuItem("Game/NTTool/坐标取整", false, 3)] static void ResetPositionToInt() { GameObjec

2016-03-30 18:27:24 467

原创 slider 控件 结合 左右btn

public class TradeGoodsItem : MonoBehaviour{ CommonDelegate.VoidDelegate _CallBack = null; int _GoodsNum = 0; ItemDataStruct _Goods = null; PaoshangData _PaoshangData = null; void Awake() { S

2016-03-25 15:03:56 352

原创 Color

public static Color GetColor(int r, int g, int b) { return new Color((float)r / 255.0f, (float)g / 255.0f, (float)b / 255.0f); }

2016-03-25 14:39:27 284

原创 LayerManger 层级设置

using UnityEngine;using System.Collections;using NTFrame;public class LayerManger { public const string UI = "UI"; public const string PLAYER = "Player"; public const string CITYQUAD = "cityqu

2016-03-25 14:29:06 1458

原创 ITween动画

using UnityEngine;using System.Collections;using System.Collections.Generic;public class UIAnimationController{ public static void CloseSlideOut(UIAnimationParam param) { if (param == null)

2016-03-25 11:45:53 415

原创 置灰 Manager

using UnityEngine;using System.Collections;using System.Collections.Generic;using NTFrame;public class GrayUIManager : SingletonMono{ public Hashtable shaderTable = new Hashtable(); publ

2016-03-25 11:16:50 298

原创 [ClientTool] 项目里用到的工具func

定义一个数据类吧 - 正常根据项目而定public class ItemDataStruct{ public int _Id; public int _Num; public ItemDataStruct() { } public ItemDataStruct(int id, int num) { Init(id,num); } public ItemDataSt

2016-03-24 14:53:50 1100

原创 items 排序 0

第一种 - x横向排序 y纵向排序 (每行只有一个) /// -------------------------------y /// x 位置 通用 /// y 第一个obj的y /// padding 行距 /// items obj数组 /// public static void SortItems(L

2016-03-24 13:08:13 239

原创 items排序

/// /// x 位置 通用 /// y 第一个obj的y /// padding 行距 /// items obj数组 /// public static void SortItems(List items,int padding = 100,float x = 0.0f,float y =0.0f) { for (int k = 0; k < items.Cou

2016-03-24 11:36:02 324

原创 NGUI UILable 换行

实现效果 :

2016-03-23 16:22:44 706

原创 拖拽

using UnityEngine;using System.Collections;using System.Collections.Generic;using System;public class DragManager{ DragItem _DragItem = null;}public class Item : MonoBehaviour { public UI

2016-03-18 15:55:40 446

原创 Ngui 左右滑动

实现效果图: private UIScrollView fubenScrollView; private UIGrid fubenGrid; public void OnBtnRight() { if (fubenScrollView == null || fubenGrid == null) return; int curIndex = GetFub

2016-03-16 15:12:56 887

原创 数字 1 转换成 “一” (10-> “十”,25-> “二十五”,.....)

public static string getNumStr(int num) { string strnum = string.Empty; int temp_num = num; bool has_0 = false; //千 int temp_qian = temp_num / 1000; if(temp_qian > 0) { strnum

2016-03-15 14:08:59 559

原创 2D 滚动Item效果

实现效果图如下 :UI 设置如下 :using UnityEngine;using System.Collections;using System.Collections.Generic;public class TestScrollView : MonoBehaviour { public UIScrollView _Scrollview; public Li

2016-03-05 18:31:57 600

原创 C# 传方法function / 传带参数的方法function

定义类似枚举---using UnityEngine;using System.Collections;namespace DelegateTools{ public delegate void VoidDelegate();// 传方法 public delegate void IdDelegate(long id);// 传带参数的方法(long id) public del

2016-03-05 14:49:42 5402

原创 Grid/ScrollView 回滚到顶部(初始位置)

public static void GridReposition(UIGrid grid) { if(grid != null) { grid.Reposition(); } } // grid到顶部 public static void ScrollResetPosition(UIScrollView scroll) { if(scroll != null)

2016-03-05 14:18:11 4337 3

原创 Ngui 拖拽到底部,直接循环到顶部

items拖拽到底部的时候,自动从顶部再次开始。。。。。

2016-03-05 13:53:00 619

原创 C# 【Math】 用法

1. 【 Mathf.Ceil】用法int allCount = 1;float result = (float)allCount/3f; // 0.33333float height = Mathf.Ceil(result);// 1

2016-03-05 11:15:05 2068

原创 C# 【String】 用法

// String.Format 用法string text1 = "1";string text2 = "2";string endString = "";endString = string.Format("{0}/{1}", text1,text2);Debug.Log(endString); // 1/2endString = string.Format("{0}/h",

2016-03-05 11:10:27 682

原创 NGUI 设置拖动区域(无需加BoxCollider)

Container和ScrollView一个父级,就可以实现无空隙拖拽了。 (Container要加DragScrollView.cs)如果ScrollView下的item要点击的话,item要单独添加DragScrollView。

2016-03-05 11:01:21 817

原创 同Grid,设置Items位置

// item排序 public void onSortItems() { float _X = 0.0f; float _Z = 0.0f; int padding = 110; // 格子高度 + 格子间距 for (int k = 0; k < _Items.Count; k++) { GameObject item = _Items[k].gameObje

2016-03-03 21:19:11 850

原创 字典排序

void Sort(){ SortedDictionary dic = new SortedDictionary(); dic.Add(1,"1"); dic.Add(12,"12"); dic.Add(5,"15"); //输出:"1","15","12"}暂时我只知道这样做

2016-03-03 21:06:02 315

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除