Exemple #1
0
        private void DrawAC1()
        {
            m_Tools.BiaoTi_B("简单步骤");
            MyCreate.Box(() =>
            {
                MyCreate.Text("第1步 制作 Sprite");
                m_Tools.Text_L("  用到的组件是", " SpriteRenderer".AddGreen(), ",所以图片要设置成 Sprite");
                MyCreate.Text("第2步 设置可破坏");
                m_Tools.Text_L("  点击选择齿轮图标 选择可破坏");
                MyCreate.Text("第3步 相机设置");
                m_Tools.Text_L("  1. 设置成 正交");
                m_Tools.Text_L("  2. 添加 ClickToSpawn 组件");
            });

            AddSpace();
            m_Tools.BiaoTi_B("例子");
            MyCreate.Box(() =>
            {
                m_Tools.TextText_WL("Break Off 崩解", "点击爆炸  划动分割", 10);
                m_Tools.TextText_WL("Break Through 冲击", "产生一个方块撞击另一方块", 10);
                m_Tools.TextText_WL("Breakable Eggs 易碎的鸡蛋", "扔石头砸鸡蛋" + "(碎的程度与力度有关)".AddGreen(), 10);
                m_Tools.TextText_WL("Breakable Glass 易碎玻璃", "扔石头" + "(轻不会碎,大力才会)".AddGreen(), 10);
                m_Tools.TextText_WL("Bullet Impacts 子弹影响", "(好像没用)", 10);
                m_Tools.TextText_WL("Car Damage 汽车危险", "汽车碰撞", 10);
                m_Tools.TextText_WL("Compound Spaceship 复合太空飞船", "飞船爆炸后像悬浮一样", 10);
                m_Tools.TextText_WL("Explode 爆炸", "点击一个物体马上四分五裂", 10);
                m_Tools.TextText_WL("Glacier 冰川", "小太阳融化冰川", 10);
                m_Tools.TextText_WL("Heal Damage 治愈伤害", "物体怎么破坏、分割都能修复", 10);
                m_Tools.TextText_WL("Huge Map 巨大的地图", "可移动", 10);
                m_Tools.TextText_WG("Multi Layer 多层", "(鱼皮 鱼肉 鱼骨)", 10);
                m_Tools.TextText_WL("Shooting Gallery 射击馆", "射击小游戏", 10);
                m_Tools.TextText_WL("Spaceship 飞船", "飞船射击(好完整)", 10);
                m_Tools.TextText_WL("Swinging Weight", "摆动重量", 10);
            });
        }
Exemple #2
0
        //——————————————————行为——————————————————

        private void XingWeiOther()                               // 行为其他
        {
            AddSpace();
            m_Tools.BiaoTi_B("解释器模式");



            AddSpace();
            m_Tools.BiaoTi_B("访问者模式");
            m_Tools.Text_H("想不到那里会需要这模式");

            AddSpace();
            m_Tools.BiaoTi_B("备忘录模式");
            m_Tools.Text_H("就是 数据Bean,然后写多一个类来记录这个 数据Bean");


            AddSpace();
            m_Tools.BiaoTi_B("命令模式");
            m_Tools.Text_H("就是将一个方法封装成对象来调用");
            m_Tools.Text_H("类巨多,不喜欢");

            AddSpace();
            m_Tools.BiaoTi_B("模板方法模式");
            m_Tools.BiaoTi_L("动机、意图、何时用" + "(这个模式简单、常用)".AddGreen());
            MyCreate.Box(() =>
            {
                m_Tools.Text_R("就是把父类定义成一个模板,给子类实现");
                m_Tools.Text_H("一次性实现一个算法的不变的部分,并将可变的行为留给子类来实现");
                m_Tools.Text_H("各子类中公共的行为应被提取出来并集中到一个公共父类中以避免代码重复");
            });

            AddSpace();
            m_Tools.BiaoTi_B("中介者模式");
            ShowImage("https://images2018.cnblogs.com/blog/959112/201807/959112-20180709225152340-1096691406.png", 15);
        }
Exemple #3
0
        private void DrawHashtable()                             //Hashtable
        {
            m_Tools.ButtonText("Hashtable", "Key不可重复,添加重复报错,取[不存在]null", ref isHashtable, () =>
            {
                MyCreate.TextCenter("foreach 出来的结果不是按照顺序排列的");
                m_Tools.Text_G("1.Key 与 Dictionary 相同不可重复,区分大小写");
                m_Tools.Text_G("2.元素存储在DictionaryEntry对象中");
                m_Tools.BiaoTi_O("foreach 的使用", ref isForeach, () =>
                {
                    MyCreate.Window("用 DictionaryEntry 对象 声明", () =>
                    {
                        m_Tools.Text_Y("foreach ( DictionaryEntry de in hashtable )");
                    });
                    AddSpace();
                    AddSpace();
                    MyCreate.Window("用 key/value 对象 声明", () =>
                    {
                        m_Tools.Text_Y("foreach ( Object key in hashtable.Keys )");
                    });
                });

                m_Tools.BiaoTi_O("方法", true);
                MyCreate.Box(() =>
                {
                    m_Tools.Method_YG("Add", "Object,Object", "添加");
                    m_Tools.Method_YG("Remove", "Object key", "根据 key 来删除");
                    m_Tools.Method_YG("ContainsKey", "Object key", "key 是否包含");
                    m_Tools.Method_YG("ContainsValue", "Object Value", "Value 是否包含");
                });
            }, -60);
        }
