上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 48 下一页
摘要: 常用操作 dict的key不能重复,不能为可变值;value可以重复 基本使用 dict1 = { "key1": 1, "key2": 2, "key3": 3, } print(type(dict1)) # <class 'dict'> print(type(dict1) == dict) # 阅读全文
posted @ 2023-07-21 00:33 yanghui01 阅读(16) 评论(0) 推荐(0)
摘要: 常用操作 列表的元素可以为空,也可以重复 基本使用 list1 = [1, 2, 3] print(type(list1)) # <class 'list'> print(type(list1) == list) # True print(isinstance(list1, list)) # Tru 阅读全文
posted @ 2023-07-21 00:22 yanghui01 阅读(20) 评论(0) 推荐(0)
摘要: 常用操作 判断类型 print(type("abc")) # <class 'str'> print(type("abc") == str) # True print(isinstance("abc", str)) # True 遍历和长度 print(len("abc")) # 3 for c i 阅读全文
posted @ 2023-07-21 00:09 yanghui01 阅读(40) 评论(0) 推荐(0)
摘要: 基础数据类型 a = 1 print(type(a)) b = 1.2 print(type(b)) c = True print(type(c)) a = c print(type(a)) e = "hello" print(type(e), id(e)) 2进制,8进制,16进制 a=0b101 阅读全文
posted @ 2023-07-20 00:45 yanghui01 阅读(31) 评论(0) 推荐(0)
摘要: Rect内部使用m_XMin, m_YMin, m_Width, m_Height存放数据,即:左下角+宽高 1) 设置xMin, xMax时,宽度m_Width会被修改 设置xMin时,认为是只有左侧在动, 右侧是不动的; 左侧往左则m_Width变大, 左侧往右则m_Width变小 设置xMax 阅读全文
posted @ 2023-07-19 00:46 yanghui01 阅读(48) 评论(0) 推荐(0)
摘要: 主要涉及到的类 看到最多的就是EventSystem这个自动添加的GameObject 代码阅读要点 1) 事件系统做了什么? 在Update中不断的检测这一帧发生的输入事件,并根据输入事件解析出当前在进行的操作。 所以,所有的逻辑都是在EventSystem.Update中发生的。Standalo 阅读全文
posted @ 2023-07-13 00:27 yanghui01 阅读(302) 评论(0) 推荐(1)
摘要: 主要的代码: public static readonly Vector2[] s_VertScratch = new Vector2[4]; public static readonly Vector2[] s_UVScratch = new Vector2[4]; private void Ge 阅读全文
posted @ 2023-07-05 01:40 yanghui01 阅读(280) 评论(0) 推荐(0)
摘要: function Test(num, nDigits) local multi = 10 ^ nDigits --10的n次方 local num1 = math.floor(num * multi) local ret = num1 / multi return ret end 百分比保留1位小数 阅读全文
posted @ 2023-07-02 23:21 yanghui01 阅读(24) 评论(0) 推荐(0)
摘要: #if UNITY_EDITOR using System; using System.IO; using UnityEditor; using UnityEngine; public static class SpriteTool { // OpenDirAfterExport const str 阅读全文
posted @ 2023-07-01 01:26 yanghui01 阅读(97) 评论(0) 推荐(0)
摘要: 最终效果,左侧为ugui的,右侧为自己实现的 using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class MyText : Graphic { public Font m_Font; 阅读全文
posted @ 2023-06-30 01:46 yanghui01 阅读(49) 评论(0) 推荐(0)
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 48 下一页