import PySimpleGUI as sg
# 作者:A.A.
# 最后保存时间:2021.12.5
imageLocation1=r'C:\Users\PC\Pictures\Saved Pictures\笔记主页.png'
layout1=[
[sg.Image(filename=imageLocation1,
right_click_menu=[1,['目录',['CSharp',
['数据类型',
['分类/定义',
['值/直接存储数据',
['数值',
['整形',
['短',['0'],
['常',['0'],
['长',['0'],
['超长',['0']]]]],
['非整形',
['单精度',['0'],
['双精度',['0']]]]],
['布尔',['0'],
['字符',['0'],
['结构',['0']]]]],
['引用/存储引用',
['接口',['0'],
['类',
['字符串',['0'],
['数组',
['一维',['0'],
['二维',['0'],
['交错',
['由多个一维数组为元素组成的数组',['0'],
['其中每个一维数组长度/容量可以不同',['0'],
['数据类型必须相同',['0']]]]]]],
['委托',['0']]]]]]]],
['使用/细节',
['类',
['成员',
['字段',['0'],
['属性',['0'],
['方法',['0'],
['构造函数',['0'],
['0',['0']]]]]]],
['结构',['0'],
['静态',['0'],
['实例',['0'],
['数组',['数组的元素声明以后为null/初始化以后为该数据类型的默认值']]]]]]]],
['语法',
['声明',
['整形/非整形/bool/char',['数据类型 变量名;'],
['一维数组',['数据类型[] 数组名;'],
['二维数组',['数据类型[,] 数组名;'],
['交错数组',['数据类型[][] 数组名;'],
['0',['0']]]]]],
['赋值',
['0',['0'],
['一维数组',['数组名[索引]=数据;'],
['二维数组',['0'],
['交错数组',['0']]]]],
['初始化',
['一维数组',['数组名=new 数据类型[容量];'],
['二维数组',['0'],
['交错数组',['0']]]],
['声明+赋值',
['0',['0']],
['类型转换',
['ToString',
['变量名.ToString();',['0'],
['0',['0'],
['0',['0']]]],
['Parse',
['int.Parse(值)',['0'],
['0',['0']]],
['0',['0']]]],
['初始化+赋值',
['一维数组',['数据类型[] 数组名=new 数据类型[容量]{数据};'],
['二维数组',['0'],
['交错数组',['0']]]],
['声明+初始化+赋值',
['一维数组',['数据类型[] 数组名={数据};'],
['二维数组',['0'],
['交错数组',['0']]]],
['类',
['可选修饰符 class 类名:继承类{}'],
['字段',['0'],
['属性',['0'],
['方法',
['访问级别 可选修饰符 返回值 方法名(参数){}'],
['构造函数',['0'],
['调用',['0'],
['结构',['可选修饰符 struct 结构名{}'],
['枚举',['0'],
['重载',['0'],
['继承',['0']]]]]]]]]]]]]]]]]],
['适用性/优缺点',
['类',
['优点/封装性好/可维护性好/易拓展',['0'],
['缺点/',['0']]],
['方法',
['优点/',['0'],
['0',['0']]],
['重载',
['优点/',['0'],
['0',['0']]],
['静态',
['优点/',['0'],
['0',['0']]],
['结构体',
['优点/',['0'],
['0',['0']]],
['枚举',
['优点/',['0'],
['0',['0']]],
['继承',
['优点/',['0'],
['0',['0']]],
['0',['0'],
['0',['0']]]]]]]]]],
['内存分配',
['数据容量单位',
['bit',
['计算机最小存储单位,1bit=4字节',['0']],
['Byte',
['1B=8bit',['0']],
['KB',
['1KB=1024B',['0']],
['MB',
['1MB=1024KB',['0']],
['G',
['1G=1024MB',['0']],
['T',
['1T=1024G',['0']]]]]]]],
['栈',
['在内存中开辟的一块相对小的空间',['0'],
['用于存储正在执行中的方法',['0'],
['每个方法执行时在栈中开辟一块栈帧用于存储数据',['0'],
['方法执行完毕清除栈帧',['0']]]]],
['堆',
['在内存中开辟的一块相对大的空间',['0'],
['用于存储大小难以界定的数据类型如字符串/数组/类的实例',['0'],
['堆中的内容如果链接不到所对应的引用就会被当作垃圾',['0'],
['垃圾由垃圾回收器/GC不定时清除',['0'],
['其余数据不会被清除',['0']]]]]],
['字符串池',['0'],
['静态',['0'],
['存储类别?',['0'],
['内存图']]]]]]],
['程序编译过程',
['源代码-(CLS编译)->CIL/通用中间语言-(CLR编译)->机器码',['0']],
['Csharp背景简介',
['微软',
['.Net战略/跨语言/只用windows环境',['0']]],
['算法',
['常用函数',
['冒泡排序',['0'],
['选择排序',['0']]],
['递归',['0']]]]]]]]]],
['Unity',
['常用类',
['Random',['0'],
['CinemachineBrain',['0'],
['0',['0'],
['0',['0']]]]],
['不常用类',
['Guid',['0'],
['RNGCryptoServiceProvider',['0']]],
['常用方法',
['激活物体',
['激活父物体/例',['xxxx.transform.parent.gameObject.SetActive(true);'],
['0',['0']]],
['获取对象',
['GameObject.Find()',['不能找未激活物体,不能找重名物体'],
['Transform.Find()',
['通过root节点,可以找到未激活物体',['0'],
['先获取顶级对象',['GameObject root = GameObject.Find("GameObject");'],
['然后寻找子节点',['GameObject xxxx = root.transform.Find("xxxx").gameObject;']]]]]]]],
['常见错误',
['invalid-global-code',['0'],
['The script don‘t inherit a native class that can manage a script.',['类名与脚本名不一致或命名空间发生修改'],
['A namespace cannot directly contain members such as fields or methods?',['0'],
['Invalid token \'=\' in class, struct, or interface member declaration',['0']]]]],
['Unity背景简介',
['Mono',
['将.Net复刻成可在不同平台使用',['0']]],
['城市建筑类',
['A星算法',
['欧拉距离',['0'],
['曼哈顿距离',['0'],
['切比雪夫距离',['0']]]],
['0',['0']]],
['数据存档',
['player prefs/用于本地持久化保存与读取的类',
['以键值对的形式将数据保存在文件中',['0'],
['程序可以根据这个名称取出上次保存的数值',['0'],
['静态方法',
['SetFloat()/SetInt()/SetString()',['写入数据'],
['GetFloat()/GetInt()/GetString()',['读取数据'],
['DeleteKey()/DeleteAll()',['删除数据'],
['HasKey(“SS”)',['检查数据,是否有该键'],
['Save()',['0']]]]]],
['代码示例',
['PlayerPrefs.SetString("_NAME", set_NAME);/写',['0'],
['get_NAME = PlayerPrefs.GetString("_NAME");/读',['0']]]]]]],
['0',['0'],
['0',['0']]]],
['资源加载',
['编辑器环境下加载GameRes目录中的资源',['0'],
['加载Resources目录中的资源',['0'],
['移动平台加载StreamingAssets目录中的资源',
['1.设置资源的AssetBundle名',['0'],
['2.AssetBundle打包',['0'],
['3.AssetBundle加载',['0']]]]]]],
['状态机',['0'],
['行为树',['0']]]]]]]]]]],
['效果实现',
['透视相机与正交相机的平滑切换',['0'],
['游戏暂停/慢放',['0'],
['0',['0']]]]]]]]])]
]
window1=sg.Window('CS发电机',layout1,keep_on_top=True,
location=(0,0),
transparent_color=sg.theme_background_color()
)
while True:
event1,values1=window1.read()
print(event1,values1)
if event1==None:
break
window1.close()
|