Exemple #4
0
        //——————————————————创建——————————————————

        private void DrawJianZaoZhe()                            // 建造者模式
        {
            MyCreate.Text("建造者模式与工厂模式结合:");
            MyCreate.Box_Hei(() =>
            {
                m_Tools.Text_H("public class ", JianGongLie);
                m_Tools.Text_H("     private static string ", gnmcStr, " =“", gaStr, "”");
                m_Tools.Text_H("     public static ", GongNeng, " ", CreateStr);
                m_Tools.Text_H("          AssemblyName name = Assembly.GetExecutingAssembly().GetName()");
                m_Tools.Text_H("          ", GongNeng, " g =", "(", GongNeng, ") Assembly.Load(name).CreateInstance(", gnmcStr, ")");
                m_Tools.Text_H("          g.", "加属性()".AddWhite());
                m_Tools.Text_H("          g.", "加武器()".AddWhite());
                m_Tools.Text_H("          g.", "加装备()".AddWhite());
                m_Tools.Text_H("          return g");
            });

            MyCreate.Text("实际的功能实现类,要做什么功能就在子类实现");
            MyCreate.Box_Hei(() =>
            {
                m_Tools.Text_H("public abstract class ", GongNeng);
                m_Tools.Text_H("     public abstract void ", "加属性()".AddWhite());
                m_Tools.Text_H("     public abstract void ", "加武器()".AddWhite());
                m_Tools.Text_H("     public abstract void ", "加装备()".AddWhite());
            });
            MyCreate.Box(() =>
            {
                m_Tools.Text_H("public class ", gaStr, " : ", GongNeng, " { ", "实现加属性、加武器、加装备".AddWhite(), " } ");
                m_Tools.Text_H("public class 功能B : ", GongNeng, " { ", "实现加属性、加武器、加装备".AddWhite(), " } ");
            });
            MyCreate.Text("客户端只需要改变 " + gnmcStr + " 里面的类名称即可");
            MyCreate.Box_Hei(() =>
            {
                m_Tools.TextText_HG(GongNeng + " g = " + JianGongLie + "." + CreateStr, "// 工厂类已经是 Static 方法");
            });
        }
Exemple #5
0
        private void DrawGongChang()                             // 工厂模式
        {
            m_Tools.BiaoTi_B("工厂模式");
            MoBan(() =>
            {
                m_Tools.Text_R("比如一开始用这个功能类 A,过段时间又要用相同结构的功能类 B,或者再来个 C");
                m_Tools.Text_W("隔离”这个易变对象“的变化,保持”其它依赖的对象“不随需求的变化而变化");
            }, () => {
                MyCreate.Text("客户端就和工厂类打交道,不会与实际实现类有任何交互");
                MyCreate.Box_Hei(() =>
                {
                    m_Tools.Text_H("public abstract class ", GongJiLie);
                    m_Tools.Text_H("     public abstract 功能基类 ", CreateStr);
                });
                MyCreate.Box(() =>
                {
                    m_Tools.Text_H("public class", " 功能A的工厂".AddRed(), ": ", GongJiLie);
                    m_Tools.Text_H("    public override 功能基类 ", CreateStr);
                    m_Tools.Text_H("        return new 功能A();");
                });
                MyCreate.Box(() =>
                {
                    m_Tools.Text_H("public class 功能B的工厂 : ", GongJiLie);
                    m_Tools.Text_H("    public override 功能基类 ", CreateStr);
                    m_Tools.Text_H("        return new 功能B();");
                });
                MyCreate.Text("实际的功能实现类,要做什么功能就在子类实现");
                MyCreate.Box_Hei(() =>
                {
                    m_Tools.Text_H("public abstract class ", GongNeng, " { ... } ");
                });
                MyCreate.Box(() =>
                {
                    m_Tools.Text_H("public class 功能A : ", GongNeng, " { ... } ");
                    m_Tools.Text_H("public class 功能B : ", GongNeng, " { ... } ");
                });
                MyCreate.Text("客户端只需要改变 方法名" + gAStr + " 即可改变对应的功能");
                MyCreate.Box_Hei(() =>
                {
                    m_Tools.Text_H("AssemblyName name = Assembly.GetExecutingAssembly().GetName()");
                    m_Tools.Text_H(GongJiLie, " f = (", GongJiLie, ") Assembly.Load(name).CreateInstance", gAStr);
                    m_Tools.Text_H(GongNeng, " g = f.", CreateStr);
                    m_Tools.Text_G("// 这时的”g“已经是想要的类了,想调用那个方法就调用那个方法叭");
                });
            }, () =>
            {
                MyCreate.Text("1. 工厂模式 -> 利用工厂 -> 创建想要的对象");
                MyCreate.Text("2. 如增加一个 C 功能类并使用:增加功能C的工厂、功能C、客户端调用”功能C的工厂“".AddRed());
                MyCreate.Text("   优点:原来的功能代码不需要更改,隔离了使用者和具体类型之间的耦合关系");
                MyCreate.Text("   缺点:每加一个功能就需要加一个功能的工厂类");
            });
            AddSpace_3();
            m_Tools.BiaoTi_L("UML 图", ref isUML1, () =>
            {
                ShowImage("https://images2018.cnblogs.com/blog/959112/201807/959112-20180709223754285-530795452.png");
            });
            AddSpace();

            DrawChuXiang();
        }
Exemple #6
0
 private void DrawDav3()                                            // 导航数据与优化
 {
     m_Tools.BiaoTi_L("导出".AddOrange() + "导航网格数据");
     MyCreate.Box(() =>
     {
         MyCreate.Text("用途例如:自己一份,导出去服务器定位一份".AddGreen());
         MyCreate.Box_Hei(() =>
         {
             m_Tools.Text_Y("使用 ", "NavMesh.CalculateTriangulation()".AddHui());
             m_Tools.Text_Y("返回 ", "NavMeshTriangulation ".AddHui());
             MyCreate.Box(() =>
             {
                 m_Tools.Method_BL("areas", "", "所有层的集合", "int[]", -30);
                 m_Tools.Method_BL("vertices", "", "所有顶点的集合", "Vector3[]", -30);
                 m_Tools.Method_BL("indices", "", "所有索引的集合", "int[]", -30);
             });
         });
         MyCreate.Text("Tip: 有插件直接可使用:".AddGreen() + " CAINav".AddOrange());
     });
     AddSpace_15();
     m_Tools.BiaoTi_L("关于大型地图导航的" + "优化".AddOrange());
     MyCreate.Box(() =>
     {
         m_Tools.Text_Y("为什么:Unity导航是基于A*的广度优先的", "(需要记录全地图)".AddLightGreen());
         m_Tools.Text_W("           当在大地图从一个点导航到另一个点的消耗巨大");
         m_Tools.Text_Y("所以:可以把大地图划分几个小地区,当从这个小区到另一个小区");
         m_Tools.Text_H("    位置 -> 区的记录点 -> 最终区的记录点 -> 再导航到目标点");
     });
 }
