C#
文章平均质量分 51
WLY_Unity_Unreal
这个人很懒,还没有添加简介
展开
-
UnityRenderStreaming云渲染
最近发现一个unity官方的一个云渲染方案,准备研究一下,看看能不能在项目中使用,官方文档:https://docs.unity3d.com/Packages/com.unity.renderstreaming@3.1/manual/index.html他的实现是把unity程序通过视频流,语音流的方式展现到网页上,通过网络传输用户的交互,好处是解决了unity输出webgl的一些弊端,但是每个网页打开都要对应一个程序跑在服务器上,看一下官方的Demo:新建工程:unity版本2019.4.0f1原创 2021-08-18 10:37:27 · 2127 阅读 · 0 评论 -
C#使用线程池、任务、任务工厂开启线程
1.使用线程池using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Threading;namespace ThreadTest{ class CustomThread ...原创 2019-11-25 21:54:37 · 387 阅读 · 0 评论 -
C#之线程
线程,通俗的讲是指程序在一个时间点内处理事物的能力,多线程,指程序能够同一时间点处理多种事物。C#中的线程使用于System.Threading命名空间下。一.通过Thread类创建线程:支持无参函数和参数为object类型的函数。using System;using System.Collections.Generic;using System.Linq;using Sy...原创 2019-11-21 22:36:12 · 608 阅读 · 0 评论 -
C#之Linq语句
Linq是一种查询语句,C#中可以用这种语句做集合和数据库查询。新建一个Student类:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication1{ ...原创 2019-10-20 17:20:13 · 1948 阅读 · 0 评论 -
C#之扩展方法
我们可以在不修改原有类型的情况下,为这个类增加新的方法.一、为内置类型添加扩展方法.新建一个AddMethods类:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleA...原创 2019-10-02 11:26:28 · 222 阅读 · 0 评论 -
C#序列化与反序列化
我们可以通过给类添加Serializable特性,使其可以序列化与反序列化.通俗的说,就是能将这个类的对象信息保存到本地,也可以通过保存到本地的对象信息实例化对象.首先,写一个Utils工具类来实现序列化与反序列化:using System;using System.Collections.Generic;using System.Linq;using System.Text;u...原创 2019-09-29 09:08:38 · 222 阅读 · 0 评论 -
C#Obsolete和Conditional特性
一、Obsolete.using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Diagnostics;namespace ConsoleApplication1{ class P...原创 2019-09-29 08:03:17 · 301 阅读 · 0 评论 -
C#Type类中的IsAssignableFrom、IsInstanceOfType、IsSubclassOf
先写两个有继承关系的类Person、Son和一个接口IProgram:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace TestType{ interface IProgram ...原创 2019-09-27 08:23:10 · 2062 阅读 · 0 评论 -
C#通过程序集动态实例化对象,并调用对象方法
在TestAssembly命名空间下创建一个Person类,结构如下:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace TestAssembly{ public class Per...原创 2019-09-26 09:02:58 · 2362 阅读 · 0 评论 -
C#反射之Type类
Type类在System.Reflection命名空间下,通过它可以得到类的一些信息.通过对象.GetType()获取对象的类型信息.IsPrimitive.注意此属性是获取当前类型是否为基元类型,如:byte,short,int...string,object等.IsNestedPrivate:是否是私有类.GetFields();获取公有字段信息.GetProperties...原创 2019-09-21 08:41:53 · 423 阅读 · 0 评论 -
C#内置委托
三种内置委托:Action:无返回值.Func:尖括号最后一个类型为返回值类型.必须要有返回值.Predicate: 返回类型为bool,必须有一个参数,等价于Func<T, bool>;注意,有返回值的委托中,如果有多个方法注册在内,返回值是最后注册的方法返回值,前面的同样会执行,只不过返回值拿不到:using System;using System.Coll...原创 2019-09-19 08:06:04 · 561 阅读 · 0 评论 -
C#中正则表达式的使用
引用命名空间:System.Text.RegularExpression;使用Regex.Replace()来替换字符串中符合正则表达式的内容.使用Regex.IsMatch()来判断字符串是否符合正则表达式.正则表达式中()表示一组组合字符,[]中为可以出现的字符,{}中规定出现的次数.注意,一般会在正则表达式字符串前面添加@来自动转义,但是当我们想确切匹配一个小括号或者...原创 2019-09-09 07:41:37 · 901 阅读 · 0 评论 -
C#实现单向泛型链表
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace DS{ class MyArrayList<T> { public Node<T> h...原创 2019-07-13 16:58:49 · 239 阅读 · 0 评论