摘要: Unity Shader中 A(x1,y1,z1,w1) B(x2,y2,z2,w2) A*B=(x1*x2,y1*y2,z1*z2,w1*w2) 阅读全文
posted @ 2022-03-18 23:40 LKGAME 阅读(108) 评论(0) 推荐(0)
摘要: using System; namespace 建造者模式 { class Program { static void Main(string[] args) { TeaBuilder teaBuilder = new TeaBuilder(); teaBuilder.addNameType("珍珠 阅读全文
posted @ 2021-01-02 16:20 LKGAME 阅读(101) 评论(0) 推荐(0)
摘要: using System; namespace 抽象工厂模式 { class Program { static void Main(string[] args) { CreateFactory createFactory = new CreateFactory(); Factory phoneFac 阅读全文
posted @ 2021-01-01 19:27 LKGAME 阅读(104) 评论(0) 推荐(0)
摘要: 工厂模式是设计模式之一,属于创建型模式,通过手机工厂的对象可以创建华为手机和Vivo手机的对象 直接上代码 先写一个手机的接口,里面有一个生产手机的方法 1 interface Phone 2 { 3 public void createPhone(); 4 } Huawei手机的类 1 class 阅读全文
posted @ 2021-01-01 17:56 LKGAME 阅读(165) 评论(0) 推荐(0)
摘要: unity协程 下面一段小代码是通过一定的延迟,把脚本的挂载物体变为蓝色 1 public float f; 2 void Update() 3 { 4 if (Input.GetKeyDown(KeyCode.W)) 5 { 6 StartCoroutine("Fade"); 7 } 8 } 9 阅读全文
posted @ 2020-08-13 20:57 LKGAME 阅读(113) 评论(0) 推荐(0)
摘要: 一.饿汉式 在程序开始时,该类就创建了实例了,但可能在运行时没有调用,造成不必要的消耗 代码: 1 using System; 2 using System.Collections.Generic; 3 using System.Text; 4 5 namespace 设计模式 6 { 7 clas 阅读全文
posted @ 2020-08-11 17:23 LKGAME 阅读(315) 评论(0) 推荐(0)