Exemple #7
0
 private void DrawRightPage(Texture text, [NotNull] Action page, bool isBox, Action nextButton)  // 画任意 右边页面都使用这个
 {
     QUI.Space(5);
     if (isNeedTu)
     {
         QUI.DrawTexture(text, mWindowSettings.CurrentPageContentWidth, 620);
         QUI.Space(-620);
     }
     QUI.Space(2);
     if (isBox)
     {
         MyCreate.Box(page);
     }
     else
     {
         MyCreate.Box_Hei(page);
     }
     MyCreate.AddSpace();
     if (null != nextButton)
     {
         MyCreate.Heng(() =>
         {
             MyCreate.AddSpace();
             if (GUILayout.Button("", QStyles.GetStyle(Style.LinkButton.Unity), GUILayout.Width(80), GUILayout.Height(20)))
             {
                 nextButton();
             }
         });
     }
 }
Exemple #8
0
        private void DrawNormal()                                // 普通 问题
        {
            m_Tools.BiaoTi_Y("如何 找到 Dll");
            MyCreate.Box(() =>
            {
                m_Tools.Text_L("引用 —> 管理 NuGet 程序包 —> 搜索 —> 安装");
                m_Tools.Text_L("运行就会有 dll 啦");
            });
            AddSpace_3();


            m_Tools.BiaoTi_Y("如何 不显示 引用后面的作者和更改选项");
            MyCreate.Box(() =>
            {
                m_Tools.Text_H("文本编辑器 -> 所有语言 -> CodeLens -> xxx");
            });
            AddSpace();


            m_Tools.BiaoTi_Y("怎么打开 .db 文件");
            MyCreate.Box(() =>
            {
                m_Tools.Text_L("1. 打开 MySql 服务");
            });
        }
Exemple #9
0
        private void DrawError()                                 // Error 问题
        {
            m_Tools.BiaoTi_R("解决 Unity Dll 4.x 不兼容问题");
            MyCreate.Box(() =>
            {
                MyCreate.Text("Unity targets .NET 4.x and is marked as compatible with editor, ".AddRed());
                MyCreate.Text("Editor can only use assemblies targeting .NET 3.5 or lower".AddRed());
                AddSpace_3();
                m_Tools.Text_G("解决方法:");
                m_Tools.Text_L("PlayerSetting —> OtherSettings —> Configuration 下面第一个");
                m_Tools.Text_L("Scripting Runtime Version 选择 " + "Experimental(.NET 4.6)".AddGreen());
            });
            AddSpace_15();



            m_Tools.BiaoTi_R("IIS 下载 没有 MIME 映射的问题");
            MyCreate.Box(() =>
            {
                m_Tools.Text_L("筛选:MIME 类型 ->添加");
                MyCreate.SelectText("application/octet-stream");
            });

            AddSpace_15();


            m_Tools.BiaoTi_R("Shader 中的错误");
            MyCreate.Box(() =>
            {
                m_Tools.Text_R("1. 数字不要带 f !!!" + " (如 5f )".AddHui());
            });
            AddSpace_15();
        }
Exemple #10
0
        private void DrawDaGang()                                // 大纲
        {
            m_Tools.BiaoTi_B("源码 问题");
            MyCreate.Box(() =>
            {
                m_Tools.Text_B("  1.  怎么看源码");
                m_Tools.Text_B("  2.  == 与 Equals 区别");
                m_Tools.Text_B("  3.  如何 当怪进入左右各 3 米,前方 5 米,就进行攻击");
                m_Tools.Text_B("  4.  不清楚的操作运算符   ", "(如 1<<8、??)".AddHui());
            });

            AddSpace();
            m_Tools.BiaoTi_Y("普通 问题");
            MyCreate.Box(() =>
            {
                m_Tools.Text_Y("  1.  如何 找到 Dll");
                m_Tools.Text_Y("  2.  如何 不显示 引用后面的作者和更改选项");
                m_Tools.Text_Y("  3.  怎么打开 .db 文件");
            });


            AddSpace();
            m_Tools.BiaoTi_R("Error 问题");
            MyCreate.Box(() =>
            {
                m_Tools.Text_R("  1.  解决 Unity Dll 4.x 不兼容问题");
                m_Tools.Text_R("  2.  IIS 下载 没有 MIME 映射的问题");
                m_Tools.Text_R("  3.  Shader 中的错误");
            });
        }
Exemple #11
0
        private void DrawEquit()                                 // == 与 Equals 区别
        {
            m_Tools.BiaoTi_O("== 与 Equals 区别" + "(==内容、equal地址、string 都相等)".AddGreen());

            MyCreate.Box(() =>
            {
                m_Tools.Text_L("1. equal 对比的是变量里的地址是否相等");
                m_Tools.Text_L("2. == 比较的内容是否一样");
                MyCreate.Text("重写 == :".AddGreen() + "public static bool operator == ( T t1,T t2)");
                m_Tools.Text_L("3. 除了 string 特殊的引用类型 ");
                MyCreate.Text("(== 与 Equals相等):".AddGreen() + "其实就是 string 重写了 Equals 的方法");
            });
            MyCreate.Box_Hei(() =>
            {
                m_Tools.Text_H("string tmpA =new string(new char[]{'H','L'})");
                m_Tools.Text_H("string tmpB =new string(new char[]{'H','L'})");
                AddSpace_3();
                m_Tools.TextText_HG("tmpA == tmpB", "// true");
                m_Tools.TextText_HG("tmpA.Equals( tmpB )", "// true");
            });
            MyCreate.Box(() =>
            {
                MyCreate.Text("内存分三部分:" + "堆、栈、全局变量区(static)".AddWhite());
                m_Tools.TextText_BY("      堆", "      栈");
                m_Tools.Text_Y("    tmpA   ".AddBlue(), "    指针指向→  ".AddWhite(), "new string(new char[]{'H','L'})", "// 地址1".AddLightGreen());
                m_Tools.Text_Y("    tmpB   ".AddBlue(), "    指针指向→  ".AddWhite(), "new string(new char[]{'H','L'})", "// 地址2".AddLightGreen());
                AddSpace_3();
                m_Tools.Text_L("1. 当方法结束:" + "tmpA 就会直接销毁".AddGreen(), ",指向对象的指针就没有");
                m_Tools.Text_G("2. 而 栈 里的对象只有完全没有指针指向,才会通过GC回收");
            });
        }
