1. 首先创建单例模式类using System;using UnityEngine;// 首先定义一个单例模式类并且也继承MonoBehaviourpublic abstract class MonoSingleton : MonoBehaviour where T : MonoSingleton...
分类:
编程语言 时间:
2014-10-24 18:48:08
阅读次数:
337
LINQ查询方法一共提供了两种扩展方法,在System.Linq命名空间下,有两个静态类:Enumerable类,它针对继承了IEnumerable接口的集合进行扩展;Queryable类,针对继承了IQueryable接口的集合进行扩展。我们会发现接口IQueryable实际也是继承了IEnume...
分类:
编程语言 时间:
2014-10-24 08:04:25
阅读次数:
297
元素操作符从一个序列返回单个指定的元素。1.DefaultIfEmpty DefaultIfEmpty操作符将一个空集合替换为包含默认的单个值的集合。在返回序列为空且又需要返回一些对象时,可以通过该操作符返回一个默认值。1>. 原型定义public static IQueryable Defa...
分类:
其他好文 时间:
2014-10-22 17:24:23
阅读次数:
219
串联是一个将两个对象联接在一起的过程。在LINQ中,串联操作将两个集合合并成一个集合,通过Concat操作符实现。Concat1>. 原型定义public static IQueryable Cast(this IQueryable source);public static IQueryabl.....
分类:
其他好文 时间:
2014-10-22 10:52:59
阅读次数:
132
分组是指根据一个特定的值将序列中的值或元素进行分组。LINQ只包含一个分组操作符:GroupBy。GroupBy1>. 原型定义public static IQueryable> GroupBy(this IQueryable source, Expression> keySelector);2.....
分类:
其他好文 时间:
2014-10-22 10:42:39
阅读次数:
157
LINQ排序操作符包括:OrderBy、OrderByDescending、ThenBy、ThenByDescending及Reverse。1. OrderBy1>. 原型定义public static IOrderedQueryable OrderBy(this IQueryable sour.....
分类:
编程语言 时间:
2014-10-21 21:17:58
阅读次数:
153
1、 接口的使用 (1) 首先定义接口 public interface IBattleMapManager : { Stages CurrentStage { get; } event EventH...
分类:
编程语言 时间:
2014-10-17 20:29:49
阅读次数:
223
//获取第一个数据源DataTable DataTable dt1 = DBHelper.GetDataTable("select top 10 ksdid,user_id,user_pwd from ksd_user_info"); IEnumerable query1 = dt...
分类:
其他好文 时间:
2014-10-17 11:47:32
阅读次数:
681
这是我google unity3D一个问题偶然发现的在stackflow上非常有趣的帖子:大意是 要在unity3D上从server下载一个zip,并解压到持久化地址.并将其载入到内存中.以下展示了这样的使用方法:IEnumerator LongCoroutine(){ yield retur...
分类:
编程语言 时间:
2014-10-17 10:03:32
阅读次数:
273
【实现foreach遍历】 IEnumerable的原始版本存在于System.Collection中。 一个类想要被foreach遍历,需要实现此IEnumerable接口。 1 public class People : IEnumerable 2 { 3 private Per...
分类:
其他好文 时间:
2014-10-11 23:10:26
阅读次数:
239