Exemple #12
0
        private void DrawShape()                                 // 形状模块
        {
            m_Tools.BiaoTi_B("Shape   [ 形状模块 ]");
            MyCreate.Box(() =>
            {
                m_Tools.Text_G("可以在Scene视图手动调整形状");
                shapeType = (ShapeType)m_Tools.TextEnum("Shape", shapeType);
                switch (shapeType)
                {
                case ShapeType.Sphere_球体:
                case ShapeType.Hemisphere_半球体:
                    m_Tools.TextText("Radius", "球体的半径");
                    m_Tools.TextText("Radius Trhickness", "半径厚度");
                    break;

                case ShapeType.Cone_锥体:
                    m_Tools.TextText("Angle", "圆锥的角度");
                    m_Tools.TextText("Radius", "发射口半径");
                    m_Tools.TextText("Radius Trhicknes", "发射口半径厚度");
                    m_Tools.TextText("Arc", "弧");
                    break;

                case ShapeType.Donut_甜甜圈:
                    m_Tools.TextText("Radius", "半径");
                    m_Tools.TextText("Dounut Radius", "内圈半径");
                    m_Tools.TextText("Radius Trhickness", "半径厚度");
                    m_Tools.TextText("Arc", "弧");
                    break;

                case ShapeType.Box_盒子:
                    m_Tools.TextText("Emit from", "从...发出");
                    break;
                }
            });
        }
Exemple #13
0
        private void DrawEmission()                              // 发射模块
        {
            m_Tools.BiaoTi_B("Emission   [ 发射模块 ]");
            MyCreate.Box(() =>
            {
                m_Tools.TextText_WL("Rate over Time", "一秒产生多少粒子");
                m_Tools.TextText("Rate over Distance".AddHui(), "一公尺产生多少粒子".AddHui() + "(没什么卵用)".AddLightGreen());
                MyCreate.Box(() =>
                {
                    MyCreate.Text("Bursts" + "[ 爆发 ]发射".AddGreen());
                    m_Tools.Text_W(" Time".AddOrange(), "                 Count".AddYellow(), "                Cycles".AddBlue(), "               Interval".AddLightBlue());
                    MyCreate.Box_Hei(() =>
                    {
                        m_Tools.Text_L("总时长".AddOrange(), "    总共爆发多少个粒子".AddYellow(), "    一次过 还是 多次".AddBlue(), "   两次或以上的间隔是多少秒");
                    });
                });
            });

            AddSpace();
            m_Tools.BiaoTi_L("注意一下");
            MyCreate.Box(() =>
            {
                m_Tools.Text_H("这个模块是必开的,不开等于没有发射器");
                m_Tools.Text_H("粒子爆发(Bursts): 在" + "持续时间内".AddGreen() + "的" + "指定时刻".AddGreen() + "额外增加大量的粒子");
                m_Tools.Text_H("爆发时间不会超过粒子的持续时间");
            });
        }
Exemple #14
0
        private void DrawLiZiZhongJie()                          // 粒子总结
        {
            m_Tools.Text_L("想要发生", "来回移动".AddGreen(), " ->  Velocity over Lifetime");
            m_Tools.Text_L("想要发生", "大小变化".AddGreen(), " ->  Size over Lifetime");
            m_Tools.Text_L("想要发生", "颜色变化".AddGreen(), " ->  Color over Lifetime");
            m_Tools.Text_L("想要发生", "图片序列动画".AddGreen(), " ->  Texture Sheet Animation");
            AddSpace_15();
            m_Tools.Text_L("Renderer  ->  Material  ->  用 粒子的 Shader 即可");

            AddSpace();
            m_Tools.BiaoTi_B("粒子系统性能");
            MyCreate.Box(() =>
            {
                m_Tools.Text_L("▪ 粒子系统是性能的大敌");
                m_Tools.Text_Y("▪ 一个场景的发射器的数量应该控制" + "( 少于 30 )".AddGreen());
                m_Tools.Text_Y("▪ 全屏粒子数量应该控制" + "( 少于 200 )".AddGreen());
                MyCreate.Box(() =>
                {
                    m_Tools.Text_L("可以从面板的 ", "MaxParticles", " 属性控制单个发射器最大数量");
                });
                m_Tools.Text_Y("▪ 慎用子发射器,(Sub Emitters)".AddBlue(), ",能不用就不用");
                m_Tools.Text_Y("▪ 关掉粒子的阴影(默认是关闭的)");
                MyCreate.Box(() =>
                {
                    m_Tools.Text_L("在 Renderer 模板 -> Cast Shadows");
                });
                m_Tools.Text_Y("▪ 关掉粒子碰撞");
                MyCreate.Box(() =>
                {
                    m_Tools.Text_L("即是没有什么特殊也不要开启碰撞这个模块");
                });
            });
        }
Exemple #15
0
 private void DrawMonoBehaviourAPI()                      // MonoBehaviour API
 {
     m_Tools.BiaoTi_O("MonoBehaviour API " + "(就多了 Invoke 和 协程)".AddGreen());
     MyCreate.Box_Hei(() =>
     {
         m_Tools.Text_H("继承 ->" + " Component ".AddOrange() + "(组件基类) ->" + " Behavior ".AddOrange() + "(可启用、禁用)");
     });
     AddSpace();
     MyCreate.MethodWindow(() =>
     {
         m_Tools.BiaoTi_B("Invoke 调用");
         MyCreate.Box(() =>
         {
             m_Tools.Method_BL("Invoke", "string 方法名,float 几秒调用该方法", "");
             m_Tools.Method_BL("InvokeRepeating", "string 方法名,float 几秒调用该方法,float 几秒重复一次", "");
             m_Tools.Method_BL("CancelInvoke", "", "取消此 Mono 上的所有Invoke调用");
             m_Tools.Method_BL("IsInvoking", "string 方法名", "这个方法是否被 Invoke 调用");
         });
         AddSpace();
         m_Tools.BiaoTi_B("Coroutine 协程");
         MyCreate.Box(() =>
         {
             m_Tools.Text_G("开始协程 ", "StartCoroutine".AddBlue(), "     结束协程", " StopCoroutine".AddBlue());
             m_Tools.Text_G("(开始协程与结束协程的参数要一致才能结束)");
             m_Tools.Method_BL("StopAllCoroutines", "", "停止所有运行的协程");
         });
     });
 }
Exemple #16
0
 private void DrawMyAssetUtil()                           // MyAssetUtil
 {
     m_Tools.BiaoTi_O("MyAssetUtil  " + "(关于 Asset 路径的工具类)".AddGreen());
     m_Tools.BiaoTi_L("工程 Application.dataPath :" + "E:/Pro/PSPFramework/Assets".AddYellow());
     MyCreate.Box(() =>
     {
         m_Tools.Method_BY("GetApplicationDataPathNoAssets()", "", "E:/Pro/", "Data不带Assets", 80);
     });
     AddSpace();
     m_Tools.BiaoTi_L("下面都以" + " E:/Pro/PSPFramework/Assets/Text.cs".AddYellow() + " 作为全路径参数");
     MyCreate.Box(() =>
     {
         m_Tools.Method_BY("GetAssetsBackPath", "string", "Assets/Text.cs", "Assets后路径", ref isGetAssetsBackPath,
                           () =>
         {
             m_Tools.Method_BY("GetAssetsBackPath", "string[] 全路径数组", "可以多个", "string[]", 80);
         }, 80);
         m_Tools.Method_BY("GetAssetsProPath", "string", "E:/Pro/PSPFramework/", "Assets前路径", 80);
         m_Tools.Method_BY("GetFileNameByFullName", "string", "Text.cs", "文件名带后缀", 80);
         m_Tools.Method_BY("GetFileNameByFullNameNoSuffix", "string", "Text", "文件名没后缀", 80);
         m_Tools.Method_BY("GetFileSuffix", "string", "cs", "文件后缀", 80);
     });
     AddSpace();
     m_Tools.BiaoTi_L("下面都以" + " Assets/Text.cs".AddYellow() + " 作为参数");
     MyCreate.Box(() =>
     {
         m_Tools.Method_BY("GetFullName", "string", "E:/Pro/PSPFramework/Assets/Text.cs", "Assets路径 ->全路径", -55);
     });
 }
Exemple #17
0
        private void DrawTimeScale()
        {
            m_Tools.Text_O("当  Time.timeScale = 0 时:");
            m_Tools.BiaoTi_B("一次性的函数" + "(都会执行)".AddGreen());
            MyCreate.Box(() =>
            {
                m_Tools.Text_L("Awake、Start、OnEnable、OnDestroy 等都会执行");
            });
            AddSpace();
            m_Tools.BiaoTi_B("每帧函数" + "(只有 Update 会执行)".AddGreen());
            MyCreate.Box_Hei(() =>
            {
                m_Tools.Text_Y("Update" + "(执行)".AddGreen() + "           FixedUpdate" + "(不执行)".AddGreen());
                m_Tools.Text_Y("Time.deltaTime" + "( 0 )".AddGreen() + "     Time.fixedTime" + "( 0 )".AddGreen());
                m_Tools.Text_G("只有 Time.fixedDeltaTime  ->  0.02  !");
            });
            AddSpace();
            m_Tools.BiaoTi_B("协程" + "(只有 yield return 前部分会执行)".AddGreen());
            MyCreate.Box_Hei(() =>
            {
                m_Tools.Text_B("yield return 前部分的语句会执行");
                m_Tools.Text_B("而 yield return 后面的语句就不会执行");
            });


            AddSpace();

            m_Tools.BiaoTi_B("Invoke" + "( 延时函数不会执行 )".AddGreen());
        }
Exemple #18
0
 private void DrawPSPUtil()                               // PSPUtil
 {
     m_Tools.BiaoTi_B("Attribute" + "  特性(其他的用插件)".AddLightBlue());
     MyCreate.Box(() =>
     {
         m_Tools.Method_BL("MyHead", "string 头部说明文字,MyEnumColor 颜色,OffsetX X轴偏移", "");
     });
     AddSpace();
     m_Tools.BiaoTi_B("ErrorException" + "  抛出异常".AddLightBlue());
     MyCreate.Box(() =>
     {
         m_Tools.TextText_RG("Error_DictionaryNoKey", "字典没有注册过对应的 Key", 20);
         m_Tools.TextText_RG("Error_ResourcesNoPath", "Resources 路径加载错误", 20);
         m_Tools.TextText_RG("Error_SwitchEnumNoDefines", "Switch case 枚举没有定义", 20);
     });
     AddSpace();
     m_Tools.BiaoTi_B("Exensions" + "  扩展方法 ->".AddLightBlue());
     AddSpace();
     m_Tools.BiaoTi_B("Singleton" + "  单例基类 ->".AddLightBlue());
     AddSpace();
     m_Tools.BiaoTi_B("StaticUtil" + "  工具类 ->".AddLightBlue());
     MyCreate.Box_Hei(() =>
     {
         m_Tools.TextText_OY("MyAssetUtil", "关于 Asset 路径的工具类");
         m_Tools.TextText_OY("MyIO", "");
         m_Tools.TextText_OY("MyColor", "关于 颜色 的工具类");
         m_Tools.TextText_OY("MyGUI", "");
         m_Tools.TextText_OY("MyType", "");
     });
 }
Exemple #19
0
        private void DrawGuGe()                                  // 谷歌浏览器
        {
            m_Tools.BiaoTi_O("下载百度云保存的");
            MyCreate.Box(() =>
            {
                m_Tools.Text_G("不要安装最新版的谷歌,太坑了");
                m_Tools.TextButton_Open("打开分享下载", "https://pan.baidu.com/s/1zk0BEPuAQLOpz3vV10bSVA");

                m_Tools.Text_G("全部先用后缀改成  zip  ->  然后解压出来");
                m_Tools.Text_G("把  _metadata   去除   _");
                m_Tools.Text_G("用开发模式加载");
            });
            AddSpace_3();



            m_Tools.BiaoTi_O("复制网站地址");
            MyCreate.Box(() =>
            {
                MyCreate.SelectText("http://www.manew.com/");
                MyCreate.SelectText("http://www.6m5m.com/");
                MyCreate.SelectText("http://www.taikr.com/");
                MyCreate.SelectText("https://translate.google.cn/#en/zh-CN");
            });
            AddSpace();
            m_Tools.BiaoTi_O("Tampermonkey");
            MyCreate.Box(() =>
            {
                m_Tools.TextButton_Open("打开下载脚本网站", "https://greasyfork.org/zh-CN");
            });
        }
Exemple #20
0
        private void BianLiang()                                 //变量
        {
            m_Tools.BiaoTi_O("变量 " + "(不需要声明)".AddHui());
            MyCreate.Box(() =>
            {
                m_Tools.TextText_BL("屏幕宽度", "width = Plugin.Sys.GetScRX()");
                m_Tools.TextText_BL("屏幕高度", "height = Plugin.Sys.GetScRY()");
                m_Tools.TextText_BL("键盘的值", "Key=WaitKey(),if( key == 几)", ref isKey, () =>
                {
                    MyCreate.Box(() =>
                    {
                        KeyValue("回车", "13", "空格", "32", "Tab", "9", "", "");
                        KeyValue("Shift", "16", "Ctrl", "17", "Alt", "18", "CapsLock", "20");
                        KeyValue("~", "192", "-", "189", "+", "187", "←", "8");
                        KeyValue("0", "48", "1", "49", "8", "56", "9", "57");
                        KeyValue("a", "65", "b", "66", "y", "89", "z", "90");
                    });
                });

                m_Tools.TextText_BL("获得当前鼠标坐标", "GetCursorPos x,y  " + "(x ,y 就是参数 ref x,ref y)".AddGreen());
                MyCreate.Text("特殊:可在面板处修改:");
                m_Tools.TextText("UserVar str1 = “默认值 ”".AddLightBlue(), "用户可修改的 string (相当于Input)");
                m_Tools.Text_L("UserVar MoShi = DropList{“ Enum1名 ”:0 |  “ Enum2名 ”:1  } = 0 ");
                m_Tools.TextText("", "用户可修改的 int(相当 Enum)");
            });
        }
Exemple #21
0
 protected void DrawnOne(string str, Action action, bool isKongGe = true)      // 层次结构第一层
 {
     if (isKongGe)
     {
         m_Tools.Text_L("─── ", str.AddBlue());
         if (null != action)
         {
             MyCreate.Heng(() =>
             {
                 MyCreate.AddSpace(35);
                 MyCreate.Box(action);
             });
         }
     }
     else
     {
         MyCreate.Text(" ── " + str);
         if (null != action)
         {
             MyCreate.Heng(() =>
             {
                 MyCreate.AddSpace(18);
                 MyCreate.Box(action);
             });
         }
     }
 }
Exemple #22
0
        private void DrawRenderer()                              // Renderer
        {
            m_Tools.BiaoTi_O("Renderer 结构图");
            MyCreate.Box_Hei(() =>
            {
                m_Tools.Text_B("Object  ->  Component", "(附加到 GameObject 的组件)".AddHui(), "  ->  Renderer");
                m_Tools.TextText_BY("   Renderer -> SkinnedMeshRenderer" + ONE, "带动画的 Mesh", 90);
                m_Tools.TextText_BY("   Renderer -> MeshRenderer" + TWO, "静态物体的 Mesh", 90);
                m_Tools.TextText_BY("   Renderer -> LineRenderer" + THREE, "线性," + LOOKATstr, 90);
                m_Tools.TextText_BY("   Renderer -> TrailRenderer" + FOUR, "拖尾", 90);
                m_Tools.TextText_BY("   Renderer -> SpriteRenderer" + FIVE, "图", 90);
                m_Tools.TextText_BG("   Renderer -> BillboardRenderer" + SIX, LOOKATstr, 90);
            });

            AddSpace();

            m_Tools.BiaoTi_B("回调函数  " + "脚本有 Renderer 组件才触发".AddGreen());
            MyCreate.Box(() =>
            {
                m_Tools.TextText_OY("OnBecameVisible", "Renderer 变成可见时调用");
                m_Tools.TextText_OY("OnBecameInvisible", "Renderer 在" + "任何相机不再可见".AddGreen() + "的情况下调用");
            });

            AddSpace();

            TheSameMainBan();
        }
Exemple #23
0
        private void DrawChuXiang()                              // 抽象工厂模式
        {
            m_Tools.BiaoTi_B("抽象工厂模式");
            MyCreate.Text("客户端只需要和" + GongLie + "打交道,不会与实际实现类有任何交互");
            MyCreate.Box_Hei(() =>
            {
                m_Tools.Text_H("public class ", GongLie);
                m_Tools.Text_H("     private static string ", gnmcStr, " =“", gaStr, "”");
                m_Tools.Text_H("     public static ", GongNeng, " ", CreateStr);
                m_Tools.Text_H("          AssemblyName name = Assembly.GetExecutingAssembly().GetName()");
                m_Tools.Text_H("          return (", GongNeng, ") Assembly.Load(name).CreateInstance(", gnmcStr, ")");
            });

            MyCreate.Text("实际的功能实现类,要做什么功能就在子类实现");
            MyCreate.Box_Hei(() =>
            {
                m_Tools.Text_H("public abstract class ", GongNeng, " { ... } ");
            });
            MyCreate.Box(() =>
            {
                m_Tools.Text_H("public class ", gaStr, " : ", GongNeng, " { ... } ");
                m_Tools.Text_H("public class 功能B : ", GongNeng, " { ... } ");
            });
            MyCreate.Text("客户端只需要改变 " + gnmcStr + " 里面的类名称即可");
            MyCreate.Box_Hei(() =>
            {
                m_Tools.TextText_HG(GongNeng + " g = " + GongLie + "." + CreateStr, "// 工厂类已经是 Static 方法");
            });
            m_Tools.BiaoTi_L("总结");
            MyCreate.Box(() =>
            {
                m_Tools.Text_R("简单好用,易扩展,功能名称甚至可以" + "使用配置文件/枚举".AddGreen() + "来解决");
            });
        }
Exemple #24
0
        private void DrawSkinnedMesh()                             // Skinned Mesh Renderer 带动画的Mesh
        {
            m_Tools.BiaoTi_B("Skinned Mesh Renderer" + "(带动画的 Mesh)".AddGreen());
            MyCreate.Box(() =>
            {
                m_Tools.TextText_OY("Quality", "在蒙皮时每个顶点使用的" + "骨骼".AddWhite() + "的最大数量");
                MyCreate.Box(() =>
                {
                    m_Tools.TextText("Auto", "自动 (获得所需的动画质量和帧率的平衡)");
                    m_Tools.TextText("1 2 4 Bone", "骨骼数,数量越多,渲染器的质量就越高");
                    m_Tools.Text_G("使用四块骨头可以得到最好的结果,但会带来更高的处理开销");
                    m_Tools.Text_G("游戏通常使用两个骨骼重量,这是视觉质量和性能之间的良好折衷");
                });

                m_Tools.TextText_OY("Update When Offscreen", "勾选在" + "屏幕外动画".AddWhite() + "也会运行,高消耗");
                m_Tools.TextText_OY("Skinned Motion Vectors", "皮肤的" + "运动矢量".AddWhite());
                m_Tools.Text_G("启用: Mesh蒙皮数据会双缓冲,蒙皮运动有缓存并放置到运动矢量Texture中");
                m_Tools.Text_G("         GPU内存开销换更正确的运动向量");
                m_Tools.TextText_OY("Mesh", "Mesh Filter 整合在这里");
                m_Tools.TextText_OY("Root Bone", "使用它来定义作为动画“根”的骨骼");
                m_Tools.TextText_OY("", "(即所有其他骨骼相对于其移动的骨骼)".AddGreen());
                m_Tools.TextText_OY("Bounds", "边框");
                DrawBounds();
            });

            MeshTheSame();
        }
Exemple #25
0
        private void DrawZhuang()                                // 装饰模式
        {
            m_Tools.BiaoTi_O("装饰模式" + "(动态地给一个对象添加一些额外职责,比生成子类更灵活)".AddYellow());
            AddSpace();
            MyCreate.Text("可以给人搭配不同的服饰的系统".AddBold());

            MyCreate.FenGeXian_Blue(PersonStr + ",拥有 Show 形象展示方法");
            MyCreate.Box_Hei(() =>
            {
                m_Tools.Text_H("class ", PersonStr);
                m_Tools.TextText_HG("     public virtual void " + ShowStr + "{ ... }", "// 可以给子类继承");
            });
            MyCreate.FenGeXian_Blue("服饰类 继承 Person 类,构造方法要求带一个 Person");
            MyCreate.Box_Hei(() =>
            {
                m_Tools.Text_H("class ", FuStr, " : ", PersonStr);
                m_Tools.Text_H("     protected ", PersonStr, m_PersonStr);
                m_Tools.Text_G("     服饰类构造方法 -> 带一个 Person -> 赋值给 " + m_PersonStr);
                m_Tools.Text_H("     public override void ", ShowStr);
                m_Tools.TextText_HG("         " + m_PersonStr + "." + ShowStr, "// 注意这里没有 base 了");
            });

            MyCreate.FenGeXian_Blue("下面就是想要怎么设计服饰就怎么设计服饰了");
            MyCreate.Box(() =>
            {
                m_Tools.Text_H("class T恤类 : ", FuStr);
                m_Tools.Text_H("     public override void ", ShowStr);
                m_Tools.TextText_HG("       ....", "// 具体设计 T 恤的方法");
                m_Tools.TextText_HG("       base.Show()", "// 先调用自己的再调用父类");
            });
            MyCreate.Box(() =>
            {
                m_Tools.Text_H("class 裤类 : ", FuStr);
                m_Tools.Text_H("     public override void ", ShowStr);
                m_Tools.TextText_HG("       ....", "// 具体设计裤方法,与上面一致");
                m_Tools.Text_H("       base.Show()");
            });
            MyCreate.FenGeXian_Blue("客户端最终只需要一层叠一层添加即可");
            MyCreate.Box_Hei(() =>
            {
                MyCreate.Text("一个人只穿一件T恤");
                m_Tools.Text_H(PersonStr, " p = ", PersonStr, "()");
                m_Tools.Text_H("T恤类 t = T恤类(p)");
                m_Tools.TextText_HG("t.Show();", "// 同时会调用 p 内部的 Show 方法的了");
                MyCreate.AddSpace(5);
                MyCreate.Text("一个人先穿T恤再穿上裤" + "再穿上等等的装饰".AddLightGreen());
                m_Tools.Text_H(PersonStr, " p = ", PersonStr, "()");
                m_Tools.Text_H("裤类 h = 裤类(p)");
                m_Tools.Text_H("T恤类 t = T恤类(h)");
                m_Tools.Text_LG("其他的装饰同理...");
                m_Tools.TextText_HG("t.Show();", "// 先是T恤Show ->裤类Show->Person Show");
            });
            AddSpace();
            MyCreate.FenGeXian("总结:");
            MyCreate.Box(() =>
            {
                m_Tools.Text_B("1. 这样做,把装饰这功能从 Person 类中抽取出来了(修改与添加也不会影响)");
                m_Tools.Text_B("2. 同时去除了重复的 Show");
            });
        }
Exemple #26
0
 private void DrawCollider()                              // Collider
 {
     m_Tools.BiaoTi_Y("先说一下 花Q 的注意事项");
     MyCreate.Box(() =>
     {
         m_Tools.Text_B("两两触发的回调事件 :", "OnTriggerEnter/Stay/Exit ".AddGreen());
         m_Tools.Text_L("     • 脚本对象必须带上 Rigidbody,Collider 可在子对象");
         m_Tools.Text_L("     • Rigidbody 必须勾选 IsKinematic");
         m_Tools.Text_G("     • Collider 必须勾选 IsTrigger");
         m_Tools.Text_L("     • 被触发的 Collider 可以不勾选 IsTrigger");
     });
     AddSpace();
     m_Tools.BiaoTi_Y("Collider 与 Collision");
     MyCreate.Box(() =>
     {
         m_Tools.Text_B("Collider  ->  碰撞体");
         MyCreate.Box_Hei(() =>
         {
             m_Tools.Text_H("     1. 是 BoxCollider, SphereCollider, CapsuleCollider, MeshCollider 的父类");
             m_Tools.Text_H("     2. Collider ", "继承 <- Component <- Object".AddGreen());
             m_Tools.Text_H("     3. 使用 OnTriggerEnter/Stay/Exi 触发回调的参数是 Collider");
         });
         m_Tools.Text_B("Collision  ->  碰撞信息");
         MyCreate.Box_Hei(() =>
         {
             m_Tools.Text_H("     1. Collision ", "没有继承".AddGreen(), ",简单类");
             m_Tools.Text_H("     2. 使用 OnCollisionEnter/Stay/Exi 碰撞回调的参数是 Collision");
         });
     });
 }
Exemple #27
0
        private void DrawDictionary()                            //Dictionary
        {
            m_Tools.ButtonText("Dictionary<k,v>", "Key不可重复,添加重复报错,取[不存在]报错", ref isDictionary, () =>
            {
                m_Tools.BiaoTi_O("foreach 的使用", ref isForeach2, () =>
                {
                    MyCreate.Window("用 KeyValuePair<int, string> 对象 声明", () =>
                    {
                        m_Tools.Text_Y("foreach (KeyValuePair<int, string> kvp in dic)");
                    });
                    AddSpace();
                    AddSpace();
                    MyCreate.Window("用 key/value 对象 声明", () =>
                    {
                        m_Tools.Text_Y("foreach ( T key in dic.Keys )");
                    });
                });

                m_Tools.BiaoTi_O("方法", true);
                MyCreate.Box(() =>
                {
                    MyCreate.Text("查");
                    m_Tools.Method_YG("ContainsKey", "K key", "key 是否包含");
                    m_Tools.Method_YG("ContainsValue", "V Value", "Value 是否包含");
                    MyCreate.Text("获取");
                    m_Tools.Method_YG("this", "K", "通过key获取value,没有报错", "V");
                    m_Tools.Method_YG("TryGetValue", "K,out V", "通过key获取value,没有不报错", "bool");

                    m_Tools.Text_G("继承 IEnumerable<T>,都有它的扩展方法");
                });
            }, -60);

            AddSpace_3();
        }
Exemple #28
0
        private void DrwUnityEvent()
        {
            m_Tools.BiaoTi_B("说明");
            MyCreate.Box(() =>
            {
                m_Tools.Text_L("• 如: Button 底下的 OnClick 也是使用这个 UnityEvent");
                m_Tools.Text_L("• UnityEvent<T0> 是 abstract 类,必须继承才能用");
                m_Tools.Text_L("• 一定要添加 ", SerializableStr, " 特性");
            });
            AddSpace_3();
            m_Tools.BiaoTi_B("使用例子");
            MyCreate.Box_Hei(() =>
            {
                MyCreate.Text("1. 想要什么参数就在泛型中添加,直接继承类即可");
                m_Tools.Text(SerializableStr);
                m_Tools.Text_H("public class MyEvent : UnityEvent<int> { }");
                MyCreate.Text("2. 在真正的 MonoBehaviour 类中添加字段 即可");
                m_Tools.Text(SerializableStr);
                m_Tools.Text_H("public MyEvent ", myEventStr);
            });
            m_Tools.BiaoTi_B("注册与发送事件");
            MyCreate.Box_Hei(() =>
            {
                MyCreate.Text("注册:");
                m_Tools.Text_L("    • 在面板上拖拽");
                m_Tools.Text_L("    • ", myEventStr, ".AddListener( 方法 )");

                MyCreate.Text("发送事件:");
                m_Tools.Text_L("    • ", myEventStr, ".Invoke()");
            });
        }
Exemple #29
0
        private void DrawFirst()                                     // First
        {
            m_Tools.Text_B("Level Manager");
            MyCreate.Box(() =>
            {
                m_Tools.Text_L("使用一配置文件 来记录每个 Level ");
                m_Tools.Text_L("只提供一个 NextLevel 的方法");
                m_Tools.Text_L("同时控制跳转时的特效");
                m_Tools.Text_L("可以看看 Mad Level Manager 这个插件");
            });
            m_Tools.Text_B("Pool Manager");
            MyCreate.Box(() =>
            {
                m_Tools.Text_L("每个 Perfab 对一个 Pool ,控制 pool 最多数量");
                m_Tools.Text_L("就是不是无限加进池子中,当超过数量就删除");
            });
            m_Tools.Text_B("Save Manager");
            MyCreate.Box(() =>
            {
                m_Tools.Text_L("推荐使用 Easy Save2 插件,它用二进制存储");
            });

            MyCreate.Box_Hei(() =>
            {
                m_Tools.Text_L("mvcs 用反射比下面慢,没界面,免费");
                m_Tools.Text_L("MVVM UFRAME 可视化框架,收费,快");
            });
            MyCreate.Box_Hei(() =>
            {
                m_Tools.Text_L("Published by unity 测试工具");
                m_Tools.Text_L("Unity test /Integration test /Assertion component");
            });
        }
Exemple #30
0
 private void DrawZip()                                     // 压缩
 {
     m_Tools.TextButton_Open("打开文件夹导入dll和工具类", "F:/ZiLiao/使用其它插件的包/使用压缩包");
     m_Tools.BiaoTi_B("压缩文件和文件夹" + "(同步)".AddGreen());
     MyCreate.Box(() =>
     {
         m_Tools.Text_B("MyZipUtil.Zip", "(string[],string,string = null)".AddHui());
         MyCreate.Box_Hei(() =>
         {
             m_Tools.TextText_HL("   string[]", "文件夹路径或者文件名的集合", -50);
             m_Tools.TextText_HL("   string", "输出压缩包的全路径", -50);
             m_Tools.TextText_HL("   string", "压缩密码,默认不添加", -50);
         });
     });
     AddSpace_3();
     m_Tools.BiaoTi_B("解压Zip包" + "(同步)".AddGreen());
     MyCreate.Box(() =>
     {
         m_Tools.Text_B(ZhongZai + "MyZipUtil.UnzipFile", "(string,string,string = null)".AddHui());
         m_Tools.Text_B(ZhongZai + "MyZipUtil.UnzipFile", "(byte[],string,string = null)".AddHui());
         m_Tools.Text_B(ZhongZai + "MyZipUtil.UnzipFile", "(Stream,string,string = null)".AddHui());
         MyCreate.Box_Hei(() =>
         {
             m_Tools.TextText_HG("   string/byte[]/Stream", "Zip文件路径/字节数组输入流", -50);
             m_Tools.TextText_HG("   string", "解压压缩包的出来路径", -50);
             m_Tools.TextText_HG("   string", "压缩密码,默认没有", -50);
         });
     });
 }